createUpdatedImage method

Future<CreateUpdatedImageResult> createUpdatedImage({
  1. required String existingImageName,
  2. required String newImageName,
  3. bool? dryRun,
  4. String? newImageDescription,
  5. String? newImageDisplayName,
  6. Map<String, String>? newImageTags,
})

Creates a new image with the latest Windows operating system updates, driver updates, and WorkSpaces Applications agent software.

For more information, see the "Update an Image by Using Managed WorkSpaces Applications Image Updates" section in Administer Your WorkSpaces Applications Images, in the Amazon WorkSpaces Applications Administration Guide.

May throw ConcurrentModificationException. May throw IncompatibleImageException. May throw InvalidAccountStatusException. May throw LimitExceededException. May throw OperationNotPermittedException. May throw ResourceAlreadyExistsException. May throw ResourceNotFoundException.

Parameter existingImageName : The name of the image to update.

Parameter newImageName : The name of the new image. The name must be unique within the AWS account and Region.

Parameter dryRun : Indicates whether to display the status of image update availability before WorkSpaces Applications initiates the process of creating a new updated image. If this value is set to true, WorkSpaces Applications displays whether image updates are available. If this value is set to false, WorkSpaces Applications initiates the process of creating a new updated image without displaying whether image updates are available.

Parameter newImageDescription : The description to display for the new image.

Parameter newImageDisplayName : The name to display for the new image.

Parameter newImageTags : The tags to associate with the new image. A tag is a key-value pair, and the value is optional. For example, Environment=Test. If you do not specify a value, Environment=.

Generally allowed characters are: letters, numbers, and spaces representable in UTF-8, and the following special characters:

_ . : / = + \ - @

If you do not specify a value, the value is set to an empty string.

For more information about tags, see Tagging Your Resources in the Amazon WorkSpaces Applications Administration Guide.

Implementation

Future<CreateUpdatedImageResult> createUpdatedImage({
  required String existingImageName,
  required String newImageName,
  bool? dryRun,
  String? newImageDescription,
  String? newImageDisplayName,
  Map<String, String>? newImageTags,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'PhotonAdminProxyService.CreateUpdatedImage'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'existingImageName': existingImageName,
      'newImageName': newImageName,
      if (dryRun != null) 'dryRun': dryRun,
      if (newImageDescription != null)
        'newImageDescription': newImageDescription,
      if (newImageDisplayName != null)
        'newImageDisplayName': newImageDisplayName,
      if (newImageTags != null) 'newImageTags': newImageTags,
    },
  );

  return CreateUpdatedImageResult.fromJson(jsonResponse.body);
}