listComponentVersions method

Future<ListComponentVersionsResponse> listComponentVersions({
  1. required String arn,
  2. int? maxResults,
  3. String? nextToken,
})

Retrieves a paginated list of all versions for a component.

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

Parameter arn : The ARN of the component version.

Parameter maxResults : The maximum number of results to be returned per paginated request.

Parameter nextToken : The token to be used for the next set of paginated results.

Implementation

Future<ListComponentVersionsResponse> listComponentVersions({
  required String arn,
  int? maxResults,
  String? nextToken,
}) async {
  ArgumentError.checkNotNull(arn, 'arn');
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    100,
  );
  final $query = <String, List<String>>{
    if (maxResults != null) 'maxResults': [maxResults.toString()],
    if (nextToken != null) 'nextToken': [nextToken],
  };
  final response = await _protocol.send(
    payload: null,
    method: 'GET',
    requestUri:
        '/greengrass/v2/components/${Uri.encodeComponent(arn)}/versions',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  return ListComponentVersionsResponse.fromJson(response);
}