aws_sdk_apigateway/operation/create_deployment/
_create_deployment_output.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>An immutable representation of a RestApi resource that can be called by users using Stages. A deployment must be associated with a Stage for it to be callable over the Internet.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct CreateDeploymentOutput {
7    /// <p>The identifier for the deployment resource.</p>
8    pub id: ::std::option::Option<::std::string::String>,
9    /// <p>The description for the deployment resource.</p>
10    pub description: ::std::option::Option<::std::string::String>,
11    /// <p>The date and time that the deployment resource was created.</p>
12    pub created_date: ::std::option::Option<::aws_smithy_types::DateTime>,
13    /// <p>A summary of the RestApi at the date and time that the deployment resource was created.</p>
14    pub api_summary: ::std::option::Option<
15        ::std::collections::HashMap<::std::string::String, ::std::collections::HashMap<::std::string::String, crate::types::MethodSnapshot>>,
16    >,
17    _request_id: Option<String>,
18}
19impl CreateDeploymentOutput {
20    /// <p>The identifier for the deployment resource.</p>
21    pub fn id(&self) -> ::std::option::Option<&str> {
22        self.id.as_deref()
23    }
24    /// <p>The description for the deployment resource.</p>
25    pub fn description(&self) -> ::std::option::Option<&str> {
26        self.description.as_deref()
27    }
28    /// <p>The date and time that the deployment resource was created.</p>
29    pub fn created_date(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
30        self.created_date.as_ref()
31    }
32    /// <p>A summary of the RestApi at the date and time that the deployment resource was created.</p>
33    pub fn api_summary(
34        &self,
35    ) -> ::std::option::Option<
36        &::std::collections::HashMap<::std::string::String, ::std::collections::HashMap<::std::string::String, crate::types::MethodSnapshot>>,
37    > {
38        self.api_summary.as_ref()
39    }
40}
41impl ::aws_types::request_id::RequestId for CreateDeploymentOutput {
42    fn request_id(&self) -> Option<&str> {
43        self._request_id.as_deref()
44    }
45}
46impl CreateDeploymentOutput {
47    /// Creates a new builder-style object to manufacture [`CreateDeploymentOutput`](crate::operation::create_deployment::CreateDeploymentOutput).
48    pub fn builder() -> crate::operation::create_deployment::builders::CreateDeploymentOutputBuilder {
49        crate::operation::create_deployment::builders::CreateDeploymentOutputBuilder::default()
50    }
51}
52
53/// A builder for [`CreateDeploymentOutput`](crate::operation::create_deployment::CreateDeploymentOutput).
54#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
55#[non_exhaustive]
56pub struct CreateDeploymentOutputBuilder {
57    pub(crate) id: ::std::option::Option<::std::string::String>,
58    pub(crate) description: ::std::option::Option<::std::string::String>,
59    pub(crate) created_date: ::std::option::Option<::aws_smithy_types::DateTime>,
60    pub(crate) api_summary: ::std::option::Option<
61        ::std::collections::HashMap<::std::string::String, ::std::collections::HashMap<::std::string::String, crate::types::MethodSnapshot>>,
62    >,
63    _request_id: Option<String>,
64}
65impl CreateDeploymentOutputBuilder {
66    /// <p>The identifier for the deployment resource.</p>
67    pub fn id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
68        self.id = ::std::option::Option::Some(input.into());
69        self
70    }
71    /// <p>The identifier for the deployment resource.</p>
72    pub fn set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
73        self.id = input;
74        self
75    }
76    /// <p>The identifier for the deployment resource.</p>
77    pub fn get_id(&self) -> &::std::option::Option<::std::string::String> {
78        &self.id
79    }
80    /// <p>The description for the deployment resource.</p>
81    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
82        self.description = ::std::option::Option::Some(input.into());
83        self
84    }
85    /// <p>The description for the deployment resource.</p>
86    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
87        self.description = input;
88        self
89    }
90    /// <p>The description for the deployment resource.</p>
91    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
92        &self.description
93    }
94    /// <p>The date and time that the deployment resource was created.</p>
95    pub fn created_date(mut self, input: ::aws_smithy_types::DateTime) -> Self {
96        self.created_date = ::std::option::Option::Some(input);
97        self
98    }
99    /// <p>The date and time that the deployment resource was created.</p>
100    pub fn set_created_date(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
101        self.created_date = input;
102        self
103    }
104    /// <p>The date and time that the deployment resource was created.</p>
105    pub fn get_created_date(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
106        &self.created_date
107    }
108    /// Adds a key-value pair to `api_summary`.
109    ///
110    /// To override the contents of this collection use [`set_api_summary`](Self::set_api_summary).
111    ///
112    /// <p>A summary of the RestApi at the date and time that the deployment resource was created.</p>
113    pub fn api_summary(
114        mut self,
115        k: impl ::std::convert::Into<::std::string::String>,
116        v: ::std::collections::HashMap<::std::string::String, crate::types::MethodSnapshot>,
117    ) -> Self {
118        let mut hash_map = self.api_summary.unwrap_or_default();
119        hash_map.insert(k.into(), v);
120        self.api_summary = ::std::option::Option::Some(hash_map);
121        self
122    }
123    /// <p>A summary of the RestApi at the date and time that the deployment resource was created.</p>
124    pub fn set_api_summary(
125        mut self,
126        input: ::std::option::Option<
127            ::std::collections::HashMap<::std::string::String, ::std::collections::HashMap<::std::string::String, crate::types::MethodSnapshot>>,
128        >,
129    ) -> Self {
130        self.api_summary = input;
131        self
132    }
133    /// <p>A summary of the RestApi at the date and time that the deployment resource was created.</p>
134    pub fn get_api_summary(
135        &self,
136    ) -> &::std::option::Option<
137        ::std::collections::HashMap<::std::string::String, ::std::collections::HashMap<::std::string::String, crate::types::MethodSnapshot>>,
138    > {
139        &self.api_summary
140    }
141    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
142        self._request_id = Some(request_id.into());
143        self
144    }
145
146    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
147        self._request_id = request_id;
148        self
149    }
150    /// Consumes the builder and constructs a [`CreateDeploymentOutput`](crate::operation::create_deployment::CreateDeploymentOutput).
151    pub fn build(self) -> crate::operation::create_deployment::CreateDeploymentOutput {
152        crate::operation::create_deployment::CreateDeploymentOutput {
153            id: self.id,
154            description: self.description,
155            created_date: self.created_date,
156            api_summary: self.api_summary,
157            _request_id: self._request_id,
158        }
159    }
160}