describeWorkspaceImages method

Future<DescribeWorkspaceImagesResult> describeWorkspaceImages({
  1. List<String>? imageIds,
  2. ImageType? imageType,
  3. int? maxResults,
  4. String? nextToken,
})

Retrieves a list that describes one or more specified images, if the image identifiers are provided. Otherwise, all images in the account are described.

May throw AccessDeniedException.

Parameter imageIds : The identifier of the image.

Parameter imageType : The type (owned or shared) of the image.

Parameter maxResults : The maximum number of items to return.

Parameter nextToken : If you received a NextToken from a previous call that was paginated, provide this token to receive the next set of results.

Implementation

Future<DescribeWorkspaceImagesResult> describeWorkspaceImages({
  List<String>? imageIds,
  ImageType? imageType,
  int? maxResults,
  String? nextToken,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    25,
  );
  _s.validateStringLength(
    'nextToken',
    nextToken,
    1,
    2048,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'WorkspacesService.DescribeWorkspaceImages'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      if (imageIds != null) 'ImageIds': imageIds,
      if (imageType != null) 'ImageType': imageType.toValue(),
      if (maxResults != null) 'MaxResults': maxResults,
      if (nextToken != null) 'NextToken': nextToken,
    },
  );

  return DescribeWorkspaceImagesResult.fromJson(jsonResponse.body);
}