/* * 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; /** *
* Describes a stale rule in a security group. *
* * @see AWS API * Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class StaleIpPermission implements Serializable, Cloneable { /** ** The start of the port range for the TCP and UDP protocols, or an ICMP type number. A value of -1 indicates all * ICMP types. *
*/ private Integer fromPort; /** *
* The IP protocol name (for tcp
, udp
, and icmp
) or number (see Protocol Numbers).
*
* The IP ranges. Not applicable for stale security group rules. *
*/ private com.amazonaws.internal.SdkInternalList* The prefix list IDs. Not applicable for stale security group rules. *
*/ private com.amazonaws.internal.SdkInternalList
* The end of the port range for the TCP and UDP protocols, or an ICMP type number. A value of -1
* indicates all ICMP types.
*
* The security group pairs. Returns the ID of the referenced security group and VPC, and the ID and status of the * VPC peering connection. *
*/ private com.amazonaws.internal.SdkInternalList* The start of the port range for the TCP and UDP protocols, or an ICMP type number. A value of -1 indicates all * ICMP types. *
* * @param fromPort * The start of the port range for the TCP and UDP protocols, or an ICMP type number. A value of -1 indicates * all ICMP types. */ public void setFromPort(Integer fromPort) { this.fromPort = fromPort; } /** ** The start of the port range for the TCP and UDP protocols, or an ICMP type number. A value of -1 indicates all * ICMP types. *
* * @return The start of the port range for the TCP and UDP protocols, or an ICMP type number. A value of -1 * indicates all ICMP types. */ public Integer getFromPort() { return this.fromPort; } /** ** The start of the port range for the TCP and UDP protocols, or an ICMP type number. A value of -1 indicates all * ICMP types. *
* * @param fromPort * The start of the port range for the TCP and UDP protocols, or an ICMP type number. A value of -1 indicates * all ICMP types. * @return Returns a reference to this object so that method calls can be chained together. */ public StaleIpPermission withFromPort(Integer fromPort) { setFromPort(fromPort); return this; } /** *
* The IP protocol name (for tcp
, udp
, and icmp
) or number (see Protocol Numbers).
*
tcp
, udp
, and icmp
) or number (see Protocol Numbers).
*/
public void setIpProtocol(String ipProtocol) {
this.ipProtocol = ipProtocol;
}
/**
*
* The IP protocol name (for tcp
, udp
, and icmp
) or number (see Protocol Numbers).
*
tcp
, udp
, and icmp
) or number (see Protocol Numbers).
*/
public String getIpProtocol() {
return this.ipProtocol;
}
/**
*
* The IP protocol name (for tcp
, udp
, and icmp
) or number (see Protocol Numbers).
*
tcp
, udp
, and icmp
) or number (see Protocol Numbers).
* @return Returns a reference to this object so that method calls can be chained together.
*/
public StaleIpPermission withIpProtocol(String ipProtocol) {
setIpProtocol(ipProtocol);
return this;
}
/**
* * The IP ranges. Not applicable for stale security group rules. *
* * @return The IP ranges. Not applicable for stale security group rules. */ public java.util.List* The IP ranges. Not applicable for stale security group rules. *
* * @param ipRanges * The IP ranges. Not applicable for stale security group rules. */ public void setIpRanges(java.util.Collection* The IP ranges. Not applicable for stale security group rules. *
** NOTE: This method appends the values to the existing list (if any). Use * {@link #setIpRanges(java.util.Collection)} or {@link #withIpRanges(java.util.Collection)} if you want to override * the existing values. *
* * @param ipRanges * The IP ranges. Not applicable for stale security group rules. * @return Returns a reference to this object so that method calls can be chained together. */ public StaleIpPermission withIpRanges(String... ipRanges) { if (this.ipRanges == null) { setIpRanges(new com.amazonaws.internal.SdkInternalList* The IP ranges. Not applicable for stale security group rules. *
* * @param ipRanges * The IP ranges. Not applicable for stale security group rules. * @return Returns a reference to this object so that method calls can be chained together. */ public StaleIpPermission withIpRanges(java.util.Collection* The prefix list IDs. Not applicable for stale security group rules. *
* * @return The prefix list IDs. Not applicable for stale security group rules. */ public java.util.List* The prefix list IDs. Not applicable for stale security group rules. *
* * @param prefixListIds * The prefix list IDs. Not applicable for stale security group rules. */ public void setPrefixListIds(java.util.Collection* The prefix list IDs. Not applicable for stale security group rules. *
** NOTE: This method appends the values to the existing list (if any). Use * {@link #setPrefixListIds(java.util.Collection)} or {@link #withPrefixListIds(java.util.Collection)} if you want * to override the existing values. *
* * @param prefixListIds * The prefix list IDs. Not applicable for stale security group rules. * @return Returns a reference to this object so that method calls can be chained together. */ public StaleIpPermission withPrefixListIds(String... prefixListIds) { if (this.prefixListIds == null) { setPrefixListIds(new com.amazonaws.internal.SdkInternalList* The prefix list IDs. Not applicable for stale security group rules. *
* * @param prefixListIds * The prefix list IDs. Not applicable for stale security group rules. * @return Returns a reference to this object so that method calls can be chained together. */ public StaleIpPermission withPrefixListIds(java.util.Collection
* The end of the port range for the TCP and UDP protocols, or an ICMP type number. A value of -1
* indicates all ICMP types.
*
-1
indicates all ICMP types.
*/
public void setToPort(Integer toPort) {
this.toPort = toPort;
}
/**
*
* The end of the port range for the TCP and UDP protocols, or an ICMP type number. A value of -1
* indicates all ICMP types.
*
-1
indicates all ICMP types.
*/
public Integer getToPort() {
return this.toPort;
}
/**
*
* The end of the port range for the TCP and UDP protocols, or an ICMP type number. A value of -1
* indicates all ICMP types.
*
-1
indicates all ICMP types.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public StaleIpPermission withToPort(Integer toPort) {
setToPort(toPort);
return this;
}
/**
* * The security group pairs. Returns the ID of the referenced security group and VPC, and the ID and status of the * VPC peering connection. *
* * @return The security group pairs. Returns the ID of the referenced security group and VPC, and the ID and status * of the VPC peering connection. */ public java.util.List* The security group pairs. Returns the ID of the referenced security group and VPC, and the ID and status of the * VPC peering connection. *
* * @param userIdGroupPairs * The security group pairs. Returns the ID of the referenced security group and VPC, and the ID and status * of the VPC peering connection. */ public void setUserIdGroupPairs(java.util.Collection* The security group pairs. Returns the ID of the referenced security group and VPC, and the ID and status of the * VPC peering connection. *
** NOTE: This method appends the values to the existing list (if any). Use * {@link #setUserIdGroupPairs(java.util.Collection)} or {@link #withUserIdGroupPairs(java.util.Collection)} if you * want to override the existing values. *
* * @param userIdGroupPairs * The security group pairs. Returns the ID of the referenced security group and VPC, and the ID and status * of the VPC peering connection. * @return Returns a reference to this object so that method calls can be chained together. */ public StaleIpPermission withUserIdGroupPairs(UserIdGroupPair... userIdGroupPairs) { if (this.userIdGroupPairs == null) { setUserIdGroupPairs(new com.amazonaws.internal.SdkInternalList* The security group pairs. Returns the ID of the referenced security group and VPC, and the ID and status of the * VPC peering connection. *
* * @param userIdGroupPairs * The security group pairs. Returns the ID of the referenced security group and VPC, and the ID and status * of the VPC peering connection. * @return Returns a reference to this object so that method calls can be chained together. */ public StaleIpPermission withUserIdGroupPairs(java.util.Collection