importCustomWorkspaceImage method

Future<ImportCustomWorkspaceImageResult> importCustomWorkspaceImage({
  1. required ImageComputeType computeType,
  2. required String imageDescription,
  3. required String imageName,
  4. required ImageSourceIdentifier imageSource,
  5. required String infrastructureConfigurationArn,
  6. required OSVersion osVersion,
  7. required Platform platform,
  8. required CustomImageProtocol protocol,
  9. List<Tag>? tags,
})

Imports the specified Windows 10 or 11 Bring Your Own License (BYOL) image into Amazon WorkSpaces using EC2 Image Builder. The image must be an already licensed image that is in your Amazon Web Services account, and you must own the image. For more information about creating BYOL images, see Bring Your Own Windows Desktop Licenses.

May throw AccessDeniedException. May throw InvalidParameterValuesException. May throw OperationNotSupportedException. May throw ResourceAlreadyExistsException. May throw ResourceLimitExceededException. May throw ResourceNotFoundException.

Parameter computeType : The supported compute type for the WorkSpace image.

Parameter imageDescription : The description of the WorkSpace image.

Parameter imageName : The name of the WorkSpace image.

Parameter imageSource : The options for image import source.

Parameter infrastructureConfigurationArn : The infrastructure configuration ARN that specifies how the WorkSpace image is built.

Parameter osVersion : The OS version for the WorkSpace image source.

Parameter platform : The platform for the WorkSpace image source.

Parameter protocol : The supported protocol for the WorkSpace image. Windows 11 does not support PCOIP protocol.

Parameter tags : The resource tags. Each WorkSpaces resource can have a maximum of 50 tags.

Implementation

Future<ImportCustomWorkspaceImageResult> importCustomWorkspaceImage({
  required ImageComputeType computeType,
  required String imageDescription,
  required String imageName,
  required ImageSourceIdentifier imageSource,
  required String infrastructureConfigurationArn,
  required OSVersion osVersion,
  required Platform platform,
  required CustomImageProtocol protocol,
  List<Tag>? tags,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'WorkspacesService.ImportCustomWorkspaceImage'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'ComputeType': computeType.value,
      'ImageDescription': imageDescription,
      'ImageName': imageName,
      'ImageSource': imageSource,
      'InfrastructureConfigurationArn': infrastructureConfigurationArn,
      'OsVersion': osVersion.value,
      'Platform': platform.value,
      'Protocol': protocol.value,
      if (tags != null) 'Tags': tags,
    },
  );

  return ImportCustomWorkspaceImageResult.fromJson(jsonResponse.body);
}