aws_sdk_storagegateway/operation/join_domain/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::join_domain::_join_domain_output::JoinDomainOutputBuilder;
3
4pub use crate::operation::join_domain::_join_domain_input::JoinDomainInputBuilder;
5
6impl crate::operation::join_domain::builders::JoinDomainInputBuilder {
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::join_domain::JoinDomainOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::join_domain::JoinDomainError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.join_domain();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `JoinDomain`.
24///
25/// <p>Adds a file gateway to an Active Directory domain. This operation is only supported for file gateways that support the SMB file protocol.</p><note>
26/// <p>Joining a domain creates an Active Directory computer account in the default organizational unit, using the gateway's <b>Gateway ID</b> as the account name (for example, SGW-1234ADE). If your Active Directory environment requires that you pre-stage accounts to facilitate the join domain process, you will need to create this account ahead of time.</p>
27/// <p>To create the gateway's computer account in an organizational unit other than the default, you must specify the organizational unit when joining the domain.</p>
28/// </note>
29#[derive(::std::clone::Clone, ::std::fmt::Debug)]
30pub struct JoinDomainFluentBuilder {
31 handle: ::std::sync::Arc<crate::client::Handle>,
32 inner: crate::operation::join_domain::builders::JoinDomainInputBuilder,
33 config_override: ::std::option::Option<crate::config::Builder>,
34}
35impl
36 crate::client::customize::internal::CustomizableSend<
37 crate::operation::join_domain::JoinDomainOutput,
38 crate::operation::join_domain::JoinDomainError,
39 > for JoinDomainFluentBuilder
40{
41 fn send(
42 self,
43 config_override: crate::config::Builder,
44 ) -> crate::client::customize::internal::BoxFuture<
45 crate::client::customize::internal::SendResult<
46 crate::operation::join_domain::JoinDomainOutput,
47 crate::operation::join_domain::JoinDomainError,
48 >,
49 > {
50 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
51 }
52}
53impl JoinDomainFluentBuilder {
54 /// Creates a new `JoinDomainFluentBuilder`.
55 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
56 Self {
57 handle,
58 inner: ::std::default::Default::default(),
59 config_override: ::std::option::Option::None,
60 }
61 }
62 /// Access the JoinDomain as a reference.
63 pub fn as_input(&self) -> &crate::operation::join_domain::builders::JoinDomainInputBuilder {
64 &self.inner
65 }
66 /// Sends the request and returns the response.
67 ///
68 /// If an error occurs, an `SdkError` will be returned with additional details that
69 /// can be matched against.
70 ///
71 /// By default, any retryable failures will be retried twice. Retry behavior
72 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
73 /// set when configuring the client.
74 pub async fn send(
75 self,
76 ) -> ::std::result::Result<
77 crate::operation::join_domain::JoinDomainOutput,
78 ::aws_smithy_runtime_api::client::result::SdkError<
79 crate::operation::join_domain::JoinDomainError,
80 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
81 >,
82 > {
83 let input = self
84 .inner
85 .build()
86 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
87 let runtime_plugins = crate::operation::join_domain::JoinDomain::operation_runtime_plugins(
88 self.handle.runtime_plugins.clone(),
89 &self.handle.conf,
90 self.config_override,
91 );
92 crate::operation::join_domain::JoinDomain::orchestrate(&runtime_plugins, input).await
93 }
94
95 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
96 pub fn customize(
97 self,
98 ) -> crate::client::customize::CustomizableOperation<
99 crate::operation::join_domain::JoinDomainOutput,
100 crate::operation::join_domain::JoinDomainError,
101 Self,
102 > {
103 crate::client::customize::CustomizableOperation::new(self)
104 }
105 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
106 self.set_config_override(::std::option::Option::Some(config_override.into()));
107 self
108 }
109
110 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
111 self.config_override = config_override;
112 self
113 }
114 /// <p>The Amazon Resource Name (ARN) of the gateway. Use the <code>ListGateways</code> operation to return a list of gateways for your account and Amazon Web Services Region.</p>
115 pub fn gateway_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
116 self.inner = self.inner.gateway_arn(input.into());
117 self
118 }
119 /// <p>The Amazon Resource Name (ARN) of the gateway. Use the <code>ListGateways</code> operation to return a list of gateways for your account and Amazon Web Services Region.</p>
120 pub fn set_gateway_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
121 self.inner = self.inner.set_gateway_arn(input);
122 self
123 }
124 /// <p>The Amazon Resource Name (ARN) of the gateway. Use the <code>ListGateways</code> operation to return a list of gateways for your account and Amazon Web Services Region.</p>
125 pub fn get_gateway_arn(&self) -> &::std::option::Option<::std::string::String> {
126 self.inner.get_gateway_arn()
127 }
128 /// <p>The name of the domain that you want the gateway to join.</p>
129 pub fn domain_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
130 self.inner = self.inner.domain_name(input.into());
131 self
132 }
133 /// <p>The name of the domain that you want the gateway to join.</p>
134 pub fn set_domain_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
135 self.inner = self.inner.set_domain_name(input);
136 self
137 }
138 /// <p>The name of the domain that you want the gateway to join.</p>
139 pub fn get_domain_name(&self) -> &::std::option::Option<::std::string::String> {
140 self.inner.get_domain_name()
141 }
142 /// <p>The organizational unit (OU) is a container in an Active Directory that can hold users, groups, computers, and other OUs and this parameter specifies the OU that the gateway will join within the AD domain.</p>
143 pub fn organizational_unit(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
144 self.inner = self.inner.organizational_unit(input.into());
145 self
146 }
147 /// <p>The organizational unit (OU) is a container in an Active Directory that can hold users, groups, computers, and other OUs and this parameter specifies the OU that the gateway will join within the AD domain.</p>
148 pub fn set_organizational_unit(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
149 self.inner = self.inner.set_organizational_unit(input);
150 self
151 }
152 /// <p>The organizational unit (OU) is a container in an Active Directory that can hold users, groups, computers, and other OUs and this parameter specifies the OU that the gateway will join within the AD domain.</p>
153 pub fn get_organizational_unit(&self) -> &::std::option::Option<::std::string::String> {
154 self.inner.get_organizational_unit()
155 }
156 ///
157 /// Appends an item to `DomainControllers`.
158 ///
159 /// To override the contents of this collection use [`set_domain_controllers`](Self::set_domain_controllers).
160 ///
161 /// <p>List of IP addresses, NetBIOS names, or host names of your domain server. If you need to specify the port number include it after the colon (“:”). For example, <code>mydc.mydomain.com:389</code>.</p><note>
162 /// <p>S3 File Gateway supports IPv6 addresses in addition to IPv4 and other existing formats.</p>
163 /// <p>FSx File Gateway does not support IPv6.</p>
164 /// </note>
165 pub fn domain_controllers(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
166 self.inner = self.inner.domain_controllers(input.into());
167 self
168 }
169 /// <p>List of IP addresses, NetBIOS names, or host names of your domain server. If you need to specify the port number include it after the colon (“:”). For example, <code>mydc.mydomain.com:389</code>.</p><note>
170 /// <p>S3 File Gateway supports IPv6 addresses in addition to IPv4 and other existing formats.</p>
171 /// <p>FSx File Gateway does not support IPv6.</p>
172 /// </note>
173 pub fn set_domain_controllers(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
174 self.inner = self.inner.set_domain_controllers(input);
175 self
176 }
177 /// <p>List of IP addresses, NetBIOS names, or host names of your domain server. If you need to specify the port number include it after the colon (“:”). For example, <code>mydc.mydomain.com:389</code>.</p><note>
178 /// <p>S3 File Gateway supports IPv6 addresses in addition to IPv4 and other existing formats.</p>
179 /// <p>FSx File Gateway does not support IPv6.</p>
180 /// </note>
181 pub fn get_domain_controllers(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
182 self.inner.get_domain_controllers()
183 }
184 /// <p>Specifies the time in seconds, in which the <code>JoinDomain</code> operation must complete. The default is 20 seconds.</p>
185 pub fn timeout_in_seconds(mut self, input: i32) -> Self {
186 self.inner = self.inner.timeout_in_seconds(input);
187 self
188 }
189 /// <p>Specifies the time in seconds, in which the <code>JoinDomain</code> operation must complete. The default is 20 seconds.</p>
190 pub fn set_timeout_in_seconds(mut self, input: ::std::option::Option<i32>) -> Self {
191 self.inner = self.inner.set_timeout_in_seconds(input);
192 self
193 }
194 /// <p>Specifies the time in seconds, in which the <code>JoinDomain</code> operation must complete. The default is 20 seconds.</p>
195 pub fn get_timeout_in_seconds(&self) -> &::std::option::Option<i32> {
196 self.inner.get_timeout_in_seconds()
197 }
198 /// <p>Sets the user name of user who has permission to add the gateway to the Active Directory domain. The domain user account should be enabled to join computers to the domain. For example, you can use the domain administrator account or an account with delegated permissions to join computers to the domain.</p>
199 pub fn user_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
200 self.inner = self.inner.user_name(input.into());
201 self
202 }
203 /// <p>Sets the user name of user who has permission to add the gateway to the Active Directory domain. The domain user account should be enabled to join computers to the domain. For example, you can use the domain administrator account or an account with delegated permissions to join computers to the domain.</p>
204 pub fn set_user_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
205 self.inner = self.inner.set_user_name(input);
206 self
207 }
208 /// <p>Sets the user name of user who has permission to add the gateway to the Active Directory domain. The domain user account should be enabled to join computers to the domain. For example, you can use the domain administrator account or an account with delegated permissions to join computers to the domain.</p>
209 pub fn get_user_name(&self) -> &::std::option::Option<::std::string::String> {
210 self.inner.get_user_name()
211 }
212 /// <p>Sets the password of the user who has permission to add the gateway to the Active Directory domain.</p>
213 pub fn password(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
214 self.inner = self.inner.password(input.into());
215 self
216 }
217 /// <p>Sets the password of the user who has permission to add the gateway to the Active Directory domain.</p>
218 pub fn set_password(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
219 self.inner = self.inner.set_password(input);
220 self
221 }
222 /// <p>Sets the password of the user who has permission to add the gateway to the Active Directory domain.</p>
223 pub fn get_password(&self) -> &::std::option::Option<::std::string::String> {
224 self.inner.get_password()
225 }
226}