/* * Copyright 2018-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with * the License. A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions * and limitations under the License. */ package com.amazonaws.services.ec2.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.AmazonWebServiceRequest; import com.amazonaws.Request; import com.amazonaws.services.ec2.model.transform.AssignPrivateIpAddressesRequestMarshaller; /** *
* Contains the parameters for AssignPrivateIpAddresses. *
*/ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class AssignPrivateIpAddressesRequest extends AmazonWebServiceRequest implements Serializable, Cloneable, DryRunSupportedRequest* Indicates whether to allow an IP address that is already assigned to another network interface or instance to be * reassigned to the specified network interface. *
*/ private Boolean allowReassignment; /** ** The ID of the network interface. *
*/ private String networkInterfaceId; /** ** The IP addresses to be assigned as a secondary private IP address to the network interface. You can't specify * this parameter when also specifying a number of secondary IP addresses. *
** If you don't specify an IP address, Amazon EC2 automatically selects an IP address within the subnet range. *
*/ private com.amazonaws.internal.SdkInternalList* The number of secondary IP addresses to assign to the network interface. You can't specify this parameter when * also specifying private IP addresses. *
*/ private Integer secondaryPrivateIpAddressCount; /** *
* One or more IPv4 prefixes assigned to the network interface. You cannot use this option if you use the
* Ipv4PrefixCount
option.
*
* The number of IPv4 prefixes that Amazon Web Services automatically assigns to the network interface. You cannot
* use this option if you use the Ipv4 Prefixes
option.
*
* Indicates whether to allow an IP address that is already assigned to another network interface or instance to be * reassigned to the specified network interface. *
* * @param allowReassignment * Indicates whether to allow an IP address that is already assigned to another network interface or instance * to be reassigned to the specified network interface. */ public void setAllowReassignment(Boolean allowReassignment) { this.allowReassignment = allowReassignment; } /** ** Indicates whether to allow an IP address that is already assigned to another network interface or instance to be * reassigned to the specified network interface. *
* * @return Indicates whether to allow an IP address that is already assigned to another network interface or * instance to be reassigned to the specified network interface. */ public Boolean getAllowReassignment() { return this.allowReassignment; } /** ** Indicates whether to allow an IP address that is already assigned to another network interface or instance to be * reassigned to the specified network interface. *
* * @param allowReassignment * Indicates whether to allow an IP address that is already assigned to another network interface or instance * to be reassigned to the specified network interface. * @return Returns a reference to this object so that method calls can be chained together. */ public AssignPrivateIpAddressesRequest withAllowReassignment(Boolean allowReassignment) { setAllowReassignment(allowReassignment); return this; } /** ** Indicates whether to allow an IP address that is already assigned to another network interface or instance to be * reassigned to the specified network interface. *
* * @return Indicates whether to allow an IP address that is already assigned to another network interface or * instance to be reassigned to the specified network interface. */ public Boolean isAllowReassignment() { return this.allowReassignment; } /** ** The ID of the network interface. *
* * @param networkInterfaceId * The ID of the network interface. */ public void setNetworkInterfaceId(String networkInterfaceId) { this.networkInterfaceId = networkInterfaceId; } /** ** The ID of the network interface. *
* * @return The ID of the network interface. */ public String getNetworkInterfaceId() { return this.networkInterfaceId; } /** ** The ID of the network interface. *
* * @param networkInterfaceId * The ID of the network interface. * @return Returns a reference to this object so that method calls can be chained together. */ public AssignPrivateIpAddressesRequest withNetworkInterfaceId(String networkInterfaceId) { setNetworkInterfaceId(networkInterfaceId); return this; } /** ** The IP addresses to be assigned as a secondary private IP address to the network interface. You can't specify * this parameter when also specifying a number of secondary IP addresses. *
** If you don't specify an IP address, Amazon EC2 automatically selects an IP address within the subnet range. *
* * @return The IP addresses to be assigned as a secondary private IP address to the network interface. You can't * specify this parameter when also specifying a number of secondary IP addresses. *
* If you don't specify an IP address, Amazon EC2 automatically selects an IP address within the subnet
* range.
*/
public java.util.List
* The IP addresses to be assigned as a secondary private IP address to the network interface. You can't specify
* this parameter when also specifying a number of secondary IP addresses.
*
* If you don't specify an IP address, Amazon EC2 automatically selects an IP address within the subnet range.
*
* If you don't specify an IP address, Amazon EC2 automatically selects an IP address within the subnet
* range.
*/
public void setPrivateIpAddresses(java.util.Collection
* The IP addresses to be assigned as a secondary private IP address to the network interface. You can't specify
* this parameter when also specifying a number of secondary IP addresses.
*
* If you don't specify an IP address, Amazon EC2 automatically selects an IP address within the subnet range.
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setPrivateIpAddresses(java.util.Collection)} or {@link #withPrivateIpAddresses(java.util.Collection)} if
* you want to override the existing values.
*
* If you don't specify an IP address, Amazon EC2 automatically selects an IP address within the subnet
* range.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AssignPrivateIpAddressesRequest withPrivateIpAddresses(String... privateIpAddresses) {
if (this.privateIpAddresses == null) {
setPrivateIpAddresses(new com.amazonaws.internal.SdkInternalList
* The IP addresses to be assigned as a secondary private IP address to the network interface. You can't specify
* this parameter when also specifying a number of secondary IP addresses.
*
* If you don't specify an IP address, Amazon EC2 automatically selects an IP address within the subnet range.
*
* If you don't specify an IP address, Amazon EC2 automatically selects an IP address within the subnet
* range.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AssignPrivateIpAddressesRequest withPrivateIpAddresses(java.util.Collection
* The number of secondary IP addresses to assign to the network interface. You can't specify this parameter when
* also specifying private IP addresses.
*
* The number of secondary IP addresses to assign to the network interface. You can't specify this parameter when
* also specifying private IP addresses.
*
* The number of secondary IP addresses to assign to the network interface. You can't specify this parameter when
* also specifying private IP addresses.
*
* One or more IPv4 prefixes assigned to the network interface. You cannot use this option if you use the
*
* One or more IPv4 prefixes assigned to the network interface. You cannot use this option if you use the
*
* One or more IPv4 prefixes assigned to the network interface. You cannot use this option if you use the
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setIpv4Prefixes(java.util.Collection)} or {@link #withIpv4Prefixes(java.util.Collection)} if you want to
* override the existing values.
*
* One or more IPv4 prefixes assigned to the network interface. You cannot use this option if you use the
*
* The number of IPv4 prefixes that Amazon Web Services automatically assigns to the network interface. You cannot
* use this option if you use the
* The number of IPv4 prefixes that Amazon Web Services automatically assigns to the network interface. You cannot
* use this option if you use the
* The number of IPv4 prefixes that Amazon Web Services automatically assigns to the network interface. You cannot
* use this option if you use the Ipv4PrefixCount
option.
* Ipv4PrefixCount
option.
*/
public java.util.ListIpv4PrefixCount
option.
* Ipv4PrefixCount
option.
*/
public void setIpv4Prefixes(java.util.CollectionIpv4PrefixCount
option.
* Ipv4PrefixCount
option.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AssignPrivateIpAddressesRequest withIpv4Prefixes(String... ipv4Prefixes) {
if (this.ipv4Prefixes == null) {
setIpv4Prefixes(new com.amazonaws.internal.SdkInternalListIpv4PrefixCount
option.
* Ipv4PrefixCount
option.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AssignPrivateIpAddressesRequest withIpv4Prefixes(java.util.CollectionIpv4 Prefixes
option.
* Ipv4 Prefixes
option.
*/
public void setIpv4PrefixCount(Integer ipv4PrefixCount) {
this.ipv4PrefixCount = ipv4PrefixCount;
}
/**
* Ipv4 Prefixes
option.
* Ipv4 Prefixes
option.
*/
public Integer getIpv4PrefixCount() {
return this.ipv4PrefixCount;
}
/**
* Ipv4 Prefixes
option.
* Ipv4 Prefixes
option.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AssignPrivateIpAddressesRequest withIpv4PrefixCount(Integer ipv4PrefixCount) {
setIpv4PrefixCount(ipv4PrefixCount);
return this;
}
/**
* This method is intended for internal use only. Returns the marshaled request configured with additional
* parameters to enable operation dry-run.
*/
@Override
public Request