aws_sdk_apigateway/operation/create_deployment/
_create_deployment_input.rs1#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct CreateDeploymentInput {
7 pub rest_api_id: ::std::option::Option<::std::string::String>,
9 pub stage_name: ::std::option::Option<::std::string::String>,
11 pub stage_description: ::std::option::Option<::std::string::String>,
13 pub description: ::std::option::Option<::std::string::String>,
15 pub cache_cluster_enabled: ::std::option::Option<bool>,
17 pub cache_cluster_size: ::std::option::Option<crate::types::CacheClusterSize>,
19 pub variables: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
21 pub canary_settings: ::std::option::Option<crate::types::DeploymentCanarySettings>,
23 pub tracing_enabled: ::std::option::Option<bool>,
25}
26impl CreateDeploymentInput {
27 pub fn rest_api_id(&self) -> ::std::option::Option<&str> {
29 self.rest_api_id.as_deref()
30 }
31 pub fn stage_name(&self) -> ::std::option::Option<&str> {
33 self.stage_name.as_deref()
34 }
35 pub fn stage_description(&self) -> ::std::option::Option<&str> {
37 self.stage_description.as_deref()
38 }
39 pub fn description(&self) -> ::std::option::Option<&str> {
41 self.description.as_deref()
42 }
43 pub fn cache_cluster_enabled(&self) -> ::std::option::Option<bool> {
45 self.cache_cluster_enabled
46 }
47 pub fn cache_cluster_size(&self) -> ::std::option::Option<&crate::types::CacheClusterSize> {
49 self.cache_cluster_size.as_ref()
50 }
51 pub fn variables(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
53 self.variables.as_ref()
54 }
55 pub fn canary_settings(&self) -> ::std::option::Option<&crate::types::DeploymentCanarySettings> {
57 self.canary_settings.as_ref()
58 }
59 pub fn tracing_enabled(&self) -> ::std::option::Option<bool> {
61 self.tracing_enabled
62 }
63}
64impl CreateDeploymentInput {
65 pub fn builder() -> crate::operation::create_deployment::builders::CreateDeploymentInputBuilder {
67 crate::operation::create_deployment::builders::CreateDeploymentInputBuilder::default()
68 }
69}
70
71#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
73#[non_exhaustive]
74pub struct CreateDeploymentInputBuilder {
75 pub(crate) rest_api_id: ::std::option::Option<::std::string::String>,
76 pub(crate) stage_name: ::std::option::Option<::std::string::String>,
77 pub(crate) stage_description: ::std::option::Option<::std::string::String>,
78 pub(crate) description: ::std::option::Option<::std::string::String>,
79 pub(crate) cache_cluster_enabled: ::std::option::Option<bool>,
80 pub(crate) cache_cluster_size: ::std::option::Option<crate::types::CacheClusterSize>,
81 pub(crate) variables: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
82 pub(crate) canary_settings: ::std::option::Option<crate::types::DeploymentCanarySettings>,
83 pub(crate) tracing_enabled: ::std::option::Option<bool>,
84}
85impl CreateDeploymentInputBuilder {
86 pub fn rest_api_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
89 self.rest_api_id = ::std::option::Option::Some(input.into());
90 self
91 }
92 pub fn set_rest_api_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
94 self.rest_api_id = input;
95 self
96 }
97 pub fn get_rest_api_id(&self) -> &::std::option::Option<::std::string::String> {
99 &self.rest_api_id
100 }
101 pub fn stage_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
103 self.stage_name = ::std::option::Option::Some(input.into());
104 self
105 }
106 pub fn set_stage_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
108 self.stage_name = input;
109 self
110 }
111 pub fn get_stage_name(&self) -> &::std::option::Option<::std::string::String> {
113 &self.stage_name
114 }
115 pub fn stage_description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
117 self.stage_description = ::std::option::Option::Some(input.into());
118 self
119 }
120 pub fn set_stage_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
122 self.stage_description = input;
123 self
124 }
125 pub fn get_stage_description(&self) -> &::std::option::Option<::std::string::String> {
127 &self.stage_description
128 }
129 pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
131 self.description = ::std::option::Option::Some(input.into());
132 self
133 }
134 pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
136 self.description = input;
137 self
138 }
139 pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
141 &self.description
142 }
143 pub fn cache_cluster_enabled(mut self, input: bool) -> Self {
145 self.cache_cluster_enabled = ::std::option::Option::Some(input);
146 self
147 }
148 pub fn set_cache_cluster_enabled(mut self, input: ::std::option::Option<bool>) -> Self {
150 self.cache_cluster_enabled = input;
151 self
152 }
153 pub fn get_cache_cluster_enabled(&self) -> &::std::option::Option<bool> {
155 &self.cache_cluster_enabled
156 }
157 pub fn cache_cluster_size(mut self, input: crate::types::CacheClusterSize) -> Self {
159 self.cache_cluster_size = ::std::option::Option::Some(input);
160 self
161 }
162 pub fn set_cache_cluster_size(mut self, input: ::std::option::Option<crate::types::CacheClusterSize>) -> Self {
164 self.cache_cluster_size = input;
165 self
166 }
167 pub fn get_cache_cluster_size(&self) -> &::std::option::Option<crate::types::CacheClusterSize> {
169 &self.cache_cluster_size
170 }
171 pub fn variables(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
177 let mut hash_map = self.variables.unwrap_or_default();
178 hash_map.insert(k.into(), v.into());
179 self.variables = ::std::option::Option::Some(hash_map);
180 self
181 }
182 pub fn set_variables(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
184 self.variables = input;
185 self
186 }
187 pub fn get_variables(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
189 &self.variables
190 }
191 pub fn canary_settings(mut self, input: crate::types::DeploymentCanarySettings) -> Self {
193 self.canary_settings = ::std::option::Option::Some(input);
194 self
195 }
196 pub fn set_canary_settings(mut self, input: ::std::option::Option<crate::types::DeploymentCanarySettings>) -> Self {
198 self.canary_settings = input;
199 self
200 }
201 pub fn get_canary_settings(&self) -> &::std::option::Option<crate::types::DeploymentCanarySettings> {
203 &self.canary_settings
204 }
205 pub fn tracing_enabled(mut self, input: bool) -> Self {
207 self.tracing_enabled = ::std::option::Option::Some(input);
208 self
209 }
210 pub fn set_tracing_enabled(mut self, input: ::std::option::Option<bool>) -> Self {
212 self.tracing_enabled = input;
213 self
214 }
215 pub fn get_tracing_enabled(&self) -> &::std::option::Option<bool> {
217 &self.tracing_enabled
218 }
219 pub fn build(
221 self,
222 ) -> ::std::result::Result<crate::operation::create_deployment::CreateDeploymentInput, ::aws_smithy_types::error::operation::BuildError> {
223 ::std::result::Result::Ok(crate::operation::create_deployment::CreateDeploymentInput {
224 rest_api_id: self.rest_api_id,
225 stage_name: self.stage_name,
226 stage_description: self.stage_description,
227 description: self.description,
228 cache_cluster_enabled: self.cache_cluster_enabled,
229 cache_cluster_size: self.cache_cluster_size,
230 variables: self.variables,
231 canary_settings: self.canary_settings,
232 tracing_enabled: self.tracing_enabled,
233 })
234 }
235}