com.amazonaws.services.globalaccelerator.model.CreateCrossAccountAttachmentRequest 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.globalaccelerator.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 CreateCrossAccountAttachmentRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable {
/**
*
* The name of the cross-account attachment.
*
*/
private String name;
/**
*
* The principals to include in the cross-account attachment. A principal can be an Amazon Web Services account
* number or the Amazon Resource Name (ARN) for an accelerator.
*
*/
private java.util.List principals;
/**
*
* The Amazon Resource Names (ARNs) for the resources to include in the cross-account attachment. A resource can be
* any supported Amazon Web Services resource type for Global Accelerator or a CIDR range for a bring your own IP
* address (BYOIP) address pool.
*
*/
private java.util.List resources;
/**
*
* A unique, case-sensitive identifier that you provide to ensure the idempotency—that is, the uniqueness—of the
* request.
*
*/
private String idempotencyToken;
/**
*
* Add tags for a cross-account attachment.
*
*
* For more information, see Tagging in
* Global Accelerator in the Global Accelerator Developer Guide.
*
*/
private java.util.List tags;
/**
*
* The name of the cross-account attachment.
*
*
* @param name
* The name of the cross-account attachment.
*/
public void setName(String name) {
this.name = name;
}
/**
*
* The name of the cross-account attachment.
*
*
* @return The name of the cross-account attachment.
*/
public String getName() {
return this.name;
}
/**
*
* The name of the cross-account attachment.
*
*
* @param name
* The name of the cross-account attachment.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateCrossAccountAttachmentRequest withName(String name) {
setName(name);
return this;
}
/**
*
* The principals to include in the cross-account attachment. A principal can be an Amazon Web Services account
* number or the Amazon Resource Name (ARN) for an accelerator.
*
*
* @return The principals to include in the cross-account attachment. A principal can be an Amazon Web Services
* account number or the Amazon Resource Name (ARN) for an accelerator.
*/
public java.util.List getPrincipals() {
return principals;
}
/**
*
* The principals to include in the cross-account attachment. A principal can be an Amazon Web Services account
* number or the Amazon Resource Name (ARN) for an accelerator.
*
*
* @param principals
* The principals to include in the cross-account attachment. A principal can be an Amazon Web Services
* account number or the Amazon Resource Name (ARN) for an accelerator.
*/
public void setPrincipals(java.util.Collection principals) {
if (principals == null) {
this.principals = null;
return;
}
this.principals = new java.util.ArrayList(principals);
}
/**
*
* The principals to include in the cross-account attachment. A principal can be an Amazon Web Services account
* number or the Amazon Resource Name (ARN) for an accelerator.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setPrincipals(java.util.Collection)} or {@link #withPrincipals(java.util.Collection)} if you want to
* override the existing values.
*
*
* @param principals
* The principals to include in the cross-account attachment. A principal can be an Amazon Web Services
* account number or the Amazon Resource Name (ARN) for an accelerator.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateCrossAccountAttachmentRequest withPrincipals(String... principals) {
if (this.principals == null) {
setPrincipals(new java.util.ArrayList(principals.length));
}
for (String ele : principals) {
this.principals.add(ele);
}
return this;
}
/**
*
* The principals to include in the cross-account attachment. A principal can be an Amazon Web Services account
* number or the Amazon Resource Name (ARN) for an accelerator.
*
*
* @param principals
* The principals to include in the cross-account attachment. A principal can be an Amazon Web Services
* account number or the Amazon Resource Name (ARN) for an accelerator.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateCrossAccountAttachmentRequest withPrincipals(java.util.Collection principals) {
setPrincipals(principals);
return this;
}
/**
*
* The Amazon Resource Names (ARNs) for the resources to include in the cross-account attachment. A resource can be
* any supported Amazon Web Services resource type for Global Accelerator or a CIDR range for a bring your own IP
* address (BYOIP) address pool.
*
*
* @return The Amazon Resource Names (ARNs) for the resources to include in the cross-account attachment. A resource
* can be any supported Amazon Web Services resource type for Global Accelerator or a CIDR range for a bring
* your own IP address (BYOIP) address pool.
*/
public java.util.List getResources() {
return resources;
}
/**
*
* The Amazon Resource Names (ARNs) for the resources to include in the cross-account attachment. A resource can be
* any supported Amazon Web Services resource type for Global Accelerator or a CIDR range for a bring your own IP
* address (BYOIP) address pool.
*
*
* @param resources
* The Amazon Resource Names (ARNs) for the resources to include in the cross-account attachment. A resource
* can be any supported Amazon Web Services resource type for Global Accelerator or a CIDR range for a bring
* your own IP address (BYOIP) address pool.
*/
public void setResources(java.util.Collection resources) {
if (resources == null) {
this.resources = null;
return;
}
this.resources = new java.util.ArrayList(resources);
}
/**
*
* The Amazon Resource Names (ARNs) for the resources to include in the cross-account attachment. A resource can be
* any supported Amazon Web Services resource type for Global Accelerator or a CIDR range for a bring your own IP
* address (BYOIP) address pool.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setResources(java.util.Collection)} or {@link #withResources(java.util.Collection)} if you want to
* override the existing values.
*
*
* @param resources
* The Amazon Resource Names (ARNs) for the resources to include in the cross-account attachment. A resource
* can be any supported Amazon Web Services resource type for Global Accelerator or a CIDR range for a bring
* your own IP address (BYOIP) address pool.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateCrossAccountAttachmentRequest withResources(Resource... resources) {
if (this.resources == null) {
setResources(new java.util.ArrayList(resources.length));
}
for (Resource ele : resources) {
this.resources.add(ele);
}
return this;
}
/**
*
* The Amazon Resource Names (ARNs) for the resources to include in the cross-account attachment. A resource can be
* any supported Amazon Web Services resource type for Global Accelerator or a CIDR range for a bring your own IP
* address (BYOIP) address pool.
*
*
* @param resources
* The Amazon Resource Names (ARNs) for the resources to include in the cross-account attachment. A resource
* can be any supported Amazon Web Services resource type for Global Accelerator or a CIDR range for a bring
* your own IP address (BYOIP) address pool.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateCrossAccountAttachmentRequest withResources(java.util.Collection resources) {
setResources(resources);
return this;
}
/**
*
* A unique, case-sensitive identifier that you provide to ensure the idempotency—that is, the uniqueness—of the
* request.
*
*
* @param idempotencyToken
* A unique, case-sensitive identifier that you provide to ensure the idempotency—that is, the uniqueness—of
* the request.
*/
public void setIdempotencyToken(String idempotencyToken) {
this.idempotencyToken = idempotencyToken;
}
/**
*
* A unique, case-sensitive identifier that you provide to ensure the idempotency—that is, the uniqueness—of the
* request.
*
*
* @return A unique, case-sensitive identifier that you provide to ensure the idempotency—that is, the uniqueness—of
* the request.
*/
public String getIdempotencyToken() {
return this.idempotencyToken;
}
/**
*
* A unique, case-sensitive identifier that you provide to ensure the idempotency—that is, the uniqueness—of the
* request.
*
*
* @param idempotencyToken
* A unique, case-sensitive identifier that you provide to ensure the idempotency—that is, the uniqueness—of
* the request.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateCrossAccountAttachmentRequest withIdempotencyToken(String idempotencyToken) {
setIdempotencyToken(idempotencyToken);
return this;
}
/**
*
* Add tags for a cross-account attachment.
*
*
* For more information, see Tagging in
* Global Accelerator in the Global Accelerator Developer Guide.
*
*
* @return Add tags for a cross-account attachment.
*
* For more information, see Tagging in Global Accelerator in the Global Accelerator Developer Guide.
*/
public java.util.List getTags() {
return tags;
}
/**
*
* Add tags for a cross-account attachment.
*
*
* For more information, see Tagging in
* Global Accelerator in the Global Accelerator Developer Guide.
*
*
* @param tags
* Add tags for a cross-account attachment.
*
* For more information, see Tagging
* in Global Accelerator in the Global Accelerator Developer Guide.
*/
public void setTags(java.util.Collection tags) {
if (tags == null) {
this.tags = null;
return;
}
this.tags = new java.util.ArrayList(tags);
}
/**
*
* Add tags for a cross-account attachment.
*
*
* For more information, see Tagging in
* Global Accelerator in the Global Accelerator Developer Guide.
*
*
* 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
* Add tags for a cross-account attachment.
*
* For more information, see Tagging
* in Global Accelerator in the Global Accelerator Developer Guide.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateCrossAccountAttachmentRequest withTags(Tag... tags) {
if (this.tags == null) {
setTags(new java.util.ArrayList(tags.length));
}
for (Tag ele : tags) {
this.tags.add(ele);
}
return this;
}
/**
*
* Add tags for a cross-account attachment.
*
*
* For more information, see Tagging in
* Global Accelerator in the Global Accelerator Developer Guide.
*
*
* @param tags
* Add tags for a cross-account attachment.
*
* For more information, see Tagging
* in Global Accelerator in the Global Accelerator Developer Guide.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateCrossAccountAttachmentRequest 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 (getName() != null)
sb.append("Name: ").append(getName()).append(",");
if (getPrincipals() != null)
sb.append("Principals: ").append(getPrincipals()).append(",");
if (getResources() != null)
sb.append("Resources: ").append(getResources()).append(",");
if (getIdempotencyToken() != null)
sb.append("IdempotencyToken: ").append(getIdempotencyToken()).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 CreateCrossAccountAttachmentRequest == false)
return false;
CreateCrossAccountAttachmentRequest other = (CreateCrossAccountAttachmentRequest) obj;
if (other.getName() == null ^ this.getName() == null)
return false;
if (other.getName() != null && other.getName().equals(this.getName()) == false)
return false;
if (other.getPrincipals() == null ^ this.getPrincipals() == null)
return false;
if (other.getPrincipals() != null && other.getPrincipals().equals(this.getPrincipals()) == false)
return false;
if (other.getResources() == null ^ this.getResources() == null)
return false;
if (other.getResources() != null && other.getResources().equals(this.getResources()) == false)
return false;
if (other.getIdempotencyToken() == null ^ this.getIdempotencyToken() == null)
return false;
if (other.getIdempotencyToken() != null && other.getIdempotencyToken().equals(this.getIdempotencyToken()) == 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 + ((getName() == null) ? 0 : getName().hashCode());
hashCode = prime * hashCode + ((getPrincipals() == null) ? 0 : getPrincipals().hashCode());
hashCode = prime * hashCode + ((getResources() == null) ? 0 : getResources().hashCode());
hashCode = prime * hashCode + ((getIdempotencyToken() == null) ? 0 : getIdempotencyToken().hashCode());
hashCode = prime * hashCode + ((getTags() == null) ? 0 : getTags().hashCode());
return hashCode;
}
@Override
public CreateCrossAccountAttachmentRequest clone() {
return (CreateCrossAccountAttachmentRequest) super.clone();
}
}