1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>Requests API Gateway to create a Deployment resource.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct CreateDeploymentInput {
    /// <p>The string identifier of the associated RestApi.</p>
    pub rest_api_id: ::std::option::Option<::std::string::String>,
    /// <p>The name of the Stage resource for the Deployment resource to create.</p>
    pub stage_name: ::std::option::Option<::std::string::String>,
    /// <p>The description of the Stage resource for the Deployment resource to create.</p>
    pub stage_description: ::std::option::Option<::std::string::String>,
    /// <p>The description for the Deployment resource to create.</p>
    pub description: ::std::option::Option<::std::string::String>,
    /// <p>Enables a cache cluster for the Stage resource specified in the input.</p>
    pub cache_cluster_enabled: ::std::option::Option<bool>,
    /// <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>
    pub cache_cluster_size: ::std::option::Option<crate::types::CacheClusterSize>,
    /// <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>
    pub variables: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
    /// <p>The input configuration for the canary deployment when the deployment is a canary release deployment. </p>
    pub canary_settings: ::std::option::Option<crate::types::DeploymentCanarySettings>,
    /// <p>Specifies whether active tracing with X-ray is enabled for the Stage.</p>
    pub tracing_enabled: ::std::option::Option<bool>,
}
impl CreateDeploymentInput {
    /// <p>The string identifier of the associated RestApi.</p>
    pub fn rest_api_id(&self) -> ::std::option::Option<&str> {
        self.rest_api_id.as_deref()
    }
    /// <p>The name of the Stage resource for the Deployment resource to create.</p>
    pub fn stage_name(&self) -> ::std::option::Option<&str> {
        self.stage_name.as_deref()
    }
    /// <p>The description of the Stage resource for the Deployment resource to create.</p>
    pub fn stage_description(&self) -> ::std::option::Option<&str> {
        self.stage_description.as_deref()
    }
    /// <p>The description for the Deployment resource to create.</p>
    pub fn description(&self) -> ::std::option::Option<&str> {
        self.description.as_deref()
    }
    /// <p>Enables a cache cluster for the Stage resource specified in the input.</p>
    pub fn cache_cluster_enabled(&self) -> ::std::option::Option<bool> {
        self.cache_cluster_enabled
    }
    /// <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>
    pub fn cache_cluster_size(&self) -> ::std::option::Option<&crate::types::CacheClusterSize> {
        self.cache_cluster_size.as_ref()
    }
    /// <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>
    pub fn variables(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        self.variables.as_ref()
    }
    /// <p>The input configuration for the canary deployment when the deployment is a canary release deployment. </p>
    pub fn canary_settings(&self) -> ::std::option::Option<&crate::types::DeploymentCanarySettings> {
        self.canary_settings.as_ref()
    }
    /// <p>Specifies whether active tracing with X-ray is enabled for the Stage.</p>
    pub fn tracing_enabled(&self) -> ::std::option::Option<bool> {
        self.tracing_enabled
    }
}
impl CreateDeploymentInput {
    /// Creates a new builder-style object to manufacture [`CreateDeploymentInput`](crate::operation::create_deployment::CreateDeploymentInput).
    pub fn builder() -> crate::operation::create_deployment::builders::CreateDeploymentInputBuilder {
        crate::operation::create_deployment::builders::CreateDeploymentInputBuilder::default()
    }
}

