aws_sdk_ssm/operation/create_resource_data_sync/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_resource_data_sync::_create_resource_data_sync_output::CreateResourceDataSyncOutputBuilder;
3
4pub use crate::operation::create_resource_data_sync::_create_resource_data_sync_input::CreateResourceDataSyncInputBuilder;
5
6impl crate::operation::create_resource_data_sync::builders::CreateResourceDataSyncInputBuilder {
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_data_sync::CreateResourceDataSyncOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::create_resource_data_sync::CreateResourceDataSyncError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.create_resource_data_sync();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `CreateResourceDataSync`.
24///
25/// <p>A resource data sync helps you view data from multiple sources in a single location. Amazon Web Services Systems Manager offers two types of resource data sync: <code>SyncToDestination</code> and <code>SyncFromSource</code>.</p>
26/// <p>You can configure Systems Manager Inventory to use the <code>SyncToDestination</code> type to synchronize Inventory data from multiple Amazon Web Services Regions to a single Amazon Simple Storage Service (Amazon S3) bucket. For more information, see <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/inventory-create-resource-data-sync.html">Creating a resource data sync for Inventory</a> in the <i>Amazon Web Services Systems Manager User Guide</i>.</p>
27/// <p>You can configure Systems Manager Explorer to use the <code>SyncFromSource</code> type to synchronize operational work items (OpsItems) and operational data (OpsData) from multiple Amazon Web Services Regions to a single Amazon S3 bucket. This type can synchronize OpsItems and OpsData from multiple Amazon Web Services accounts and Amazon Web Services Regions or <code>EntireOrganization</code> by using Organizations. For more information, see <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/Explorer-resource-data-sync.html">Setting up Systems Manager Explorer to display data from multiple accounts and Regions</a> in the <i>Amazon Web Services Systems Manager User Guide</i>.</p>
28/// <p>A resource data sync is an asynchronous operation that returns immediately. After a successful initial sync is completed, the system continuously syncs data. To check the status of a sync, use the <code>ListResourceDataSync</code>.</p><note>
29/// <p>By default, data isn't encrypted in Amazon S3. We strongly recommend that you enable encryption in Amazon S3 to ensure secure data storage. We also recommend that you secure access to the Amazon S3 bucket by creating a restrictive bucket policy.</p>
30/// </note>
31#[derive(::std::clone::Clone, ::std::fmt::Debug)]
32pub struct CreateResourceDataSyncFluentBuilder {
33    handle: ::std::sync::Arc<crate::client::Handle>,
34    inner: crate::operation::create_resource_data_sync::builders::CreateResourceDataSyncInputBuilder,
35    config_override: ::std::option::Option<crate::config::Builder>,
36}
37impl
38    crate::client::customize::internal::CustomizableSend<
39        crate::operation::create_resource_data_sync::CreateResourceDataSyncOutput,
40        crate::operation::create_resource_data_sync::CreateResourceDataSyncError,
41    > for CreateResourceDataSyncFluentBuilder
42{
43    fn send(
44        self,
45        config_override: crate::config::Builder,
46    ) -> crate::client::customize::internal::BoxFuture<
47        crate::client::customize::internal::SendResult<
48            crate::operation::create_resource_data_sync::CreateResourceDataSyncOutput,
49            crate::operation::create_resource_data_sync::CreateResourceDataSyncError,
50        >,
51    > {
52        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
53    }
54}
55impl CreateResourceDataSyncFluentBuilder {
56    /// Creates a new `CreateResourceDataSyncFluentBuilder`.
57    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
58        Self {
59            handle,
60            inner: ::std::default::Default::default(),
61            config_override: ::std::option::Option::None,
62        }
63    }
64    /// Access the CreateResourceDataSync as a reference.
65    pub fn as_input(&self) -> &crate::operation::create_resource_data_sync::builders::CreateResourceDataSyncInputBuilder {
66        &self.inner
67    }
68    /// Sends the request and returns the response.
69    ///
70    /// If an error occurs, an `SdkError` will be returned with additional details that
71    /// can be matched against.
72    ///
73    /// By default, any retryable failures will be retried twice. Retry behavior
74    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
75    /// set when configuring the client.
76    pub async fn send(
77        self,
78    ) -> ::std::result::Result<
79        crate::operation::create_resource_data_sync::CreateResourceDataSyncOutput,
80        ::aws_smithy_runtime_api::client::result::SdkError<
81            crate::operation::create_resource_data_sync::CreateResourceDataSyncError,
82            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
83        >,
84    > {
85        let input = self
86            .inner
87            .build()
88            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
89        let runtime_plugins = crate::operation::create_resource_data_sync::CreateResourceDataSync::operation_runtime_plugins(
90            self.handle.runtime_plugins.clone(),
91            &self.handle.conf,
92            self.config_override,
93        );
94        crate::operation::create_resource_data_sync::CreateResourceDataSync::orchestrate(&runtime_plugins, input).await
95    }
96
97    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
98    pub fn customize(
99        self,
100    ) -> crate::client::customize::CustomizableOperation<
101        crate::operation::create_resource_data_sync::CreateResourceDataSyncOutput,
102        crate::operation::create_resource_data_sync::CreateResourceDataSyncError,
103        Self,
104    > {
105        crate::client::customize::CustomizableOperation::new(self)
106    }
107    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
108        self.set_config_override(::std::option::Option::Some(config_override.into()));
109        self
110    }
111
112    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
113        self.config_override = config_override;
114        self
115    }
116    /// <p>A name for the configuration.</p>
117    pub fn sync_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
118        self.inner = self.inner.sync_name(input.into());
119        self
120    }
121    /// <p>A name for the configuration.</p>
122    pub fn set_sync_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
123        self.inner = self.inner.set_sync_name(input);
124        self
125    }
126    /// <p>A name for the configuration.</p>
127    pub fn get_sync_name(&self) -> &::std::option::Option<::std::string::String> {
128        self.inner.get_sync_name()
129    }
130    /// <p>Amazon S3 configuration details for the sync. This parameter is required if the <code>SyncType</code> value is SyncToDestination.</p>
131    pub fn s3_destination(mut self, input: crate::types::ResourceDataSyncS3Destination) -> Self {
132        self.inner = self.inner.s3_destination(input);
133        self
134    }
135    /// <p>Amazon S3 configuration details for the sync. This parameter is required if the <code>SyncType</code> value is SyncToDestination.</p>
136    pub fn set_s3_destination(mut self, input: ::std::option::Option<crate::types::ResourceDataSyncS3Destination>) -> Self {
137        self.inner = self.inner.set_s3_destination(input);
138        self
139    }
140    /// <p>Amazon S3 configuration details for the sync. This parameter is required if the <code>SyncType</code> value is SyncToDestination.</p>
141    pub fn get_s3_destination(&self) -> &::std::option::Option<crate::types::ResourceDataSyncS3Destination> {
142        self.inner.get_s3_destination()
143    }
144    /// <p>Specify <code>SyncToDestination</code> to create a resource data sync that synchronizes data to an S3 bucket for Inventory. If you specify <code>SyncToDestination</code>, you must provide a value for <code>S3Destination</code>. Specify <code>SyncFromSource</code> to synchronize data from a single account and multiple Regions, or multiple Amazon Web Services accounts and Amazon Web Services Regions, as listed in Organizations for Explorer. If you specify <code>SyncFromSource</code>, you must provide a value for <code>SyncSource</code>. The default value is <code>SyncToDestination</code>.</p>
145    pub fn sync_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
146        self.inner = self.inner.sync_type(input.into());
147        self
148    }
149    /// <p>Specify <code>SyncToDestination</code> to create a resource data sync that synchronizes data to an S3 bucket for Inventory. If you specify <code>SyncToDestination</code>, you must provide a value for <code>S3Destination</code>. Specify <code>SyncFromSource</code> to synchronize data from a single account and multiple Regions, or multiple Amazon Web Services accounts and Amazon Web Services Regions, as listed in Organizations for Explorer. If you specify <code>SyncFromSource</code>, you must provide a value for <code>SyncSource</code>. The default value is <code>SyncToDestination</code>.</p>
150    pub fn set_sync_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
151        self.inner = self.inner.set_sync_type(input);
152        self
153    }
154    /// <p>Specify <code>SyncToDestination</code> to create a resource data sync that synchronizes data to an S3 bucket for Inventory. If you specify <code>SyncToDestination</code>, you must provide a value for <code>S3Destination</code>. Specify <code>SyncFromSource</code> to synchronize data from a single account and multiple Regions, or multiple Amazon Web Services accounts and Amazon Web Services Regions, as listed in Organizations for Explorer. If you specify <code>SyncFromSource</code>, you must provide a value for <code>SyncSource</code>. The default value is <code>SyncToDestination</code>.</p>
155    pub fn get_sync_type(&self) -> &::std::option::Option<::std::string::String> {
156        self.inner.get_sync_type()
157    }
158    /// <p>Specify information about the data sources to synchronize. This parameter is required if the <code>SyncType</code> value is SyncFromSource.</p>
159    pub fn sync_source(mut self, input: crate::types::ResourceDataSyncSource) -> Self {
160        self.inner = self.inner.sync_source(input);
161        self
162    }
163    /// <p>Specify information about the data sources to synchronize. This parameter is required if the <code>SyncType</code> value is SyncFromSource.</p>
164    pub fn set_sync_source(mut self, input: ::std::option::Option<crate::types::ResourceDataSyncSource>) -> Self {
165        self.inner = self.inner.set_sync_source(input);
166        self
167    }
168    /// <p>Specify information about the data sources to synchronize. This parameter is required if the <code>SyncType</code> value is SyncFromSource.</p>
169    pub fn get_sync_source(&self) -> &::std::option::Option<crate::types::ResourceDataSyncSource> {
170        self.inner.get_sync_source()
171    }
172}