aws_sdk_lightsail/operation/create_distribution/
_create_distribution_output.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct CreateDistributionOutput {
6    /// <p>An object that describes the distribution created.</p>
7    pub distribution: ::std::option::Option<crate::types::LightsailDistribution>,
8    /// <p>An array of objects that describe the result of the action, such as the status of the request, the timestamp of the request, and the resources affected by the request.</p>
9    pub operation: ::std::option::Option<crate::types::Operation>,
10    _request_id: Option<String>,
11}
12impl CreateDistributionOutput {
13    /// <p>An object that describes the distribution created.</p>
14    pub fn distribution(&self) -> ::std::option::Option<&crate::types::LightsailDistribution> {
15        self.distribution.as_ref()
16    }
17    /// <p>An array of objects that describe the result of the action, such as the status of the request, the timestamp of the request, and the resources affected by the request.</p>
18    pub fn operation(&self) -> ::std::option::Option<&crate::types::Operation> {
19        self.operation.as_ref()
20    }
21}
22impl ::aws_types::request_id::RequestId for CreateDistributionOutput {
23    fn request_id(&self) -> Option<&str> {
24        self._request_id.as_deref()
25    }
26}
27impl CreateDistributionOutput {
28    /// Creates a new builder-style object to manufacture [`CreateDistributionOutput`](crate::operation::create_distribution::CreateDistributionOutput).
29    pub fn builder() -> crate::operation::create_distribution::builders::CreateDistributionOutputBuilder {
30        crate::operation::create_distribution::builders::CreateDistributionOutputBuilder::default()
31    }
32}
33
34/// A builder for [`CreateDistributionOutput`](crate::operation::create_distribution::CreateDistributionOutput).
35#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
36#[non_exhaustive]
37pub struct CreateDistributionOutputBuilder {
38    pub(crate) distribution: ::std::option::Option<crate::types::LightsailDistribution>,
39    pub(crate) operation: ::std::option::Option<crate::types::Operation>,
40    _request_id: Option<String>,
41}
42impl CreateDistributionOutputBuilder {
43    /// <p>An object that describes the distribution created.</p>
44    pub fn distribution(mut self, input: crate::types::LightsailDistribution) -> Self {
45        self.distribution = ::std::option::Option::Some(input);
46        self
47    }
48    /// <p>An object that describes the distribution created.</p>
49    pub fn set_distribution(mut self, input: ::std::option::Option<crate::types::LightsailDistribution>) -> Self {
50        self.distribution = input;
51        self
52    }
53    /// <p>An object that describes the distribution created.</p>
54    pub fn get_distribution(&self) -> &::std::option::Option<crate::types::LightsailDistribution> {
55        &self.distribution
56    }
57    /// <p>An array of objects that describe the result of the action, such as the status of the request, the timestamp of the request, and the resources affected by the request.</p>
58    pub fn operation(mut self, input: crate::types::Operation) -> Self {
59        self.operation = ::std::option::Option::Some(input);
60        self
61    }
62    /// <p>An array of objects that describe the result of the action, such as the status of the request, the timestamp of the request, and the resources affected by the request.</p>
63    pub fn set_operation(mut self, input: ::std::option::Option<crate::types::Operation>) -> Self {
64        self.operation = input;
65        self
66    }
67    /// <p>An array of objects that describe the result of the action, such as the status of the request, the timestamp of the request, and the resources affected by the request.</p>
68    pub fn get_operation(&self) -> &::std::option::Option<crate::types::Operation> {
69        &self.operation
70    }
71    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
72        self._request_id = Some(request_id.into());
73        self
74    }
75
76    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
77        self._request_id = request_id;
78        self
79    }
80    /// Consumes the builder and constructs a [`CreateDistributionOutput`](crate::operation::create_distribution::CreateDistributionOutput).
81    pub fn build(self) -> crate::operation::create_distribution::CreateDistributionOutput {
82        crate::operation::create_distribution::CreateDistributionOutput {
83            distribution: self.distribution,
84            operation: self.operation,
85            _request_id: self._request_id,
86        }
87    }
88}