/// A builder for [`CreateDeploymentInput`](crate::operation::create_deployment::CreateDeploymentInput).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct CreateDeploymentInputBuilder {
    pub(crate) rest_api_id: ::std::option::Option<::std::string::String>,
    pub(crate) stage_name: ::std::option::Option<::std::string::String>,
    pub(crate) stage_description: ::std::option::Option<::std::string::String>,
    pub(crate) description: ::std::option::Option<::std::string::String>,
    pub(crate) cache_cluster_enabled: ::std::option::Option<bool>,
    pub(crate) cache_cluster_size: ::std::option::Option<crate::types::CacheClusterSize>,
    pub(crate) variables: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
    pub(crate) canary_settings: ::std::option::Option<crate::types::DeploymentCanarySettings>,
    pub(crate) tracing_enabled: ::std::option::Option<bool>,
}
impl CreateDeploymentInputBuilder {
    /// <p>The string identifier of the associated RestApi.</p>
    /// This field is required.
    pub fn rest_api_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.rest_api_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The string identifier of the associated RestApi.</p>
    pub fn set_rest_api_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.rest_api_id = input;
        self
    }
    /// <p>The string identifier of the associated RestApi.</p>
    pub fn get_rest_api_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.rest_api_id
    }
    /// <p>The name of the Stage resource for the Deployment resource to create.</p>
    pub fn stage_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.stage_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the Stage resource for the Deployment resource to create.</p>
    pub fn set_stage_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.stage_name = input;
        self
    }
    /// <p>The name of the Stage resource for the Deployment resource to create.</p>
    pub fn get_stage_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.stage_name
    }
    /// <p>The description of the Stage resource for the Deployment resource to create.</p>
    pub fn stage_description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.stage_description = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The description of the Stage resource for the Deployment resource to create.</p>
    pub fn set_stage_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.stage_description = input;
        self
    }
    /// <p>The description of the Stage resource for the Deployment resource to create.</p>
    pub fn get_stage_description(&self) -> &::std::option::Option<::std::string::String> {
        &self.stage_description
    }
    /// <p>The description for the Deployment resource to create.</p>
    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.description = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The description for the Deployment resource to create.</p>
    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.description = input;
        self
    }
    /// <p>The description for the Deployment resource to create.</p>
    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
        &self.description
    }
    /// <p>Enables a cache cluster for the Stage resource specified in the input.</p>
    pub fn cache_cluster_enabled(mut self, input: bool) -> Self {
        self.cache_cluster_enabled = ::std::option::Option::Some(input);
        self
    }
    /// <p>Enables a cache cluster for the Stage resource specified in the input.</p>
    pub fn set_cache_cluster_enabled(mut self, input: ::std::option::Option<bool>) -> Self {
        self.cache_cluster_enabled = input;
        self
    }
    /// <p>Enables a cache cluster for the Stage resource specified in the input.</p>
    pub fn get_cache_cluster_enabled(&self) -> &::std::option::Option<bool> {
        &self.cache_cluster_enabled
    }
    /// <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>
    pub fn cache_cluster_size(mut self, input: crate::types::CacheClusterSize) -> Self {
        self.cache_cluster_size = ::std::option::Option::Some(input);
        self
    }
    /// <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>
    pub fn set_cache_cluster_size(mut self, input: ::std::option::Option<crate::types::CacheClusterSize>) -> Self {
        self.cache_cluster_size = input;
        self
    }
    /// <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>
    pub fn get_cache_cluster_size(&self) -> &::std::option::Option<crate::types::CacheClusterSize> {
        &self.cache_cluster_size
    }
    /// Adds a key-value pair to `variables`.
    ///
    /// To override the contents of this collection use [`set_variables`](Self::set_variables).
    ///
    /// <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>
    pub fn variables(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
        let mut hash_map = self.variables.unwrap_or_default();
        hash_map.insert(k.into(), v.into());
        self.variables = ::std::option::Option::Some(hash_map);
        self
    }
    /// <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>
    pub fn set_variables(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
        self.variables = input;
        self
    }
    /// <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>
    pub fn get_variables(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        &self.variables
    }
    /// <p>The input configuration for the canary deployment when the deployment is a canary release deployment. </p>
    pub fn canary_settings(mut self, input: crate::types::DeploymentCanarySettings) -> Self {
        self.canary_settings = ::std::option::Option::Some(input);
        self
    }
    /// <p>The input configuration for the canary deployment when the deployment is a canary release deployment. </p>
    pub fn set_canary_settings(mut self, input: ::std::option::Option<crate::types::DeploymentCanarySettings>) -> Self {
        self.canary_settings = input;
        self
    }
    /// <p>The input configuration for the canary deployment when the deployment is a canary release deployment. </p>
    pub fn get_canary_settings(&self) -> &::std::option::Option<crate::types::DeploymentCanarySettings> {
        &self.canary_settings
    }
    /// <p>Specifies whether active tracing with X-ray is enabled for the Stage.</p>
    pub fn tracing_enabled(mut self, input: bool) -> Self {
        self.tracing_enabled = ::std::option::Option::Some(input);
        self
    }
    /// <p>Specifies whether active tracing with X-ray is enabled for the Stage.</p>
    pub fn set_tracing_enabled(mut self, input: ::std::option::Option<bool>) -> Self {
        self.tracing_enabled = input;
        self
    }
    /// <p>Specifies whether active tracing with X-ray is enabled for the Stage.</p>
    pub fn get_tracing_enabled(&self) -> &::std::option::Option<bool> {
        &self.tracing_enabled
    }
    /// Consumes the builder and constructs a [`CreateDeploymentInput`](crate::operation::create_deployment::CreateDeploymentInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::create_deployment::CreateDeploymentInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::create_deployment::CreateDeploymentInput {
            rest_api_id: self.rest_api_id,
            stage_name: self.stage_name,
            stage_description: self.stage_description,
            description: self.description,
            cache_cluster_enabled: self.cache_cluster_enabled,
            cache_cluster_size: self.cache_cluster_size,
            variables: self.variables,
            canary_settings: self.canary_settings,
            tracing_enabled: self.tracing_enabled,
        })
    }
}