
com.amazonaws.services.ram.model.CreateResourceShareRequest Maven / Gradle / Ivy
/*
* Copyright 2015-2020 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.ram.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 CreateResourceShareRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable {
/**
*
* The name of the resource share.
*
*/
private String name;
/**
*
* The Amazon Resource Names (ARN) of the resources to associate with the resource share.
*
*/
private java.util.List resourceArns;
/**
*
* The principals to associate with the resource share. The possible values are IDs of AWS accounts, the ARN of an
* OU or organization from AWS Organizations.
*
*/
private java.util.List principals;
/**
*
* One or more tags.
*
*/
private java.util.List tags;
/**
*
* Indicates whether principals outside your AWS organization can be associated with a resource share.
*
*/
private Boolean allowExternalPrincipals;
/**
*
* A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.
*
*/
private String clientToken;
/**
*
* The ARNs of the permissions to associate with the resource share. If you do not specify an ARN for the
* permission, AWS RAM automatically attaches the default version of the permission for each resource type.
*
*/
private java.util.List permissionArns;
/**
*
* The name of the resource share.
*
*
* @param name
* The name of the resource share.
*/
public void setName(String name) {
this.name = name;
}
/**
*
* The name of the resource share.
*
*
* @return The name of the resource share.
*/
public String getName() {
return this.name;
}
/**
*
* The name of the resource share.
*
*
* @param name
* The name of the resource share.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateResourceShareRequest withName(String name) {
setName(name);
return this;
}
/**
*
* The Amazon Resource Names (ARN) of the resources to associate with the resource share.
*
*
* @return The Amazon Resource Names (ARN) of the resources to associate with the resource share.
*/
public java.util.List getResourceArns() {
return resourceArns;
}
/**
*
* The Amazon Resource Names (ARN) of the resources to associate with the resource share.
*
*
* @param resourceArns
* The Amazon Resource Names (ARN) of the resources to associate with the resource share.
*/
public void setResourceArns(java.util.Collection resourceArns) {
if (resourceArns == null) {
this.resourceArns = null;
return;
}
this.resourceArns = new java.util.ArrayList(resourceArns);
}
/**
*
* The Amazon Resource Names (ARN) of the resources to associate with the resource share.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setResourceArns(java.util.Collection)} or {@link #withResourceArns(java.util.Collection)} if you want to
* override the existing values.
*
*
* @param resourceArns
* The Amazon Resource Names (ARN) of the resources to associate with the resource share.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateResourceShareRequest withResourceArns(String... resourceArns) {
if (this.resourceArns == null) {
setResourceArns(new java.util.ArrayList(resourceArns.length));
}
for (String ele : resourceArns) {
this.resourceArns.add(ele);
}
return this;
}
/**
*
* The Amazon Resource Names (ARN) of the resources to associate with the resource share.
*
*
* @param resourceArns
* The Amazon Resource Names (ARN) of the resources to associate with the resource share.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateResourceShareRequest withResourceArns(java.util.Collection resourceArns) {
setResourceArns(resourceArns);
return this;
}
/**
*
* The principals to associate with the resource share. The possible values are IDs of AWS accounts, the ARN of an
* OU or organization from AWS Organizations.
*
*
* @return The principals to associate with the resource share. The possible values are IDs of AWS accounts, the ARN
* of an OU or organization from AWS Organizations.
*/
public java.util.List getPrincipals() {
return principals;
}
/**
*
* The principals to associate with the resource share. The possible values are IDs of AWS accounts, the ARN of an
* OU or organization from AWS Organizations.
*
*
* @param principals
* The principals to associate with the resource share. The possible values are IDs of AWS accounts, the ARN
* of an OU or organization from AWS Organizations.
*/
public void setPrincipals(java.util.Collection principals) {
if (principals == null) {
this.principals = null;
return;
}
this.principals = new java.util.ArrayList(principals);
}
/**
*
* The principals to associate with the resource share. The possible values are IDs of AWS accounts, the ARN of an
* OU or organization from AWS Organizations.
*
*
* 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 associate with the resource share. The possible values are IDs of AWS accounts, the ARN
* of an OU or organization from AWS Organizations.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateResourceShareRequest 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 associate with the resource share. The possible values are IDs of AWS accounts, the ARN of an
* OU or organization from AWS Organizations.
*
*
* @param principals
* The principals to associate with the resource share. The possible values are IDs of AWS accounts, the ARN
* of an OU or organization from AWS Organizations.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateResourceShareRequest withPrincipals(java.util.Collection principals) {
setPrincipals(principals);
return this;
}
/**
*
* One or more tags.
*
*
* @return One or more tags.
*/
public java.util.List getTags() {
return tags;
}
/**
*
* One or more tags.
*
*
* @param tags
* One or more tags.
*/
public void setTags(java.util.Collection tags) {
if (tags == null) {
this.tags = null;
return;
}
this.tags = new java.util.ArrayList(tags);
}
/**
*
* One or more tags.
*
*
* 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
* One or more tags.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateResourceShareRequest withTags(Tag... tags) {
if (this.tags == null) {
setTags(new java.util.ArrayList(tags.length));
}
for (Tag ele : tags) {
this.tags.add(ele);
}
return this;
}
/**
*
* One or more tags.
*
*
* @param tags
* One or more tags.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateResourceShareRequest withTags(java.util.Collection tags) {
setTags(tags);
return this;
}
/**
*
* Indicates whether principals outside your AWS organization can be associated with a resource share.
*
*
* @param allowExternalPrincipals
* Indicates whether principals outside your AWS organization can be associated with a resource share.
*/
public void setAllowExternalPrincipals(Boolean allowExternalPrincipals) {
this.allowExternalPrincipals = allowExternalPrincipals;
}
/**
*
* Indicates whether principals outside your AWS organization can be associated with a resource share.
*
*
* @return Indicates whether principals outside your AWS organization can be associated with a resource share.
*/
public Boolean getAllowExternalPrincipals() {
return this.allowExternalPrincipals;
}
/**
*
* Indicates whether principals outside your AWS organization can be associated with a resource share.
*
*
* @param allowExternalPrincipals
* Indicates whether principals outside your AWS organization can be associated with a resource share.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateResourceShareRequest withAllowExternalPrincipals(Boolean allowExternalPrincipals) {
setAllowExternalPrincipals(allowExternalPrincipals);
return this;
}
/**
*
* Indicates whether principals outside your AWS organization can be associated with a resource share.
*
*
* @return Indicates whether principals outside your AWS organization can be associated with a resource share.
*/
public Boolean isAllowExternalPrincipals() {
return this.allowExternalPrincipals;
}
/**
*
* A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.
*
*
* @param clientToken
* A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.
*/
public void setClientToken(String clientToken) {
this.clientToken = clientToken;
}
/**
*
* A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.
*
*
* @return A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.
*/
public String getClientToken() {
return this.clientToken;
}
/**
*
* A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.
*
*
* @param clientToken
* A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateResourceShareRequest withClientToken(String clientToken) {
setClientToken(clientToken);
return this;
}
/**
*
* The ARNs of the permissions to associate with the resource share. If you do not specify an ARN for the
* permission, AWS RAM automatically attaches the default version of the permission for each resource type.
*
*
* @return The ARNs of the permissions to associate with the resource share. If you do not specify an ARN for the
* permission, AWS RAM automatically attaches the default version of the permission for each resource type.
*/
public java.util.List getPermissionArns() {
return permissionArns;
}
/**
*
* The ARNs of the permissions to associate with the resource share. If you do not specify an ARN for the
* permission, AWS RAM automatically attaches the default version of the permission for each resource type.
*
*
* @param permissionArns
* The ARNs of the permissions to associate with the resource share. If you do not specify an ARN for the
* permission, AWS RAM automatically attaches the default version of the permission for each resource type.
*/
public void setPermissionArns(java.util.Collection permissionArns) {
if (permissionArns == null) {
this.permissionArns = null;
return;
}
this.permissionArns = new java.util.ArrayList(permissionArns);
}
/**
*
* The ARNs of the permissions to associate with the resource share. If you do not specify an ARN for the
* permission, AWS RAM automatically attaches the default version of the permission for each resource type.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setPermissionArns(java.util.Collection)} or {@link #withPermissionArns(java.util.Collection)} if you want
* to override the existing values.
*
*
* @param permissionArns
* The ARNs of the permissions to associate with the resource share. If you do not specify an ARN for the
* permission, AWS RAM automatically attaches the default version of the permission for each resource type.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateResourceShareRequest withPermissionArns(String... permissionArns) {
if (this.permissionArns == null) {
setPermissionArns(new java.util.ArrayList(permissionArns.length));
}
for (String ele : permissionArns) {
this.permissionArns.add(ele);
}
return this;
}
/**
*
* The ARNs of the permissions to associate with the resource share. If you do not specify an ARN for the
* permission, AWS RAM automatically attaches the default version of the permission for each resource type.
*
*
* @param permissionArns
* The ARNs of the permissions to associate with the resource share. If you do not specify an ARN for the
* permission, AWS RAM automatically attaches the default version of the permission for each resource type.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateResourceShareRequest withPermissionArns(java.util.Collection permissionArns) {
setPermissionArns(permissionArns);
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 (getResourceArns() != null)
sb.append("ResourceArns: ").append(getResourceArns()).append(",");
if (getPrincipals() != null)
sb.append("Principals: ").append(getPrincipals()).append(",");
if (getTags() != null)
sb.append("Tags: ").append(getTags()).append(",");
if (getAllowExternalPrincipals() != null)
sb.append("AllowExternalPrincipals: ").append(getAllowExternalPrincipals()).append(",");
if (getClientToken() != null)
sb.append("ClientToken: ").append(getClientToken()).append(",");
if (getPermissionArns() != null)
sb.append("PermissionArns: ").append(getPermissionArns());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof CreateResourceShareRequest == false)
return false;
CreateResourceShareRequest other = (CreateResourceShareRequest) obj;
if (other.getName() == null ^ this.getName() == null)
return false;
if (other.getName() != null && other.getName().equals(this.getName()) == false)
return false;
if (other.getResourceArns() == null ^ this.getResourceArns() == null)
return false;
if (other.getResourceArns() != null && other.getResourceArns().equals(this.getResourceArns()) == 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.getTags() == null ^ this.getTags() == null)
return false;
if (other.getTags() != null && other.getTags().equals(this.getTags()) == false)
return false;
if (other.getAllowExternalPrincipals() == null ^ this.getAllowExternalPrincipals() == null)
return false;
if (other.getAllowExternalPrincipals() != null && other.getAllowExternalPrincipals().equals(this.getAllowExternalPrincipals()) == false)
return false;
if (other.getClientToken() == null ^ this.getClientToken() == null)
return false;
if (other.getClientToken() != null && other.getClientToken().equals(this.getClientToken()) == false)
return false;
if (other.getPermissionArns() == null ^ this.getPermissionArns() == null)
return false;
if (other.getPermissionArns() != null && other.getPermissionArns().equals(this.getPermissionArns()) == 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 + ((getResourceArns() == null) ? 0 : getResourceArns().hashCode());
hashCode = prime * hashCode + ((getPrincipals() == null) ? 0 : getPrincipals().hashCode());
hashCode = prime * hashCode + ((getTags() == null) ? 0 : getTags().hashCode());
hashCode = prime * hashCode + ((getAllowExternalPrincipals() == null) ? 0 : getAllowExternalPrincipals().hashCode());
hashCode = prime * hashCode + ((getClientToken() == null) ? 0 : getClientToken().hashCode());
hashCode = prime * hashCode + ((getPermissionArns() == null) ? 0 : getPermissionArns().hashCode());
return hashCode;
}
@Override
public CreateResourceShareRequest clone() {
return (CreateResourceShareRequest) super.clone();
}
}