
com.amazonaws.services.apprunner.model.CreateVpcConnectorRequest Maven / Gradle / Ivy
/*
* 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.apprunner.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.AmazonWebServiceRequest;
/**
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class CreateVpcConnectorRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable {
/**
*
* A name for the VPC connector.
*
*/
private String vpcConnectorName;
/**
*
* A list of IDs of subnets that App Runner should use when it associates your service with a custom Amazon VPC.
* Specify IDs of subnets of a single Amazon VPC. App Runner determines the Amazon VPC from the subnets you specify.
*
*
*
* App Runner currently only provides support for IPv4.
*
*
*/
private java.util.List subnets;
/**
*
* A list of IDs of security groups that App Runner should use 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;
/**
*
* A list of metadata items that you can associate with your VPC connector resource. A tag is a key-value pair.
*
*/
private java.util.List tags;
/**
*
* A name for the VPC connector.
*
*
* @param vpcConnectorName
* A name for the VPC connector.
*/
public void setVpcConnectorName(String vpcConnectorName) {
this.vpcConnectorName = vpcConnectorName;
}
/**
*
* A name for the VPC connector.
*
*
* @return A name for the VPC connector.
*/
public String getVpcConnectorName() {
return this.vpcConnectorName;
}
/**
*
* A name for the VPC connector.
*
*
* @param vpcConnectorName
* A name for the VPC connector.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateVpcConnectorRequest withVpcConnectorName(String vpcConnectorName) {
setVpcConnectorName(vpcConnectorName);
return this;
}
/**
*
* A list of IDs of subnets that App Runner should use when it associates your service with a custom Amazon VPC.
* Specify IDs of subnets of a single Amazon VPC. App Runner determines the Amazon VPC from the subnets you specify.
*
*
*
* App Runner currently only provides support for IPv4.
*
*
*
* @return A list of IDs of subnets that App Runner should use when it associates your service with a custom Amazon
* VPC. Specify IDs of subnets of a single Amazon VPC. App Runner determines the Amazon VPC from the subnets
* you specify.
*
* App Runner currently only provides support for IPv4.
*
*/
public java.util.List getSubnets() {
return subnets;
}
/**
*
* A list of IDs of subnets that App Runner should use when it associates your service with a custom Amazon VPC.
* Specify IDs of subnets of a single Amazon VPC. App Runner determines the Amazon VPC from the subnets you specify.
*
*
*
* App Runner currently only provides support for IPv4.
*
*
*
* @param subnets
* A list of IDs of subnets that App Runner should use when it associates your service with a custom Amazon
* VPC. Specify IDs of subnets of a single Amazon VPC. App Runner determines the Amazon VPC from the subnets
* you specify.
*
* App Runner currently only provides support for IPv4.
*
*/
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 should use when it associates your service with a custom Amazon VPC.
* Specify IDs of subnets of a single Amazon VPC. App Runner determines the Amazon VPC from the subnets you specify.
*
*
*
* App Runner currently only provides support for IPv4.
*
*
*
* 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 should use when it associates your service with a custom Amazon
* VPC. Specify IDs of subnets of a single Amazon VPC. App Runner determines the Amazon VPC from the subnets
* you specify.
*
* App Runner currently only provides support for IPv4.
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateVpcConnectorRequest 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 should use when it associates your service with a custom Amazon VPC.
* Specify IDs of subnets of a single Amazon VPC. App Runner determines the Amazon VPC from the subnets you specify.
*
*
*
* App Runner currently only provides support for IPv4.
*
*
*
* @param subnets
* A list of IDs of subnets that App Runner should use when it associates your service with a custom Amazon
* VPC. Specify IDs of subnets of a single Amazon VPC. App Runner determines the Amazon VPC from the subnets
* you specify.
*
* App Runner currently only provides support for IPv4.
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateVpcConnectorRequest withSubnets(java.util.Collection subnets) {
setSubnets(subnets);
return this;
}
/**
*
* A list of IDs of security groups that App Runner should use 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 should use 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 should use 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 should use 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 should use 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 should use 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 CreateVpcConnectorRequest 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 should use 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 should use 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 CreateVpcConnectorRequest withSecurityGroups(java.util.Collection securityGroups) {
setSecurityGroups(securityGroups);
return this;
}
/**
*
* A list of metadata items that you can associate with your VPC connector resource. A tag is a key-value pair.
*
*
* @return A list of metadata items that you can associate with your VPC connector resource. A tag is a key-value
* pair.
*/
public java.util.List getTags() {
return tags;
}
/**
*
* A list of metadata items that you can associate with your VPC connector resource. A tag is a key-value pair.
*
*
* @param tags
* A list of metadata items that you can associate with your VPC connector resource. A tag is a key-value
* pair.
*/
public void setTags(java.util.Collection tags) {
if (tags == null) {
this.tags = null;
return;
}
this.tags = new java.util.ArrayList(tags);
}
/**
*
* A list of metadata items that you can associate with your VPC connector resource. A tag is a key-value pair.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setTags(java.util.Collection)} or {@link #withTags(java.util.Collection)} if you want to override the
* existing values.
*
*
* @param tags
* A list of metadata items that you can associate with your VPC connector resource. A tag is a key-value
* pair.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateVpcConnectorRequest withTags(Tag... tags) {
if (this.tags == null) {
setTags(new java.util.ArrayList(tags.length));
}
for (Tag ele : tags) {
this.tags.add(ele);
}
return this;
}
/**
*
* A list of metadata items that you can associate with your VPC connector resource. A tag is a key-value pair.
*
*
* @param tags
* A list of metadata items that you can associate with your VPC connector resource. A tag is a key-value
* pair.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateVpcConnectorRequest withTags(java.util.Collection tags) {
setTags(tags);
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 (getSubnets() != null)
sb.append("Subnets: ").append(getSubnets()).append(",");
if (getSecurityGroups() != null)
sb.append("SecurityGroups: ").append(getSecurityGroups()).append(",");
if (getTags() != null)
sb.append("Tags: ").append(getTags());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof CreateVpcConnectorRequest == false)
return false;
CreateVpcConnectorRequest other = (CreateVpcConnectorRequest) obj;
if (other.getVpcConnectorName() == null ^ this.getVpcConnectorName() == null)
return false;
if (other.getVpcConnectorName() != null && other.getVpcConnectorName().equals(this.getVpcConnectorName()) == 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.getTags() == null ^ this.getTags() == null)
return false;
if (other.getTags() != null && other.getTags().equals(this.getTags()) == 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 + ((getSubnets() == null) ? 0 : getSubnets().hashCode());
hashCode = prime * hashCode + ((getSecurityGroups() == null) ? 0 : getSecurityGroups().hashCode());
hashCode = prime * hashCode + ((getTags() == null) ? 0 : getTags().hashCode());
return hashCode;
}
@Override
public CreateVpcConnectorRequest clone() {
return (CreateVpcConnectorRequest) super.clone();
}
}