aws_sdk_cloudfront/operation/update_distribution_tenant/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::update_distribution_tenant::_update_distribution_tenant_output::UpdateDistributionTenantOutputBuilder;
3
4pub use crate::operation::update_distribution_tenant::_update_distribution_tenant_input::UpdateDistributionTenantInputBuilder;
5
6impl crate::operation::update_distribution_tenant::builders::UpdateDistributionTenantInputBuilder {
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::update_distribution_tenant::UpdateDistributionTenantOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::update_distribution_tenant::UpdateDistributionTenantError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.update_distribution_tenant();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `UpdateDistributionTenant`.
24///
25/// <p>Updates a distribution tenant.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct UpdateDistributionTenantFluentBuilder {
28    handle: ::std::sync::Arc<crate::client::Handle>,
29    inner: crate::operation::update_distribution_tenant::builders::UpdateDistributionTenantInputBuilder,
30    config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33    crate::client::customize::internal::CustomizableSend<
34        crate::operation::update_distribution_tenant::UpdateDistributionTenantOutput,
35        crate::operation::update_distribution_tenant::UpdateDistributionTenantError,
36    > for UpdateDistributionTenantFluentBuilder
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::update_distribution_tenant::UpdateDistributionTenantOutput,
44            crate::operation::update_distribution_tenant::UpdateDistributionTenantError,
45        >,
46    > {
47        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48    }
49}
50impl UpdateDistributionTenantFluentBuilder {
51    /// Creates a new `UpdateDistributionTenantFluentBuilder`.
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 UpdateDistributionTenant as a reference.
60    pub fn as_input(&self) -> &crate::operation::update_distribution_tenant::builders::UpdateDistributionTenantInputBuilder {
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::update_distribution_tenant::UpdateDistributionTenantOutput,
75        ::aws_smithy_runtime_api::client::result::SdkError<
76            crate::operation::update_distribution_tenant::UpdateDistributionTenantError,
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::update_distribution_tenant::UpdateDistributionTenant::operation_runtime_plugins(
85            self.handle.runtime_plugins.clone(),
86            &self.handle.conf,
87            self.config_override,
88        );
89        crate::operation::update_distribution_tenant::UpdateDistributionTenant::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::update_distribution_tenant::UpdateDistributionTenantOutput,
97        crate::operation::update_distribution_tenant::UpdateDistributionTenantError,
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 distribution tenant.</p>
112    pub fn id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
113        self.inner = self.inner.id(input.into());
114        self
115    }
116    /// <p>The ID of the distribution tenant.</p>
117    pub fn set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
118        self.inner = self.inner.set_id(input);
119        self
120    }
121    /// <p>The ID of the distribution tenant.</p>
122    pub fn get_id(&self) -> &::std::option::Option<::std::string::String> {
123        self.inner.get_id()
124    }
125    /// <p>The ID for the multi-tenant distribution.</p>
126    pub fn distribution_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
127        self.inner = self.inner.distribution_id(input.into());
128        self
129    }
130    /// <p>The ID for the multi-tenant distribution.</p>
131    pub fn set_distribution_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
132        self.inner = self.inner.set_distribution_id(input);
133        self
134    }
135    /// <p>The ID for the multi-tenant distribution.</p>
136    pub fn get_distribution_id(&self) -> &::std::option::Option<::std::string::String> {
137        self.inner.get_distribution_id()
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 to update for the distribution tenant. A domain object can contain only a domain property. You must specify at least one domain. Each distribution tenant can have up to 5 domains.</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 to update for the distribution tenant. A domain object can contain only a domain property. You must specify at least one domain. Each distribution tenant can have up to 5 domains.</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 to update for the distribution tenant. A domain object can contain only a domain property. You must specify at least one domain. Each distribution tenant can have up to 5 domains.</p>
155    pub fn get_domains(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::DomainItem>> {
156        self.inner.get_domains()
157    }
158    /// <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>
159    pub fn customizations(mut self, input: crate::types::Customizations) -> Self {
160        self.inner = self.inner.customizations(input);
161        self
162    }
163    /// <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>
164    pub fn set_customizations(mut self, input: ::std::option::Option<crate::types::Customizations>) -> Self {
165        self.inner = self.inner.set_customizations(input);
166        self
167    }
168    /// <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>
169    pub fn get_customizations(&self) -> &::std::option::Option<crate::types::Customizations> {
170        self.inner.get_customizations()
171    }
172    ///
173    /// Appends an item to `Parameters`.
174    ///
175    /// To override the contents of this collection use [`set_parameters`](Self::set_parameters).
176    ///
177    /// <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>
178    pub fn parameters(mut self, input: crate::types::Parameter) -> Self {
179        self.inner = self.inner.parameters(input);
180        self
181    }
182    /// <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>
183    pub fn set_parameters(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Parameter>>) -> Self {
184        self.inner = self.inner.set_parameters(input);
185        self
186    }
187    /// <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>
188    pub fn get_parameters(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Parameter>> {
189        self.inner.get_parameters()
190    }
191    /// <p>The ID of the target connection group.</p>
192    pub fn connection_group_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
193        self.inner = self.inner.connection_group_id(input.into());
194        self
195    }
196    /// <p>The ID of the target connection group.</p>
197    pub fn set_connection_group_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
198        self.inner = self.inner.set_connection_group_id(input);
199        self
200    }
201    /// <p>The ID of the target connection group.</p>
202    pub fn get_connection_group_id(&self) -> &::std::option::Option<::std::string::String> {
203        self.inner.get_connection_group_id()
204    }
205    /// <p>The value of the <code>ETag</code> header that you received when retrieving the distribution tenant to update. This value is returned in the response of the <code>GetDistributionTenant</code> API operation.</p>
206    pub fn if_match(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
207        self.inner = self.inner.if_match(input.into());
208        self
209    }
210    /// <p>The value of the <code>ETag</code> header that you received when retrieving the distribution tenant to update. This value is returned in the response of the <code>GetDistributionTenant</code> API operation.</p>
211    pub fn set_if_match(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
212        self.inner = self.inner.set_if_match(input);
213        self
214    }
215    /// <p>The value of the <code>ETag</code> header that you received when retrieving the distribution tenant to update. This value is returned in the response of the <code>GetDistributionTenant</code> API operation.</p>
216    pub fn get_if_match(&self) -> &::std::option::Option<::std::string::String> {
217        self.inner.get_if_match()
218    }
219    /// <p>An object that contains 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>An object that contains 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>An object that contains 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 updated to an enabled state. If you update the distribution tenant and it's not enabled, 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 updated to an enabled state. If you update the distribution tenant and it's not enabled, 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 updated to an enabled state. If you update the distribution tenant and it's not enabled, 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}