aws_sdk_apigateway/types/
_deployment.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 Deployment {
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}
18impl Deployment {
19    /// <p>The identifier for the deployment resource.</p>
20    pub fn id(&self) -> ::std::option::Option<&str> {
21        self.id.as_deref()
22    }
23    /// <p>The description for the deployment resource.</p>
24    pub fn description(&self) -> ::std::option::Option<&str> {
25        self.description.as_deref()
26    }
27    /// <p>The date and time that the deployment resource was created.</p>
28    pub fn created_date(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
29        self.created_date.as_ref()
30    }
31    /// <p>A summary of the RestApi at the date and time that the deployment resource was created.</p>
32    pub fn api_summary(
33        &self,
34    ) -> ::std::option::Option<
35        &::std::collections::HashMap<::std::string::String, ::std::collections::HashMap<::std::string::String, crate::types::MethodSnapshot>>,
36    > {
37        self.api_summary.as_ref()
38    }
39}
40impl Deployment {
41    /// Creates a new builder-style object to manufacture [`Deployment`](crate::types::Deployment).
42    pub fn builder() -> crate::types::builders::DeploymentBuilder {
43        crate::types::builders::DeploymentBuilder::default()
44    }
45}
46
47/// A builder for [`Deployment`](crate::types::Deployment).
48#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
49#[non_exhaustive]
50pub struct DeploymentBuilder {
51    pub(crate) id: ::std::option::Option<::std::string::String>,
52    pub(crate) description: ::std::option::Option<::std::string::String>,
53    pub(crate) created_date: ::std::option::Option<::aws_smithy_types::DateTime>,
54    pub(crate) api_summary: ::std::option::Option<
55        ::std::collections::HashMap<::std::string::String, ::std::collections::HashMap<::std::string::String, crate::types::MethodSnapshot>>,
56    >,
57}
58impl DeploymentBuilder {
59    /// <p>The identifier for the deployment resource.</p>
60    pub fn id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
61        self.id = ::std::option::Option::Some(input.into());
62        self
63    }
64    /// <p>The identifier for the deployment resource.</p>
65    pub fn set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
66        self.id = input;
67        self
68    }
69    /// <p>The identifier for the deployment resource.</p>
70    pub fn get_id(&self) -> &::std::option::Option<::std::string::String> {
71        &self.id
72    }
73    /// <p>The description for the deployment resource.</p>
74    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
75        self.description = ::std::option::Option::Some(input.into());
76        self
77    }
78    /// <p>The description for the deployment resource.</p>
79    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
80        self.description = input;
81        self
82    }
83    /// <p>The description for the deployment resource.</p>
84    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
85        &self.description
86    }
87    /// <p>The date and time that the deployment resource was created.</p>
88    pub fn created_date(mut self, input: ::aws_smithy_types::DateTime) -> Self {
89        self.created_date = ::std::option::Option::Some(input);
90        self
91    }
92    /// <p>The date and time that the deployment resource was created.</p>
93    pub fn set_created_date(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
94        self.created_date = input;
95        self
96    }
97    /// <p>The date and time that the deployment resource was created.</p>
98    pub fn get_created_date(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
99        &self.created_date
100    }
101    /// Adds a key-value pair to `api_summary`.
102    ///
103    /// To override the contents of this collection use [`set_api_summary`](Self::set_api_summary).
104    ///
105    /// <p>A summary of the RestApi at the date and time that the deployment resource was created.</p>
106    pub fn api_summary(
107        mut self,
108        k: impl ::std::convert::Into<::std::string::String>,
109        v: ::std::collections::HashMap<::std::string::String, crate::types::MethodSnapshot>,
110    ) -> Self {
111        let mut hash_map = self.api_summary.unwrap_or_default();
112        hash_map.insert(k.into(), v);
113        self.api_summary = ::std::option::Option::Some(hash_map);
114        self
115    }
116    /// <p>A summary of the RestApi at the date and time that the deployment resource was created.</p>
117    pub fn set_api_summary(
118        mut self,
119        input: ::std::option::Option<
120            ::std::collections::HashMap<::std::string::String, ::std::collections::HashMap<::std::string::String, crate::types::MethodSnapshot>>,
121        >,
122    ) -> Self {
123        self.api_summary = input;
124        self
125    }
126    /// <p>A summary of the RestApi at the date and time that the deployment resource was created.</p>
127    pub fn get_api_summary(
128        &self,
129    ) -> &::std::option::Option<
130        ::std::collections::HashMap<::std::string::String, ::std::collections::HashMap<::std::string::String, crate::types::MethodSnapshot>>,
131    > {
132        &self.api_summary
133    }
134    /// Consumes the builder and constructs a [`Deployment`](crate::types::Deployment).
135    pub fn build(self) -> crate::types::Deployment {
136        crate::types::Deployment {
137            id: self.id,
138            description: self.description,
139            created_date: self.created_date,
140            api_summary: self.api_summary,
141        }
142    }
143}