aws_sdk_datasync/operation/add_storage_system/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::add_storage_system::_add_storage_system_output::AddStorageSystemOutputBuilder;
3
4pub use crate::operation::add_storage_system::_add_storage_system_input::AddStorageSystemInputBuilder;
5
6impl crate::operation::add_storage_system::builders::AddStorageSystemInputBuilder {
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::add_storage_system::AddStorageSystemOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::add_storage_system::AddStorageSystemError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.add_storage_system();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `AddStorageSystem`.
24///
25/// <p>Creates an Amazon Web Services resource for an on-premises storage system that you want DataSync Discovery to collect information about.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct AddStorageSystemFluentBuilder {
28    handle: ::std::sync::Arc<crate::client::Handle>,
29    inner: crate::operation::add_storage_system::builders::AddStorageSystemInputBuilder,
30    config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33    crate::client::customize::internal::CustomizableSend<
34        crate::operation::add_storage_system::AddStorageSystemOutput,
35        crate::operation::add_storage_system::AddStorageSystemError,
36    > for AddStorageSystemFluentBuilder
37{
38    fn send(
39        self,
40        config_override: crate::config::Builder,
41    ) -> crate::client::customize::internal::BoxFuture<
42        crate::client::customize::internal::SendResult<
43            crate::operation::add_storage_system::AddStorageSystemOutput,
44            crate::operation::add_storage_system::AddStorageSystemError,
45        >,
46    > {
47        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48    }
49}
50impl AddStorageSystemFluentBuilder {
51    /// Creates a new `AddStorageSystemFluentBuilder`.
52    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
53        Self {
54            handle,
55            inner: ::std::default::Default::default(),
56            config_override: ::std::option::Option::None,
57        }
58    }
59    /// Access the AddStorageSystem as a reference.
60    pub fn as_input(&self) -> &crate::operation::add_storage_system::builders::AddStorageSystemInputBuilder {
61        &self.inner
62    }
63    /// Sends the request and returns the response.
64    ///
65    /// If an error occurs, an `SdkError` will be returned with additional details that
66    /// can be matched against.
67    ///
68    /// By default, any retryable failures will be retried twice. Retry behavior
69    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
70    /// set when configuring the client.
71    pub async fn send(
72        self,
73    ) -> ::std::result::Result<
74        crate::operation::add_storage_system::AddStorageSystemOutput,
75        ::aws_smithy_runtime_api::client::result::SdkError<
76            crate::operation::add_storage_system::AddStorageSystemError,
77            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
78        >,
79    > {
80        let input = self
81            .inner
82            .build()
83            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
84        let runtime_plugins = crate::operation::add_storage_system::AddStorageSystem::operation_runtime_plugins(
85            self.handle.runtime_plugins.clone(),
86            &self.handle.conf,
87            self.config_override,
88        );
89        crate::operation::add_storage_system::AddStorageSystem::orchestrate(&runtime_plugins, input).await
90    }
91
92    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
93    pub fn customize(
94        self,
95    ) -> crate::client::customize::CustomizableOperation<
96        crate::operation::add_storage_system::AddStorageSystemOutput,
97        crate::operation::add_storage_system::AddStorageSystemError,
98        Self,
99    > {
100        crate::client::customize::CustomizableOperation::new(self)
101    }
102    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
103        self.set_config_override(::std::option::Option::Some(config_override.into()));
104        self
105    }
106
107    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
108        self.config_override = config_override;
109        self
110    }
111    /// <p>Specifies the server name and network port required to connect with the management interface of your on-premises storage system.</p>
112    pub fn server_configuration(mut self, input: crate::types::DiscoveryServerConfiguration) -> Self {
113        self.inner = self.inner.server_configuration(input);
114        self
115    }
116    /// <p>Specifies the server name and network port required to connect with the management interface of your on-premises storage system.</p>
117    pub fn set_server_configuration(mut self, input: ::std::option::Option<crate::types::DiscoveryServerConfiguration>) -> Self {
118        self.inner = self.inner.set_server_configuration(input);
119        self
120    }
121    /// <p>Specifies the server name and network port required to connect with the management interface of your on-premises storage system.</p>
122    pub fn get_server_configuration(&self) -> &::std::option::Option<crate::types::DiscoveryServerConfiguration> {
123        self.inner.get_server_configuration()
124    }
125    /// <p>Specifies the type of on-premises storage system that you want DataSync Discovery to collect information about.</p><note>
126    /// <p>DataSync Discovery currently supports NetApp Fabric-Attached Storage (FAS) and All Flash FAS (AFF) systems running ONTAP 9.7 or later.</p>
127    /// </note>
128    pub fn system_type(mut self, input: crate::types::DiscoverySystemType) -> Self {
129        self.inner = self.inner.system_type(input);
130        self
131    }
132    /// <p>Specifies the type of on-premises storage system that you want DataSync Discovery to collect information about.</p><note>
133    /// <p>DataSync Discovery currently supports NetApp Fabric-Attached Storage (FAS) and All Flash FAS (AFF) systems running ONTAP 9.7 or later.</p>
134    /// </note>
135    pub fn set_system_type(mut self, input: ::std::option::Option<crate::types::DiscoverySystemType>) -> Self {
136        self.inner = self.inner.set_system_type(input);
137        self
138    }
139    /// <p>Specifies the type of on-premises storage system that you want DataSync Discovery to collect information about.</p><note>
140    /// <p>DataSync Discovery currently supports NetApp Fabric-Attached Storage (FAS) and All Flash FAS (AFF) systems running ONTAP 9.7 or later.</p>
141    /// </note>
142    pub fn get_system_type(&self) -> &::std::option::Option<crate::types::DiscoverySystemType> {
143        self.inner.get_system_type()
144    }
145    ///
146    /// Appends an item to `AgentArns`.
147    ///
148    /// To override the contents of this collection use [`set_agent_arns`](Self::set_agent_arns).
149    ///
150    /// <p>Specifies the Amazon Resource Name (ARN) of the DataSync agent that connects to and reads from your on-premises storage system's management interface. You can only specify one ARN.</p>
151    pub fn agent_arns(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
152        self.inner = self.inner.agent_arns(input.into());
153        self
154    }
155    /// <p>Specifies the Amazon Resource Name (ARN) of the DataSync agent that connects to and reads from your on-premises storage system's management interface. You can only specify one ARN.</p>
156    pub fn set_agent_arns(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
157        self.inner = self.inner.set_agent_arns(input);
158        self
159    }
160    /// <p>Specifies the Amazon Resource Name (ARN) of the DataSync agent that connects to and reads from your on-premises storage system's management interface. You can only specify one ARN.</p>
161    pub fn get_agent_arns(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
162        self.inner.get_agent_arns()
163    }
164    /// <p>Specifies the ARN of the Amazon CloudWatch log group for monitoring and logging discovery job events.</p>
165    pub fn cloud_watch_log_group_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
166        self.inner = self.inner.cloud_watch_log_group_arn(input.into());
167        self
168    }
169    /// <p>Specifies the ARN of the Amazon CloudWatch log group for monitoring and logging discovery job events.</p>
170    pub fn set_cloud_watch_log_group_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
171        self.inner = self.inner.set_cloud_watch_log_group_arn(input);
172        self
173    }
174    /// <p>Specifies the ARN of the Amazon CloudWatch log group for monitoring and logging discovery job events.</p>
175    pub fn get_cloud_watch_log_group_arn(&self) -> &::std::option::Option<::std::string::String> {
176        self.inner.get_cloud_watch_log_group_arn()
177    }
178    ///
179    /// Appends an item to `Tags`.
180    ///
181    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
182    ///
183    /// <p>Specifies labels that help you categorize, filter, and search for your Amazon Web Services resources. We recommend creating at least a name tag for your on-premises storage system.</p>
184    pub fn tags(mut self, input: crate::types::TagListEntry) -> Self {
185        self.inner = self.inner.tags(input);
186        self
187    }
188    /// <p>Specifies labels that help you categorize, filter, and search for your Amazon Web Services resources. We recommend creating at least a name tag for your on-premises storage system.</p>
189    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::TagListEntry>>) -> Self {
190        self.inner = self.inner.set_tags(input);
191        self
192    }
193    /// <p>Specifies labels that help you categorize, filter, and search for your Amazon Web Services resources. We recommend creating at least a name tag for your on-premises storage system.</p>
194    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::TagListEntry>> {
195        self.inner.get_tags()
196    }
197    /// <p>Specifies a familiar name for your on-premises storage system.</p>
198    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
199        self.inner = self.inner.name(input.into());
200        self
201    }
202    /// <p>Specifies a familiar name for your on-premises storage system.</p>
203    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
204        self.inner = self.inner.set_name(input);
205        self
206    }
207    /// <p>Specifies a familiar name for your on-premises storage system.</p>
208    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
209        self.inner.get_name()
210    }
211    /// <p>Specifies a client token to make sure requests with this API operation are idempotent. If you don't specify a client token, DataSync generates one for you automatically.</p>
212    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
213        self.inner = self.inner.client_token(input.into());
214        self
215    }
216    /// <p>Specifies a client token to make sure requests with this API operation are idempotent. If you don't specify a client token, DataSync generates one for you automatically.</p>
217    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
218        self.inner = self.inner.set_client_token(input);
219        self
220    }
221    /// <p>Specifies a client token to make sure requests with this API operation are idempotent. If you don't specify a client token, DataSync generates one for you automatically.</p>
222    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
223        self.inner.get_client_token()
224    }
225    /// <p>Specifies the user name and password for accessing your on-premises storage system's management interface.</p>
226    pub fn credentials(mut self, input: crate::types::Credentials) -> Self {
227        self.inner = self.inner.credentials(input);
228        self
229    }
230    /// <p>Specifies the user name and password for accessing your on-premises storage system's management interface.</p>
231    pub fn set_credentials(mut self, input: ::std::option::Option<crate::types::Credentials>) -> Self {
232        self.inner = self.inner.set_credentials(input);
233        self
234    }
235    /// <p>Specifies the user name and password for accessing your on-premises storage system's management interface.</p>
236    pub fn get_credentials(&self) -> &::std::option::Option<crate::types::Credentials> {
237        self.inner.get_credentials()
238    }
239}