aws_sdk_apigateway/operation/create_deployment/
_create_deployment_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Requests API Gateway to create a Deployment resource.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct CreateDeploymentInput {
7    /// <p>The string identifier of the associated RestApi.</p>
8    pub rest_api_id: ::std::option::Option<::std::string::String>,
9    /// <p>The name of the Stage resource for the Deployment resource to create.</p>
10    pub stage_name: ::std::option::Option<::std::string::String>,
11    /// <p>The description of the Stage resource for the Deployment resource to create.</p>
12    pub stage_description: ::std::option::Option<::std::string::String>,
13    /// <p>The description for the Deployment resource to create.</p>
14    pub description: ::std::option::Option<::std::string::String>,
15    /// <p>Enables a cache cluster for the Stage resource specified in the input.</p>
16    pub cache_cluster_enabled: ::std::option::Option<bool>,
17    /// <p>The stage's cache capacity in GB. For more information about choosing a cache size, see <a href="https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-caching.html">Enabling API caching to enhance responsiveness</a>.</p>
18    pub cache_cluster_size: ::std::option::Option<crate::types::CacheClusterSize>,
19    /// <p>A map that defines the stage variables for the Stage resource that is associated with the new deployment. Variable names can have alphanumeric and underscore characters, and the values must match <code>\[A-Za-z0-9-._~:/?#&amp;=,\]+</code>.</p>
20    pub variables: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
21    /// <p>The input configuration for the canary deployment when the deployment is a canary release deployment.</p>
22    pub canary_settings: ::std::option::Option<crate::types::DeploymentCanarySettings>,
23    /// <p>Specifies whether active tracing with X-ray is enabled for the Stage.</p>
24    pub tracing_enabled: ::std::option::Option<bool>,
25}
26impl CreateDeploymentInput {
27    /// <p>The string identifier of the associated RestApi.</p>
28    pub fn rest_api_id(&self) -> ::std::option::Option<&str> {
29        self.rest_api_id.as_deref()
30    }
31    /// <p>The name of the Stage resource for the Deployment resource to create.</p>
32    pub fn stage_name(&self) -> ::std::option::Option<&str> {
33        self.stage_name.as_deref()
34    }
35    /// <p>The description of the Stage resource for the Deployment resource to create.</p>
36    pub fn stage_description(&self) -> ::std::option::Option<&str> {
37        self.stage_description.as_deref()
38    }
39    /// <p>The description for the Deployment resource to create.</p>
40    pub fn description(&self) -> ::std::option::Option<&str> {
41        self.description.as_deref()
42    }
43    /// <p>Enables a cache cluster for the Stage resource specified in the input.</p>
44    pub fn cache_cluster_enabled(&self) -> ::std::option::Option<bool> {
45        self.cache_cluster_enabled
46    }
47    /// <p>The stage's cache capacity in GB. For more information about choosing a cache size, see <a href="https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-caching.html">Enabling API caching to enhance responsiveness</a>.</p>
48    pub fn cache_cluster_size(&self) -> ::std::option::Option<&crate::types::CacheClusterSize> {
49        self.cache_cluster_size.as_ref()
50    }
51    /// <p>A map that defines the stage variables for the Stage resource that is associated with the new deployment. Variable names can have alphanumeric and underscore characters, and the values must match <code>\[A-Za-z0-9-._~:/?#&amp;=,\]+</code>.</p>
52    pub fn variables(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
53        self.variables.as_ref()
54    }
55    /// <p>The input configuration for the canary deployment when the deployment is a canary release deployment.</p>
56    pub fn canary_settings(&self) -> ::std::option::Option<&crate::types::DeploymentCanarySettings> {
57        self.canary_settings.as_ref()
58    }
59    /// <p>Specifies whether active tracing with X-ray is enabled for the Stage.</p>
60    pub fn tracing_enabled(&self) -> ::std::option::Option<bool> {
61        self.tracing_enabled
62    }
63}
64impl CreateDeploymentInput {
65    /// Creates a new builder-style object to manufacture [`CreateDeploymentInput`](crate::operation::create_deployment::CreateDeploymentInput).
66    pub fn builder() -> crate::operation::create_deployment::builders::CreateDeploymentInputBuilder {
67        crate::operation::create_deployment::builders::CreateDeploymentInputBuilder::default()
68    }
69}
70
71/// A builder for [`CreateDeploymentInput`](crate::operation::create_deployment::CreateDeploymentInput).
72#[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    /// <p>The string identifier of the associated RestApi.</p>
87    /// This field is required.
88    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    /// <p>The string identifier of the associated RestApi.</p>
93    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    /// <p>The string identifier of the associated RestApi.</p>
98    pub fn get_rest_api_id(&self) -> &::std::option::Option<::std::string::String> {
99        &self.rest_api_id
100    }
101    /// <p>The name of the Stage resource for the Deployment resource to create.</p>
102    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    /// <p>The name of the Stage resource for the Deployment resource to create.</p>
107    pub fn set_stage_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
108        self.stage_name = input;
109        self
110    }
111    /// <p>The name of the Stage resource for the Deployment resource to create.</p>
112    pub fn get_stage_name(&self) -> &::std::option::Option<::std::string::String> {
113        &self.stage_name
114    }
115    /// <p>The description of the Stage resource for the Deployment resource to create.</p>
116    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    /// <p>The description of the Stage resource for the Deployment resource to create.</p>
121    pub fn set_stage_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
122        self.stage_description = input;
123        self
124    }
125    /// <p>The description of the Stage resource for the Deployment resource to create.</p>
126    pub fn get_stage_description(&self) -> &::std::option::Option<::std::string::String> {
127        &self.stage_description
128    }
129    /// <p>The description for the Deployment resource to create.</p>
130    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    /// <p>The description for the Deployment resource to create.</p>
135    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
136        self.description = input;
137        self
138    }
139    /// <p>The description for the Deployment resource to create.</p>
140    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
141        &self.description
142    }
143    /// <p>Enables a cache cluster for the Stage resource specified in the input.</p>
144    pub fn cache_cluster_enabled(mut self, input: bool) -> Self {
145        self.cache_cluster_enabled = ::std::option::Option::Some(input);
146        self
147    }
148    /// <p>Enables a cache cluster for the Stage resource specified in the input.</p>
149    pub fn set_cache_cluster_enabled(mut self, input: ::std::option::Option<bool>) -> Self {
150        self.cache_cluster_enabled = input;
151        self
152    }
153    /// <p>Enables a cache cluster for the Stage resource specified in the input.</p>
154    pub fn get_cache_cluster_enabled(&self) -> &::std::option::Option<bool> {
155        &self.cache_cluster_enabled
156    }
157    /// <p>The stage's cache capacity in GB. For more information about choosing a cache size, see <a href="https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-caching.html">Enabling API caching to enhance responsiveness</a>.</p>
158    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    /// <p>The stage's cache capacity in GB. For more information about choosing a cache size, see <a href="https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-caching.html">Enabling API caching to enhance responsiveness</a>.</p>
163    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    /// <p>The stage's cache capacity in GB. For more information about choosing a cache size, see <a href="https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-caching.html">Enabling API caching to enhance responsiveness</a>.</p>
168    pub fn get_cache_cluster_size(&self) -> &::std::option::Option<crate::types::CacheClusterSize> {
169        &self.cache_cluster_size
170    }
171    /// Adds a key-value pair to `variables`.
172    ///
173    /// To override the contents of this collection use [`set_variables`](Self::set_variables).
174    ///
175    /// <p>A map that defines the stage variables for the Stage resource that is associated with the new deployment. Variable names can have alphanumeric and underscore characters, and the values must match <code>\[A-Za-z0-9-._~:/?#&amp;=,\]+</code>.</p>
176    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    /// <p>A map that defines the stage variables for the Stage resource that is associated with the new deployment. Variable names can have alphanumeric and underscore characters, and the values must match <code>\[A-Za-z0-9-._~:/?#&amp;=,\]+</code>.</p>
183    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    /// <p>A map that defines the stage variables for the Stage resource that is associated with the new deployment. Variable names can have alphanumeric and underscore characters, and the values must match <code>\[A-Za-z0-9-._~:/?#&amp;=,\]+</code>.</p>
188    pub fn get_variables(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
189        &self.variables
190    }
191    /// <p>The input configuration for the canary deployment when the deployment is a canary release deployment.</p>
192    pub fn canary_settings(mut self, input: crate::types::DeploymentCanarySettings) -> Self {
193        self.canary_settings = ::std::option::Option::Some(input);
194        self
195    }
196    /// <p>The input configuration for the canary deployment when the deployment is a canary release deployment.</p>
197    pub fn set_canary_settings(mut self, input: ::std::option::Option<crate::types::DeploymentCanarySettings>) -> Self {
198        self.canary_settings = input;
199        self
200    }
201    /// <p>The input configuration for the canary deployment when the deployment is a canary release deployment.</p>
202    pub fn get_canary_settings(&self) -> &::std::option::Option<crate::types::DeploymentCanarySettings> {
203        &self.canary_settings
204    }
205    /// <p>Specifies whether active tracing with X-ray is enabled for the Stage.</p>
206    pub fn tracing_enabled(mut self, input: bool) -> Self {
207        self.tracing_enabled = ::std::option::Option::Some(input);
208        self
209    }
210    /// <p>Specifies whether active tracing with X-ray is enabled for the Stage.</p>
211    pub fn set_tracing_enabled(mut self, input: ::std::option::Option<bool>) -> Self {
212        self.tracing_enabled = input;
213        self
214    }
215    /// <p>Specifies whether active tracing with X-ray is enabled for the Stage.</p>
216    pub fn get_tracing_enabled(&self) -> &::std::option::Option<bool> {
217        &self.tracing_enabled
218    }
219    /// Consumes the builder and constructs a [`CreateDeploymentInput`](crate::operation::create_deployment::CreateDeploymentInput).
220    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}