aws_sdk_auditmanager/operation/start_assessment_framework_share/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::start_assessment_framework_share::_start_assessment_framework_share_output::StartAssessmentFrameworkShareOutputBuilder;
3
4pub use crate::operation::start_assessment_framework_share::_start_assessment_framework_share_input::StartAssessmentFrameworkShareInputBuilder;
5
6impl crate::operation::start_assessment_framework_share::builders::StartAssessmentFrameworkShareInputBuilder {
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::start_assessment_framework_share::StartAssessmentFrameworkShareOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::start_assessment_framework_share::StartAssessmentFrameworkShareError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.start_assessment_framework_share();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `StartAssessmentFrameworkShare`.
24///
25/// <p>Creates a share request for a custom framework in Audit Manager.</p>
26/// <p>The share request specifies a recipient and notifies them that a custom framework is available. Recipients have 120 days to accept or decline the request. If no action is taken, the share request expires.</p>
27/// <p>When you create a share request, Audit Manager stores a snapshot of your custom framework in the US East (N. Virginia) Amazon Web Services Region. Audit Manager also stores a backup of the same snapshot in the US West (Oregon) Amazon Web Services Region.</p>
28/// <p>Audit Manager deletes the snapshot and the backup snapshot when one of the following events occurs:</p>
29/// <ul>
30/// <li>
31/// <p>The sender revokes the share request.</p></li>
32/// <li>
33/// <p>The recipient declines the share request.</p></li>
34/// <li>
35/// <p>The recipient encounters an error and doesn't successfully accept the share request.</p></li>
36/// <li>
37/// <p>The share request expires before the recipient responds to the request.</p></li>
38/// </ul>
39/// <p>When a sender <a href="https://docs.aws.amazon.com/audit-manager/latest/userguide/framework-sharing.html#framework-sharing-resend">resends a share request</a>, the snapshot is replaced with an updated version that corresponds with the latest version of the custom framework.</p>
40/// <p>When a recipient accepts a share request, the snapshot is replicated into their Amazon Web Services account under the Amazon Web Services Region that was specified in the share request.</p><important>
41/// <p>When you invoke the <code>StartAssessmentFrameworkShare</code> API, you are about to share a custom framework with another Amazon Web Services account. You may not share a custom framework that is derived from a standard framework if the standard framework is designated as not eligible for sharing by Amazon Web Services, unless you have obtained permission to do so from the owner of the standard framework. To learn more about which standard frameworks are eligible for sharing, see <a href="https://docs.aws.amazon.com/audit-manager/latest/userguide/share-custom-framework-concepts-and-terminology.html#eligibility">Framework sharing eligibility</a> in the <i>Audit Manager User Guide</i>.</p>
42/// </important>
43#[derive(::std::clone::Clone, ::std::fmt::Debug)]
44pub struct StartAssessmentFrameworkShareFluentBuilder {
45    handle: ::std::sync::Arc<crate::client::Handle>,
46    inner: crate::operation::start_assessment_framework_share::builders::StartAssessmentFrameworkShareInputBuilder,
47    config_override: ::std::option::Option<crate::config::Builder>,
48}
49impl
50    crate::client::customize::internal::CustomizableSend<
51        crate::operation::start_assessment_framework_share::StartAssessmentFrameworkShareOutput,
52        crate::operation::start_assessment_framework_share::StartAssessmentFrameworkShareError,
53    > for StartAssessmentFrameworkShareFluentBuilder
54{
55    fn send(
56        self,
57        config_override: crate::config::Builder,
58    ) -> crate::client::customize::internal::BoxFuture<
59        crate::client::customize::internal::SendResult<
60            crate::operation::start_assessment_framework_share::StartAssessmentFrameworkShareOutput,
61            crate::operation::start_assessment_framework_share::StartAssessmentFrameworkShareError,
62        >,
63    > {
64        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
65    }
66}
67impl StartAssessmentFrameworkShareFluentBuilder {
68    /// Creates a new `StartAssessmentFrameworkShareFluentBuilder`.
69    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
70        Self {
71            handle,
72            inner: ::std::default::Default::default(),
73            config_override: ::std::option::Option::None,
74        }
75    }
76    /// Access the StartAssessmentFrameworkShare as a reference.
77    pub fn as_input(&self) -> &crate::operation::start_assessment_framework_share::builders::StartAssessmentFrameworkShareInputBuilder {
78        &self.inner
79    }
80    /// Sends the request and returns the response.
81    ///
82    /// If an error occurs, an `SdkError` will be returned with additional details that
83    /// can be matched against.
84    ///
85    /// By default, any retryable failures will be retried twice. Retry behavior
86    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
87    /// set when configuring the client.
88    pub async fn send(
89        self,
90    ) -> ::std::result::Result<
91        crate::operation::start_assessment_framework_share::StartAssessmentFrameworkShareOutput,
92        ::aws_smithy_runtime_api::client::result::SdkError<
93            crate::operation::start_assessment_framework_share::StartAssessmentFrameworkShareError,
94            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
95        >,
96    > {
97        let input = self
98            .inner
99            .build()
100            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
101        let runtime_plugins = crate::operation::start_assessment_framework_share::StartAssessmentFrameworkShare::operation_runtime_plugins(
102            self.handle.runtime_plugins.clone(),
103            &self.handle.conf,
104            self.config_override,
105        );
106        crate::operation::start_assessment_framework_share::StartAssessmentFrameworkShare::orchestrate(&runtime_plugins, input).await
107    }
108
109    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
110    pub fn customize(
111        self,
112    ) -> crate::client::customize::CustomizableOperation<
113        crate::operation::start_assessment_framework_share::StartAssessmentFrameworkShareOutput,
114        crate::operation::start_assessment_framework_share::StartAssessmentFrameworkShareError,
115        Self,
116    > {
117        crate::client::customize::CustomizableOperation::new(self)
118    }
119    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
120        self.set_config_override(::std::option::Option::Some(config_override.into()));
121        self
122    }
123
124    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
125        self.config_override = config_override;
126        self
127    }
128    /// <p>The unique identifier for the custom framework to be shared.</p>
129    pub fn framework_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
130        self.inner = self.inner.framework_id(input.into());
131        self
132    }
133    /// <p>The unique identifier for the custom framework to be shared.</p>
134    pub fn set_framework_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
135        self.inner = self.inner.set_framework_id(input);
136        self
137    }
138    /// <p>The unique identifier for the custom framework to be shared.</p>
139    pub fn get_framework_id(&self) -> &::std::option::Option<::std::string::String> {
140        self.inner.get_framework_id()
141    }
142    /// <p>The Amazon Web Services account of the recipient.</p>
143    pub fn destination_account(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
144        self.inner = self.inner.destination_account(input.into());
145        self
146    }
147    /// <p>The Amazon Web Services account of the recipient.</p>
148    pub fn set_destination_account(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
149        self.inner = self.inner.set_destination_account(input);
150        self
151    }
152    /// <p>The Amazon Web Services account of the recipient.</p>
153    pub fn get_destination_account(&self) -> &::std::option::Option<::std::string::String> {
154        self.inner.get_destination_account()
155    }
156    /// <p>The Amazon Web Services Region of the recipient.</p>
157    pub fn destination_region(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
158        self.inner = self.inner.destination_region(input.into());
159        self
160    }
161    /// <p>The Amazon Web Services Region of the recipient.</p>
162    pub fn set_destination_region(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
163        self.inner = self.inner.set_destination_region(input);
164        self
165    }
166    /// <p>The Amazon Web Services Region of the recipient.</p>
167    pub fn get_destination_region(&self) -> &::std::option::Option<::std::string::String> {
168        self.inner.get_destination_region()
169    }
170    /// <p>An optional comment from the sender about the share request.</p>
171    pub fn comment(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
172        self.inner = self.inner.comment(input.into());
173        self
174    }
175    /// <p>An optional comment from the sender about the share request.</p>
176    pub fn set_comment(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
177        self.inner = self.inner.set_comment(input);
178        self
179    }
180    /// <p>An optional comment from the sender about the share request.</p>
181    pub fn get_comment(&self) -> &::std::option::Option<::std::string::String> {
182        self.inner.get_comment()
183    }
184}