listComponents method

Future<ListComponentsResponse> listComponents({
  1. bool? byName,
  2. List<Filter>? filters,
  3. int? maxResults,
  4. String? nextToken,
  5. Ownership? owner,
})

Returns the list of components that can be filtered by name, or by using the listed filters to streamline results. Newly created components can take up to two minutes to appear in the ListComponents API Results.

Filtering: With semantic versioning, you have the flexibility to use wildcards (x) to specify the most recent versions or nodes when selecting the base image or components for your recipe. When you use a wildcard in any node, all nodes to the right of the first wildcard must also be wildcards.

May throw CallRateLimitExceededException. May throw ClientException. May throw ForbiddenException. May throw InvalidPaginationTokenException. May throw InvalidRequestException. May throw ServiceException. May throw ServiceUnavailableException.

Parameter byName : Returns the list of components for the specified name.

Parameter filters : Use the following filters to streamline results:

  • description
  • name
  • platform
  • supportedOsVersion
  • type
  • version

Parameter maxResults : Specify the maximum number of items to return in a request.

Parameter nextToken : A token to specify where to start paginating. This is the nextToken from a previously truncated response.

Parameter owner : Filters results based on the type of owner for the component. By default, this request returns a list of components that your account owns. To see results for other types of owners, you can specify components that Amazon manages, third party components, or components that other accounts have shared with you.

Implementation

Future<ListComponentsResponse> listComponents({
  bool? byName,
  List<Filter>? filters,
  int? maxResults,
  String? nextToken,
  Ownership? owner,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    25,
  );
  final $payload = <String, dynamic>{
    if (byName != null) 'byName': byName,
    if (filters != null) 'filters': filters,
    if (maxResults != null) 'maxResults': maxResults,
    if (nextToken != null) 'nextToken': nextToken,
    if (owner != null) 'owner': owner.value,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/ListComponents',
    exceptionFnMap: _exceptionFns,
  );
  return ListComponentsResponse.fromJson(response);
}