aws_sdk_cloudfront/operation/get_distribution/
_get_distribution_output.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>The returned result of the corresponding request.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct GetDistributionOutput {
7    /// <p>The distribution's information.</p>
8    pub distribution: ::std::option::Option<crate::types::Distribution>,
9    /// <p>The current version of the distribution's information. For example: <code>E2QWRUHAPOMQZL</code>.</p>
10    pub e_tag: ::std::option::Option<::std::string::String>,
11    _request_id: Option<String>,
12}
13impl GetDistributionOutput {
14    /// <p>The distribution's information.</p>
15    pub fn distribution(&self) -> ::std::option::Option<&crate::types::Distribution> {
16        self.distribution.as_ref()
17    }
18    /// <p>The current version of the distribution's information. For example: <code>E2QWRUHAPOMQZL</code>.</p>
19    pub fn e_tag(&self) -> ::std::option::Option<&str> {
20        self.e_tag.as_deref()
21    }
22}
23impl ::aws_types::request_id::RequestId for GetDistributionOutput {
24    fn request_id(&self) -> Option<&str> {
25        self._request_id.as_deref()
26    }
27}
28impl GetDistributionOutput {
29    /// Creates a new builder-style object to manufacture [`GetDistributionOutput`](crate::operation::get_distribution::GetDistributionOutput).
30    pub fn builder() -> crate::operation::get_distribution::builders::GetDistributionOutputBuilder {
31        crate::operation::get_distribution::builders::GetDistributionOutputBuilder::default()
32    }
33}
34
35/// A builder for [`GetDistributionOutput`](crate::operation::get_distribution::GetDistributionOutput).
36#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
37#[non_exhaustive]
38pub struct GetDistributionOutputBuilder {
39    pub(crate) distribution: ::std::option::Option<crate::types::Distribution>,
40    pub(crate) e_tag: ::std::option::Option<::std::string::String>,
41    _request_id: Option<String>,
42}
43impl GetDistributionOutputBuilder {
44    /// <p>The distribution's information.</p>
45    pub fn distribution(mut self, input: crate::types::Distribution) -> Self {
46        self.distribution = ::std::option::Option::Some(input);
47        self
48    }
49    /// <p>The distribution's information.</p>
50    pub fn set_distribution(mut self, input: ::std::option::Option<crate::types::Distribution>) -> Self {
51        self.distribution = input;
52        self
53    }
54    /// <p>The distribution's information.</p>
55    pub fn get_distribution(&self) -> &::std::option::Option<crate::types::Distribution> {
56        &self.distribution
57    }
58    /// <p>The current version of the distribution's information. For example: <code>E2QWRUHAPOMQZL</code>.</p>
59    pub fn e_tag(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
60        self.e_tag = ::std::option::Option::Some(input.into());
61        self
62    }
63    /// <p>The current version of the distribution's information. For example: <code>E2QWRUHAPOMQZL</code>.</p>
64    pub fn set_e_tag(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
65        self.e_tag = input;
66        self
67    }
68    /// <p>The current version of the distribution's information. For example: <code>E2QWRUHAPOMQZL</code>.</p>
69    pub fn get_e_tag(&self) -> &::std::option::Option<::std::string::String> {
70        &self.e_tag
71    }
72    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
73        self._request_id = Some(request_id.into());
74        self
75    }
76
77    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
78        self._request_id = request_id;
79        self
80    }
81    /// Consumes the builder and constructs a [`GetDistributionOutput`](crate::operation::get_distribution::GetDistributionOutput).
82    pub fn build(self) -> crate::operation::get_distribution::GetDistributionOutput {
83        crate::operation::get_distribution::GetDistributionOutput {
84            distribution: self.distribution,
85            e_tag: self.e_tag,
86            _request_id: self._request_id,
87        }
88    }
89}