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
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct CreateDeploymentOutput {
/// <p>The service-generated id of the deployment.</p>
pub deployment_id: ::std::string::String,
/// <p>The Amazon Resource Name (ARN) of the deployment.</p>
pub deployment_arn: ::std::string::String,
/// <p>The name of the deployment.</p>
pub deployment_name: ::std::string::String,
/// <p>A description of the deployment.</p>
pub deployment_description: ::std::option::Option<::std::string::String>,
/// <p>The current status of the resource: <code>DRAFT</code> (unpublished, editable) or <code>ACTIVE</code> (published, in use).</p>
pub status: crate::types::EntityStatus,
/// <p>The configuration settings for the deployment.</p>
pub deployment_configuration: ::std::option::Option<crate::types::DeploymentConfiguration>,
/// <p>The policies associated with the deployment.</p>
pub associated_policy_list: ::std::vec::Vec<crate::types::AssociatedPolicy>,
/// <p>The scope associated with the deployment. A deployment has exactly one scope.</p>
pub associated_scope_list: ::std::vec::Vec<crate::types::AssociatedScope>,
/// <p>The version of the resource.</p>
pub version: ::std::string::String,
/// <p>A token used for optimistic concurrency control. Each read and write returns an <code>updateToken</code>. Provide the most recent value on your next update to detect and prevent conflicting concurrent modifications.</p>
pub update_token: ::std::option::Option<::std::string::String>,
/// <p>Specifies whether the resource is a snapshot of a published version.</p>
pub is_snapshot: ::std::option::Option<bool>,
/// <p>Specifies whether a published version of the resource exists.</p>
pub has_published_version: ::std::option::Option<bool>,
/// <p>The coverage information for the deployment. For each firewall type, it shows which policies have that firewall type and which in-scope resource types the firewall type protects.</p>
pub deployment_coverage: ::std::option::Option<::std::vec::Vec<crate::types::DeploymentCoverageEntry>>,
/// <p>Warnings about potential issues, such as a policy that has no applicable resources in the deployment's scope.</p>
pub warnings: ::std::option::Option<::std::vec::Vec<crate::types::DeploymentWarningEntry>>,
/// <p>The time when the resource was last updated.</p>
pub updated_at: ::std::option::Option<::aws_smithy_types::DateTime>,
_request_id: Option<String>,
}
impl CreateDeploymentOutput {
/// <p>The service-generated id of the deployment.</p>
pub fn deployment_id(&self) -> &str {
use std::ops::Deref;
self.deployment_id.deref()
}
/// <p>The Amazon Resource Name (ARN) of the deployment.</p>
pub fn deployment_arn(&self) -> &str {
use std::ops::Deref;
self.deployment_arn.deref()
}
/// <p>The name of the deployment.</p>
pub fn deployment_name(&self) -> &str {
use std::ops::Deref;
self.deployment_name.deref()
}
/// <p>A description of the deployment.</p>
pub fn deployment_description(&self) -> ::std::option::Option<&str> {
self.deployment_description.as_deref()
}
/// <p>The current status of the resource: <code>DRAFT</code> (unpublished, editable) or <code>ACTIVE</code> (published, in use).</p>
pub fn status(&self) -> &crate::types::EntityStatus {
&self.status
}
/// <p>The configuration settings for the deployment.</p>
pub fn deployment_configuration(&self) -> ::std::option::Option<&crate::types::DeploymentConfiguration> {
self.deployment_configuration.as_ref()
}
/// <p>The policies associated with the deployment.</p>
pub fn associated_policy_list(&self) -> &[crate::types::AssociatedPolicy] {
use std::ops::Deref;
self.associated_policy_list.deref()
}
/// <p>The scope associated with the deployment. A deployment has exactly one scope.</p>
pub fn associated_scope_list(&self) -> &[crate::types::AssociatedScope] {
use std::ops::Deref;
self.associated_scope_list.deref()
}
/// <p>The version of the resource.</p>
pub fn version(&self) -> &str {
use std::ops::Deref;
self.version.deref()
}
/// <p>A token used for optimistic concurrency control. Each read and write returns an <code>updateToken</code>. Provide the most recent value on your next update to detect and prevent conflicting concurrent modifications.</p>
pub fn update_token(&self) -> ::std::option::Option<&str> {
self.update_token.as_deref()
}
/// <p>Specifies whether the resource is a snapshot of a published version.</p>
pub fn is_snapshot(&self) -> ::std::option::Option<bool> {
self.is_snapshot
}
/// <p>Specifies whether a published version of the resource exists.</p>
pub fn has_published_version(&self) -> ::std::option::Option<bool> {
self.has_published_version
}
/// <p>The coverage information for the deployment. For each firewall type, it shows which policies have that firewall type and which in-scope resource types the firewall type protects.</p>
///
/// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.deployment_coverage.is_none()`.
pub fn deployment_coverage(&self) -> &[crate::types::DeploymentCoverageEntry] {
self.deployment_coverage.as_deref().unwrap_or_default()
}
/// <p>Warnings about potential issues, such as a policy that has no applicable resources in the deployment's scope.</p>
///
/// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.warnings.is_none()`.
pub fn warnings(&self) -> &[crate::types::DeploymentWarningEntry] {
self.warnings.as_deref().unwrap_or_default()
}
/// <p>The time when the resource was last updated.</p>
pub fn updated_at(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
self.updated_at.as_ref()
}
}
impl ::aws_types::request_id::RequestId for CreateDeploymentOutput {
fn request_id(&self) -> Option<&str> {
self._request_id.as_deref()
}
}
impl CreateDeploymentOutput {
/// Creates a new builder-style object to manufacture [`CreateDeploymentOutput`](crate::operation::create_deployment::CreateDeploymentOutput).
pub fn builder() -> crate::operation::create_deployment::builders::CreateDeploymentOutputBuilder {
crate::operation::create_deployment::builders::CreateDeploymentOutputBuilder::default()
}
}
/// A builder for [`CreateDeploymentOutput`](crate::operation::create_deployment::CreateDeploymentOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct CreateDeploymentOutputBuilder {
pub(crate) deployment_id: ::std::option::Option<::std::string::String>,
pub(crate) deployment_arn: ::std::option::Option<::std::string::String>,
pub(crate) deployment_name: ::std::option::Option<::std::string::String>,
pub(crate) deployment_description: ::std::option::Option<::std::string::String>,
pub(crate) status: ::std::option::Option<crate::types::EntityStatus>,
pub(crate) deployment_configuration: ::std::option::Option<crate::types::DeploymentConfiguration>,
pub(crate) associated_policy_list: ::std::option::Option<::std::vec::Vec<crate::types::AssociatedPolicy>>,
pub(crate) associated_scope_list: ::std::option::Option<::std::vec::Vec<crate::types::AssociatedScope>>,
pub(crate) version: ::std::option::Option<::std::string::String>,
pub(crate) update_token: ::std::option::Option<::std::string::String>,
pub(crate) is_snapshot: ::std::option::Option<bool>,
pub(crate) has_published_version: ::std::option::Option<bool>,
pub(crate) deployment_coverage: ::std::option::Option<::std::vec::Vec<crate::types::DeploymentCoverageEntry>>,
pub(crate) warnings: ::std::option::Option<::std::vec::Vec<crate::types::DeploymentWarningEntry>>,
pub(crate) updated_at: ::std::option::Option<::aws_smithy_types::DateTime>,
_request_id: Option<String>,
}
impl CreateDeploymentOutputBuilder {
/// <p>The service-generated id of the deployment.</p>
/// This field is required.
pub fn deployment_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.deployment_id = ::std::option::Option::Some(input.into());
self
}
/// <p>The service-generated id of the deployment.</p>
pub fn set_deployment_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.deployment_id = input;
self
}
/// <p>The service-generated id of the deployment.</p>
pub fn get_deployment_id(&self) -> &::std::option::Option<::std::string::String> {
&self.deployment_id
}
/// <p>The Amazon Resource Name (ARN) of the deployment.</p>
/// This field is required.
pub fn deployment_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.deployment_arn = ::std::option::Option::Some(input.into());
self
}
/// <p>The Amazon Resource Name (ARN) of the deployment.</p>
pub fn set_deployment_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.deployment_arn = input;
self
}
/// <p>The Amazon Resource Name (ARN) of the deployment.</p>
pub fn get_deployment_arn(&self) -> &::std::option::Option<::std::string::String> {
&self.deployment_arn
}
/// <p>The name of the deployment.</p>
/// This field is required.
pub fn deployment_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.deployment_name = ::std::option::Option::Some(input.into());
self
}
/// <p>The name of the deployment.</p>
pub fn set_deployment_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.deployment_name = input;
self
}
/// <p>The name of the deployment.</p>
pub fn get_deployment_name(&self) -> &::std::option::Option<::std::string::String> {
&self.deployment_name
}
/// <p>A description of the deployment.</p>
pub fn deployment_description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.deployment_description = ::std::option::Option::Some(input.into());
self
}
/// <p>A description of the deployment.</p>
pub fn set_deployment_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.deployment_description = input;
self
}
/// <p>A description of the deployment.</p>
pub fn get_deployment_description(&self) -> &::std::option::Option<::std::string::String> {
&self.deployment_description
}
/// <p>The current status of the resource: <code>DRAFT</code> (unpublished, editable) or <code>ACTIVE</code> (published, in use).</p>
/// This field is required.
pub fn status(mut self, input: crate::types::EntityStatus) -> Self {
self.status = ::std::option::Option::Some(input);
self
}
/// <p>The current status of the resource: <code>DRAFT</code> (unpublished, editable) or <code>ACTIVE</code> (published, in use).</p>
pub fn set_status(mut self, input: ::std::option::Option<crate::types::EntityStatus>) -> Self {
self.status = input;
self
}
/// <p>The current status of the resource: <code>DRAFT</code> (unpublished, editable) or <code>ACTIVE</code> (published, in use).</p>
pub fn get_status(&self) -> &::std::option::Option<crate::types::EntityStatus> {
&self.status
}
/// <p>The configuration settings for the deployment.</p>
pub fn deployment_configuration(mut self, input: crate::types::DeploymentConfiguration) -> Self {
self.deployment_configuration = ::std::option::Option::Some(input);
self
}
/// <p>The configuration settings for the deployment.</p>
pub fn set_deployment_configuration(mut self, input: ::std::option::Option<crate::types::DeploymentConfiguration>) -> Self {
self.deployment_configuration = input;
self
}
/// <p>The configuration settings for the deployment.</p>
pub fn get_deployment_configuration(&self) -> &::std::option::Option<crate::types::DeploymentConfiguration> {
&self.deployment_configuration
}
/// Appends an item to `associated_policy_list`.
///
/// To override the contents of this collection use [`set_associated_policy_list`](Self::set_associated_policy_list).
///
/// <p>The policies associated with the deployment.</p>
pub fn associated_policy_list(mut self, input: crate::types::AssociatedPolicy) -> Self {
let mut v = self.associated_policy_list.unwrap_or_default();
v.push(input);
self.associated_policy_list = ::std::option::Option::Some(v);
self
}
/// <p>The policies associated with the deployment.</p>
pub fn set_associated_policy_list(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::AssociatedPolicy>>) -> Self {
self.associated_policy_list = input;
self
}
/// <p>The policies associated with the deployment.</p>
pub fn get_associated_policy_list(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::AssociatedPolicy>> {
&self.associated_policy_list
}
/// Appends an item to `associated_scope_list`.
///
/// To override the contents of this collection use [`set_associated_scope_list`](Self::set_associated_scope_list).
///
/// <p>The scope associated with the deployment. A deployment has exactly one scope.</p>
pub fn associated_scope_list(mut self, input: crate::types::AssociatedScope) -> Self {
let mut v = self.associated_scope_list.unwrap_or_default();
v.push(input);
self.associated_scope_list = ::std::option::Option::Some(v);
self
}
/// <p>The scope associated with the deployment. A deployment has exactly one scope.</p>
pub fn set_associated_scope_list(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::AssociatedScope>>) -> Self {
self.associated_scope_list = input;
self
}
/// <p>The scope associated with the deployment. A deployment has exactly one scope.</p>
pub fn get_associated_scope_list(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::AssociatedScope>> {
&self.associated_scope_list
}
/// <p>The version of the resource.</p>
/// This field is required.
pub fn version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.version = ::std::option::Option::Some(input.into());
self
}
/// <p>The version of the resource.</p>
pub fn set_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.version = input;
self
}
/// <p>The version of the resource.</p>
pub fn get_version(&self) -> &::std::option::Option<::std::string::String> {
&self.version
}
/// <p>A token used for optimistic concurrency control. Each read and write returns an <code>updateToken</code>. Provide the most recent value on your next update to detect and prevent conflicting concurrent modifications.</p>
pub fn update_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.update_token = ::std::option::Option::Some(input.into());
self
}
/// <p>A token used for optimistic concurrency control. Each read and write returns an <code>updateToken</code>. Provide the most recent value on your next update to detect and prevent conflicting concurrent modifications.</p>
pub fn set_update_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.update_token = input;
self
}
/// <p>A token used for optimistic concurrency control. Each read and write returns an <code>updateToken</code>. Provide the most recent value on your next update to detect and prevent conflicting concurrent modifications.</p>
pub fn get_update_token(&self) -> &::std::option::Option<::std::string::String> {
&self.update_token
}
/// <p>Specifies whether the resource is a snapshot of a published version.</p>
pub fn is_snapshot(mut self, input: bool) -> Self {
self.is_snapshot = ::std::option::Option::Some(input);
self
}
/// <p>Specifies whether the resource is a snapshot of a published version.</p>
pub fn set_is_snapshot(mut self, input: ::std::option::Option<bool>) -> Self {
self.is_snapshot = input;
self
}
/// <p>Specifies whether the resource is a snapshot of a published version.</p>
pub fn get_is_snapshot(&self) -> &::std::option::Option<bool> {
&self.is_snapshot
}
/// <p>Specifies whether a published version of the resource exists.</p>
pub fn has_published_version(mut self, input: bool) -> Self {
self.has_published_version = ::std::option::Option::Some(input);
self
}
/// <p>Specifies whether a published version of the resource exists.</p>
pub fn set_has_published_version(mut self, input: ::std::option::Option<bool>) -> Self {
self.has_published_version = input;
self
}
/// <p>Specifies whether a published version of the resource exists.</p>
pub fn get_has_published_version(&self) -> &::std::option::Option<bool> {
&self.has_published_version
}
/// Appends an item to `deployment_coverage`.
///
/// To override the contents of this collection use [`set_deployment_coverage`](Self::set_deployment_coverage).
///
/// <p>The coverage information for the deployment. For each firewall type, it shows which policies have that firewall type and which in-scope resource types the firewall type protects.</p>
pub fn deployment_coverage(mut self, input: crate::types::DeploymentCoverageEntry) -> Self {
let mut v = self.deployment_coverage.unwrap_or_default();
v.push(input);
self.deployment_coverage = ::std::option::Option::Some(v);
self
}
/// <p>The coverage information for the deployment. For each firewall type, it shows which policies have that firewall type and which in-scope resource types the firewall type protects.</p>
pub fn set_deployment_coverage(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::DeploymentCoverageEntry>>) -> Self {
self.deployment_coverage = input;
self
}
/// <p>The coverage information for the deployment. For each firewall type, it shows which policies have that firewall type and which in-scope resource types the firewall type protects.</p>
pub fn get_deployment_coverage(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::DeploymentCoverageEntry>> {
&self.deployment_coverage
}
/// Appends an item to `warnings`.
///
/// To override the contents of this collection use [`set_warnings`](Self::set_warnings).
///
/// <p>Warnings about potential issues, such as a policy that has no applicable resources in the deployment's scope.</p>
pub fn warnings(mut self, input: crate::types::DeploymentWarningEntry) -> Self {
let mut v = self.warnings.unwrap_or_default();
v.push(input);
self.warnings = ::std::option::Option::Some(v);
self
}
/// <p>Warnings about potential issues, such as a policy that has no applicable resources in the deployment's scope.</p>
pub fn set_warnings(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::DeploymentWarningEntry>>) -> Self {
self.warnings = input;
self
}
/// <p>Warnings about potential issues, such as a policy that has no applicable resources in the deployment's scope.</p>
pub fn get_warnings(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::DeploymentWarningEntry>> {
&self.warnings
}
/// <p>The time when the resource was last updated.</p>
pub fn updated_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
self.updated_at = ::std::option::Option::Some(input);
self
}
/// <p>The time when the resource was last updated.</p>
pub fn set_updated_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
self.updated_at = input;
self
}
/// <p>The time when the resource was last updated.</p>
pub fn get_updated_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
&self.updated_at
}
pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
self._request_id = Some(request_id.into());
self
}
pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
self._request_id = request_id;
self
}
/// Consumes the builder and constructs a [`CreateDeploymentOutput`](crate::operation::create_deployment::CreateDeploymentOutput).
/// This method will fail if any of the following fields are not set:
/// - [`deployment_id`](crate::operation::create_deployment::builders::CreateDeploymentOutputBuilder::deployment_id)
/// - [`deployment_arn`](crate::operation::create_deployment::builders::CreateDeploymentOutputBuilder::deployment_arn)
/// - [`deployment_name`](crate::operation::create_deployment::builders::CreateDeploymentOutputBuilder::deployment_name)
/// - [`status`](crate::operation::create_deployment::builders::CreateDeploymentOutputBuilder::status)
/// - [`associated_policy_list`](crate::operation::create_deployment::builders::CreateDeploymentOutputBuilder::associated_policy_list)
/// - [`associated_scope_list`](crate::operation::create_deployment::builders::CreateDeploymentOutputBuilder::associated_scope_list)
/// - [`version`](crate::operation::create_deployment::builders::CreateDeploymentOutputBuilder::version)
pub fn build(
self,
) -> ::std::result::Result<crate::operation::create_deployment::CreateDeploymentOutput, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::operation::create_deployment::CreateDeploymentOutput {
deployment_id: self.deployment_id.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"deployment_id",
"deployment_id was not specified but it is required when building CreateDeploymentOutput",
)
})?,
deployment_arn: self.deployment_arn.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"deployment_arn",
"deployment_arn was not specified but it is required when building CreateDeploymentOutput",
)
})?,
deployment_name: self.deployment_name.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"deployment_name",
"deployment_name was not specified but it is required when building CreateDeploymentOutput",
)
})?,
deployment_description: self.deployment_description,
status: self.status.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"status",
"status was not specified but it is required when building CreateDeploymentOutput",
)
})?,
deployment_configuration: self.deployment_configuration,
associated_policy_list: self.associated_policy_list.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"associated_policy_list",
"associated_policy_list was not specified but it is required when building CreateDeploymentOutput",
)
})?,
associated_scope_list: self.associated_scope_list.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"associated_scope_list",
"associated_scope_list was not specified but it is required when building CreateDeploymentOutput",
)
})?,
version: self.version.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"version",
"version was not specified but it is required when building CreateDeploymentOutput",
)
})?,
update_token: self.update_token,
is_snapshot: self.is_snapshot,
has_published_version: self.has_published_version,
deployment_coverage: self.deployment_coverage,
warnings: self.warnings,
updated_at: self.updated_at,
_request_id: self._request_id,
})
}
}