listTestSources method

Future<ListTestSourcesResponse> listTestSources({
  1. required String serviceArn,
  2. required String testId,
  3. int? maxResults,
  4. String? nextToken,
  5. TestSourceType? type,
})

Lists the monitoring sources attached to a test, optionally filtered by type.

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

Parameter serviceArn : The ARN of the service the test belongs to.

Parameter testId : The identifier of the test to list sources for.

Parameter type : Filter sources by type.

Implementation

Future<ListTestSourcesResponse> listTestSources({
  required String serviceArn,
  required String testId,
  int? maxResults,
  String? nextToken,
  TestSourceType? type,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    100,
  );
  final $query = <String, List<String>>{
    'serviceArn': [serviceArn],
    if (maxResults != null) 'maxResults': [maxResults.toString()],
    if (nextToken != null) 'nextToken': [nextToken],
    if (type != null) 'type': [type.value],
  };
  final response = await _protocol.send(
    payload: null,
    method: 'GET',
    requestUri: '/v2/tests/${Uri.encodeComponent(testId)}/sources',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  return ListTestSourcesResponse.fromJson(response);
}