aws_sdk_datasync/operation/create_location_nfs/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_location_nfs::_create_location_nfs_output::CreateLocationNfsOutputBuilder;
3
4pub use crate::operation::create_location_nfs::_create_location_nfs_input::CreateLocationNfsInputBuilder;
5
6impl crate::operation::create_location_nfs::builders::CreateLocationNfsInputBuilder {
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_location_nfs::CreateLocationNfsOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::create_location_nfs::CreateLocationNfsError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.create_location_nfs();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `CreateLocationNfs`.
24///
25/// <p>Creates a transfer <i>location</i> for a Network File System (NFS) file server. DataSync can use this location as a source or destination for transferring data.</p>
26/// <p>Before you begin, make sure that you understand how DataSync <a href="https://docs.aws.amazon.com/datasync/latest/userguide/create-nfs-location.html#accessing-nfs">accesses NFS file servers</a>.</p>
27#[derive(::std::clone::Clone, ::std::fmt::Debug)]
28pub struct CreateLocationNfsFluentBuilder {
29    handle: ::std::sync::Arc<crate::client::Handle>,
30    inner: crate::operation::create_location_nfs::builders::CreateLocationNfsInputBuilder,
31    config_override: ::std::option::Option<crate::config::Builder>,
32}
33impl
34    crate::client::customize::internal::CustomizableSend<
35        crate::operation::create_location_nfs::CreateLocationNfsOutput,
36        crate::operation::create_location_nfs::CreateLocationNfsError,
37    > for CreateLocationNfsFluentBuilder
38{
39    fn send(
40        self,
41        config_override: crate::config::Builder,
42    ) -> crate::client::customize::internal::BoxFuture<
43        crate::client::customize::internal::SendResult<
44            crate::operation::create_location_nfs::CreateLocationNfsOutput,
45            crate::operation::create_location_nfs::CreateLocationNfsError,
46        >,
47    > {
48        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
49    }
50}
51impl CreateLocationNfsFluentBuilder {
52    /// Creates a new `CreateLocationNfsFluentBuilder`.
53    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
54        Self {
55            handle,
56            inner: ::std::default::Default::default(),
57            config_override: ::std::option::Option::None,
58        }
59    }
60    /// Access the CreateLocationNfs as a reference.
61    pub fn as_input(&self) -> &crate::operation::create_location_nfs::builders::CreateLocationNfsInputBuilder {
62        &self.inner
63    }
64    /// Sends the request and returns the response.
65    ///
66    /// If an error occurs, an `SdkError` will be returned with additional details that
67    /// can be matched against.
68    ///
69    /// By default, any retryable failures will be retried twice. Retry behavior
70    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
71    /// set when configuring the client.
72    pub async fn send(
73        self,
74    ) -> ::std::result::Result<
75        crate::operation::create_location_nfs::CreateLocationNfsOutput,
76        ::aws_smithy_runtime_api::client::result::SdkError<
77            crate::operation::create_location_nfs::CreateLocationNfsError,
78            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
79        >,
80    > {
81        let input = self
82            .inner
83            .build()
84            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
85        let runtime_plugins = crate::operation::create_location_nfs::CreateLocationNfs::operation_runtime_plugins(
86            self.handle.runtime_plugins.clone(),
87            &self.handle.conf,
88            self.config_override,
89        );
90        crate::operation::create_location_nfs::CreateLocationNfs::orchestrate(&runtime_plugins, input).await
91    }
92
93    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
94    pub fn customize(
95        self,
96    ) -> crate::client::customize::CustomizableOperation<
97        crate::operation::create_location_nfs::CreateLocationNfsOutput,
98        crate::operation::create_location_nfs::CreateLocationNfsError,
99        Self,
100    > {
101        crate::client::customize::CustomizableOperation::new(self)
102    }
103    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
104        self.set_config_override(::std::option::Option::Some(config_override.into()));
105        self
106    }
107
108    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
109        self.config_override = config_override;
110        self
111    }
112    /// <p>Specifies the export path in your NFS file server that you want DataSync to mount.</p>
113    /// <p>This path (or a subdirectory of the path) is where DataSync transfers data to or from. For information on configuring an export for DataSync, see <a href="https://docs.aws.amazon.com/datasync/latest/userguide/create-nfs-location.html#accessing-nfs">Accessing NFS file servers</a>.</p>
114    pub fn subdirectory(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
115        self.inner = self.inner.subdirectory(input.into());
116        self
117    }
118    /// <p>Specifies the export path in your NFS file server that you want DataSync to mount.</p>
119    /// <p>This path (or a subdirectory of the path) is where DataSync transfers data to or from. For information on configuring an export for DataSync, see <a href="https://docs.aws.amazon.com/datasync/latest/userguide/create-nfs-location.html#accessing-nfs">Accessing NFS file servers</a>.</p>
120    pub fn set_subdirectory(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
121        self.inner = self.inner.set_subdirectory(input);
122        self
123    }
124    /// <p>Specifies the export path in your NFS file server that you want DataSync to mount.</p>
125    /// <p>This path (or a subdirectory of the path) is where DataSync transfers data to or from. For information on configuring an export for DataSync, see <a href="https://docs.aws.amazon.com/datasync/latest/userguide/create-nfs-location.html#accessing-nfs">Accessing NFS file servers</a>.</p>
126    pub fn get_subdirectory(&self) -> &::std::option::Option<::std::string::String> {
127        self.inner.get_subdirectory()
128    }
129    /// <p>Specifies the DNS name or IP version 4 address of the NFS file server that your DataSync agent connects to.</p>
130    pub fn server_hostname(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
131        self.inner = self.inner.server_hostname(input.into());
132        self
133    }
134    /// <p>Specifies the DNS name or IP version 4 address of the NFS file server that your DataSync agent connects to.</p>
135    pub fn set_server_hostname(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
136        self.inner = self.inner.set_server_hostname(input);
137        self
138    }
139    /// <p>Specifies the DNS name or IP version 4 address of the NFS file server that your DataSync agent connects to.</p>
140    pub fn get_server_hostname(&self) -> &::std::option::Option<::std::string::String> {
141        self.inner.get_server_hostname()
142    }
143    /// <p>Specifies the Amazon Resource Name (ARN) of the DataSync agent that can connect to your NFS file server.</p>
144    /// <p>You can specify more than one agent. For more information, see <a href="https://docs.aws.amazon.com/datasync/latest/userguide/do-i-need-datasync-agent.html#multiple-agents">Using multiple DataSync agents</a>.</p>
145    pub fn on_prem_config(mut self, input: crate::types::OnPremConfig) -> Self {
146        self.inner = self.inner.on_prem_config(input);
147        self
148    }
149    /// <p>Specifies the Amazon Resource Name (ARN) of the DataSync agent that can connect to your NFS file server.</p>
150    /// <p>You can specify more than one agent. For more information, see <a href="https://docs.aws.amazon.com/datasync/latest/userguide/do-i-need-datasync-agent.html#multiple-agents">Using multiple DataSync agents</a>.</p>
151    pub fn set_on_prem_config(mut self, input: ::std::option::Option<crate::types::OnPremConfig>) -> Self {
152        self.inner = self.inner.set_on_prem_config(input);
153        self
154    }
155    /// <p>Specifies the Amazon Resource Name (ARN) of the DataSync agent that can connect to your NFS file server.</p>
156    /// <p>You can specify more than one agent. For more information, see <a href="https://docs.aws.amazon.com/datasync/latest/userguide/do-i-need-datasync-agent.html#multiple-agents">Using multiple DataSync agents</a>.</p>
157    pub fn get_on_prem_config(&self) -> &::std::option::Option<crate::types::OnPremConfig> {
158        self.inner.get_on_prem_config()
159    }
160    /// <p>Specifies the options that DataSync can use to mount your NFS file server.</p>
161    pub fn mount_options(mut self, input: crate::types::NfsMountOptions) -> Self {
162        self.inner = self.inner.mount_options(input);
163        self
164    }
165    /// <p>Specifies the options that DataSync can use to mount your NFS file server.</p>
166    pub fn set_mount_options(mut self, input: ::std::option::Option<crate::types::NfsMountOptions>) -> Self {
167        self.inner = self.inner.set_mount_options(input);
168        self
169    }
170    /// <p>Specifies the options that DataSync can use to mount your NFS file server.</p>
171    pub fn get_mount_options(&self) -> &::std::option::Option<crate::types::NfsMountOptions> {
172        self.inner.get_mount_options()
173    }
174    ///
175    /// Appends an item to `Tags`.
176    ///
177    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
178    ///
179    /// <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 location.</p>
180    pub fn tags(mut self, input: crate::types::TagListEntry) -> Self {
181        self.inner = self.inner.tags(input);
182        self
183    }
184    /// <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 location.</p>
185    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::TagListEntry>>) -> Self {
186        self.inner = self.inner.set_tags(input);
187        self
188    }
189    /// <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 location.</p>
190    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::TagListEntry>> {
191        self.inner.get_tags()
192    }
193}