com.amazonaws.services.datasync.model.PrivateLinkConfig Maven / Gradle / Ivy
/*
* Copyright 2017-2022 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.datasync.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* The VPC endpoint, subnet, and security group that an agent uses to access IP addresses in a VPC (Virtual Private
* Cloud).
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class PrivateLinkConfig implements Serializable, Cloneable, StructuredPojo {
/**
*
* The ID of the VPC endpoint that is configured for an agent. An agent that is configured with a VPC endpoint will
* not be accessible over the public internet.
*
*/
private String vpcEndpointId;
/**
*
* The private endpoint that is configured for an agent that has access to IP addresses in a PrivateLink. An agent that is
* configured with this endpoint will not be accessible over the public internet.
*
*/
private String privateLinkEndpoint;
/**
*
* The Amazon Resource Names (ARNs) of the subnets that are configured for an agent activated in a VPC or an agent
* that has access to a VPC endpoint.
*
*/
private java.util.List subnetArns;
/**
*
* The Amazon Resource Names (ARNs) of the security groups that are configured for the EC2 resource that hosts an
* agent activated in a VPC or an agent that has access to a VPC endpoint.
*
*/
private java.util.List securityGroupArns;
/**
*
* The ID of the VPC endpoint that is configured for an agent. An agent that is configured with a VPC endpoint will
* not be accessible over the public internet.
*
*
* @param vpcEndpointId
* The ID of the VPC endpoint that is configured for an agent. An agent that is configured with a VPC
* endpoint will not be accessible over the public internet.
*/
public void setVpcEndpointId(String vpcEndpointId) {
this.vpcEndpointId = vpcEndpointId;
}
/**
*
* The ID of the VPC endpoint that is configured for an agent. An agent that is configured with a VPC endpoint will
* not be accessible over the public internet.
*
*
* @return The ID of the VPC endpoint that is configured for an agent. An agent that is configured with a VPC
* endpoint will not be accessible over the public internet.
*/
public String getVpcEndpointId() {
return this.vpcEndpointId;
}
/**
*
* The ID of the VPC endpoint that is configured for an agent. An agent that is configured with a VPC endpoint will
* not be accessible over the public internet.
*
*
* @param vpcEndpointId
* The ID of the VPC endpoint that is configured for an agent. An agent that is configured with a VPC
* endpoint will not be accessible over the public internet.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public PrivateLinkConfig withVpcEndpointId(String vpcEndpointId) {
setVpcEndpointId(vpcEndpointId);
return this;
}
/**
*
* The private endpoint that is configured for an agent that has access to IP addresses in a PrivateLink. An agent that is
* configured with this endpoint will not be accessible over the public internet.
*
*
* @param privateLinkEndpoint
* The private endpoint that is configured for an agent that has access to IP addresses in a PrivateLink. An agent
* that is configured with this endpoint will not be accessible over the public internet.
*/
public void setPrivateLinkEndpoint(String privateLinkEndpoint) {
this.privateLinkEndpoint = privateLinkEndpoint;
}
/**
*
* The private endpoint that is configured for an agent that has access to IP addresses in a PrivateLink. An agent that is
* configured with this endpoint will not be accessible over the public internet.
*
*
* @return The private endpoint that is configured for an agent that has access to IP addresses in a PrivateLink. An agent
* that is configured with this endpoint will not be accessible over the public internet.
*/
public String getPrivateLinkEndpoint() {
return this.privateLinkEndpoint;
}
/**
*
* The private endpoint that is configured for an agent that has access to IP addresses in a PrivateLink. An agent that is
* configured with this endpoint will not be accessible over the public internet.
*
*
* @param privateLinkEndpoint
* The private endpoint that is configured for an agent that has access to IP addresses in a PrivateLink. An agent
* that is configured with this endpoint will not be accessible over the public internet.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public PrivateLinkConfig withPrivateLinkEndpoint(String privateLinkEndpoint) {
setPrivateLinkEndpoint(privateLinkEndpoint);
return this;
}
/**
*
* The Amazon Resource Names (ARNs) of the subnets that are configured for an agent activated in a VPC or an agent
* that has access to a VPC endpoint.
*
*
* @return The Amazon Resource Names (ARNs) of the subnets that are configured for an agent activated in a VPC or an
* agent that has access to a VPC endpoint.
*/
public java.util.List getSubnetArns() {
return subnetArns;
}
/**
*
* The Amazon Resource Names (ARNs) of the subnets that are configured for an agent activated in a VPC or an agent
* that has access to a VPC endpoint.
*
*
* @param subnetArns
* The Amazon Resource Names (ARNs) of the subnets that are configured for an agent activated in a VPC or an
* agent that has access to a VPC endpoint.
*/
public void setSubnetArns(java.util.Collection subnetArns) {
if (subnetArns == null) {
this.subnetArns = null;
return;
}
this.subnetArns = new java.util.ArrayList(subnetArns);
}
/**
*
* The Amazon Resource Names (ARNs) of the subnets that are configured for an agent activated in a VPC or an agent
* that has access to a VPC endpoint.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setSubnetArns(java.util.Collection)} or {@link #withSubnetArns(java.util.Collection)} if you want to
* override the existing values.
*
*
* @param subnetArns
* The Amazon Resource Names (ARNs) of the subnets that are configured for an agent activated in a VPC or an
* agent that has access to a VPC endpoint.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public PrivateLinkConfig withSubnetArns(String... subnetArns) {
if (this.subnetArns == null) {
setSubnetArns(new java.util.ArrayList(subnetArns.length));
}
for (String ele : subnetArns) {
this.subnetArns.add(ele);
}
return this;
}
/**
*
* The Amazon Resource Names (ARNs) of the subnets that are configured for an agent activated in a VPC or an agent
* that has access to a VPC endpoint.
*
*
* @param subnetArns
* The Amazon Resource Names (ARNs) of the subnets that are configured for an agent activated in a VPC or an
* agent that has access to a VPC endpoint.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public PrivateLinkConfig withSubnetArns(java.util.Collection subnetArns) {
setSubnetArns(subnetArns);
return this;
}
/**
*
* The Amazon Resource Names (ARNs) of the security groups that are configured for the EC2 resource that hosts an
* agent activated in a VPC or an agent that has access to a VPC endpoint.
*
*
* @return The Amazon Resource Names (ARNs) of the security groups that are configured for the EC2 resource that
* hosts an agent activated in a VPC or an agent that has access to a VPC endpoint.
*/
public java.util.List getSecurityGroupArns() {
return securityGroupArns;
}
/**
*
* The Amazon Resource Names (ARNs) of the security groups that are configured for the EC2 resource that hosts an
* agent activated in a VPC or an agent that has access to a VPC endpoint.
*
*
* @param securityGroupArns
* The Amazon Resource Names (ARNs) of the security groups that are configured for the EC2 resource that
* hosts an agent activated in a VPC or an agent that has access to a VPC endpoint.
*/
public void setSecurityGroupArns(java.util.Collection securityGroupArns) {
if (securityGroupArns == null) {
this.securityGroupArns = null;
return;
}
this.securityGroupArns = new java.util.ArrayList(securityGroupArns);
}
/**
*
* The Amazon Resource Names (ARNs) of the security groups that are configured for the EC2 resource that hosts an
* agent activated in a VPC or an agent that has access to a VPC endpoint.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setSecurityGroupArns(java.util.Collection)} or {@link #withSecurityGroupArns(java.util.Collection)} if
* you want to override the existing values.
*
*
* @param securityGroupArns
* The Amazon Resource Names (ARNs) of the security groups that are configured for the EC2 resource that
* hosts an agent activated in a VPC or an agent that has access to a VPC endpoint.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public PrivateLinkConfig withSecurityGroupArns(String... securityGroupArns) {
if (this.securityGroupArns == null) {
setSecurityGroupArns(new java.util.ArrayList(securityGroupArns.length));
}
for (String ele : securityGroupArns) {
this.securityGroupArns.add(ele);
}
return this;
}
/**
*
* The Amazon Resource Names (ARNs) of the security groups that are configured for the EC2 resource that hosts an
* agent activated in a VPC or an agent that has access to a VPC endpoint.
*
*
* @param securityGroupArns
* The Amazon Resource Names (ARNs) of the security groups that are configured for the EC2 resource that
* hosts an agent activated in a VPC or an agent that has access to a VPC endpoint.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public PrivateLinkConfig withSecurityGroupArns(java.util.Collection securityGroupArns) {
setSecurityGroupArns(securityGroupArns);
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 (getVpcEndpointId() != null)
sb.append("VpcEndpointId: ").append(getVpcEndpointId()).append(",");
if (getPrivateLinkEndpoint() != null)
sb.append("PrivateLinkEndpoint: ").append(getPrivateLinkEndpoint()).append(",");
if (getSubnetArns() != null)
sb.append("SubnetArns: ").append(getSubnetArns()).append(",");
if (getSecurityGroupArns() != null)
sb.append("SecurityGroupArns: ").append(getSecurityGroupArns());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof PrivateLinkConfig == false)
return false;
PrivateLinkConfig other = (PrivateLinkConfig) obj;
if (other.getVpcEndpointId() == null ^ this.getVpcEndpointId() == null)
return false;
if (other.getVpcEndpointId() != null && other.getVpcEndpointId().equals(this.getVpcEndpointId()) == false)
return false;
if (other.getPrivateLinkEndpoint() == null ^ this.getPrivateLinkEndpoint() == null)
return false;
if (other.getPrivateLinkEndpoint() != null && other.getPrivateLinkEndpoint().equals(this.getPrivateLinkEndpoint()) == false)
return false;
if (other.getSubnetArns() == null ^ this.getSubnetArns() == null)
return false;
if (other.getSubnetArns() != null && other.getSubnetArns().equals(this.getSubnetArns()) == false)
return false;
if (other.getSecurityGroupArns() == null ^ this.getSecurityGroupArns() == null)
return false;
if (other.getSecurityGroupArns() != null && other.getSecurityGroupArns().equals(this.getSecurityGroupArns()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getVpcEndpointId() == null) ? 0 : getVpcEndpointId().hashCode());
hashCode = prime * hashCode + ((getPrivateLinkEndpoint() == null) ? 0 : getPrivateLinkEndpoint().hashCode());
hashCode = prime * hashCode + ((getSubnetArns() == null) ? 0 : getSubnetArns().hashCode());
hashCode = prime * hashCode + ((getSecurityGroupArns() == null) ? 0 : getSecurityGroupArns().hashCode());
return hashCode;
}
@Override
public PrivateLinkConfig clone() {
try {
return (PrivateLinkConfig) 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.datasync.model.transform.PrivateLinkConfigMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}