aws_sdk_cloudfront/operation/update_distribution/
_update_distribution_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>The request to update a distribution.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct UpdateDistributionInput {
7    /// <p>The distribution's configuration information.</p>
8    pub distribution_config: ::std::option::Option<crate::types::DistributionConfig>,
9    /// <p>The distribution's id.</p>
10    pub id: ::std::option::Option<::std::string::String>,
11    /// <p>The value of the <code>ETag</code> header that you received when retrieving the distribution's configuration. For example: <code>E2QWRUHAPOMQZL</code>.</p>
12    pub if_match: ::std::option::Option<::std::string::String>,
13}
14impl UpdateDistributionInput {
15    /// <p>The distribution's configuration information.</p>
16    pub fn distribution_config(&self) -> ::std::option::Option<&crate::types::DistributionConfig> {
17        self.distribution_config.as_ref()
18    }
19    /// <p>The distribution's id.</p>
20    pub fn id(&self) -> ::std::option::Option<&str> {
21        self.id.as_deref()
22    }
23    /// <p>The value of the <code>ETag</code> header that you received when retrieving the distribution's configuration. For example: <code>E2QWRUHAPOMQZL</code>.</p>
24    pub fn if_match(&self) -> ::std::option::Option<&str> {
25        self.if_match.as_deref()
26    }
27}
28impl UpdateDistributionInput {
29    /// Creates a new builder-style object to manufacture [`UpdateDistributionInput`](crate::operation::update_distribution::UpdateDistributionInput).
30    pub fn builder() -> crate::operation::update_distribution::builders::UpdateDistributionInputBuilder {
31        crate::operation::update_distribution::builders::UpdateDistributionInputBuilder::default()
32    }
33}
34
35/// A builder for [`UpdateDistributionInput`](crate::operation::update_distribution::UpdateDistributionInput).
36#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
37#[non_exhaustive]
38pub struct UpdateDistributionInputBuilder {
39    pub(crate) distribution_config: ::std::option::Option<crate::types::DistributionConfig>,
40    pub(crate) id: ::std::option::Option<::std::string::String>,
41    pub(crate) if_match: ::std::option::Option<::std::string::String>,
42}
43impl UpdateDistributionInputBuilder {
44    /// <p>The distribution's configuration information.</p>
45    /// This field is required.
46    pub fn distribution_config(mut self, input: crate::types::DistributionConfig) -> Self {
47        self.distribution_config = ::std::option::Option::Some(input);
48        self
49    }
50    /// <p>The distribution's configuration information.</p>
51    pub fn set_distribution_config(mut self, input: ::std::option::Option<crate::types::DistributionConfig>) -> Self {
52        self.distribution_config = input;
53        self
54    }
55    /// <p>The distribution's configuration information.</p>
56    pub fn get_distribution_config(&self) -> &::std::option::Option<crate::types::DistributionConfig> {
57        &self.distribution_config
58    }
59    /// <p>The distribution's id.</p>
60    /// This field is required.
61    pub fn id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
62        self.id = ::std::option::Option::Some(input.into());
63        self
64    }
65    /// <p>The distribution's id.</p>
66    pub fn set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
67        self.id = input;
68        self
69    }
70    /// <p>The distribution's id.</p>
71    pub fn get_id(&self) -> &::std::option::Option<::std::string::String> {
72        &self.id
73    }
74    /// <p>The value of the <code>ETag</code> header that you received when retrieving the distribution's configuration. For example: <code>E2QWRUHAPOMQZL</code>.</p>
75    pub fn if_match(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
76        self.if_match = ::std::option::Option::Some(input.into());
77        self
78    }
79    /// <p>The value of the <code>ETag</code> header that you received when retrieving the distribution's configuration. For example: <code>E2QWRUHAPOMQZL</code>.</p>
80    pub fn set_if_match(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
81        self.if_match = input;
82        self
83    }
84    /// <p>The value of the <code>ETag</code> header that you received when retrieving the distribution's configuration. For example: <code>E2QWRUHAPOMQZL</code>.</p>
85    pub fn get_if_match(&self) -> &::std::option::Option<::std::string::String> {
86        &self.if_match
87    }
88    /// Consumes the builder and constructs a [`UpdateDistributionInput`](crate::operation::update_distribution::UpdateDistributionInput).
89    pub fn build(
90        self,
91    ) -> ::std::result::Result<crate::operation::update_distribution::UpdateDistributionInput, ::aws_smithy_types::error::operation::BuildError> {
92        ::std::result::Result::Ok(crate::operation::update_distribution::UpdateDistributionInput {
93            distribution_config: self.distribution_config,
94            id: self.id,
95            if_match: self.if_match,
96        })
97    }
98}