com.amazonaws.services.apprunner.model.VpcConnector Maven / Gradle / Ivy
/*
* Copyright 2019-2024 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.apprunner.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* Describes an App Runner VPC connector resource. A VPC connector describes the Amazon Virtual Private Cloud (Amazon
* VPC) that an App Runner service is associated with, and the subnets and security group that are used.
*
*
* Multiple revisions of a connector might have the same Name
and different Revision
values.
*
*
*
* At this time, App Runner supports only one revision per name.
*
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class VpcConnector implements Serializable, Cloneable, StructuredPojo {
/**
*
* The customer-provided VPC connector name.
*
*/
private String vpcConnectorName;
/**
*
* The Amazon Resource Name (ARN) of this VPC connector.
*
*/
private String vpcConnectorArn;
/**
*
* The revision of this VPC connector. It's unique among all the active connectors ("Status": "ACTIVE"
)
* that share the same Name
.
*
*
*
* At this time, App Runner supports only one revision per name.
*
*
*/
private Integer vpcConnectorRevision;
/**
*
* A list of IDs of subnets that App Runner uses for your service. All IDs are of subnets of a single Amazon VPC.
*
*/
private java.util.List subnets;
/**
*
* A list of IDs of security groups that App Runner uses for access to Amazon Web Services resources under the
* specified subnets. If not specified, App Runner uses the default security group of the Amazon VPC. The default
* security group allows all outbound traffic.
*
*/
private java.util.List securityGroups;
/**
*
* The current state of the VPC connector. If the status of a connector revision is INACTIVE
, it was
* deleted and can't be used. Inactive connector revisions are permanently removed some time after they are deleted.
*
*/
private String status;
/**
*
* The time when the VPC connector was created. It's in Unix time stamp format.
*
*/
private java.util.Date createdAt;
/**
*
* The time when the VPC connector was deleted. It's in Unix time stamp format.
*
*/
private java.util.Date deletedAt;
/**
*
* The customer-provided VPC connector name.
*
*
* @param vpcConnectorName
* The customer-provided VPC connector name.
*/
public void setVpcConnectorName(String vpcConnectorName) {
this.vpcConnectorName = vpcConnectorName;
}
/**
*
* The customer-provided VPC connector name.
*
*
* @return The customer-provided VPC connector name.
*/
public String getVpcConnectorName() {
return this.vpcConnectorName;
}
/**
*
* The customer-provided VPC connector name.
*
*
* @param vpcConnectorName
* The customer-provided VPC connector name.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public VpcConnector withVpcConnectorName(String vpcConnectorName) {
setVpcConnectorName(vpcConnectorName);
return this;
}
/**
*
* The Amazon Resource Name (ARN) of this VPC connector.
*
*
* @param vpcConnectorArn
* The Amazon Resource Name (ARN) of this VPC connector.
*/
public void setVpcConnectorArn(String vpcConnectorArn) {
this.vpcConnectorArn = vpcConnectorArn;
}
/**
*
* The Amazon Resource Name (ARN) of this VPC connector.
*
*
* @return The Amazon Resource Name (ARN) of this VPC connector.
*/
public String getVpcConnectorArn() {
return this.vpcConnectorArn;
}
/**
*
* The Amazon Resource Name (ARN) of this VPC connector.
*
*
* @param vpcConnectorArn
* The Amazon Resource Name (ARN) of this VPC connector.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public VpcConnector withVpcConnectorArn(String vpcConnectorArn) {
setVpcConnectorArn(vpcConnectorArn);
return this;
}
/**
*
* The revision of this VPC connector. It's unique among all the active connectors ("Status": "ACTIVE"
)
* that share the same Name
.
*
*
*
* At this time, App Runner supports only one revision per name.
*
*
*
* @param vpcConnectorRevision
* The revision of this VPC connector. It's unique among all the active connectors (
* "Status": "ACTIVE"
) that share the same Name
.
*
* At this time, App Runner supports only one revision per name.
*
*/
public void setVpcConnectorRevision(Integer vpcConnectorRevision) {
this.vpcConnectorRevision = vpcConnectorRevision;
}
/**
*
* The revision of this VPC connector. It's unique among all the active connectors ("Status": "ACTIVE"
)
* that share the same Name
.
*
*
*
* At this time, App Runner supports only one revision per name.
*
*
*
* @return The revision of this VPC connector. It's unique among all the active connectors (
* "Status": "ACTIVE"
) that share the same Name
.
*
* At this time, App Runner supports only one revision per name.
*
*/
public Integer getVpcConnectorRevision() {
return this.vpcConnectorRevision;
}
/**
*
* The revision of this VPC connector. It's unique among all the active connectors ("Status": "ACTIVE"
)
* that share the same Name
.
*
*
*
* At this time, App Runner supports only one revision per name.
*
*
*
* @param vpcConnectorRevision
* The revision of this VPC connector. It's unique among all the active connectors (
* "Status": "ACTIVE"
) that share the same Name
.
*
* At this time, App Runner supports only one revision per name.
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
public VpcConnector withVpcConnectorRevision(Integer vpcConnectorRevision) {
setVpcConnectorRevision(vpcConnectorRevision);
return this;
}
/**
*
* A list of IDs of subnets that App Runner uses for your service. All IDs are of subnets of a single Amazon VPC.
*
*
* @return A list of IDs of subnets that App Runner uses for your service. All IDs are of subnets of a single Amazon
* VPC.
*/
public java.util.List getSubnets() {
return subnets;
}
/**
*
* A list of IDs of subnets that App Runner uses for your service. All IDs are of subnets of a single Amazon VPC.
*
*
* @param subnets
* A list of IDs of subnets that App Runner uses for your service. All IDs are of subnets of a single Amazon
* VPC.
*/
public void setSubnets(java.util.Collection subnets) {
if (subnets == null) {
this.subnets = null;
return;
}
this.subnets = new java.util.ArrayList(subnets);
}
/**
*
* A list of IDs of subnets that App Runner uses for your service. All IDs are of subnets of a single Amazon VPC.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setSubnets(java.util.Collection)} or {@link #withSubnets(java.util.Collection)} if you want to override
* the existing values.
*
*
* @param subnets
* A list of IDs of subnets that App Runner uses for your service. All IDs are of subnets of a single Amazon
* VPC.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public VpcConnector withSubnets(String... subnets) {
if (this.subnets == null) {
setSubnets(new java.util.ArrayList(subnets.length));
}
for (String ele : subnets) {
this.subnets.add(ele);
}
return this;
}
/**
*
* A list of IDs of subnets that App Runner uses for your service. All IDs are of subnets of a single Amazon VPC.
*
*
* @param subnets
* A list of IDs of subnets that App Runner uses for your service. All IDs are of subnets of a single Amazon
* VPC.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public VpcConnector withSubnets(java.util.Collection subnets) {
setSubnets(subnets);
return this;
}
/**
*
* A list of IDs of security groups that App Runner uses for access to Amazon Web Services resources under the
* specified subnets. If not specified, App Runner uses the default security group of the Amazon VPC. The default
* security group allows all outbound traffic.
*
*
* @return A list of IDs of security groups that App Runner uses for access to Amazon Web Services resources under
* the specified subnets. If not specified, App Runner uses the default security group of the Amazon VPC.
* The default security group allows all outbound traffic.
*/
public java.util.List getSecurityGroups() {
return securityGroups;
}
/**
*
* A list of IDs of security groups that App Runner uses for access to Amazon Web Services resources under the
* specified subnets. If not specified, App Runner uses the default security group of the Amazon VPC. The default
* security group allows all outbound traffic.
*
*
* @param securityGroups
* A list of IDs of security groups that App Runner uses for access to Amazon Web Services resources under
* the specified subnets. If not specified, App Runner uses the default security group of the Amazon VPC. The
* default security group allows all outbound traffic.
*/
public void setSecurityGroups(java.util.Collection securityGroups) {
if (securityGroups == null) {
this.securityGroups = null;
return;
}
this.securityGroups = new java.util.ArrayList(securityGroups);
}
/**
*
* A list of IDs of security groups that App Runner uses for access to Amazon Web Services resources under the
* specified subnets. If not specified, App Runner uses the default security group of the Amazon VPC. The default
* security group allows all outbound traffic.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setSecurityGroups(java.util.Collection)} or {@link #withSecurityGroups(java.util.Collection)} if you want
* to override the existing values.
*
*
* @param securityGroups
* A list of IDs of security groups that App Runner uses for access to Amazon Web Services resources under
* the specified subnets. If not specified, App Runner uses the default security group of the Amazon VPC. The
* default security group allows all outbound traffic.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public VpcConnector withSecurityGroups(String... securityGroups) {
if (this.securityGroups == null) {
setSecurityGroups(new java.util.ArrayList(securityGroups.length));
}
for (String ele : securityGroups) {
this.securityGroups.add(ele);
}
return this;
}
/**
*
* A list of IDs of security groups that App Runner uses for access to Amazon Web Services resources under the
* specified subnets. If not specified, App Runner uses the default security group of the Amazon VPC. The default
* security group allows all outbound traffic.
*
*
* @param securityGroups
* A list of IDs of security groups that App Runner uses for access to Amazon Web Services resources under
* the specified subnets. If not specified, App Runner uses the default security group of the Amazon VPC. The
* default security group allows all outbound traffic.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public VpcConnector withSecurityGroups(java.util.Collection securityGroups) {
setSecurityGroups(securityGroups);
return this;
}
/**
*
* The current state of the VPC connector. If the status of a connector revision is INACTIVE
, it was
* deleted and can't be used. Inactive connector revisions are permanently removed some time after they are deleted.
*
*
* @param status
* The current state of the VPC connector. If the status of a connector revision is INACTIVE
, it
* was deleted and can't be used. Inactive connector revisions are permanently removed some time after they
* are deleted.
* @see VpcConnectorStatus
*/
public void setStatus(String status) {
this.status = status;
}
/**
*
* The current state of the VPC connector. If the status of a connector revision is INACTIVE
, it was
* deleted and can't be used. Inactive connector revisions are permanently removed some time after they are deleted.
*
*
* @return The current state of the VPC connector. If the status of a connector revision is INACTIVE
,
* it was deleted and can't be used. Inactive connector revisions are permanently removed some time after
* they are deleted.
* @see VpcConnectorStatus
*/
public String getStatus() {
return this.status;
}
/**
*
* The current state of the VPC connector. If the status of a connector revision is INACTIVE
, it was
* deleted and can't be used. Inactive connector revisions are permanently removed some time after they are deleted.
*
*
* @param status
* The current state of the VPC connector. If the status of a connector revision is INACTIVE
, it
* was deleted and can't be used. Inactive connector revisions are permanently removed some time after they
* are deleted.
* @return Returns a reference to this object so that method calls can be chained together.
* @see VpcConnectorStatus
*/
public VpcConnector withStatus(String status) {
setStatus(status);
return this;
}
/**
*
* The current state of the VPC connector. If the status of a connector revision is INACTIVE
, it was
* deleted and can't be used. Inactive connector revisions are permanently removed some time after they are deleted.
*
*
* @param status
* The current state of the VPC connector. If the status of a connector revision is INACTIVE
, it
* was deleted and can't be used. Inactive connector revisions are permanently removed some time after they
* are deleted.
* @return Returns a reference to this object so that method calls can be chained together.
* @see VpcConnectorStatus
*/
public VpcConnector withStatus(VpcConnectorStatus status) {
this.status = status.toString();
return this;
}
/**
*
* The time when the VPC connector was created. It's in Unix time stamp format.
*
*
* @param createdAt
* The time when the VPC connector was created. It's in Unix time stamp format.
*/
public void setCreatedAt(java.util.Date createdAt) {
this.createdAt = createdAt;
}
/**
*
* The time when the VPC connector was created. It's in Unix time stamp format.
*
*
* @return The time when the VPC connector was created. It's in Unix time stamp format.
*/
public java.util.Date getCreatedAt() {
return this.createdAt;
}
/**
*
* The time when the VPC connector was created. It's in Unix time stamp format.
*
*
* @param createdAt
* The time when the VPC connector was created. It's in Unix time stamp format.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public VpcConnector withCreatedAt(java.util.Date createdAt) {
setCreatedAt(createdAt);
return this;
}
/**
*
* The time when the VPC connector was deleted. It's in Unix time stamp format.
*
*
* @param deletedAt
* The time when the VPC connector was deleted. It's in Unix time stamp format.
*/
public void setDeletedAt(java.util.Date deletedAt) {
this.deletedAt = deletedAt;
}
/**
*
* The time when the VPC connector was deleted. It's in Unix time stamp format.
*
*
* @return The time when the VPC connector was deleted. It's in Unix time stamp format.
*/
public java.util.Date getDeletedAt() {
return this.deletedAt;
}
/**
*
* The time when the VPC connector was deleted. It's in Unix time stamp format.
*
*
* @param deletedAt
* The time when the VPC connector was deleted. It's in Unix time stamp format.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public VpcConnector withDeletedAt(java.util.Date deletedAt) {
setDeletedAt(deletedAt);
return this;
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getVpcConnectorName() != null)
sb.append("VpcConnectorName: ").append(getVpcConnectorName()).append(",");
if (getVpcConnectorArn() != null)
sb.append("VpcConnectorArn: ").append(getVpcConnectorArn()).append(",");
if (getVpcConnectorRevision() != null)
sb.append("VpcConnectorRevision: ").append(getVpcConnectorRevision()).append(",");
if (getSubnets() != null)
sb.append("Subnets: ").append(getSubnets()).append(",");
if (getSecurityGroups() != null)
sb.append("SecurityGroups: ").append(getSecurityGroups()).append(",");
if (getStatus() != null)
sb.append("Status: ").append(getStatus()).append(",");
if (getCreatedAt() != null)
sb.append("CreatedAt: ").append(getCreatedAt()).append(",");
if (getDeletedAt() != null)
sb.append("DeletedAt: ").append(getDeletedAt());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof VpcConnector == false)
return false;
VpcConnector other = (VpcConnector) obj;
if (other.getVpcConnectorName() == null ^ this.getVpcConnectorName() == null)
return false;
if (other.getVpcConnectorName() != null && other.getVpcConnectorName().equals(this.getVpcConnectorName()) == false)
return false;
if (other.getVpcConnectorArn() == null ^ this.getVpcConnectorArn() == null)
return false;
if (other.getVpcConnectorArn() != null && other.getVpcConnectorArn().equals(this.getVpcConnectorArn()) == false)
return false;
if (other.getVpcConnectorRevision() == null ^ this.getVpcConnectorRevision() == null)
return false;
if (other.getVpcConnectorRevision() != null && other.getVpcConnectorRevision().equals(this.getVpcConnectorRevision()) == false)
return false;
if (other.getSubnets() == null ^ this.getSubnets() == null)
return false;
if (other.getSubnets() != null && other.getSubnets().equals(this.getSubnets()) == false)
return false;
if (other.getSecurityGroups() == null ^ this.getSecurityGroups() == null)
return false;
if (other.getSecurityGroups() != null && other.getSecurityGroups().equals(this.getSecurityGroups()) == false)
return false;
if (other.getStatus() == null ^ this.getStatus() == null)
return false;
if (other.getStatus() != null && other.getStatus().equals(this.getStatus()) == false)
return false;
if (other.getCreatedAt() == null ^ this.getCreatedAt() == null)
return false;
if (other.getCreatedAt() != null && other.getCreatedAt().equals(this.getCreatedAt()) == false)
return false;
if (other.getDeletedAt() == null ^ this.getDeletedAt() == null)
return false;
if (other.getDeletedAt() != null && other.getDeletedAt().equals(this.getDeletedAt()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getVpcConnectorName() == null) ? 0 : getVpcConnectorName().hashCode());
hashCode = prime * hashCode + ((getVpcConnectorArn() == null) ? 0 : getVpcConnectorArn().hashCode());
hashCode = prime * hashCode + ((getVpcConnectorRevision() == null) ? 0 : getVpcConnectorRevision().hashCode());
hashCode = prime * hashCode + ((getSubnets() == null) ? 0 : getSubnets().hashCode());
hashCode = prime * hashCode + ((getSecurityGroups() == null) ? 0 : getSecurityGroups().hashCode());
hashCode = prime * hashCode + ((getStatus() == null) ? 0 : getStatus().hashCode());
hashCode = prime * hashCode + ((getCreatedAt() == null) ? 0 : getCreatedAt().hashCode());
hashCode = prime * hashCode + ((getDeletedAt() == null) ? 0 : getDeletedAt().hashCode());
return hashCode;
}
@Override
public VpcConnector clone() {
try {
return (VpcConnector) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
@com.amazonaws.annotation.SdkInternalApi
@Override
public void marshall(ProtocolMarshaller protocolMarshaller) {
com.amazonaws.services.apprunner.model.transform.VpcConnectorMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}