/** * 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 { /** */ class AWS_EC2_API AssociateAddressRequest : public EC2Request { public: AssociateAddressRequest(); // 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 "AssociateAddress"; } Aws::String SerializePayload() const override; protected: void DumpBodyToUrl(Aws::Http::URI& uri ) const override; public: /** *

[EC2-VPC] The allocation ID. This is required for EC2-VPC.

*/ inline const Aws::String& GetAllocationId() const{ return m_allocationId; } /** *

[EC2-VPC] The allocation ID. This is required for EC2-VPC.

*/ inline bool AllocationIdHasBeenSet() const { return m_allocationIdHasBeenSet; } /** *

[EC2-VPC] The allocation ID. This is required for EC2-VPC.

*/ inline void SetAllocationId(const Aws::String& value) { m_allocationIdHasBeenSet = true; m_allocationId = value; } /** *

[EC2-VPC] The allocation ID. This is required for EC2-VPC.

*/ inline void SetAllocationId(Aws::String&& value) { m_allocationIdHasBeenSet = true; m_allocationId = std::move(value); } /** *

[EC2-VPC] The allocation ID. This is required for EC2-VPC.

*/ inline void SetAllocationId(const char* value) { m_allocationIdHasBeenSet = true; m_allocationId.assign(value); } /** *

[EC2-VPC] The allocation ID. This is required for EC2-VPC.

*/ inline AssociateAddressRequest& WithAllocationId(const Aws::String& value) { SetAllocationId(value); return *this;} /** *

[EC2-VPC] The allocation ID. This is required for EC2-VPC.

*/ inline AssociateAddressRequest& WithAllocationId(Aws::String&& value) { SetAllocationId(std::move(value)); return *this;} /** *

[EC2-VPC] The allocation ID. This is required for EC2-VPC.

*/ inline AssociateAddressRequest& WithAllocationId(const char* value) { SetAllocationId(value); return *this;} /** *

The ID of the instance. This is required for EC2-Classic. For EC2-VPC, you * can specify either the instance ID or the network interface ID, but not both. * The operation fails if you specify an instance ID unless exactly one network * interface is attached.

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

The ID of the instance. This is required for EC2-Classic. For EC2-VPC, you * can specify either the instance ID or the network interface ID, but not both. * The operation fails if you specify an instance ID unless exactly one network * interface is attached.

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

The ID of the instance. This is required for EC2-Classic. For EC2-VPC, you * can specify either the instance ID or the network interface ID, but not both. * The operation fails if you specify an instance ID unless exactly one network * interface is attached.

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

The ID of the instance. This is required for EC2-Classic. For EC2-VPC, you * can specify either the instance ID or the network interface ID, but not both. * The operation fails if you specify an instance ID unless exactly one network * interface is attached.

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

The ID of the instance. This is required for EC2-Classic. For EC2-VPC, you * can specify either the instance ID or the network interface ID, but not both. * The operation fails if you specify an instance ID unless exactly one network * interface is attached.

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

The ID of the instance. This is required for EC2-Classic. For EC2-VPC, you * can specify either the instance ID or the network interface ID, but not both. * The operation fails if you specify an instance ID unless exactly one network * interface is attached.

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

The ID of the instance. This is required for EC2-Classic. For EC2-VPC, you * can specify either the instance ID or the network interface ID, but not both. * The operation fails if you specify an instance ID unless exactly one network * interface is attached.

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

The ID of the instance. This is required for EC2-Classic. For EC2-VPC, you * can specify either the instance ID or the network interface ID, but not both. * The operation fails if you specify an instance ID unless exactly one network * interface is attached.

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

The Elastic IP address to associate with the instance. This is required for * EC2-Classic.

*/ inline const Aws::String& GetPublicIp() const{ return m_publicIp; } /** *

The Elastic IP address to associate with the instance. This is required for * EC2-Classic.

*/ inline bool PublicIpHasBeenSet() const { return m_publicIpHasBeenSet; } /** *

The Elastic IP address to associate with the instance. This is required for * EC2-Classic.

*/ inline void SetPublicIp(const Aws::String& value) { m_publicIpHasBeenSet = true; m_publicIp = value; } /** *

The Elastic IP address to associate with the instance. This is required for * EC2-Classic.

*/ inline void SetPublicIp(Aws::String&& value) { m_publicIpHasBeenSet = true; m_publicIp = std::move(value); } /** *

The Elastic IP address to associate with the instance. This is required for * EC2-Classic.

*/ inline void SetPublicIp(const char* value) { m_publicIpHasBeenSet = true; m_publicIp.assign(value); } /** *

The Elastic IP address to associate with the instance. This is required for * EC2-Classic.

*/ inline AssociateAddressRequest& WithPublicIp(const Aws::String& value) { SetPublicIp(value); return *this;} /** *

The Elastic IP address to associate with the instance. This is required for * EC2-Classic.

*/ inline AssociateAddressRequest& WithPublicIp(Aws::String&& value) { SetPublicIp(std::move(value)); return *this;} /** *

The Elastic IP address to associate with the instance. This is required for * EC2-Classic.

*/ inline AssociateAddressRequest& WithPublicIp(const char* value) { SetPublicIp(value); return *this;} /** *

[EC2-VPC] For a VPC in an EC2-Classic account, specify true to allow an * Elastic IP address that is already associated with an instance or network * interface to be reassociated with the specified instance or network interface. * Otherwise, the operation fails. In a VPC in an EC2-VPC-only account, * reassociation is automatic, therefore you can specify false to ensure the * operation fails if the Elastic IP address is already associated with another * resource.

*/ inline bool GetAllowReassociation() const{ return m_allowReassociation; } /** *

[EC2-VPC] For a VPC in an EC2-Classic account, specify true to allow an * Elastic IP address that is already associated with an instance or network * interface to be reassociated with the specified instance or network interface. * Otherwise, the operation fails. In a VPC in an EC2-VPC-only account, * reassociation is automatic, therefore you can specify false to ensure the * operation fails if the Elastic IP address is already associated with another * resource.

*/ inline bool AllowReassociationHasBeenSet() const { return m_allowReassociationHasBeenSet; } /** *

[EC2-VPC] For a VPC in an EC2-Classic account, specify true to allow an * Elastic IP address that is already associated with an instance or network * interface to be reassociated with the specified instance or network interface. * Otherwise, the operation fails. In a VPC in an EC2-VPC-only account, * reassociation is automatic, therefore you can specify false to ensure the * operation fails if the Elastic IP address is already associated with another * resource.

*/ inline void SetAllowReassociation(bool value) { m_allowReassociationHasBeenSet = true; m_allowReassociation = value; } /** *

[EC2-VPC] For a VPC in an EC2-Classic account, specify true to allow an * Elastic IP address that is already associated with an instance or network * interface to be reassociated with the specified instance or network interface. * Otherwise, the operation fails. In a VPC in an EC2-VPC-only account, * reassociation is automatic, therefore you can specify false to ensure the * operation fails if the Elastic IP address is already associated with another * resource.

*/ inline AssociateAddressRequest& WithAllowReassociation(bool value) { SetAllowReassociation(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 AssociateAddressRequest& WithDryRun(bool value) { SetDryRun(value); return *this;} /** *

[EC2-VPC] The ID of the network interface. If the instance has more than one * network interface, you must specify a network interface ID.

For EC2-VPC, * you can specify either the instance ID or the network interface ID, but not * both.

*/ inline const Aws::String& GetNetworkInterfaceId() const{ return m_networkInterfaceId; } /** *

[EC2-VPC] The ID of the network interface. If the instance has more than one * network interface, you must specify a network interface ID.

For EC2-VPC, * you can specify either the instance ID or the network interface ID, but not * both.

*/ inline bool NetworkInterfaceIdHasBeenSet() const { return m_networkInterfaceIdHasBeenSet; } /** *

[EC2-VPC] The ID of the network interface. If the instance has more than one * network interface, you must specify a network interface ID.

For EC2-VPC, * you can specify either the instance ID or the network interface ID, but not * both.

*/ inline void SetNetworkInterfaceId(const Aws::String& value) { m_networkInterfaceIdHasBeenSet = true; m_networkInterfaceId = value; } /** *

[EC2-VPC] The ID of the network interface. If the instance has more than one * network interface, you must specify a network interface ID.

For EC2-VPC, * you can specify either the instance ID or the network interface ID, but not * both.

*/ inline void SetNetworkInterfaceId(Aws::String&& value) { m_networkInterfaceIdHasBeenSet = true; m_networkInterfaceId = std::move(value); } /** *

[EC2-VPC] The ID of the network interface. If the instance has more than one * network interface, you must specify a network interface ID.

For EC2-VPC, * you can specify either the instance ID or the network interface ID, but not * both.

*/ inline void SetNetworkInterfaceId(const char* value) { m_networkInterfaceIdHasBeenSet = true; m_networkInterfaceId.assign(value); } /** *

[EC2-VPC] The ID of the network interface. If the instance has more than one * network interface, you must specify a network interface ID.

For EC2-VPC, * you can specify either the instance ID or the network interface ID, but not * both.

*/ inline AssociateAddressRequest& WithNetworkInterfaceId(const Aws::String& value) { SetNetworkInterfaceId(value); return *this;} /** *

[EC2-VPC] The ID of the network interface. If the instance has more than one * network interface, you must specify a network interface ID.

For EC2-VPC, * you can specify either the instance ID or the network interface ID, but not * both.

*/ inline AssociateAddressRequest& WithNetworkInterfaceId(Aws::String&& value) { SetNetworkInterfaceId(std::move(value)); return *this;} /** *

[EC2-VPC] The ID of the network interface. If the instance has more than one * network interface, you must specify a network interface ID.

For EC2-VPC, * you can specify either the instance ID or the network interface ID, but not * both.

*/ inline AssociateAddressRequest& WithNetworkInterfaceId(const char* value) { SetNetworkInterfaceId(value); return *this;} /** *

[EC2-VPC] The primary or secondary private IP address to associate with the * Elastic IP address. If no private IP address is specified, the Elastic IP * address is associated with the primary private IP address.

*/ inline const Aws::String& GetPrivateIpAddress() const{ return m_privateIpAddress; } /** *

[EC2-VPC] The primary or secondary private IP address to associate with the * Elastic IP address. If no private IP address is specified, the Elastic IP * address is associated with the primary private IP address.

*/ inline bool PrivateIpAddressHasBeenSet() const { return m_privateIpAddressHasBeenSet; } /** *

[EC2-VPC] The primary or secondary private IP address to associate with the * Elastic IP address. If no private IP address is specified, the Elastic IP * address is associated with the primary private IP address.

*/ inline void SetPrivateIpAddress(const Aws::String& value) { m_privateIpAddressHasBeenSet = true; m_privateIpAddress = value; } /** *

[EC2-VPC] The primary or secondary private IP address to associate with the * Elastic IP address. If no private IP address is specified, the Elastic IP * address is associated with the primary private IP address.

*/ inline void SetPrivateIpAddress(Aws::String&& value) { m_privateIpAddressHasBeenSet = true; m_privateIpAddress = std::move(value); } /** *

[EC2-VPC] The primary or secondary private IP address to associate with the * Elastic IP address. If no private IP address is specified, the Elastic IP * address is associated with the primary private IP address.

*/ inline void SetPrivateIpAddress(const char* value) { m_privateIpAddressHasBeenSet = true; m_privateIpAddress.assign(value); } /** *

[EC2-VPC] The primary or secondary private IP address to associate with the * Elastic IP address. If no private IP address is specified, the Elastic IP * address is associated with the primary private IP address.

*/ inline AssociateAddressRequest& WithPrivateIpAddress(const Aws::String& value) { SetPrivateIpAddress(value); return *this;} /** *

[EC2-VPC] The primary or secondary private IP address to associate with the * Elastic IP address. If no private IP address is specified, the Elastic IP * address is associated with the primary private IP address.

*/ inline AssociateAddressRequest& WithPrivateIpAddress(Aws::String&& value) { SetPrivateIpAddress(std::move(value)); return *this;} /** *

[EC2-VPC] The primary or secondary private IP address to associate with the * Elastic IP address. If no private IP address is specified, the Elastic IP * address is associated with the primary private IP address.

*/ inline AssociateAddressRequest& WithPrivateIpAddress(const char* value) { SetPrivateIpAddress(value); return *this;} private: Aws::String m_allocationId; bool m_allocationIdHasBeenSet; Aws::String m_instanceId; bool m_instanceIdHasBeenSet; Aws::String m_publicIp; bool m_publicIpHasBeenSet; bool m_allowReassociation; bool m_allowReassociationHasBeenSet; bool m_dryRun; bool m_dryRunHasBeenSet; Aws::String m_networkInterfaceId; bool m_networkInterfaceIdHasBeenSet; Aws::String m_privateIpAddress; bool m_privateIpAddressHasBeenSet; }; } // namespace Model } // namespace EC2 } // namespace Aws