listServices method

Future<ListServicesResponse> listServices({
  1. String? accountId,
  2. AssessmentStatus? assessmentStatus,
  3. int? maxResults,
  4. String? nextToken,
  5. String? ouId,
  6. String? policyArn,
  7. String? systemArn,
  8. String? userJourneyId,
})

Lists services.

May throw AccessDeniedException. May throw InternalServerException. May throw ValidationException.

Parameter accountId : Filter services by AWS account ID.

Parameter assessmentStatus : Filter services by assessment status.

Parameter ouId : Filter services by organizational unit (OU) identifier.

Parameter userJourneyId : Filter services by user journey identifier.

Implementation

Future<ListServicesResponse> listServices({
  String? accountId,
  AssessmentStatus? assessmentStatus,
  int? maxResults,
  String? nextToken,
  String? ouId,
  String? policyArn,
  String? systemArn,
  String? userJourneyId,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    100,
  );
  final $query = <String, List<String>>{
    if (accountId != null) 'accountId': [accountId],
    if (assessmentStatus != null)
      'assessmentStatus': [assessmentStatus.value],
    if (maxResults != null) 'maxResults': [maxResults.toString()],
    if (nextToken != null) 'nextToken': [nextToken],
    if (ouId != null) 'ouId': [ouId],
    if (policyArn != null) 'policyArn': [policyArn],
    if (systemArn != null) 'systemArn': [systemArn],
    if (userJourneyId != null) 'userJourneyId': [userJourneyId],
  };
  final response = await _protocol.send(
    payload: null,
    method: 'GET',
    requestUri: '/v2/list-services',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  return ListServicesResponse.fromJson(response);
}