Skip to main content

aws_sdk_lightsail/types/
_lightsail_distribution.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Describes an Amazon Lightsail content delivery network (CDN) distribution.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct LightsailDistribution {
7    /// <p>The name of the distribution.</p>
8    pub name: ::std::option::Option<::std::string::String>,
9    /// <p>The Amazon Resource Name (ARN) of the distribution.</p>
10    pub arn: ::std::option::Option<::std::string::String>,
11    /// <p>The support code. Include this code in your email to support when you have questions about your Lightsail distribution. This code enables our support team to look up your Lightsail information more easily.</p>
12    pub support_code: ::std::option::Option<::std::string::String>,
13    /// <p>The timestamp when the distribution was created.</p>
14    pub created_at: ::std::option::Option<::aws_smithy_types::DateTime>,
15    /// <p>An object that describes the location of the distribution, such as the Amazon Web Services Region and Availability Zone.</p><note>
16    /// <p>Lightsail distributions are global resources that can reference an origin in any Amazon Web Services Region, and distribute its content globally. However, all distributions are located in the <code>us-east-1</code> Region.</p>
17    /// </note>
18    pub location: ::std::option::Option<crate::types::ResourceLocation>,
19    /// <p>The Lightsail resource type (<code>Distribution</code>).</p>
20    pub resource_type: ::std::option::Option<crate::types::ResourceType>,
21    /// <p>The alternate domain names of the distribution.</p>
22    pub alternative_domain_names: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
23    /// <p>The status of the distribution.</p>
24    pub status: ::std::option::Option<::std::string::String>,
25    /// <p>Indicates whether the distribution is enabled.</p>
26    pub is_enabled: ::std::option::Option<bool>,
27    /// <p>The domain name of the distribution.</p>
28    pub domain_name: ::std::option::Option<::std::string::String>,
29    /// <p>The ID of the bundle currently applied to the distribution.</p>
30    pub bundle_id: ::std::option::Option<::std::string::String>,
31    /// <p>The name of the SSL/TLS certificate attached to the distribution, if any.</p>
32    pub certificate_name: ::std::option::Option<::std::string::String>,
33    /// <p>An object that describes the origin resource of the distribution, such as a Lightsail instance, bucket, or load balancer.</p>
34    /// <p>The distribution pulls, caches, and serves content from the origin.</p>
35    pub origin: ::std::option::Option<crate::types::Origin>,
36    /// <p>The public DNS of the origin.</p>
37    pub origin_public_dns: ::std::option::Option<::std::string::String>,
38    /// <p>An object that describes the default cache behavior of the distribution.</p>
39    pub default_cache_behavior: ::std::option::Option<crate::types::CacheBehavior>,
40    /// <p>An object that describes the cache behavior settings of the distribution.</p>
41    pub cache_behavior_settings: ::std::option::Option<crate::types::CacheSettings>,
42    /// <p>An array of objects that describe the per-path cache behavior of the distribution.</p>
43    pub cache_behaviors: ::std::option::Option<::std::vec::Vec<crate::types::CacheBehaviorPerPath>>,
44    /// <p>Indicates whether the bundle that is currently applied to your distribution, specified using the <code>distributionName</code> parameter, can be changed to another bundle.</p>
45    /// <p>Use the <code>UpdateDistributionBundle</code> action to change your distribution's bundle.</p>
46    pub able_to_update_bundle: ::std::option::Option<bool>,
47    /// <p>The IP address type of the distribution.</p>
48    /// <p>The possible values are <code>ipv4</code> for IPv4 only, and <code>dualstack</code> for IPv4 and IPv6.</p>
49    pub ip_address_type: ::std::option::Option<crate::types::IpAddressType>,
50    /// <p>The tag keys and optional values for the resource. For more information about tags in Lightsail, see the <a href="https://docs.aws.amazon.com/lightsail/latest/userguide/amazon-lightsail-tags">Amazon Lightsail Developer Guide</a>.</p>
51    pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
52    /// <p>The minimum TLS protocol version that the distribution can use to communicate with viewers.</p>
53    pub viewer_minimum_tls_protocol_version: ::std::option::Option<::std::string::String>,
54}
55impl LightsailDistribution {
56    /// <p>The name of the distribution.</p>
57    pub fn name(&self) -> ::std::option::Option<&str> {
58        self.name.as_deref()
59    }
60    /// <p>The Amazon Resource Name (ARN) of the distribution.</p>
61    pub fn arn(&self) -> ::std::option::Option<&str> {
62        self.arn.as_deref()
63    }
64    /// <p>The support code. Include this code in your email to support when you have questions about your Lightsail distribution. This code enables our support team to look up your Lightsail information more easily.</p>
65    pub fn support_code(&self) -> ::std::option::Option<&str> {
66        self.support_code.as_deref()
67    }
68    /// <p>The timestamp when the distribution was created.</p>
69    pub fn created_at(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
70        self.created_at.as_ref()
71    }
72    /// <p>An object that describes the location of the distribution, such as the Amazon Web Services Region and Availability Zone.</p><note>
73    /// <p>Lightsail distributions are global resources that can reference an origin in any Amazon Web Services Region, and distribute its content globally. However, all distributions are located in the <code>us-east-1</code> Region.</p>
74    /// </note>
75    pub fn location(&self) -> ::std::option::Option<&crate::types::ResourceLocation> {
76        self.location.as_ref()
77    }
78    /// <p>The Lightsail resource type (<code>Distribution</code>).</p>
79    pub fn resource_type(&self) -> ::std::option::Option<&crate::types::ResourceType> {
80        self.resource_type.as_ref()
81    }
82    /// <p>The alternate domain names of the distribution.</p>
83    ///
84    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.alternative_domain_names.is_none()`.
85    pub fn alternative_domain_names(&self) -> &[::std::string::String] {
86        self.alternative_domain_names.as_deref().unwrap_or_default()
87    }
88    /// <p>The status of the distribution.</p>
89    pub fn status(&self) -> ::std::option::Option<&str> {
90        self.status.as_deref()
91    }
92    /// <p>Indicates whether the distribution is enabled.</p>
93    pub fn is_enabled(&self) -> ::std::option::Option<bool> {
94        self.is_enabled
95    }
96    /// <p>The domain name of the distribution.</p>
97    pub fn domain_name(&self) -> ::std::option::Option<&str> {
98        self.domain_name.as_deref()
99    }
100    /// <p>The ID of the bundle currently applied to the distribution.</p>
101    pub fn bundle_id(&self) -> ::std::option::Option<&str> {
102        self.bundle_id.as_deref()
103    }
104    /// <p>The name of the SSL/TLS certificate attached to the distribution, if any.</p>
105    pub fn certificate_name(&self) -> ::std::option::Option<&str> {
106        self.certificate_name.as_deref()
107    }
108    /// <p>An object that describes the origin resource of the distribution, such as a Lightsail instance, bucket, or load balancer.</p>
109    /// <p>The distribution pulls, caches, and serves content from the origin.</p>
110    pub fn origin(&self) -> ::std::option::Option<&crate::types::Origin> {
111        self.origin.as_ref()
112    }
113    /// <p>The public DNS of the origin.</p>
114    pub fn origin_public_dns(&self) -> ::std::option::Option<&str> {
115        self.origin_public_dns.as_deref()
116    }
117    /// <p>An object that describes the default cache behavior of the distribution.</p>
118    pub fn default_cache_behavior(&self) -> ::std::option::Option<&crate::types::CacheBehavior> {
119        self.default_cache_behavior.as_ref()
120    }
121    /// <p>An object that describes the cache behavior settings of the distribution.</p>
122    pub fn cache_behavior_settings(&self) -> ::std::option::Option<&crate::types::CacheSettings> {
123        self.cache_behavior_settings.as_ref()
124    }
125    /// <p>An array of objects that describe the per-path cache behavior of the distribution.</p>
126    ///
127    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.cache_behaviors.is_none()`.
128    pub fn cache_behaviors(&self) -> &[crate::types::CacheBehaviorPerPath] {
129        self.cache_behaviors.as_deref().unwrap_or_default()
130    }
131    /// <p>Indicates whether the bundle that is currently applied to your distribution, specified using the <code>distributionName</code> parameter, can be changed to another bundle.</p>
132    /// <p>Use the <code>UpdateDistributionBundle</code> action to change your distribution's bundle.</p>
133    pub fn able_to_update_bundle(&self) -> ::std::option::Option<bool> {
134        self.able_to_update_bundle
135    }
136    /// <p>The IP address type of the distribution.</p>
137    /// <p>The possible values are <code>ipv4</code> for IPv4 only, and <code>dualstack</code> for IPv4 and IPv6.</p>
138    pub fn ip_address_type(&self) -> ::std::option::Option<&crate::types::IpAddressType> {
139        self.ip_address_type.as_ref()
140    }
141    /// <p>The tag keys and optional values for the resource. For more information about tags in Lightsail, see the <a href="https://docs.aws.amazon.com/lightsail/latest/userguide/amazon-lightsail-tags">Amazon Lightsail Developer Guide</a>.</p>
142    ///
143    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.tags.is_none()`.
144    pub fn tags(&self) -> &[crate::types::Tag] {
145        self.tags.as_deref().unwrap_or_default()
146    }
147    /// <p>The minimum TLS protocol version that the distribution can use to communicate with viewers.</p>
148    pub fn viewer_minimum_tls_protocol_version(&self) -> ::std::option::Option<&str> {
149        self.viewer_minimum_tls_protocol_version.as_deref()
150    }
151}
152impl LightsailDistribution {
153    /// Creates a new builder-style object to manufacture [`LightsailDistribution`](crate::types::LightsailDistribution).
154    pub fn builder() -> crate::types::builders::LightsailDistributionBuilder {
155        crate::types::builders::LightsailDistributionBuilder::default()
156    }
157}
158
159/// A builder for [`LightsailDistribution`](crate::types::LightsailDistribution).
160#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
161#[non_exhaustive]
162pub struct LightsailDistributionBuilder {
163    pub(crate) name: ::std::option::Option<::std::string::String>,
164    pub(crate) arn: ::std::option::Option<::std::string::String>,
165    pub(crate) support_code: ::std::option::Option<::std::string::String>,
166    pub(crate) created_at: ::std::option::Option<::aws_smithy_types::DateTime>,
167    pub(crate) location: ::std::option::Option<crate::types::ResourceLocation>,
168    pub(crate) resource_type: ::std::option::Option<crate::types::ResourceType>,
169    pub(crate) alternative_domain_names: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
170    pub(crate) status: ::std::option::Option<::std::string::String>,
171    pub(crate) is_enabled: ::std::option::Option<bool>,
172    pub(crate) domain_name: ::std::option::Option<::std::string::String>,
173    pub(crate) bundle_id: ::std::option::Option<::std::string::String>,
174    pub(crate) certificate_name: ::std::option::Option<::std::string::String>,
175    pub(crate) origin: ::std::option::Option<crate::types::Origin>,
176    pub(crate) origin_public_dns: ::std::option::Option<::std::string::String>,
177    pub(crate) default_cache_behavior: ::std::option::Option<crate::types::CacheBehavior>,
178    pub(crate) cache_behavior_settings: ::std::option::Option<crate::types::CacheSettings>,
179    pub(crate) cache_behaviors: ::std::option::Option<::std::vec::Vec<crate::types::CacheBehaviorPerPath>>,
180    pub(crate) able_to_update_bundle: ::std::option::Option<bool>,
181    pub(crate) ip_address_type: ::std::option::Option<crate::types::IpAddressType>,
182    pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
183    pub(crate) viewer_minimum_tls_protocol_version: ::std::option::Option<::std::string::String>,
184}
185impl LightsailDistributionBuilder {
186    /// <p>The name of the distribution.</p>
187    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
188        self.name = ::std::option::Option::Some(input.into());
189        self
190    }
191    /// <p>The name of the distribution.</p>
192    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
193        self.name = input;
194        self
195    }
196    /// <p>The name of the distribution.</p>
197    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
198        &self.name
199    }
200    /// <p>The Amazon Resource Name (ARN) of the distribution.</p>
201    pub fn arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
202        self.arn = ::std::option::Option::Some(input.into());
203        self
204    }
205    /// <p>The Amazon Resource Name (ARN) of the distribution.</p>
206    pub fn set_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
207        self.arn = input;
208        self
209    }
210    /// <p>The Amazon Resource Name (ARN) of the distribution.</p>
211    pub fn get_arn(&self) -> &::std::option::Option<::std::string::String> {
212        &self.arn
213    }
214    /// <p>The support code. Include this code in your email to support when you have questions about your Lightsail distribution. This code enables our support team to look up your Lightsail information more easily.</p>
215    pub fn support_code(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
216        self.support_code = ::std::option::Option::Some(input.into());
217        self
218    }
219    /// <p>The support code. Include this code in your email to support when you have questions about your Lightsail distribution. This code enables our support team to look up your Lightsail information more easily.</p>
220    pub fn set_support_code(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
221        self.support_code = input;
222        self
223    }
224    /// <p>The support code. Include this code in your email to support when you have questions about your Lightsail distribution. This code enables our support team to look up your Lightsail information more easily.</p>
225    pub fn get_support_code(&self) -> &::std::option::Option<::std::string::String> {
226        &self.support_code
227    }
228    /// <p>The timestamp when the distribution was created.</p>
229    pub fn created_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
230        self.created_at = ::std::option::Option::Some(input);
231        self
232    }
233    /// <p>The timestamp when the distribution was created.</p>
234    pub fn set_created_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
235        self.created_at = input;
236        self
237    }
238    /// <p>The timestamp when the distribution was created.</p>
239    pub fn get_created_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
240        &self.created_at
241    }
242    /// <p>An object that describes the location of the distribution, such as the Amazon Web Services Region and Availability Zone.</p><note>
243    /// <p>Lightsail distributions are global resources that can reference an origin in any Amazon Web Services Region, and distribute its content globally. However, all distributions are located in the <code>us-east-1</code> Region.</p>
244    /// </note>
245    pub fn location(mut self, input: crate::types::ResourceLocation) -> Self {
246        self.location = ::std::option::Option::Some(input);
247        self
248    }
249    /// <p>An object that describes the location of the distribution, such as the Amazon Web Services Region and Availability Zone.</p><note>
250    /// <p>Lightsail distributions are global resources that can reference an origin in any Amazon Web Services Region, and distribute its content globally. However, all distributions are located in the <code>us-east-1</code> Region.</p>
251    /// </note>
252    pub fn set_location(mut self, input: ::std::option::Option<crate::types::ResourceLocation>) -> Self {
253        self.location = input;
254        self
255    }
256    /// <p>An object that describes the location of the distribution, such as the Amazon Web Services Region and Availability Zone.</p><note>
257    /// <p>Lightsail distributions are global resources that can reference an origin in any Amazon Web Services Region, and distribute its content globally. However, all distributions are located in the <code>us-east-1</code> Region.</p>
258    /// </note>
259    pub fn get_location(&self) -> &::std::option::Option<crate::types::ResourceLocation> {
260        &self.location
261    }
262    /// <p>The Lightsail resource type (<code>Distribution</code>).</p>
263    pub fn resource_type(mut self, input: crate::types::ResourceType) -> Self {
264        self.resource_type = ::std::option::Option::Some(input);
265        self
266    }
267    /// <p>The Lightsail resource type (<code>Distribution</code>).</p>
268    pub fn set_resource_type(mut self, input: ::std::option::Option<crate::types::ResourceType>) -> Self {
269        self.resource_type = input;
270        self
271    }
272    /// <p>The Lightsail resource type (<code>Distribution</code>).</p>
273    pub fn get_resource_type(&self) -> &::std::option::Option<crate::types::ResourceType> {
274        &self.resource_type
275    }
276    /// Appends an item to `alternative_domain_names`.
277    ///
278    /// To override the contents of this collection use [`set_alternative_domain_names`](Self::set_alternative_domain_names).
279    ///
280    /// <p>The alternate domain names of the distribution.</p>
281    pub fn alternative_domain_names(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
282        let mut v = self.alternative_domain_names.unwrap_or_default();
283        v.push(input.into());
284        self.alternative_domain_names = ::std::option::Option::Some(v);
285        self
286    }
287    /// <p>The alternate domain names of the distribution.</p>
288    pub fn set_alternative_domain_names(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
289        self.alternative_domain_names = input;
290        self
291    }
292    /// <p>The alternate domain names of the distribution.</p>
293    pub fn get_alternative_domain_names(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
294        &self.alternative_domain_names
295    }
296    /// <p>The status of the distribution.</p>
297    pub fn status(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
298        self.status = ::std::option::Option::Some(input.into());
299        self
300    }
301    /// <p>The status of the distribution.</p>
302    pub fn set_status(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
303        self.status = input;
304        self
305    }
306    /// <p>The status of the distribution.</p>
307    pub fn get_status(&self) -> &::std::option::Option<::std::string::String> {
308        &self.status
309    }
310    /// <p>Indicates whether the distribution is enabled.</p>
311    pub fn is_enabled(mut self, input: bool) -> Self {
312        self.is_enabled = ::std::option::Option::Some(input);
313        self
314    }
315    /// <p>Indicates whether the distribution is enabled.</p>
316    pub fn set_is_enabled(mut self, input: ::std::option::Option<bool>) -> Self {
317        self.is_enabled = input;
318        self
319    }
320    /// <p>Indicates whether the distribution is enabled.</p>
321    pub fn get_is_enabled(&self) -> &::std::option::Option<bool> {
322        &self.is_enabled
323    }
324    /// <p>The domain name of the distribution.</p>
325    pub fn domain_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
326        self.domain_name = ::std::option::Option::Some(input.into());
327        self
328    }
329    /// <p>The domain name of the distribution.</p>
330    pub fn set_domain_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
331        self.domain_name = input;
332        self
333    }
334    /// <p>The domain name of the distribution.</p>
335    pub fn get_domain_name(&self) -> &::std::option::Option<::std::string::String> {
336        &self.domain_name
337    }
338    /// <p>The ID of the bundle currently applied to the distribution.</p>
339    pub fn bundle_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
340        self.bundle_id = ::std::option::Option::Some(input.into());
341        self
342    }
343    /// <p>The ID of the bundle currently applied to the distribution.</p>
344    pub fn set_bundle_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
345        self.bundle_id = input;
346        self
347    }
348    /// <p>The ID of the bundle currently applied to the distribution.</p>
349    pub fn get_bundle_id(&self) -> &::std::option::Option<::std::string::String> {
350        &self.bundle_id
351    }
352    /// <p>The name of the SSL/TLS certificate attached to the distribution, if any.</p>
353    pub fn certificate_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
354        self.certificate_name = ::std::option::Option::Some(input.into());
355        self
356    }
357    /// <p>The name of the SSL/TLS certificate attached to the distribution, if any.</p>
358    pub fn set_certificate_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
359        self.certificate_name = input;
360        self
361    }
362    /// <p>The name of the SSL/TLS certificate attached to the distribution, if any.</p>
363    pub fn get_certificate_name(&self) -> &::std::option::Option<::std::string::String> {
364        &self.certificate_name
365    }
366    /// <p>An object that describes the origin resource of the distribution, such as a Lightsail instance, bucket, or load balancer.</p>
367    /// <p>The distribution pulls, caches, and serves content from the origin.</p>
368    pub fn origin(mut self, input: crate::types::Origin) -> Self {
369        self.origin = ::std::option::Option::Some(input);
370        self
371    }
372    /// <p>An object that describes the origin resource of the distribution, such as a Lightsail instance, bucket, or load balancer.</p>
373    /// <p>The distribution pulls, caches, and serves content from the origin.</p>
374    pub fn set_origin(mut self, input: ::std::option::Option<crate::types::Origin>) -> Self {
375        self.origin = input;
376        self
377    }
378    /// <p>An object that describes the origin resource of the distribution, such as a Lightsail instance, bucket, or load balancer.</p>
379    /// <p>The distribution pulls, caches, and serves content from the origin.</p>
380    pub fn get_origin(&self) -> &::std::option::Option<crate::types::Origin> {
381        &self.origin
382    }
383    /// <p>The public DNS of the origin.</p>
384    pub fn origin_public_dns(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
385        self.origin_public_dns = ::std::option::Option::Some(input.into());
386        self
387    }
388    /// <p>The public DNS of the origin.</p>
389    pub fn set_origin_public_dns(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
390        self.origin_public_dns = input;
391        self
392    }
393    /// <p>The public DNS of the origin.</p>
394    pub fn get_origin_public_dns(&self) -> &::std::option::Option<::std::string::String> {
395        &self.origin_public_dns
396    }
397    /// <p>An object that describes the default cache behavior of the distribution.</p>
398    pub fn default_cache_behavior(mut self, input: crate::types::CacheBehavior) -> Self {
399        self.default_cache_behavior = ::std::option::Option::Some(input);
400        self
401    }
402    /// <p>An object that describes the default cache behavior of the distribution.</p>
403    pub fn set_default_cache_behavior(mut self, input: ::std::option::Option<crate::types::CacheBehavior>) -> Self {
404        self.default_cache_behavior = input;
405        self
406    }
407    /// <p>An object that describes the default cache behavior of the distribution.</p>
408    pub fn get_default_cache_behavior(&self) -> &::std::option::Option<crate::types::CacheBehavior> {
409        &self.default_cache_behavior
410    }
411    /// <p>An object that describes the cache behavior settings of the distribution.</p>
412    pub fn cache_behavior_settings(mut self, input: crate::types::CacheSettings) -> Self {
413        self.cache_behavior_settings = ::std::option::Option::Some(input);
414        self
415    }
416    /// <p>An object that describes the cache behavior settings of the distribution.</p>
417    pub fn set_cache_behavior_settings(mut self, input: ::std::option::Option<crate::types::CacheSettings>) -> Self {
418        self.cache_behavior_settings = input;
419        self
420    }
421    /// <p>An object that describes the cache behavior settings of the distribution.</p>
422    pub fn get_cache_behavior_settings(&self) -> &::std::option::Option<crate::types::CacheSettings> {
423        &self.cache_behavior_settings
424    }
425    /// Appends an item to `cache_behaviors`.
426    ///
427    /// To override the contents of this collection use [`set_cache_behaviors`](Self::set_cache_behaviors).
428    ///
429    /// <p>An array of objects that describe the per-path cache behavior of the distribution.</p>
430    pub fn cache_behaviors(mut self, input: crate::types::CacheBehaviorPerPath) -> Self {
431        let mut v = self.cache_behaviors.unwrap_or_default();
432        v.push(input);
433        self.cache_behaviors = ::std::option::Option::Some(v);
434        self
435    }
436    /// <p>An array of objects that describe the per-path cache behavior of the distribution.</p>
437    pub fn set_cache_behaviors(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::CacheBehaviorPerPath>>) -> Self {
438        self.cache_behaviors = input;
439        self
440    }
441    /// <p>An array of objects that describe the per-path cache behavior of the distribution.</p>
442    pub fn get_cache_behaviors(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::CacheBehaviorPerPath>> {
443        &self.cache_behaviors
444    }
445    /// <p>Indicates whether the bundle that is currently applied to your distribution, specified using the <code>distributionName</code> parameter, can be changed to another bundle.</p>
446    /// <p>Use the <code>UpdateDistributionBundle</code> action to change your distribution's bundle.</p>
447    pub fn able_to_update_bundle(mut self, input: bool) -> Self {
448        self.able_to_update_bundle = ::std::option::Option::Some(input);
449        self
450    }
451    /// <p>Indicates whether the bundle that is currently applied to your distribution, specified using the <code>distributionName</code> parameter, can be changed to another bundle.</p>
452    /// <p>Use the <code>UpdateDistributionBundle</code> action to change your distribution's bundle.</p>
453    pub fn set_able_to_update_bundle(mut self, input: ::std::option::Option<bool>) -> Self {
454        self.able_to_update_bundle = input;
455        self
456    }
457    /// <p>Indicates whether the bundle that is currently applied to your distribution, specified using the <code>distributionName</code> parameter, can be changed to another bundle.</p>
458    /// <p>Use the <code>UpdateDistributionBundle</code> action to change your distribution's bundle.</p>
459    pub fn get_able_to_update_bundle(&self) -> &::std::option::Option<bool> {
460        &self.able_to_update_bundle
461    }
462    /// <p>The IP address type of the distribution.</p>
463    /// <p>The possible values are <code>ipv4</code> for IPv4 only, and <code>dualstack</code> for IPv4 and IPv6.</p>
464    pub fn ip_address_type(mut self, input: crate::types::IpAddressType) -> Self {
465        self.ip_address_type = ::std::option::Option::Some(input);
466        self
467    }
468    /// <p>The IP address type of the distribution.</p>
469    /// <p>The possible values are <code>ipv4</code> for IPv4 only, and <code>dualstack</code> for IPv4 and IPv6.</p>
470    pub fn set_ip_address_type(mut self, input: ::std::option::Option<crate::types::IpAddressType>) -> Self {
471        self.ip_address_type = input;
472        self
473    }
474    /// <p>The IP address type of the distribution.</p>
475    /// <p>The possible values are <code>ipv4</code> for IPv4 only, and <code>dualstack</code> for IPv4 and IPv6.</p>
476    pub fn get_ip_address_type(&self) -> &::std::option::Option<crate::types::IpAddressType> {
477        &self.ip_address_type
478    }
479    /// Appends an item to `tags`.
480    ///
481    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
482    ///
483    /// <p>The tag keys and optional values for the resource. For more information about tags in Lightsail, see the <a href="https://docs.aws.amazon.com/lightsail/latest/userguide/amazon-lightsail-tags">Amazon Lightsail Developer Guide</a>.</p>
484    pub fn tags(mut self, input: crate::types::Tag) -> Self {
485        let mut v = self.tags.unwrap_or_default();
486        v.push(input);
487        self.tags = ::std::option::Option::Some(v);
488        self
489    }
490    /// <p>The tag keys and optional values for the resource. For more information about tags in Lightsail, see the <a href="https://docs.aws.amazon.com/lightsail/latest/userguide/amazon-lightsail-tags">Amazon Lightsail Developer Guide</a>.</p>
491    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
492        self.tags = input;
493        self
494    }
495    /// <p>The tag keys and optional values for the resource. For more information about tags in Lightsail, see the <a href="https://docs.aws.amazon.com/lightsail/latest/userguide/amazon-lightsail-tags">Amazon Lightsail Developer Guide</a>.</p>
496    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
497        &self.tags
498    }
499    /// <p>The minimum TLS protocol version that the distribution can use to communicate with viewers.</p>
500    pub fn viewer_minimum_tls_protocol_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
501        self.viewer_minimum_tls_protocol_version = ::std::option::Option::Some(input.into());
502        self
503    }
504    /// <p>The minimum TLS protocol version that the distribution can use to communicate with viewers.</p>
505    pub fn set_viewer_minimum_tls_protocol_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
506        self.viewer_minimum_tls_protocol_version = input;
507        self
508    }
509    /// <p>The minimum TLS protocol version that the distribution can use to communicate with viewers.</p>
510    pub fn get_viewer_minimum_tls_protocol_version(&self) -> &::std::option::Option<::std::string::String> {
511        &self.viewer_minimum_tls_protocol_version
512    }
513    /// Consumes the builder and constructs a [`LightsailDistribution`](crate::types::LightsailDistribution).
514    pub fn build(self) -> crate::types::LightsailDistribution {
515        crate::types::LightsailDistribution {
516            name: self.name,
517            arn: self.arn,
518            support_code: self.support_code,
519            created_at: self.created_at,
520            location: self.location,
521            resource_type: self.resource_type,
522            alternative_domain_names: self.alternative_domain_names,
523            status: self.status,
524            is_enabled: self.is_enabled,
525            domain_name: self.domain_name,
526            bundle_id: self.bundle_id,
527            certificate_name: self.certificate_name,
528            origin: self.origin,
529            origin_public_dns: self.origin_public_dns,
530            default_cache_behavior: self.default_cache_behavior,
531            cache_behavior_settings: self.cache_behavior_settings,
532            cache_behaviors: self.cache_behaviors,
533            able_to_update_bundle: self.able_to_update_bundle,
534            ip_address_type: self.ip_address_type,
535            tags: self.tags,
536            viewer_minimum_tls_protocol_version: self.viewer_minimum_tls_protocol_version,
537        }
538    }
539}