aws_sdk_cloudfront/operation/create_distribution/
_create_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 CreateDistributionOutput {
7    /// <p>The distribution's information.</p>
8    pub distribution: ::std::option::Option<crate::types::Distribution>,
9    /// <p>The fully qualified URI of the new distribution resource just created.</p>
10    pub location: ::std::option::Option<::std::string::String>,
11    /// <p>The current version of the distribution created.</p>
12    pub e_tag: ::std::option::Option<::std::string::String>,
13    _request_id: Option<String>,
14}
15impl CreateDistributionOutput {
16    /// <p>The distribution's information.</p>
17    pub fn distribution(&self) -> ::std::option::Option<&crate::types::Distribution> {
18        self.distribution.as_ref()
19    }
20    /// <p>The fully qualified URI of the new distribution resource just created.</p>
21    pub fn location(&self) -> ::std::option::Option<&str> {
22        self.location.as_deref()
23    }
24    /// <p>The current version of the distribution created.</p>
25    pub fn e_tag(&self) -> ::std::option::Option<&str> {
26        self.e_tag.as_deref()
27    }
28}
29impl ::aws_types::request_id::RequestId for CreateDistributionOutput {
30    fn request_id(&self) -> Option<&str> {
31        self._request_id.as_deref()
32    }
33}
34impl CreateDistributionOutput {
35    /// Creates a new builder-style object to manufacture [`CreateDistributionOutput`](crate::operation::create_distribution::CreateDistributionOutput).
36    pub fn builder() -> crate::operation::create_distribution::builders::CreateDistributionOutputBuilder {
37        crate::operation::create_distribution::builders::CreateDistributionOutputBuilder::default()
38    }
39}
40
41/// A builder for [`CreateDistributionOutput`](crate::operation::create_distribution::CreateDistributionOutput).
42#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
43#[non_exhaustive]
44pub struct CreateDistributionOutputBuilder {
45    pub(crate) distribution: ::std::option::Option<crate::types::Distribution>,
46    pub(crate) location: ::std::option::Option<::std::string::String>,
47    pub(crate) e_tag: ::std::option::Option<::std::string::String>,
48    _request_id: Option<String>,
49}
50impl CreateDistributionOutputBuilder {
51    /// <p>The distribution's information.</p>
52    pub fn distribution(mut self, input: crate::types::Distribution) -> Self {
53        self.distribution = ::std::option::Option::Some(input);
54        self
55    }
56    /// <p>The distribution's information.</p>
57    pub fn set_distribution(mut self, input: ::std::option::Option<crate::types::Distribution>) -> Self {
58        self.distribution = input;
59        self
60    }
61    /// <p>The distribution's information.</p>
62    pub fn get_distribution(&self) -> &::std::option::Option<crate::types::Distribution> {
63        &self.distribution
64    }
65    /// <p>The fully qualified URI of the new distribution resource just created.</p>
66    pub fn location(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
67        self.location = ::std::option::Option::Some(input.into());
68        self
69    }
70    /// <p>The fully qualified URI of the new distribution resource just created.</p>
71    pub fn set_location(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
72        self.location = input;
73        self
74    }
75    /// <p>The fully qualified URI of the new distribution resource just created.</p>
76    pub fn get_location(&self) -> &::std::option::Option<::std::string::String> {
77        &self.location
78    }
79    /// <p>The current version of the distribution created.</p>
80    pub fn e_tag(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
81        self.e_tag = ::std::option::Option::Some(input.into());
82        self
83    }
84    /// <p>The current version of the distribution created.</p>
85    pub fn set_e_tag(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
86        self.e_tag = input;
87        self
88    }
89    /// <p>The current version of the distribution created.</p>
90    pub fn get_e_tag(&self) -> &::std::option::Option<::std::string::String> {
91        &self.e_tag
92    }
93    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
94        self._request_id = Some(request_id.into());
95        self
96    }
97
98    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
99        self._request_id = request_id;
100        self
101    }
102    /// Consumes the builder and constructs a [`CreateDistributionOutput`](crate::operation::create_distribution::CreateDistributionOutput).
103    pub fn build(self) -> crate::operation::create_distribution::CreateDistributionOutput {
104        crate::operation::create_distribution::CreateDistributionOutput {
105            distribution: self.distribution,
106            location: self.location,
107            e_tag: self.e_tag,
108            _request_id: self._request_id,
109        }
110    }
111}