listComponents method

Future<ListComponentsOutput> listComponents({
  1. String? environmentName,
  2. int? maxResults,
  3. String? nextToken,
  4. String? serviceInstanceName,
  5. String? serviceName,
})

List components with summary data. You can filter the result list by environment, service, or a single service instance.

For more information about components, see Proton components in the Proton User Guide.

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

Parameter environmentName : The name of an environment for result list filtering. Proton returns components associated with the environment or attached to service instances running in it.

Parameter maxResults : The maximum number of components to list.

Parameter nextToken : A token that indicates the location of the next component in the array of components, after the list of components that was previously requested.

Parameter serviceInstanceName : The name of a service instance for result list filtering. Proton returns the component attached to the service instance, if any.

Parameter serviceName : The name of a service for result list filtering. Proton returns components attached to service instances of the service.

Implementation

Future<ListComponentsOutput> listComponents({
  String? environmentName,
  int? maxResults,
  String? nextToken,
  String? serviceInstanceName,
  String? serviceName,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    100,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.0',
    'X-Amz-Target': 'AwsProton20200720.ListComponents'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      if (environmentName != null) 'environmentName': environmentName,
      if (maxResults != null) 'maxResults': maxResults,
      if (nextToken != null) 'nextToken': nextToken,
      if (serviceInstanceName != null)
        'serviceInstanceName': serviceInstanceName,
      if (serviceName != null) 'serviceName': serviceName,
    },
  );

  return ListComponentsOutput.fromJson(jsonResponse.body);
}