/* * 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.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 { /** *
* Specifies the name of the resource share. *
*/ private String name; /** ** Specifies a list of one or more ARNs of the resources to associate with the resource share. *
*/ private java.util.List* Specifies a list of one or more principals to associate with the resource share. *
** You can include the following values: *
*
* An Amazon Web Services account ID, for example: 123456789012
*
* An Amazon Resource Name
* (ARN) of an organization in Organizations, for example:
* organizations::123456789012:organization/o-exampleorgid
*
* An ARN of an organizational unit (OU) in Organizations, for example:
* organizations::123456789012:ou/o-exampleorgid/ou-examplerootid-exampleouid123
*
* An ARN of an IAM role, for example: iam::123456789012:role/rolename
*
* An ARN of an IAM user, for example: iam::123456789012user/username
*
* Not all resource types can be shared with IAM roles and users. For more information, see Sharing with IAM roles and users in the Resource Access Manager User Guide. *
** Specifies one or more tags to attach to the resource share itself. It doesn't attach the tags to the resources * associated with the resource share. *
*/ private java.util.List
* Specifies whether principals outside your organization in Organizations can be associated with a resource share.
* A value of true
lets you share with individual Amazon Web Services accounts that are not in
* your organization. A value of false
only has meaning if your account is a member of an Amazon Web
* Services Organization. The default value is true
.
*
* Specifies a unique, case-sensitive identifier that you provide to ensure the idempotency of the request. This * lets you safely retry the request without accidentally performing the same operation a second time. Passing the * same value to a later call to an operation requires that you also pass the same value for all other parameters. * We recommend that you use a UUID type of * value.. *
** If you don't provide this value, then Amazon Web Services generates a random one for you. *
*
* If you retry the operation with the same ClientToken
, but with different parameters, the retry fails
* with an IdempotentParameterMismatch
error.
*
* Specifies the Amazon * Resource Names (ARNs) of the RAM permission to associate with the resource share. If you do not specify an * ARN for the permission, RAM automatically attaches the default version of the permission for each resource type. * You can associate only one permission with each resource type included in the resource share. *
*/ private java.util.List* Specifies from which source accounts the service principal has access to the resources in this resource share. *
*/ private java.util.List* Specifies the name of the resource share. *
* * @param name * Specifies the name of the resource share. */ public void setName(String name) { this.name = name; } /** ** Specifies the name of the resource share. *
* * @return Specifies the name of the resource share. */ public String getName() { return this.name; } /** ** Specifies the name of the resource share. *
* * @param name * Specifies 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; } /** ** Specifies a list of one or more ARNs of the resources to associate with the resource share. *
* * @return Specifies a list of one or more ARNs of the resources to associate with the resource share. */ public java.util.List* Specifies a list of one or more ARNs of the resources to associate with the resource share. *
* * @param resourceArns * Specifies a list of one or more ARNs of the resources to associate with the resource share. */ public void setResourceArns(java.util.Collection* Specifies a list of one or more ARNs 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 * Specifies a list of one or more ARNs 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* Specifies a list of one or more ARNs of the resources to associate with the resource share. *
* * @param resourceArns * Specifies a list of one or more ARNs 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* Specifies a list of one or more principals to associate with the resource share. *
** You can include the following values: *
*
* An Amazon Web Services account ID, for example: 123456789012
*
* An Amazon Resource Name
* (ARN) of an organization in Organizations, for example:
* organizations::123456789012:organization/o-exampleorgid
*
* An ARN of an organizational unit (OU) in Organizations, for example:
* organizations::123456789012:ou/o-exampleorgid/ou-examplerootid-exampleouid123
*
* An ARN of an IAM role, for example: iam::123456789012:role/rolename
*
* An ARN of an IAM user, for example: iam::123456789012user/username
*
* Not all resource types can be shared with IAM roles and users. For more information, see Sharing with IAM roles and users in the Resource Access Manager User Guide. *
** You can include the following values: *
*
* An Amazon Web Services account ID, for example: 123456789012
*
* An Amazon Resource
* Name (ARN) of an organization in Organizations, for example:
* organizations::123456789012:organization/o-exampleorgid
*
* An ARN of an organizational unit (OU) in Organizations, for example:
* organizations::123456789012:ou/o-exampleorgid/ou-examplerootid-exampleouid123
*
* An ARN of an IAM role, for example: iam::123456789012:role/rolename
*
* An ARN of an IAM user, for example: iam::123456789012user/username
*
* Not all resource types can be shared with IAM roles and users. For more information, see Sharing with IAM roles and users in the Resource Access Manager User Guide. *
*/ public java.util.List* Specifies a list of one or more principals to associate with the resource share. *
** You can include the following values: *
*
* An Amazon Web Services account ID, for example: 123456789012
*
* An Amazon Resource Name
* (ARN) of an organization in Organizations, for example:
* organizations::123456789012:organization/o-exampleorgid
*
* An ARN of an organizational unit (OU) in Organizations, for example:
* organizations::123456789012:ou/o-exampleorgid/ou-examplerootid-exampleouid123
*
* An ARN of an IAM role, for example: iam::123456789012:role/rolename
*
* An ARN of an IAM user, for example: iam::123456789012user/username
*
* Not all resource types can be shared with IAM roles and users. For more information, see Sharing with IAM roles and users in the Resource Access Manager User Guide. *
** You can include the following values: *
*
* An Amazon Web Services account ID, for example: 123456789012
*
* An Amazon Resource
* Name (ARN) of an organization in Organizations, for example:
* organizations::123456789012:organization/o-exampleorgid
*
* An ARN of an organizational unit (OU) in Organizations, for example:
* organizations::123456789012:ou/o-exampleorgid/ou-examplerootid-exampleouid123
*
* An ARN of an IAM role, for example: iam::123456789012:role/rolename
*
* An ARN of an IAM user, for example: iam::123456789012user/username
*
* Not all resource types can be shared with IAM roles and users. For more information, see Sharing with IAM roles and users in the Resource Access Manager User Guide. *
*/ public void setPrincipals(java.util.Collection* Specifies a list of one or more principals to associate with the resource share. *
** You can include the following values: *
*
* An Amazon Web Services account ID, for example: 123456789012
*
* An Amazon Resource Name
* (ARN) of an organization in Organizations, for example:
* organizations::123456789012:organization/o-exampleorgid
*
* An ARN of an organizational unit (OU) in Organizations, for example:
* organizations::123456789012:ou/o-exampleorgid/ou-examplerootid-exampleouid123
*
* An ARN of an IAM role, for example: iam::123456789012:role/rolename
*
* An ARN of an IAM user, for example: iam::123456789012user/username
*
* Not all resource types can be shared with IAM roles and users. For more information, see Sharing with IAM roles and users in the Resource Access Manager User Guide. *
** 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 * Specifies a list of one or more principals to associate with the resource share. ** You can include the following values: *
*
* An Amazon Web Services account ID, for example: 123456789012
*
* An Amazon Resource
* Name (ARN) of an organization in Organizations, for example:
* organizations::123456789012:organization/o-exampleorgid
*
* An ARN of an organizational unit (OU) in Organizations, for example:
* organizations::123456789012:ou/o-exampleorgid/ou-examplerootid-exampleouid123
*
* An ARN of an IAM role, for example: iam::123456789012:role/rolename
*
* An ARN of an IAM user, for example: iam::123456789012user/username
*
* Not all resource types can be shared with IAM roles and users. For more information, see Sharing with IAM roles and users in the Resource Access Manager User Guide. *
* @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* Specifies a list of one or more principals to associate with the resource share. *
** You can include the following values: *
*
* An Amazon Web Services account ID, for example: 123456789012
*
* An Amazon Resource Name
* (ARN) of an organization in Organizations, for example:
* organizations::123456789012:organization/o-exampleorgid
*
* An ARN of an organizational unit (OU) in Organizations, for example:
* organizations::123456789012:ou/o-exampleorgid/ou-examplerootid-exampleouid123
*
* An ARN of an IAM role, for example: iam::123456789012:role/rolename
*
* An ARN of an IAM user, for example: iam::123456789012user/username
*
* Not all resource types can be shared with IAM roles and users. For more information, see Sharing with IAM roles and users in the Resource Access Manager User Guide. *
** You can include the following values: *
*
* An Amazon Web Services account ID, for example: 123456789012
*
* An Amazon Resource
* Name (ARN) of an organization in Organizations, for example:
* organizations::123456789012:organization/o-exampleorgid
*
* An ARN of an organizational unit (OU) in Organizations, for example:
* organizations::123456789012:ou/o-exampleorgid/ou-examplerootid-exampleouid123
*
* An ARN of an IAM role, for example: iam::123456789012:role/rolename
*
* An ARN of an IAM user, for example: iam::123456789012user/username
*
* Not all resource types can be shared with IAM roles and users. For more information, see Sharing with IAM roles and users in the Resource Access Manager User Guide. *
* @return Returns a reference to this object so that method calls can be chained together. */ public CreateResourceShareRequest withPrincipals(java.util.Collection* Specifies one or more tags to attach to the resource share itself. It doesn't attach the tags to the resources * associated with the resource share. *
* * @return Specifies one or more tags to attach to the resource share itself. It doesn't attach the tags to the * resources associated with the resource share. */ public java.util.List* Specifies one or more tags to attach to the resource share itself. It doesn't attach the tags to the resources * associated with the resource share. *
* * @param tags * Specifies one or more tags to attach to the resource share itself. It doesn't attach the tags to the * resources associated with the resource share. */ public void setTags(java.util.Collection* Specifies one or more tags to attach to the resource share itself. It doesn't attach the tags to the resources * associated with the resource share. *
** 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 * Specifies one or more tags to attach to the resource share itself. It doesn't attach the tags to the * resources associated with the resource share. * @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* Specifies one or more tags to attach to the resource share itself. It doesn't attach the tags to the resources * associated with the resource share. *
* * @param tags * Specifies one or more tags to attach to the resource share itself. It doesn't attach the tags to the * resources associated with the resource share. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateResourceShareRequest withTags(java.util.Collection
* Specifies whether principals outside your organization in Organizations can be associated with a resource share.
* A value of true
lets you share with individual Amazon Web Services accounts that are not in
* your organization. A value of false
only has meaning if your account is a member of an Amazon Web
* Services Organization. The default value is true
.
*
true
lets you share with individual Amazon Web Services accounts that are
* not in your organization. A value of false
only has meaning if your account is a
* member of an Amazon Web Services Organization. The default value is true
.
*/
public void setAllowExternalPrincipals(Boolean allowExternalPrincipals) {
this.allowExternalPrincipals = allowExternalPrincipals;
}
/**
*
* Specifies whether principals outside your organization in Organizations can be associated with a resource share.
* A value of true
lets you share with individual Amazon Web Services accounts that are not in
* your organization. A value of false
only has meaning if your account is a member of an Amazon Web
* Services Organization. The default value is true
.
*
true
lets you share with individual Amazon Web Services accounts that are
* not in your organization. A value of false
only has meaning if your account is a
* member of an Amazon Web Services Organization. The default value is true
.
*/
public Boolean getAllowExternalPrincipals() {
return this.allowExternalPrincipals;
}
/**
*
* Specifies whether principals outside your organization in Organizations can be associated with a resource share.
* A value of true
lets you share with individual Amazon Web Services accounts that are not in
* your organization. A value of false
only has meaning if your account is a member of an Amazon Web
* Services Organization. The default value is true
.
*
true
lets you share with individual Amazon Web Services accounts that are
* not in your organization. A value of false
only has meaning if your account is a
* member of an Amazon Web Services Organization. The default value is true
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateResourceShareRequest withAllowExternalPrincipals(Boolean allowExternalPrincipals) {
setAllowExternalPrincipals(allowExternalPrincipals);
return this;
}
/**
*
* Specifies whether principals outside your organization in Organizations can be associated with a resource share.
* A value of true
lets you share with individual Amazon Web Services accounts that are not in
* your organization. A value of false
only has meaning if your account is a member of an Amazon Web
* Services Organization. The default value is true
.
*
true
lets you share with individual Amazon Web Services accounts that are
* not in your organization. A value of false
only has meaning if your account is a
* member of an Amazon Web Services Organization. The default value is true
.
*/
public Boolean isAllowExternalPrincipals() {
return this.allowExternalPrincipals;
}
/**
* * Specifies a unique, case-sensitive identifier that you provide to ensure the idempotency of the request. This * lets you safely retry the request without accidentally performing the same operation a second time. Passing the * same value to a later call to an operation requires that you also pass the same value for all other parameters. * We recommend that you use a UUID type of * value.. *
** If you don't provide this value, then Amazon Web Services generates a random one for you. *
*
* If you retry the operation with the same ClientToken
, but with different parameters, the retry fails
* with an IdempotentParameterMismatch
error.
*
* If you don't provide this value, then Amazon Web Services generates a random one for you. *
*
* If you retry the operation with the same ClientToken
, but with different parameters, the
* retry fails with an IdempotentParameterMismatch
error.
*/
public void setClientToken(String clientToken) {
this.clientToken = clientToken;
}
/**
*
* Specifies a unique, case-sensitive identifier that you provide to ensure the idempotency of the request. This * lets you safely retry the request without accidentally performing the same operation a second time. Passing the * same value to a later call to an operation requires that you also pass the same value for all other parameters. * We recommend that you use a UUID type of * value.. *
** If you don't provide this value, then Amazon Web Services generates a random one for you. *
*
* If you retry the operation with the same ClientToken
, but with different parameters, the retry fails
* with an IdempotentParameterMismatch
error.
*
* If you don't provide this value, then Amazon Web Services generates a random one for you. *
*
* If you retry the operation with the same ClientToken
, but with different parameters, the
* retry fails with an IdempotentParameterMismatch
error.
*/
public String getClientToken() {
return this.clientToken;
}
/**
*
* Specifies a unique, case-sensitive identifier that you provide to ensure the idempotency of the request. This * lets you safely retry the request without accidentally performing the same operation a second time. Passing the * same value to a later call to an operation requires that you also pass the same value for all other parameters. * We recommend that you use a UUID type of * value.. *
** If you don't provide this value, then Amazon Web Services generates a random one for you. *
*
* If you retry the operation with the same ClientToken
, but with different parameters, the retry fails
* with an IdempotentParameterMismatch
error.
*
* If you don't provide this value, then Amazon Web Services generates a random one for you. *
*
* If you retry the operation with the same ClientToken
, but with different parameters, the
* retry fails with an IdempotentParameterMismatch
error.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateResourceShareRequest withClientToken(String clientToken) {
setClientToken(clientToken);
return this;
}
/**
*
* Specifies the Amazon * Resource Names (ARNs) of the RAM permission to associate with the resource share. If you do not specify an * ARN for the permission, RAM automatically attaches the default version of the permission for each resource type. * You can associate only one permission with each resource type included in the resource share. *
* * @return Specifies the Amazon * Resource Names (ARNs) of the RAM permission to associate with the resource share. If you do not * specify an ARN for the permission, RAM automatically attaches the default version of the permission for * each resource type. You can associate only one permission with each resource type included in the * resource share. */ public java.util.List* Specifies the Amazon * Resource Names (ARNs) of the RAM permission to associate with the resource share. If you do not specify an * ARN for the permission, RAM automatically attaches the default version of the permission for each resource type. * You can associate only one permission with each resource type included in the resource share. *
* * @param permissionArns * Specifies the Amazon * Resource Names (ARNs) of the RAM permission to associate with the resource share. If you do not * specify an ARN for the permission, RAM automatically attaches the default version of the permission for * each resource type. You can associate only one permission with each resource type included in the resource * share. */ public void setPermissionArns(java.util.Collection* Specifies the Amazon * Resource Names (ARNs) of the RAM permission to associate with the resource share. If you do not specify an * ARN for the permission, RAM automatically attaches the default version of the permission for each resource type. * You can associate only one permission with each resource type included in the resource share. *
** 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 * Specifies the Amazon * Resource Names (ARNs) of the RAM permission to associate with the resource share. If you do not * specify an ARN for the permission, RAM automatically attaches the default version of the permission for * each resource type. You can associate only one permission with each resource type included in the resource * share. * @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* Specifies the Amazon * Resource Names (ARNs) of the RAM permission to associate with the resource share. If you do not specify an * ARN for the permission, RAM automatically attaches the default version of the permission for each resource type. * You can associate only one permission with each resource type included in the resource share. *
* * @param permissionArns * Specifies the Amazon * Resource Names (ARNs) of the RAM permission to associate with the resource share. If you do not * specify an ARN for the permission, RAM automatically attaches the default version of the permission for * each resource type. You can associate only one permission with each resource type included in the resource * share. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateResourceShareRequest withPermissionArns(java.util.Collection* Specifies from which source accounts the service principal has access to the resources in this resource share. *
* * @return Specifies from which source accounts the service principal has access to the resources in this resource * share. */ public java.util.List* Specifies from which source accounts the service principal has access to the resources in this resource share. *
* * @param sources * Specifies from which source accounts the service principal has access to the resources in this resource * share. */ public void setSources(java.util.Collection* Specifies from which source accounts the service principal has access to the resources in this resource share. *
** NOTE: This method appends the values to the existing list (if any). Use * {@link #setSources(java.util.Collection)} or {@link #withSources(java.util.Collection)} if you want to override * the existing values. *
* * @param sources * Specifies from which source accounts the service principal has access to the resources in this resource * share. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateResourceShareRequest withSources(String... sources) { if (this.sources == null) { setSources(new java.util.ArrayList* Specifies from which source accounts the service principal has access to the resources in this resource share. *
* * @param sources * Specifies from which source accounts the service principal has access to the resources in this resource * share. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateResourceShareRequest withSources(java.util.Collection