aws_sdk_wellarchitected/operation/create_lens_share/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_lens_share::_create_lens_share_output::CreateLensShareOutputBuilder;
3
4pub use crate::operation::create_lens_share::_create_lens_share_input::CreateLensShareInputBuilder;
5
6impl crate::operation::create_lens_share::builders::CreateLensShareInputBuilder {
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_lens_share::CreateLensShareOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::create_lens_share::CreateLensShareError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.create_lens_share();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `CreateLensShare`.
24///
25/// <p>Create a lens share.</p>
26/// <p>The owner of a lens can share it with other Amazon Web Services accounts, users, an organization, and organizational units (OUs) in the same Amazon Web Services Region. Lenses provided by Amazon Web Services (Amazon Web Services Official Content) cannot be shared.</p>
27/// <p>Shared access to a lens is not removed until the lens invitation is deleted.</p>
28/// <p>If you share a lens with an organization or OU, all accounts in the organization or OU are granted access to the lens.</p>
29/// <p>For more information, see <a href="https://docs.aws.amazon.com/wellarchitected/latest/userguide/lenses-sharing.html">Sharing a custom lens</a> in the <i>Well-Architected Tool User Guide</i>.</p><note>
30/// <p><b>Disclaimer</b></p>
31/// <p>By sharing your custom lenses with other Amazon Web Services accounts, you acknowledge that Amazon Web Services will make your custom lenses available to those other accounts. Those other accounts may continue to access and use your shared custom lenses even if you delete the custom lenses from your own Amazon Web Services account or terminate your Amazon Web Services account.</p>
32/// </note>
33#[derive(::std::clone::Clone, ::std::fmt::Debug)]
34pub struct CreateLensShareFluentBuilder {
35    handle: ::std::sync::Arc<crate::client::Handle>,
36    inner: crate::operation::create_lens_share::builders::CreateLensShareInputBuilder,
37    config_override: ::std::option::Option<crate::config::Builder>,
38}
39impl
40    crate::client::customize::internal::CustomizableSend<
41        crate::operation::create_lens_share::CreateLensShareOutput,
42        crate::operation::create_lens_share::CreateLensShareError,
43    > for CreateLensShareFluentBuilder
44{
45    fn send(
46        self,
47        config_override: crate::config::Builder,
48    ) -> crate::client::customize::internal::BoxFuture<
49        crate::client::customize::internal::SendResult<
50            crate::operation::create_lens_share::CreateLensShareOutput,
51            crate::operation::create_lens_share::CreateLensShareError,
52        >,
53    > {
54        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
55    }
56}
57impl CreateLensShareFluentBuilder {
58    /// Creates a new `CreateLensShareFluentBuilder`.
59    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
60        Self {
61            handle,
62            inner: ::std::default::Default::default(),
63            config_override: ::std::option::Option::None,
64        }
65    }
66    /// Access the CreateLensShare as a reference.
67    pub fn as_input(&self) -> &crate::operation::create_lens_share::builders::CreateLensShareInputBuilder {
68        &self.inner
69    }
70    /// Sends the request and returns the response.
71    ///
72    /// If an error occurs, an `SdkError` will be returned with additional details that
73    /// can be matched against.
74    ///
75    /// By default, any retryable failures will be retried twice. Retry behavior
76    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
77    /// set when configuring the client.
78    pub async fn send(
79        self,
80    ) -> ::std::result::Result<
81        crate::operation::create_lens_share::CreateLensShareOutput,
82        ::aws_smithy_runtime_api::client::result::SdkError<
83            crate::operation::create_lens_share::CreateLensShareError,
84            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
85        >,
86    > {
87        let input = self
88            .inner
89            .build()
90            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
91        let runtime_plugins = crate::operation::create_lens_share::CreateLensShare::operation_runtime_plugins(
92            self.handle.runtime_plugins.clone(),
93            &self.handle.conf,
94            self.config_override,
95        );
96        crate::operation::create_lens_share::CreateLensShare::orchestrate(&runtime_plugins, input).await
97    }
98
99    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
100    pub fn customize(
101        self,
102    ) -> crate::client::customize::CustomizableOperation<
103        crate::operation::create_lens_share::CreateLensShareOutput,
104        crate::operation::create_lens_share::CreateLensShareError,
105        Self,
106    > {
107        crate::client::customize::CustomizableOperation::new(self)
108    }
109    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
110        self.set_config_override(::std::option::Option::Some(config_override.into()));
111        self
112    }
113
114    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
115        self.config_override = config_override;
116        self
117    }
118    /// <p>The alias of the lens.</p>
119    /// <p>For Amazon Web Services official lenses, this is either the lens alias, such as <code>serverless</code>, or the lens ARN, such as <code>arn:aws:wellarchitected:us-east-1::lens/serverless</code>. Note that some operations (such as ExportLens and CreateLensShare) are not permitted on Amazon Web Services official lenses.</p>
120    /// <p>For custom lenses, this is the lens ARN, such as <code>arn:aws:wellarchitected:us-west-2:123456789012:lens/0123456789abcdef01234567890abcdef</code>.</p>
121    /// <p>Each lens is identified by its <code>LensSummary$LensAlias</code>.</p>
122    pub fn lens_alias(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
123        self.inner = self.inner.lens_alias(input.into());
124        self
125    }
126    /// <p>The alias of the lens.</p>
127    /// <p>For Amazon Web Services official lenses, this is either the lens alias, such as <code>serverless</code>, or the lens ARN, such as <code>arn:aws:wellarchitected:us-east-1::lens/serverless</code>. Note that some operations (such as ExportLens and CreateLensShare) are not permitted on Amazon Web Services official lenses.</p>
128    /// <p>For custom lenses, this is the lens ARN, such as <code>arn:aws:wellarchitected:us-west-2:123456789012:lens/0123456789abcdef01234567890abcdef</code>.</p>
129    /// <p>Each lens is identified by its <code>LensSummary$LensAlias</code>.</p>
130    pub fn set_lens_alias(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
131        self.inner = self.inner.set_lens_alias(input);
132        self
133    }
134    /// <p>The alias of the lens.</p>
135    /// <p>For Amazon Web Services official lenses, this is either the lens alias, such as <code>serverless</code>, or the lens ARN, such as <code>arn:aws:wellarchitected:us-east-1::lens/serverless</code>. Note that some operations (such as ExportLens and CreateLensShare) are not permitted on Amazon Web Services official lenses.</p>
136    /// <p>For custom lenses, this is the lens ARN, such as <code>arn:aws:wellarchitected:us-west-2:123456789012:lens/0123456789abcdef01234567890abcdef</code>.</p>
137    /// <p>Each lens is identified by its <code>LensSummary$LensAlias</code>.</p>
138    pub fn get_lens_alias(&self) -> &::std::option::Option<::std::string::String> {
139        self.inner.get_lens_alias()
140    }
141    /// <p>The Amazon Web Services account ID, organization ID, or organizational unit (OU) ID with which the workload, lens, profile, or review template is shared.</p>
142    pub fn shared_with(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
143        self.inner = self.inner.shared_with(input.into());
144        self
145    }
146    /// <p>The Amazon Web Services account ID, organization ID, or organizational unit (OU) ID with which the workload, lens, profile, or review template is shared.</p>
147    pub fn set_shared_with(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
148        self.inner = self.inner.set_shared_with(input);
149        self
150    }
151    /// <p>The Amazon Web Services account ID, organization ID, or organizational unit (OU) ID with which the workload, lens, profile, or review template is shared.</p>
152    pub fn get_shared_with(&self) -> &::std::option::Option<::std::string::String> {
153        self.inner.get_shared_with()
154    }
155    /// <p>A unique case-sensitive string used to ensure that this request is idempotent (executes only once).</p>
156    /// <p>You should not reuse the same token for other requests. If you retry a request with the same client request token and the same parameters after the original request has completed successfully, the result of the original request is returned.</p><important>
157    /// <p>This token is listed as required, however, if you do not specify it, the Amazon Web Services SDKs automatically generate one for you. If you are not using the Amazon Web Services SDK or the CLI, you must provide this token or the request will fail.</p>
158    /// </important>
159    pub fn client_request_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
160        self.inner = self.inner.client_request_token(input.into());
161        self
162    }
163    /// <p>A unique case-sensitive string used to ensure that this request is idempotent (executes only once).</p>
164    /// <p>You should not reuse the same token for other requests. If you retry a request with the same client request token and the same parameters after the original request has completed successfully, the result of the original request is returned.</p><important>
165    /// <p>This token is listed as required, however, if you do not specify it, the Amazon Web Services SDKs automatically generate one for you. If you are not using the Amazon Web Services SDK or the CLI, you must provide this token or the request will fail.</p>
166    /// </important>
167    pub fn set_client_request_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
168        self.inner = self.inner.set_client_request_token(input);
169        self
170    }
171    /// <p>A unique case-sensitive string used to ensure that this request is idempotent (executes only once).</p>
172    /// <p>You should not reuse the same token for other requests. If you retry a request with the same client request token and the same parameters after the original request has completed successfully, the result of the original request is returned.</p><important>
173    /// <p>This token is listed as required, however, if you do not specify it, the Amazon Web Services SDKs automatically generate one for you. If you are not using the Amazon Web Services SDK or the CLI, you must provide this token or the request will fail.</p>
174    /// </important>
175    pub fn get_client_request_token(&self) -> &::std::option::Option<::std::string::String> {
176        self.inner.get_client_request_token()
177    }
178}