aws_sdk_cloudfront/operation/create_distribution_tenant/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_distribution_tenant::_create_distribution_tenant_output::CreateDistributionTenantOutputBuilder;
3
4pub use crate::operation::create_distribution_tenant::_create_distribution_tenant_input::CreateDistributionTenantInputBuilder;
5
6impl crate::operation::create_distribution_tenant::builders::CreateDistributionTenantInputBuilder {
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_distribution_tenant::CreateDistributionTenantOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::create_distribution_tenant::CreateDistributionTenantError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.create_distribution_tenant();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `CreateDistributionTenant`.
24///
25/// <p>Creates a distribution tenant.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct CreateDistributionTenantFluentBuilder {
28    handle: ::std::sync::Arc<crate::client::Handle>,
29    inner: crate::operation::create_distribution_tenant::builders::CreateDistributionTenantInputBuilder,
30    config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33    crate::client::customize::internal::CustomizableSend<
34        crate::operation::create_distribution_tenant::CreateDistributionTenantOutput,
35        crate::operation::create_distribution_tenant::CreateDistributionTenantError,
36    > for CreateDistributionTenantFluentBuilder
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::create_distribution_tenant::CreateDistributionTenantOutput,
44            crate::operation::create_distribution_tenant::CreateDistributionTenantError,
45        >,
46    > {
47        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48    }
49}
50impl CreateDistributionTenantFluentBuilder {
51    /// Creates a new `CreateDistributionTenantFluentBuilder`.
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 CreateDistributionTenant as a reference.
60    pub fn as_input(&self) -> &crate::operation::create_distribution_tenant::builders::CreateDistributionTenantInputBuilder {
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::create_distribution_tenant::CreateDistributionTenantOutput,
75        ::aws_smithy_runtime_api::client::result::SdkError<
76            crate::operation::create_distribution_tenant::CreateDistributionTenantError,
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::create_distribution_tenant::CreateDistributionTenant::operation_runtime_plugins(
85            self.handle.runtime_plugins.clone(),
86            &self.handle.conf,
87            self.config_override,
88        );
89        crate::operation::create_distribution_tenant::CreateDistributionTenant::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::create_distribution_tenant::CreateDistributionTenantOutput,
97        crate::operation::create_distribution_tenant::CreateDistributionTenantError,
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>The ID of the multi-tenant distribution to use for creating the distribution tenant.</p>
112    pub fn distribution_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
113        self.inner = self.inner.distribution_id(input.into());
114        self
115    }
116    /// <p>The ID of the multi-tenant distribution to use for creating the distribution tenant.</p>
117    pub fn set_distribution_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
118        self.inner = self.inner.set_distribution_id(input);
119        self
120    }
121    /// <p>The ID of the multi-tenant distribution to use for creating the distribution tenant.</p>
122    pub fn get_distribution_id(&self) -> &::std::option::Option<::std::string::String> {
123        self.inner.get_distribution_id()
124    }
125    /// <p>The name of the distribution tenant. Enter a friendly identifier that is unique within your Amazon Web Services account. This name can't be updated after you create the distribution tenant.</p>
126    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
127        self.inner = self.inner.name(input.into());
128        self
129    }
130    /// <p>The name of the distribution tenant. Enter a friendly identifier that is unique within your Amazon Web Services account. This name can't be updated after you create the distribution tenant.</p>
131    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
132        self.inner = self.inner.set_name(input);
133        self
134    }
135    /// <p>The name of the distribution tenant. Enter a friendly identifier that is unique within your Amazon Web Services account. This name can't be updated after you create the distribution tenant.</p>
136    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
137        self.inner.get_name()
138    }
139    ///
140    /// Appends an item to `Domains`.
141    ///
142    /// To override the contents of this collection use [`set_domains`](Self::set_domains).
143    ///
144    /// <p>The domains associated with the distribution tenant. You must specify at least one domain in the request.</p>
145    pub fn domains(mut self, input: crate::types::DomainItem) -> Self {
146        self.inner = self.inner.domains(input);
147        self
148    }
149    /// <p>The domains associated with the distribution tenant. You must specify at least one domain in the request.</p>
150    pub fn set_domains(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::DomainItem>>) -> Self {
151        self.inner = self.inner.set_domains(input);
152        self
153    }
154    /// <p>The domains associated with the distribution tenant. You must specify at least one domain in the request.</p>
155    pub fn get_domains(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::DomainItem>> {
156        self.inner.get_domains()
157    }
158    /// <p>A complex type that contains zero or more <code>Tag</code> elements.</p>
159    pub fn tags(mut self, input: crate::types::Tags) -> Self {
160        self.inner = self.inner.tags(input);
161        self
162    }
163    /// <p>A complex type that contains zero or more <code>Tag</code> elements.</p>
164    pub fn set_tags(mut self, input: ::std::option::Option<crate::types::Tags>) -> Self {
165        self.inner = self.inner.set_tags(input);
166        self
167    }
168    /// <p>A complex type that contains zero or more <code>Tag</code> elements.</p>
169    pub fn get_tags(&self) -> &::std::option::Option<crate::types::Tags> {
170        self.inner.get_tags()
171    }
172    /// <p>Customizations for the distribution tenant. For each distribution tenant, you can specify the geographic restrictions, and the Amazon Resource Names (ARNs) for the ACM certificate and WAF web ACL. These are specific values that you can override or disable from the multi-tenant distribution that was used to create the distribution tenant.</p>
173    pub fn customizations(mut self, input: crate::types::Customizations) -> Self {
174        self.inner = self.inner.customizations(input);
175        self
176    }
177    /// <p>Customizations for the distribution tenant. For each distribution tenant, you can specify the geographic restrictions, and the Amazon Resource Names (ARNs) for the ACM certificate and WAF web ACL. These are specific values that you can override or disable from the multi-tenant distribution that was used to create the distribution tenant.</p>
178    pub fn set_customizations(mut self, input: ::std::option::Option<crate::types::Customizations>) -> Self {
179        self.inner = self.inner.set_customizations(input);
180        self
181    }
182    /// <p>Customizations for the distribution tenant. For each distribution tenant, you can specify the geographic restrictions, and the Amazon Resource Names (ARNs) for the ACM certificate and WAF web ACL. These are specific values that you can override or disable from the multi-tenant distribution that was used to create the distribution tenant.</p>
183    pub fn get_customizations(&self) -> &::std::option::Option<crate::types::Customizations> {
184        self.inner.get_customizations()
185    }
186    ///
187    /// Appends an item to `Parameters`.
188    ///
189    /// To override the contents of this collection use [`set_parameters`](Self::set_parameters).
190    ///
191    /// <p>A list of parameter values to add to the resource. A parameter is specified as a key-value pair. A valid parameter value must exist for any parameter that is marked as required in the multi-tenant distribution.</p>
192    pub fn parameters(mut self, input: crate::types::Parameter) -> Self {
193        self.inner = self.inner.parameters(input);
194        self
195    }
196    /// <p>A list of parameter values to add to the resource. A parameter is specified as a key-value pair. A valid parameter value must exist for any parameter that is marked as required in the multi-tenant distribution.</p>
197    pub fn set_parameters(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Parameter>>) -> Self {
198        self.inner = self.inner.set_parameters(input);
199        self
200    }
201    /// <p>A list of parameter values to add to the resource. A parameter is specified as a key-value pair. A valid parameter value must exist for any parameter that is marked as required in the multi-tenant distribution.</p>
202    pub fn get_parameters(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Parameter>> {
203        self.inner.get_parameters()
204    }
205    /// <p>The ID of the connection group to associate with the distribution tenant.</p>
206    pub fn connection_group_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
207        self.inner = self.inner.connection_group_id(input.into());
208        self
209    }
210    /// <p>The ID of the connection group to associate with the distribution tenant.</p>
211    pub fn set_connection_group_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
212        self.inner = self.inner.set_connection_group_id(input);
213        self
214    }
215    /// <p>The ID of the connection group to associate with the distribution tenant.</p>
216    pub fn get_connection_group_id(&self) -> &::std::option::Option<::std::string::String> {
217        self.inner.get_connection_group_id()
218    }
219    /// <p>The configuration for the CloudFront managed ACM certificate request.</p>
220    pub fn managed_certificate_request(mut self, input: crate::types::ManagedCertificateRequest) -> Self {
221        self.inner = self.inner.managed_certificate_request(input);
222        self
223    }
224    /// <p>The configuration for the CloudFront managed ACM certificate request.</p>
225    pub fn set_managed_certificate_request(mut self, input: ::std::option::Option<crate::types::ManagedCertificateRequest>) -> Self {
226        self.inner = self.inner.set_managed_certificate_request(input);
227        self
228    }
229    /// <p>The configuration for the CloudFront managed ACM certificate request.</p>
230    pub fn get_managed_certificate_request(&self) -> &::std::option::Option<crate::types::ManagedCertificateRequest> {
231        self.inner.get_managed_certificate_request()
232    }
233    /// <p>Indicates whether the distribution tenant should be enabled when created. If the distribution tenant is disabled, the distribution tenant won't serve traffic.</p>
234    pub fn enabled(mut self, input: bool) -> Self {
235        self.inner = self.inner.enabled(input);
236        self
237    }
238    /// <p>Indicates whether the distribution tenant should be enabled when created. If the distribution tenant is disabled, the distribution tenant won't serve traffic.</p>
239    pub fn set_enabled(mut self, input: ::std::option::Option<bool>) -> Self {
240        self.inner = self.inner.set_enabled(input);
241        self
242    }
243    /// <p>Indicates whether the distribution tenant should be enabled when created. If the distribution tenant is disabled, the distribution tenant won't serve traffic.</p>
244    pub fn get_enabled(&self) -> &::std::option::Option<bool> {
245        self.inner.get_enabled()
246    }
247}