/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #pragma once #include #include #include #include #include #include namespace Aws { namespace EC2 { namespace Model { /** */ class AWS_EC2_API CreateImageRequest : public EC2Request { public: CreateImageRequest(); // 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 "CreateImage"; } Aws::String SerializePayload() const override; protected: void DumpBodyToUrl(Aws::Http::URI& uri ) const override; public: /** *

The block device mappings. This parameter cannot be used to modify the * encryption status of existing volumes or snapshots. To create an AMI with * encrypted snapshots, use the CopyImage action.

*/ inline const Aws::Vector& GetBlockDeviceMappings() const{ return m_blockDeviceMappings; } /** *

The block device mappings. This parameter cannot be used to modify the * encryption status of existing volumes or snapshots. To create an AMI with * encrypted snapshots, use the CopyImage action.

*/ inline bool BlockDeviceMappingsHasBeenSet() const { return m_blockDeviceMappingsHasBeenSet; } /** *

The block device mappings. This parameter cannot be used to modify the * encryption status of existing volumes or snapshots. To create an AMI with * encrypted snapshots, use the CopyImage action.

*/ inline void SetBlockDeviceMappings(const Aws::Vector& value) { m_blockDeviceMappingsHasBeenSet = true; m_blockDeviceMappings = value; } /** *

The block device mappings. This parameter cannot be used to modify the * encryption status of existing volumes or snapshots. To create an AMI with * encrypted snapshots, use the CopyImage action.

*/ inline void SetBlockDeviceMappings(Aws::Vector&& value) { m_blockDeviceMappingsHasBeenSet = true; m_blockDeviceMappings = std::move(value); } /** *

The block device mappings. This parameter cannot be used to modify the * encryption status of existing volumes or snapshots. To create an AMI with * encrypted snapshots, use the CopyImage action.

*/ inline CreateImageRequest& WithBlockDeviceMappings(const Aws::Vector& value) { SetBlockDeviceMappings(value); return *this;} /** *

The block device mappings. This parameter cannot be used to modify the * encryption status of existing volumes or snapshots. To create an AMI with * encrypted snapshots, use the CopyImage action.

*/ inline CreateImageRequest& WithBlockDeviceMappings(Aws::Vector&& value) { SetBlockDeviceMappings(std::move(value)); return *this;} /** *

The block device mappings. This parameter cannot be used to modify the * encryption status of existing volumes or snapshots. To create an AMI with * encrypted snapshots, use the CopyImage action.

*/ inline CreateImageRequest& AddBlockDeviceMappings(const BlockDeviceMapping& value) { m_blockDeviceMappingsHasBeenSet = true; m_blockDeviceMappings.push_back(value); return *this; } /** *

The block device mappings. This parameter cannot be used to modify the * encryption status of existing volumes or snapshots. To create an AMI with * encrypted snapshots, use the CopyImage action.

*/ inline CreateImageRequest& AddBlockDeviceMappings(BlockDeviceMapping&& value) { m_blockDeviceMappingsHasBeenSet = true; m_blockDeviceMappings.push_back(std::move(value)); return *this; } /** *

A description for the new image.

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

A description for the new image.

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

A description for the new image.

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

A description for the new image.

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

A description for the new image.

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

A description for the new image.

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

A description for the new image.

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

A description for the new image.

*/ inline CreateImageRequest& WithDescription(const char* value) { SetDescription(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 CreateImageRequest& WithDryRun(bool value) { SetDryRun(value); return *this;} /** *

The ID of the instance.

*/ inline const Aws::String& GetInstanceId() const{ return m_instanceId; } /** *

The ID of the instance.

*/ inline bool InstanceIdHasBeenSet() const { return m_instanceIdHasBeenSet; } /** *

The ID of the instance.

*/ inline void SetInstanceId(const Aws::String& value) { m_instanceIdHasBeenSet = true; m_instanceId = value; } /** *

The ID of the instance.

*/ inline void SetInstanceId(Aws::String&& value) { m_instanceIdHasBeenSet = true; m_instanceId = std::move(value); } /** *

The ID of the instance.

*/ inline void SetInstanceId(const char* value) { m_instanceIdHasBeenSet = true; m_instanceId.assign(value); } /** *

The ID of the instance.

*/ inline CreateImageRequest& WithInstanceId(const Aws::String& value) { SetInstanceId(value); return *this;} /** *

The ID of the instance.

*/ inline CreateImageRequest& WithInstanceId(Aws::String&& value) { SetInstanceId(std::move(value)); return *this;} /** *

The ID of the instance.

*/ inline CreateImageRequest& WithInstanceId(const char* value) { SetInstanceId(value); return *this;} /** *

A name for the new image.

Constraints: 3-128 alphanumeric characters, * parentheses (()), square brackets ([]), spaces ( ), periods (.), slashes (/), * dashes (-), single quotes ('), at-signs (@), or underscores(_)

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

A name for the new image.

Constraints: 3-128 alphanumeric characters, * parentheses (()), square brackets ([]), spaces ( ), periods (.), slashes (/), * dashes (-), single quotes ('), at-signs (@), or underscores(_)

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

A name for the new image.

Constraints: 3-128 alphanumeric characters, * parentheses (()), square brackets ([]), spaces ( ), periods (.), slashes (/), * dashes (-), single quotes ('), at-signs (@), or underscores(_)

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

A name for the new image.

Constraints: 3-128 alphanumeric characters, * parentheses (()), square brackets ([]), spaces ( ), periods (.), slashes (/), * dashes (-), single quotes ('), at-signs (@), or underscores(_)

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

A name for the new image.

Constraints: 3-128 alphanumeric characters, * parentheses (()), square brackets ([]), spaces ( ), periods (.), slashes (/), * dashes (-), single quotes ('), at-signs (@), or underscores(_)

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

A name for the new image.

Constraints: 3-128 alphanumeric characters, * parentheses (()), square brackets ([]), spaces ( ), periods (.), slashes (/), * dashes (-), single quotes ('), at-signs (@), or underscores(_)

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

A name for the new image.

Constraints: 3-128 alphanumeric characters, * parentheses (()), square brackets ([]), spaces ( ), periods (.), slashes (/), * dashes (-), single quotes ('), at-signs (@), or underscores(_)

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

A name for the new image.

Constraints: 3-128 alphanumeric characters, * parentheses (()), square brackets ([]), spaces ( ), periods (.), slashes (/), * dashes (-), single quotes ('), at-signs (@), or underscores(_)

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

By default, Amazon EC2 attempts to shut down and reboot the instance before * creating the image. If the 'No Reboot' option is set, Amazon EC2 doesn't shut * down the instance before creating the image. When this option is used, file * system integrity on the created image can't be guaranteed.

*/ inline bool GetNoReboot() const{ return m_noReboot; } /** *

By default, Amazon EC2 attempts to shut down and reboot the instance before * creating the image. If the 'No Reboot' option is set, Amazon EC2 doesn't shut * down the instance before creating the image. When this option is used, file * system integrity on the created image can't be guaranteed.

*/ inline bool NoRebootHasBeenSet() const { return m_noRebootHasBeenSet; } /** *

By default, Amazon EC2 attempts to shut down and reboot the instance before * creating the image. If the 'No Reboot' option is set, Amazon EC2 doesn't shut * down the instance before creating the image. When this option is used, file * system integrity on the created image can't be guaranteed.

*/ inline void SetNoReboot(bool value) { m_noRebootHasBeenSet = true; m_noReboot = value; } /** *

By default, Amazon EC2 attempts to shut down and reboot the instance before * creating the image. If the 'No Reboot' option is set, Amazon EC2 doesn't shut * down the instance before creating the image. When this option is used, file * system integrity on the created image can't be guaranteed.

*/ inline CreateImageRequest& WithNoReboot(bool value) { SetNoReboot(value); return *this;} private: Aws::Vector m_blockDeviceMappings; bool m_blockDeviceMappingsHasBeenSet; Aws::String m_description; bool m_descriptionHasBeenSet; bool m_dryRun; bool m_dryRunHasBeenSet; Aws::String m_instanceId; bool m_instanceIdHasBeenSet; Aws::String m_name; bool m_nameHasBeenSet; bool m_noReboot; bool m_noRebootHasBeenSet; }; } // namespace Model } // namespace EC2 } // namespace Aws