aws_sdk_ram/operation/create_resource_share/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_resource_share::_create_resource_share_output::CreateResourceShareOutputBuilder;
3
4pub use crate::operation::create_resource_share::_create_resource_share_input::CreateResourceShareInputBuilder;
5
6impl crate::operation::create_resource_share::builders::CreateResourceShareInputBuilder {
7    /// Sends a request with this input using the given client.
8    pub async fn send_with(
9        self,
10        client: &crate::Client,
11    ) -> ::std::result::Result<
12        crate::operation::create_resource_share::CreateResourceShareOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::create_resource_share::CreateResourceShareError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.create_resource_share();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `CreateResourceShare`.
24///
25/// <p>Creates a resource share. You can provide a list of the <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Amazon Resource Names (ARNs)</a> for the resources that you want to share, a list of principals you want to share the resources with, and the permissions to grant those principals.</p><note>
26/// <p>Sharing a resource makes it available for use by principals outside of the Amazon Web Services account that created the resource. Sharing doesn't change any permissions or quotas that apply to the resource in the account that created it.</p>
27/// </note>
28#[derive(::std::clone::Clone, ::std::fmt::Debug)]
29pub struct CreateResourceShareFluentBuilder {
30    handle: ::std::sync::Arc<crate::client::Handle>,
31    inner: crate::operation::create_resource_share::builders::CreateResourceShareInputBuilder,
32    config_override: ::std::option::Option<crate::config::Builder>,
33}
34impl
35    crate::client::customize::internal::CustomizableSend<
36        crate::operation::create_resource_share::CreateResourceShareOutput,
37        crate::operation::create_resource_share::CreateResourceShareError,
38    > for CreateResourceShareFluentBuilder
39{
40    fn send(
41        self,
42        config_override: crate::config::Builder,
43    ) -> crate::client::customize::internal::BoxFuture<
44        crate::client::customize::internal::SendResult<
45            crate::operation::create_resource_share::CreateResourceShareOutput,
46            crate::operation::create_resource_share::CreateResourceShareError,
47        >,
48    > {
49        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
50    }
51}
52impl CreateResourceShareFluentBuilder {
53    /// Creates a new `CreateResourceShareFluentBuilder`.
54    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
55        Self {
56            handle,
57            inner: ::std::default::Default::default(),
58            config_override: ::std::option::Option::None,
59        }
60    }
61    /// Access the CreateResourceShare as a reference.
62    pub fn as_input(&self) -> &crate::operation::create_resource_share::builders::CreateResourceShareInputBuilder {
63        &self.inner
64    }
65    /// Sends the request and returns the response.
66    ///
67    /// If an error occurs, an `SdkError` will be returned with additional details that
68    /// can be matched against.
69    ///
70    /// By default, any retryable failures will be retried twice. Retry behavior
71    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
72    /// set when configuring the client.
73    pub async fn send(
74        self,
75    ) -> ::std::result::Result<
76        crate::operation::create_resource_share::CreateResourceShareOutput,
77        ::aws_smithy_runtime_api::client::result::SdkError<
78            crate::operation::create_resource_share::CreateResourceShareError,
79            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
80        >,
81    > {
82        let input = self
83            .inner
84            .build()
85            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
86        let runtime_plugins = crate::operation::create_resource_share::CreateResourceShare::operation_runtime_plugins(
87            self.handle.runtime_plugins.clone(),
88            &self.handle.conf,
89            self.config_override,
90        );
91        crate::operation::create_resource_share::CreateResourceShare::orchestrate(&runtime_plugins, input).await
92    }
93
94    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
95    pub fn customize(
96        self,
97    ) -> crate::client::customize::CustomizableOperation<
98        crate::operation::create_resource_share::CreateResourceShareOutput,
99        crate::operation::create_resource_share::CreateResourceShareError,
100        Self,
101    > {
102        crate::client::customize::CustomizableOperation::new(self)
103    }
104    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
105        self.set_config_override(::std::option::Option::Some(config_override.into()));
106        self
107    }
108
109    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
110        self.config_override = config_override;
111        self
112    }
113    /// <p>Specifies the name of the resource share.</p>
114    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
115        self.inner = self.inner.name(input.into());
116        self
117    }
118    /// <p>Specifies the name of the resource share.</p>
119    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
120        self.inner = self.inner.set_name(input);
121        self
122    }
123    /// <p>Specifies the name of the resource share.</p>
124    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
125        self.inner.get_name()
126    }
127    ///
128    /// Appends an item to `resourceArns`.
129    ///
130    /// To override the contents of this collection use [`set_resource_arns`](Self::set_resource_arns).
131    ///
132    /// <p>Specifies a list of one or more ARNs of the resources to associate with the resource share.</p>
133    pub fn resource_arns(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
134        self.inner = self.inner.resource_arns(input.into());
135        self
136    }
137    /// <p>Specifies a list of one or more ARNs of the resources to associate with the resource share.</p>
138    pub fn set_resource_arns(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
139        self.inner = self.inner.set_resource_arns(input);
140        self
141    }
142    /// <p>Specifies a list of one or more ARNs of the resources to associate with the resource share.</p>
143    pub fn get_resource_arns(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
144        self.inner.get_resource_arns()
145    }
146    ///
147    /// Appends an item to `principals`.
148    ///
149    /// To override the contents of this collection use [`set_principals`](Self::set_principals).
150    ///
151    /// <p>Specifies a list of one or more principals to associate with the resource share.</p>
152    /// <p>You can include the following values:</p>
153    /// <ul>
154    /// <li>
155    /// <p>An Amazon Web Services account ID, for example: <code>123456789012</code></p></li>
156    /// <li>
157    /// <p>An <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Amazon Resource Name (ARN)</a> of an organization in Organizations, for example: <code>organizations::123456789012:organization/o-exampleorgid</code></p></li>
158    /// <li>
159    /// <p>An ARN of an organizational unit (OU) in Organizations, for example: <code>organizations::123456789012:ou/o-exampleorgid/ou-examplerootid-exampleouid123</code></p></li>
160    /// <li>
161    /// <p>An ARN of an IAM role, for example: <code>iam::123456789012:role/rolename</code></p></li>
162    /// <li>
163    /// <p>An ARN of an IAM user, for example: <code>iam::123456789012user/username</code></p></li>
164    /// </ul><note>
165    /// <p>Not all resource types can be shared with IAM roles and users. For more information, see <a href="https://docs.aws.amazon.com/ram/latest/userguide/permissions.html#permissions-rbp-supported-resource-types">Sharing with IAM roles and users</a> in the <i>Resource Access Manager User Guide</i>.</p>
166    /// </note>
167    pub fn principals(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
168        self.inner = self.inner.principals(input.into());
169        self
170    }
171    /// <p>Specifies a list of one or more principals to associate with the resource share.</p>
172    /// <p>You can include the following values:</p>
173    /// <ul>
174    /// <li>
175    /// <p>An Amazon Web Services account ID, for example: <code>123456789012</code></p></li>
176    /// <li>
177    /// <p>An <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Amazon Resource Name (ARN)</a> of an organization in Organizations, for example: <code>organizations::123456789012:organization/o-exampleorgid</code></p></li>
178    /// <li>
179    /// <p>An ARN of an organizational unit (OU) in Organizations, for example: <code>organizations::123456789012:ou/o-exampleorgid/ou-examplerootid-exampleouid123</code></p></li>
180    /// <li>
181    /// <p>An ARN of an IAM role, for example: <code>iam::123456789012:role/rolename</code></p></li>
182    /// <li>
183    /// <p>An ARN of an IAM user, for example: <code>iam::123456789012user/username</code></p></li>
184    /// </ul><note>
185    /// <p>Not all resource types can be shared with IAM roles and users. For more information, see <a href="https://docs.aws.amazon.com/ram/latest/userguide/permissions.html#permissions-rbp-supported-resource-types">Sharing with IAM roles and users</a> in the <i>Resource Access Manager User Guide</i>.</p>
186    /// </note>
187    pub fn set_principals(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
188        self.inner = self.inner.set_principals(input);
189        self
190    }
191    /// <p>Specifies a list of one or more principals to associate with the resource share.</p>
192    /// <p>You can include the following values:</p>
193    /// <ul>
194    /// <li>
195    /// <p>An Amazon Web Services account ID, for example: <code>123456789012</code></p></li>
196    /// <li>
197    /// <p>An <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Amazon Resource Name (ARN)</a> of an organization in Organizations, for example: <code>organizations::123456789012:organization/o-exampleorgid</code></p></li>
198    /// <li>
199    /// <p>An ARN of an organizational unit (OU) in Organizations, for example: <code>organizations::123456789012:ou/o-exampleorgid/ou-examplerootid-exampleouid123</code></p></li>
200    /// <li>
201    /// <p>An ARN of an IAM role, for example: <code>iam::123456789012:role/rolename</code></p></li>
202    /// <li>
203    /// <p>An ARN of an IAM user, for example: <code>iam::123456789012user/username</code></p></li>
204    /// </ul><note>
205    /// <p>Not all resource types can be shared with IAM roles and users. For more information, see <a href="https://docs.aws.amazon.com/ram/latest/userguide/permissions.html#permissions-rbp-supported-resource-types">Sharing with IAM roles and users</a> in the <i>Resource Access Manager User Guide</i>.</p>
206    /// </note>
207    pub fn get_principals(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
208        self.inner.get_principals()
209    }
210    ///
211    /// Appends an item to `tags`.
212    ///
213    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
214    ///
215    /// <p>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.</p>
216    pub fn tags(mut self, input: crate::types::Tag) -> Self {
217        self.inner = self.inner.tags(input);
218        self
219    }
220    /// <p>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.</p>
221    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
222        self.inner = self.inner.set_tags(input);
223        self
224    }
225    /// <p>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.</p>
226    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
227        self.inner.get_tags()
228    }
229    /// <p>Specifies whether principals outside your organization in Organizations can be associated with a resource share. A value of <code>true</code> lets you share with individual Amazon Web Services accounts that are <i>not</i> in your organization. A value of <code>false</code> only has meaning if your account is a member of an Amazon Web Services Organization. The default value is <code>true</code>.</p>
230    pub fn allow_external_principals(mut self, input: bool) -> Self {
231        self.inner = self.inner.allow_external_principals(input);
232        self
233    }
234    /// <p>Specifies whether principals outside your organization in Organizations can be associated with a resource share. A value of <code>true</code> lets you share with individual Amazon Web Services accounts that are <i>not</i> in your organization. A value of <code>false</code> only has meaning if your account is a member of an Amazon Web Services Organization. The default value is <code>true</code>.</p>
235    pub fn set_allow_external_principals(mut self, input: ::std::option::Option<bool>) -> Self {
236        self.inner = self.inner.set_allow_external_principals(input);
237        self
238    }
239    /// <p>Specifies whether principals outside your organization in Organizations can be associated with a resource share. A value of <code>true</code> lets you share with individual Amazon Web Services accounts that are <i>not</i> in your organization. A value of <code>false</code> only has meaning if your account is a member of an Amazon Web Services Organization. The default value is <code>true</code>.</p>
240    pub fn get_allow_external_principals(&self) -> &::std::option::Option<bool> {
241        self.inner.get_allow_external_principals()
242    }
243    /// <p>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 <a href="https://wikipedia.org/wiki/Universally_unique_identifier">UUID type of value.</a>.</p>
244    /// <p>If you don't provide this value, then Amazon Web Services generates a random one for you.</p>
245    /// <p>If you retry the operation with the same <code>ClientToken</code>, but with different parameters, the retry fails with an <code>IdempotentParameterMismatch</code> error.</p>
246    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
247        self.inner = self.inner.client_token(input.into());
248        self
249    }
250    /// <p>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 <a href="https://wikipedia.org/wiki/Universally_unique_identifier">UUID type of value.</a>.</p>
251    /// <p>If you don't provide this value, then Amazon Web Services generates a random one for you.</p>
252    /// <p>If you retry the operation with the same <code>ClientToken</code>, but with different parameters, the retry fails with an <code>IdempotentParameterMismatch</code> error.</p>
253    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
254        self.inner = self.inner.set_client_token(input);
255        self
256    }
257    /// <p>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 <a href="https://wikipedia.org/wiki/Universally_unique_identifier">UUID type of value.</a>.</p>
258    /// <p>If you don't provide this value, then Amazon Web Services generates a random one for you.</p>
259    /// <p>If you retry the operation with the same <code>ClientToken</code>, but with different parameters, the retry fails with an <code>IdempotentParameterMismatch</code> error.</p>
260    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
261        self.inner.get_client_token()
262    }
263    ///
264    /// Appends an item to `permissionArns`.
265    ///
266    /// To override the contents of this collection use [`set_permission_arns`](Self::set_permission_arns).
267    ///
268    /// <p>Specifies the <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Amazon Resource Names (ARNs)</a> 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.</p>
269    pub fn permission_arns(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
270        self.inner = self.inner.permission_arns(input.into());
271        self
272    }
273    /// <p>Specifies the <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Amazon Resource Names (ARNs)</a> 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.</p>
274    pub fn set_permission_arns(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
275        self.inner = self.inner.set_permission_arns(input);
276        self
277    }
278    /// <p>Specifies the <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Amazon Resource Names (ARNs)</a> 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.</p>
279    pub fn get_permission_arns(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
280        self.inner.get_permission_arns()
281    }
282    ///
283    /// Appends an item to `sources`.
284    ///
285    /// To override the contents of this collection use [`set_sources`](Self::set_sources).
286    ///
287    /// <p>Specifies from which source accounts the service principal has access to the resources in this resource share.</p>
288    pub fn sources(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
289        self.inner = self.inner.sources(input.into());
290        self
291    }
292    /// <p>Specifies from which source accounts the service principal has access to the resources in this resource share.</p>
293    pub fn set_sources(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
294        self.inner = self.inner.set_sources(input);
295        self
296    }
297    /// <p>Specifies from which source accounts the service principal has access to the resources in this resource share.</p>
298    pub fn get_sources(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
299        self.inner.get_sources()
300    }
301}