/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #pragma once #include #include #include #include namespace Aws { namespace EC2 { namespace Model { /** *

Contains the parameters for CopyImage.

See Also:

AWS * API Reference

*/ class AWS_EC2_API CopyImageRequest : public EC2Request { public: CopyImageRequest(); // Service request name is the Operation name which will send this request out, // each operation should has unique request name, so that we can get operation's name from this request. // Note: this is not true for response, multiple operations may have the same response name, // so we can not get operation's name from response. inline virtual const char* GetServiceRequestName() const override { return "CopyImage"; } Aws::String SerializePayload() const override; protected: void DumpBodyToUrl(Aws::Http::URI& uri ) const override; public: /** *

Unique, case-sensitive identifier you provide to ensure idempotency of the * request. For more information, see How * to Ensure Idempotency in the Amazon Elastic Compute Cloud User * Guide.

*/ inline const Aws::String& GetClientToken() const{ return m_clientToken; } /** *

Unique, case-sensitive identifier you provide to ensure idempotency of the * request. For more information, see How * to Ensure Idempotency in the Amazon Elastic Compute Cloud User * Guide.

*/ inline bool ClientTokenHasBeenSet() const { return m_clientTokenHasBeenSet; } /** *

Unique, case-sensitive identifier you provide to ensure idempotency of the * request. For more information, see How * to Ensure Idempotency in the Amazon Elastic Compute Cloud User * Guide.

*/ inline void SetClientToken(const Aws::String& value) { m_clientTokenHasBeenSet = true; m_clientToken = value; } /** *

Unique, case-sensitive identifier you provide to ensure idempotency of the * request. For more information, see How * to Ensure Idempotency in the Amazon Elastic Compute Cloud User * Guide.

*/ inline void SetClientToken(Aws::String&& value) { m_clientTokenHasBeenSet = true; m_clientToken = std::move(value); } /** *

Unique, case-sensitive identifier you provide to ensure idempotency of the * request. For more information, see How * to Ensure Idempotency in the Amazon Elastic Compute Cloud User * Guide.

*/ inline void SetClientToken(const char* value) { m_clientTokenHasBeenSet = true; m_clientToken.assign(value); } /** *

Unique, case-sensitive identifier you provide to ensure idempotency of the * request. For more information, see How * to Ensure Idempotency in the Amazon Elastic Compute Cloud User * Guide.

*/ inline CopyImageRequest& WithClientToken(const Aws::String& value) { SetClientToken(value); return *this;} /** *

Unique, case-sensitive identifier you provide to ensure idempotency of the * request. For more information, see How * to Ensure Idempotency in the Amazon Elastic Compute Cloud User * Guide.

*/ inline CopyImageRequest& WithClientToken(Aws::String&& value) { SetClientToken(std::move(value)); return *this;} /** *

Unique, case-sensitive identifier you provide to ensure idempotency of the * request. For more information, see How * to Ensure Idempotency in the Amazon Elastic Compute Cloud User * Guide.

*/ inline CopyImageRequest& WithClientToken(const char* value) { SetClientToken(value); return *this;} /** *

A description for the new AMI in the destination Region.

*/ inline const Aws::String& GetDescription() const{ return m_description; } /** *

A description for the new AMI in the destination Region.

*/ inline bool DescriptionHasBeenSet() const { return m_descriptionHasBeenSet; } /** *

A description for the new AMI in the destination Region.

*/ inline void SetDescription(const Aws::String& value) { m_descriptionHasBeenSet = true; m_description = value; } /** *

A description for the new AMI in the destination Region.

*/ inline void SetDescription(Aws::String&& value) { m_descriptionHasBeenSet = true; m_description = std::move(value); } /** *

A description for the new AMI in the destination Region.

*/ inline void SetDescription(const char* value) { m_descriptionHasBeenSet = true; m_description.assign(value); } /** *

A description for the new AMI in the destination Region.

*/ inline CopyImageRequest& WithDescription(const Aws::String& value) { SetDescription(value); return *this;} /** *

A description for the new AMI in the destination Region.

*/ inline CopyImageRequest& WithDescription(Aws::String&& value) { SetDescription(std::move(value)); return *this;} /** *

A description for the new AMI in the destination Region.

*/ inline CopyImageRequest& WithDescription(const char* value) { SetDescription(value); return *this;} /** *

Specifies whether the destination snapshots of the copied image should be * encrypted. You can encrypt a copy of an unencrypted snapshot, but you cannot * create an unencrypted copy of an encrypted snapshot. The default CMK for EBS is * used unless you specify a non-default AWS Key Management Service (AWS KMS) CMK * using KmsKeyId. For more information, see Amazon * EBS Encryption in the Amazon Elastic Compute Cloud User Guide.

*/ inline bool GetEncrypted() const{ return m_encrypted; } /** *

Specifies whether the destination snapshots of the copied image should be * encrypted. You can encrypt a copy of an unencrypted snapshot, but you cannot * create an unencrypted copy of an encrypted snapshot. The default CMK for EBS is * used unless you specify a non-default AWS Key Management Service (AWS KMS) CMK * using KmsKeyId. For more information, see Amazon * EBS Encryption in the Amazon Elastic Compute Cloud User Guide.

*/ inline bool EncryptedHasBeenSet() const { return m_encryptedHasBeenSet; } /** *

Specifies whether the destination snapshots of the copied image should be * encrypted. You can encrypt a copy of an unencrypted snapshot, but you cannot * create an unencrypted copy of an encrypted snapshot. The default CMK for EBS is * used unless you specify a non-default AWS Key Management Service (AWS KMS) CMK * using KmsKeyId. For more information, see Amazon * EBS Encryption in the Amazon Elastic Compute Cloud User Guide.

*/ inline void SetEncrypted(bool value) { m_encryptedHasBeenSet = true; m_encrypted = value; } /** *

Specifies whether the destination snapshots of the copied image should be * encrypted. You can encrypt a copy of an unencrypted snapshot, but you cannot * create an unencrypted copy of an encrypted snapshot. The default CMK for EBS is * used unless you specify a non-default AWS Key Management Service (AWS KMS) CMK * using KmsKeyId. For more information, see Amazon * EBS Encryption in the Amazon Elastic Compute Cloud User Guide.

*/ inline CopyImageRequest& WithEncrypted(bool value) { SetEncrypted(value); return *this;} /** *

An identifier for the symmetric AWS Key Management Service (AWS KMS) customer * master key (CMK) to use when creating the encrypted volume. This parameter is * only required if you want to use a non-default CMK; if this parameter is not * specified, the default CMK for EBS is used. If a KmsKeyId is * specified, the Encrypted flag must also be set.

To specify * a CMK, use its key ID, Amazon Resource Name (ARN), alias name, or alias ARN. * When using an alias name, prefix it with "alias/". For example:

  • *

    Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab

  • *

    Key ARN: * arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab *

  • Alias name: alias/ExampleAlias

  • *

    Alias ARN: arn:aws:kms:us-east-2:111122223333:alias/ExampleAlias *

AWS parses KmsKeyId asynchronously, meaning * that the action you call may appear to complete even though you provided an * invalid identifier. This action will eventually report failure.

The * specified CMK must exist in the Region that the snapshot is being copied to. *

Amazon EBS does not support asymmetric CMKs.

*/ inline const Aws::String& GetKmsKeyId() const{ return m_kmsKeyId; } /** *

An identifier for the symmetric AWS Key Management Service (AWS KMS) customer * master key (CMK) to use when creating the encrypted volume. This parameter is * only required if you want to use a non-default CMK; if this parameter is not * specified, the default CMK for EBS is used. If a KmsKeyId is * specified, the Encrypted flag must also be set.

To specify * a CMK, use its key ID, Amazon Resource Name (ARN), alias name, or alias ARN. * When using an alias name, prefix it with "alias/". For example:

  • *

    Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab

  • *

    Key ARN: * arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab *

  • Alias name: alias/ExampleAlias

  • *

    Alias ARN: arn:aws:kms:us-east-2:111122223333:alias/ExampleAlias *

AWS parses KmsKeyId asynchronously, meaning * that the action you call may appear to complete even though you provided an * invalid identifier. This action will eventually report failure.

The * specified CMK must exist in the Region that the snapshot is being copied to. *

Amazon EBS does not support asymmetric CMKs.

*/ inline bool KmsKeyIdHasBeenSet() const { return m_kmsKeyIdHasBeenSet; } /** *

An identifier for the symmetric AWS Key Management Service (AWS KMS) customer * master key (CMK) to use when creating the encrypted volume. This parameter is * only required if you want to use a non-default CMK; if this parameter is not * specified, the default CMK for EBS is used. If a KmsKeyId is * specified, the Encrypted flag must also be set.

To specify * a CMK, use its key ID, Amazon Resource Name (ARN), alias name, or alias ARN. * When using an alias name, prefix it with "alias/". For example:

  • *

    Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab

  • *

    Key ARN: * arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab *

  • Alias name: alias/ExampleAlias

  • *

    Alias ARN: arn:aws:kms:us-east-2:111122223333:alias/ExampleAlias *

AWS parses KmsKeyId asynchronously, meaning * that the action you call may appear to complete even though you provided an * invalid identifier. This action will eventually report failure.

The * specified CMK must exist in the Region that the snapshot is being copied to. *

Amazon EBS does not support asymmetric CMKs.

*/ inline void SetKmsKeyId(const Aws::String& value) { m_kmsKeyIdHasBeenSet = true; m_kmsKeyId = value; } /** *

An identifier for the symmetric AWS Key Management Service (AWS KMS) customer * master key (CMK) to use when creating the encrypted volume. This parameter is * only required if you want to use a non-default CMK; if this parameter is not * specified, the default CMK for EBS is used. If a KmsKeyId is * specified, the Encrypted flag must also be set.

To specify * a CMK, use its key ID, Amazon Resource Name (ARN), alias name, or alias ARN. * When using an alias name, prefix it with "alias/". For example:

  • *

    Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab

  • *

    Key ARN: * arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab *

  • Alias name: alias/ExampleAlias

  • *

    Alias ARN: arn:aws:kms:us-east-2:111122223333:alias/ExampleAlias *

AWS parses KmsKeyId asynchronously, meaning * that the action you call may appear to complete even though you provided an * invalid identifier. This action will eventually report failure.

The * specified CMK must exist in the Region that the snapshot is being copied to. *

Amazon EBS does not support asymmetric CMKs.

*/ inline void SetKmsKeyId(Aws::String&& value) { m_kmsKeyIdHasBeenSet = true; m_kmsKeyId = std::move(value); } /** *

An identifier for the symmetric AWS Key Management Service (AWS KMS) customer * master key (CMK) to use when creating the encrypted volume. This parameter is * only required if you want to use a non-default CMK; if this parameter is not * specified, the default CMK for EBS is used. If a KmsKeyId is * specified, the Encrypted flag must also be set.

To specify * a CMK, use its key ID, Amazon Resource Name (ARN), alias name, or alias ARN. * When using an alias name, prefix it with "alias/". For example:

  • *

    Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab

  • *

    Key ARN: * arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab *

  • Alias name: alias/ExampleAlias

  • *

    Alias ARN: arn:aws:kms:us-east-2:111122223333:alias/ExampleAlias *

AWS parses KmsKeyId asynchronously, meaning * that the action you call may appear to complete even though you provided an * invalid identifier. This action will eventually report failure.

The * specified CMK must exist in the Region that the snapshot is being copied to. *

Amazon EBS does not support asymmetric CMKs.

*/ inline void SetKmsKeyId(const char* value) { m_kmsKeyIdHasBeenSet = true; m_kmsKeyId.assign(value); } /** *

An identifier for the symmetric AWS Key Management Service (AWS KMS) customer * master key (CMK) to use when creating the encrypted volume. This parameter is * only required if you want to use a non-default CMK; if this parameter is not * specified, the default CMK for EBS is used. If a KmsKeyId is * specified, the Encrypted flag must also be set.

To specify * a CMK, use its key ID, Amazon Resource Name (ARN), alias name, or alias ARN. * When using an alias name, prefix it with "alias/". For example:

  • *

    Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab

  • *

    Key ARN: * arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab *

  • Alias name: alias/ExampleAlias

  • *

    Alias ARN: arn:aws:kms:us-east-2:111122223333:alias/ExampleAlias *

AWS parses KmsKeyId asynchronously, meaning * that the action you call may appear to complete even though you provided an * invalid identifier. This action will eventually report failure.

The * specified CMK must exist in the Region that the snapshot is being copied to. *

Amazon EBS does not support asymmetric CMKs.

*/ inline CopyImageRequest& WithKmsKeyId(const Aws::String& value) { SetKmsKeyId(value); return *this;} /** *

An identifier for the symmetric AWS Key Management Service (AWS KMS) customer * master key (CMK) to use when creating the encrypted volume. This parameter is * only required if you want to use a non-default CMK; if this parameter is not * specified, the default CMK for EBS is used. If a KmsKeyId is * specified, the Encrypted flag must also be set.

To specify * a CMK, use its key ID, Amazon Resource Name (ARN), alias name, or alias ARN. * When using an alias name, prefix it with "alias/". For example:

  • *

    Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab

  • *

    Key ARN: * arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab *

  • Alias name: alias/ExampleAlias

  • *

    Alias ARN: arn:aws:kms:us-east-2:111122223333:alias/ExampleAlias *

AWS parses KmsKeyId asynchronously, meaning * that the action you call may appear to complete even though you provided an * invalid identifier. This action will eventually report failure.

The * specified CMK must exist in the Region that the snapshot is being copied to. *

Amazon EBS does not support asymmetric CMKs.

*/ inline CopyImageRequest& WithKmsKeyId(Aws::String&& value) { SetKmsKeyId(std::move(value)); return *this;} /** *

An identifier for the symmetric AWS Key Management Service (AWS KMS) customer * master key (CMK) to use when creating the encrypted volume. This parameter is * only required if you want to use a non-default CMK; if this parameter is not * specified, the default CMK for EBS is used. If a KmsKeyId is * specified, the Encrypted flag must also be set.

To specify * a CMK, use its key ID, Amazon Resource Name (ARN), alias name, or alias ARN. * When using an alias name, prefix it with "alias/". For example:

  • *

    Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab

  • *

    Key ARN: * arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab *

  • Alias name: alias/ExampleAlias

  • *

    Alias ARN: arn:aws:kms:us-east-2:111122223333:alias/ExampleAlias *

AWS parses KmsKeyId asynchronously, meaning * that the action you call may appear to complete even though you provided an * invalid identifier. This action will eventually report failure.

The * specified CMK must exist in the Region that the snapshot is being copied to. *

Amazon EBS does not support asymmetric CMKs.

*/ inline CopyImageRequest& WithKmsKeyId(const char* value) { SetKmsKeyId(value); return *this;} /** *

The name of the new AMI in the destination Region.

*/ inline const Aws::String& GetName() const{ return m_name; } /** *

The name of the new AMI in the destination Region.

*/ inline bool NameHasBeenSet() const { return m_nameHasBeenSet; } /** *

The name of the new AMI in the destination Region.

*/ inline void SetName(const Aws::String& value) { m_nameHasBeenSet = true; m_name = value; } /** *

The name of the new AMI in the destination Region.

*/ inline void SetName(Aws::String&& value) { m_nameHasBeenSet = true; m_name = std::move(value); } /** *

The name of the new AMI in the destination Region.

*/ inline void SetName(const char* value) { m_nameHasBeenSet = true; m_name.assign(value); } /** *

The name of the new AMI in the destination Region.

*/ inline CopyImageRequest& WithName(const Aws::String& value) { SetName(value); return *this;} /** *

The name of the new AMI in the destination Region.

*/ inline CopyImageRequest& WithName(Aws::String&& value) { SetName(std::move(value)); return *this;} /** *

The name of the new AMI in the destination Region.

*/ inline CopyImageRequest& WithName(const char* value) { SetName(value); return *this;} /** *

The ID of the AMI to copy.

*/ inline const Aws::String& GetSourceImageId() const{ return m_sourceImageId; } /** *

The ID of the AMI to copy.

*/ inline bool SourceImageIdHasBeenSet() const { return m_sourceImageIdHasBeenSet; } /** *

The ID of the AMI to copy.

*/ inline void SetSourceImageId(const Aws::String& value) { m_sourceImageIdHasBeenSet = true; m_sourceImageId = value; } /** *

The ID of the AMI to copy.

*/ inline void SetSourceImageId(Aws::String&& value) { m_sourceImageIdHasBeenSet = true; m_sourceImageId = std::move(value); } /** *

The ID of the AMI to copy.

*/ inline void SetSourceImageId(const char* value) { m_sourceImageIdHasBeenSet = true; m_sourceImageId.assign(value); } /** *

The ID of the AMI to copy.

*/ inline CopyImageRequest& WithSourceImageId(const Aws::String& value) { SetSourceImageId(value); return *this;} /** *

The ID of the AMI to copy.

*/ inline CopyImageRequest& WithSourceImageId(Aws::String&& value) { SetSourceImageId(std::move(value)); return *this;} /** *

The ID of the AMI to copy.

*/ inline CopyImageRequest& WithSourceImageId(const char* value) { SetSourceImageId(value); return *this;} /** *

The name of the Region that contains the AMI to copy.

*/ inline const Aws::String& GetSourceRegion() const{ return m_sourceRegion; } /** *

The name of the Region that contains the AMI to copy.

*/ inline bool SourceRegionHasBeenSet() const { return m_sourceRegionHasBeenSet; } /** *

The name of the Region that contains the AMI to copy.

*/ inline void SetSourceRegion(const Aws::String& value) { m_sourceRegionHasBeenSet = true; m_sourceRegion = value; } /** *

The name of the Region that contains the AMI to copy.

*/ inline void SetSourceRegion(Aws::String&& value) { m_sourceRegionHasBeenSet = true; m_sourceRegion = std::move(value); } /** *

The name of the Region that contains the AMI to copy.

*/ inline void SetSourceRegion(const char* value) { m_sourceRegionHasBeenSet = true; m_sourceRegion.assign(value); } /** *

The name of the Region that contains the AMI to copy.

*/ inline CopyImageRequest& WithSourceRegion(const Aws::String& value) { SetSourceRegion(value); return *this;} /** *

The name of the Region that contains the AMI to copy.

*/ inline CopyImageRequest& WithSourceRegion(Aws::String&& value) { SetSourceRegion(std::move(value)); return *this;} /** *

The name of the Region that contains the AMI to copy.

*/ inline CopyImageRequest& WithSourceRegion(const char* value) { SetSourceRegion(value); return *this;} /** *

Checks whether you have the required permissions for the action, without * actually making the request, and provides an error response. If you have the * required permissions, the error response is DryRunOperation. * Otherwise, it is UnauthorizedOperation.

*/ inline bool GetDryRun() const{ return m_dryRun; } /** *

Checks whether you have the required permissions for the action, without * actually making the request, and provides an error response. If you have the * required permissions, the error response is DryRunOperation. * Otherwise, it is UnauthorizedOperation.

*/ inline bool DryRunHasBeenSet() const { return m_dryRunHasBeenSet; } /** *

Checks whether you have the required permissions for the action, without * actually making the request, and provides an error response. If you have the * required permissions, the error response is DryRunOperation. * Otherwise, it is UnauthorizedOperation.

*/ inline void SetDryRun(bool value) { m_dryRunHasBeenSet = true; m_dryRun = value; } /** *

Checks whether you have the required permissions for the action, without * actually making the request, and provides an error response. If you have the * required permissions, the error response is DryRunOperation. * Otherwise, it is UnauthorizedOperation.

*/ inline CopyImageRequest& WithDryRun(bool value) { SetDryRun(value); return *this;} private: Aws::String m_clientToken; bool m_clientTokenHasBeenSet; Aws::String m_description; bool m_descriptionHasBeenSet; bool m_encrypted; bool m_encryptedHasBeenSet; Aws::String m_kmsKeyId; bool m_kmsKeyIdHasBeenSet; Aws::String m_name; bool m_nameHasBeenSet; Aws::String m_sourceImageId; bool m_sourceImageIdHasBeenSet; Aws::String m_sourceRegion; bool m_sourceRegionHasBeenSet; bool m_dryRun; bool m_dryRunHasBeenSet; }; } // namespace Model } // namespace EC2 } // namespace Aws