aws-sdk-amplifygen3 1.0.0

AWS SDK for AWS Amplify Gen 3
Documentation
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
// 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 GetEnvironmentOutput {
    /// <p>The name of the app.</p>
    pub app_name: ::std::string::String,
    /// <p>The name of the environment.</p>
    pub environment_name: ::std::string::String,
    /// <p>The Amazon Resource Name (ARN) of the environment.</p>
    pub environment_arn: ::std::string::String,
    /// <p>The type of the environment.</p>
    pub r#type: crate::types::EnvironmentType,
    /// <p>The Amazon Resource Name (ARN) of the IAM role for the environment.</p>
    pub environment_role_arn: ::std::string::String,
    /// <p>The permission mode for the environment's IAM role.</p>
    pub environment_role_permission_mode: ::std::option::Option<crate::types::EnvironmentRolePermissionMode>,
    /// <p>The source configuration for the environment.</p>
    pub source_config: ::std::option::Option<crate::types::EnvironmentSourceConfig>,
    /// <p>A list of the environment's AWS WAF log configurations. Omitted when the environment has no WAF log configuration.</p>
    pub waf_log_configs: ::std::option::Option<::std::vec::Vec<crate::types::WafLogConfig>>,
    /// <p>The gradual rollout settings.</p>
    pub gradual_rollout_config: ::std::option::Option<crate::types::GradualRolloutConfig>,
    /// <p>The web hosting settings for the environment.</p>
    pub web: ::std::option::Option<crate::types::EnvironmentWebConfig>,
    /// <p>The backend settings for the environment. Database is present only when the app has a backend. Auth is present whenever it is stored.</p>
    pub backend: ::std::option::Option<crate::types::EnvironmentBackend>,
    /// <p>The VPC network configuration for the environment.</p>
    pub network_config: ::std::option::Option<crate::types::EnvironmentNetworkConfig>,
    /// <p>The time at which the environment was created. The value is in ISO-8601 format.</p>
    pub created_at: ::aws_smithy_types::DateTime,
    /// <p>The time at which the environment was last updated. The value is in ISO-8601 format.</p>
    pub updated_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    _request_id: Option<String>,
}
impl GetEnvironmentOutput {
    /// <p>The name of the app.</p>
    pub fn app_name(&self) -> &str {
        use std::ops::Deref;
        self.app_name.deref()
    }
    /// <p>The name of the environment.</p>
    pub fn environment_name(&self) -> &str {
        use std::ops::Deref;
        self.environment_name.deref()
    }
    /// <p>The Amazon Resource Name (ARN) of the environment.</p>
    pub fn environment_arn(&self) -> &str {
        use std::ops::Deref;
        self.environment_arn.deref()
    }
    /// <p>The type of the environment.</p>
    pub fn r#type(&self) -> &crate::types::EnvironmentType {
        &self.r#type
    }
    /// <p>The Amazon Resource Name (ARN) of the IAM role for the environment.</p>
    pub fn environment_role_arn(&self) -> &str {
        use std::ops::Deref;
        self.environment_role_arn.deref()
    }
    /// <p>The permission mode for the environment's IAM role.</p>
    pub fn environment_role_permission_mode(&self) -> ::std::option::Option<&crate::types::EnvironmentRolePermissionMode> {
        self.environment_role_permission_mode.as_ref()
    }
    /// <p>The source configuration for the environment.</p>
    pub fn source_config(&self) -> ::std::option::Option<&crate::types::EnvironmentSourceConfig> {
        self.source_config.as_ref()
    }
    /// <p>A list of the environment's AWS WAF log configurations. Omitted when the environment has no WAF log configuration.</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 `.waf_log_configs.is_none()`.
    pub fn waf_log_configs(&self) -> &[crate::types::WafLogConfig] {
        self.waf_log_configs.as_deref().unwrap_or_default()
    }
    /// <p>The gradual rollout settings.</p>
    pub fn gradual_rollout_config(&self) -> ::std::option::Option<&crate::types::GradualRolloutConfig> {
        self.gradual_rollout_config.as_ref()
    }
    /// <p>The web hosting settings for the environment.</p>
    pub fn web(&self) -> ::std::option::Option<&crate::types::EnvironmentWebConfig> {
        self.web.as_ref()
    }
    /// <p>The backend settings for the environment. Database is present only when the app has a backend. Auth is present whenever it is stored.</p>
    pub fn backend(&self) -> ::std::option::Option<&crate::types::EnvironmentBackend> {
        self.backend.as_ref()
    }
    /// <p>The VPC network configuration for the environment.</p>
    pub fn network_config(&self) -> ::std::option::Option<&crate::types::EnvironmentNetworkConfig> {
        self.network_config.as_ref()
    }
    /// <p>The time at which the environment was created. The value is in ISO-8601 format.</p>
    pub fn created_at(&self) -> &::aws_smithy_types::DateTime {
        &self.created_at
    }
    /// <p>The time at which the environment was last updated. The value is in ISO-8601 format.</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 GetEnvironmentOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl GetEnvironmentOutput {
    /// Creates a new builder-style object to manufacture [`GetEnvironmentOutput`](crate::operation::get_environment::GetEnvironmentOutput).
    pub fn builder() -> crate::operation::get_environment::builders::GetEnvironmentOutputBuilder {
        crate::operation::get_environment::builders::GetEnvironmentOutputBuilder::default()
    }
}

/// A builder for [`GetEnvironmentOutput`](crate::operation::get_environment::GetEnvironmentOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct GetEnvironmentOutputBuilder {
    pub(crate) app_name: ::std::option::Option<::std::string::String>,
    pub(crate) environment_name: ::std::option::Option<::std::string::String>,
    pub(crate) environment_arn: ::std::option::Option<::std::string::String>,
    pub(crate) r#type: ::std::option::Option<crate::types::EnvironmentType>,
    pub(crate) environment_role_arn: ::std::option::Option<::std::string::String>,
    pub(crate) environment_role_permission_mode: ::std::option::Option<crate::types::EnvironmentRolePermissionMode>,
    pub(crate) source_config: ::std::option::Option<crate::types::EnvironmentSourceConfig>,
    pub(crate) waf_log_configs: ::std::option::Option<::std::vec::Vec<crate::types::WafLogConfig>>,
    pub(crate) gradual_rollout_config: ::std::option::Option<crate::types::GradualRolloutConfig>,
    pub(crate) web: ::std::option::Option<crate::types::EnvironmentWebConfig>,
    pub(crate) backend: ::std::option::Option<crate::types::EnvironmentBackend>,
    pub(crate) network_config: ::std::option::Option<crate::types::EnvironmentNetworkConfig>,
    pub(crate) created_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) updated_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    _request_id: Option<String>,
}
impl GetEnvironmentOutputBuilder {
    /// <p>The name of the app.</p>
    /// This field is required.
    pub fn app_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.app_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the app.</p>
    pub fn set_app_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.app_name = input;
        self
    }
    /// <p>The name of the app.</p>
    pub fn get_app_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.app_name
    }
    /// <p>The name of the environment.</p>
    /// This field is required.
    pub fn environment_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.environment_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the environment.</p>
    pub fn set_environment_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.environment_name = input;
        self
    }
    /// <p>The name of the environment.</p>
    pub fn get_environment_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.environment_name
    }
    /// <p>The Amazon Resource Name (ARN) of the environment.</p>
    /// This field is required.
    pub fn environment_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.environment_arn = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the environment.</p>
    pub fn set_environment_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.environment_arn = input;
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the environment.</p>
    pub fn get_environment_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.environment_arn
    }
    /// <p>The type of the environment.</p>
    /// This field is required.
    pub fn r#type(mut self, input: crate::types::EnvironmentType) -> Self {
        self.r#type = ::std::option::Option::Some(input);
        self
    }
    /// <p>The type of the environment.</p>
    pub fn set_type(mut self, input: ::std::option::Option<crate::types::EnvironmentType>) -> Self {
        self.r#type = input;
        self
    }
    /// <p>The type of the environment.</p>
    pub fn get_type(&self) -> &::std::option::Option<crate::types::EnvironmentType> {
        &self.r#type
    }
    /// <p>The Amazon Resource Name (ARN) of the IAM role for the environment.</p>
    /// This field is required.
    pub fn environment_role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.environment_role_arn = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the IAM role for the environment.</p>
    pub fn set_environment_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.environment_role_arn = input;
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the IAM role for the environment.</p>
    pub fn get_environment_role_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.environment_role_arn
    }
    /// <p>The permission mode for the environment's IAM role.</p>
    pub fn environment_role_permission_mode(mut self, input: crate::types::EnvironmentRolePermissionMode) -> Self {
        self.environment_role_permission_mode = ::std::option::Option::Some(input);
        self
    }
    /// <p>The permission mode for the environment's IAM role.</p>
    pub fn set_environment_role_permission_mode(mut self, input: ::std::option::Option<crate::types::EnvironmentRolePermissionMode>) -> Self {
        self.environment_role_permission_mode = input;
        self
    }
    /// <p>The permission mode for the environment's IAM role.</p>
    pub fn get_environment_role_permission_mode(&self) -> &::std::option::Option<crate::types::EnvironmentRolePermissionMode> {
        &self.environment_role_permission_mode
    }
    /// <p>The source configuration for the environment.</p>
    pub fn source_config(mut self, input: crate::types::EnvironmentSourceConfig) -> Self {
        self.source_config = ::std::option::Option::Some(input);
        self
    }
    /// <p>The source configuration for the environment.</p>
    pub fn set_source_config(mut self, input: ::std::option::Option<crate::types::EnvironmentSourceConfig>) -> Self {
        self.source_config = input;
        self
    }
    /// <p>The source configuration for the environment.</p>
    pub fn get_source_config(&self) -> &::std::option::Option<crate::types::EnvironmentSourceConfig> {
        &self.source_config
    }
    /// Appends an item to `waf_log_configs`.
    ///
    /// To override the contents of this collection use [`set_waf_log_configs`](Self::set_waf_log_configs).
    ///
    /// <p>A list of the environment's AWS WAF log configurations. Omitted when the environment has no WAF log configuration.</p>
    pub fn waf_log_configs(mut self, input: crate::types::WafLogConfig) -> Self {
        let mut v = self.waf_log_configs.unwrap_or_default();
        v.push(input);
        self.waf_log_configs = ::std::option::Option::Some(v);
        self
    }
    /// <p>A list of the environment's AWS WAF log configurations. Omitted when the environment has no WAF log configuration.</p>
    pub fn set_waf_log_configs(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::WafLogConfig>>) -> Self {
        self.waf_log_configs = input;
        self
    }
    /// <p>A list of the environment's AWS WAF log configurations. Omitted when the environment has no WAF log configuration.</p>
    pub fn get_waf_log_configs(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::WafLogConfig>> {
        &self.waf_log_configs
    }
    /// <p>The gradual rollout settings.</p>
    pub fn gradual_rollout_config(mut self, input: crate::types::GradualRolloutConfig) -> Self {
        self.gradual_rollout_config = ::std::option::Option::Some(input);
        self
    }
    /// <p>The gradual rollout settings.</p>
    pub fn set_gradual_rollout_config(mut self, input: ::std::option::Option<crate::types::GradualRolloutConfig>) -> Self {
        self.gradual_rollout_config = input;
        self
    }
    /// <p>The gradual rollout settings.</p>
    pub fn get_gradual_rollout_config(&self) -> &::std::option::Option<crate::types::GradualRolloutConfig> {
        &self.gradual_rollout_config
    }
    /// <p>The web hosting settings for the environment.</p>
    pub fn web(mut self, input: crate::types::EnvironmentWebConfig) -> Self {
        self.web = ::std::option::Option::Some(input);
        self
    }
    /// <p>The web hosting settings for the environment.</p>
    pub fn set_web(mut self, input: ::std::option::Option<crate::types::EnvironmentWebConfig>) -> Self {
        self.web = input;
        self
    }
    /// <p>The web hosting settings for the environment.</p>
    pub fn get_web(&self) -> &::std::option::Option<crate::types::EnvironmentWebConfig> {
        &self.web
    }
    /// <p>The backend settings for the environment. Database is present only when the app has a backend. Auth is present whenever it is stored.</p>
    pub fn backend(mut self, input: crate::types::EnvironmentBackend) -> Self {
        self.backend = ::std::option::Option::Some(input);
        self
    }
    /// <p>The backend settings for the environment. Database is present only when the app has a backend. Auth is present whenever it is stored.</p>
    pub fn set_backend(mut self, input: ::std::option::Option<crate::types::EnvironmentBackend>) -> Self {
        self.backend = input;
        self
    }
    /// <p>The backend settings for the environment. Database is present only when the app has a backend. Auth is present whenever it is stored.</p>
    pub fn get_backend(&self) -> &::std::option::Option<crate::types::EnvironmentBackend> {
        &self.backend
    }
    /// <p>The VPC network configuration for the environment.</p>
    pub fn network_config(mut self, input: crate::types::EnvironmentNetworkConfig) -> Self {
        self.network_config = ::std::option::Option::Some(input);
        self
    }
    /// <p>The VPC network configuration for the environment.</p>
    pub fn set_network_config(mut self, input: ::std::option::Option<crate::types::EnvironmentNetworkConfig>) -> Self {
        self.network_config = input;
        self
    }
    /// <p>The VPC network configuration for the environment.</p>
    pub fn get_network_config(&self) -> &::std::option::Option<crate::types::EnvironmentNetworkConfig> {
        &self.network_config
    }
    /// <p>The time at which the environment was created. The value is in ISO-8601 format.</p>
    /// This field is required.
    pub fn created_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.created_at = ::std::option::Option::Some(input);
        self
    }
    /// <p>The time at which the environment was created. The value is in ISO-8601 format.</p>
    pub fn set_created_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.created_at = input;
        self
    }
    /// <p>The time at which the environment was created. The value is in ISO-8601 format.</p>
    pub fn get_created_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.created_at
    }
    /// <p>The time at which the environment was last updated. The value is in ISO-8601 format.</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 at which the environment was last updated. The value is in ISO-8601 format.</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 at which the environment was last updated. The value is in ISO-8601 format.</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 [`GetEnvironmentOutput`](crate::operation::get_environment::GetEnvironmentOutput).
    /// This method will fail if any of the following fields are not set:
    /// - [`app_name`](crate::operation::get_environment::builders::GetEnvironmentOutputBuilder::app_name)
    /// - [`environment_name`](crate::operation::get_environment::builders::GetEnvironmentOutputBuilder::environment_name)
    /// - [`environment_arn`](crate::operation::get_environment::builders::GetEnvironmentOutputBuilder::environment_arn)
    /// - [`r#type`](crate::operation::get_environment::builders::GetEnvironmentOutputBuilder::type)
    /// - [`environment_role_arn`](crate::operation::get_environment::builders::GetEnvironmentOutputBuilder::environment_role_arn)
    /// - [`created_at`](crate::operation::get_environment::builders::GetEnvironmentOutputBuilder::created_at)
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::get_environment::GetEnvironmentOutput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::get_environment::GetEnvironmentOutput {
            app_name: self.app_name.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "app_name",
                    "app_name was not specified but it is required when building GetEnvironmentOutput",
                )
            })?,
            environment_name: self.environment_name.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "environment_name",
                    "environment_name was not specified but it is required when building GetEnvironmentOutput",
                )
            })?,
            environment_arn: self.environment_arn.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "environment_arn",
                    "environment_arn was not specified but it is required when building GetEnvironmentOutput",
                )
            })?,
            r#type: self.r#type.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "r#type",
                    "r#type was not specified but it is required when building GetEnvironmentOutput",
                )
            })?,
            environment_role_arn: self.environment_role_arn.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "environment_role_arn",
                    "environment_role_arn was not specified but it is required when building GetEnvironmentOutput",
                )
            })?,
            environment_role_permission_mode: self.environment_role_permission_mode,
            source_config: self.source_config,
            waf_log_configs: self.waf_log_configs,
            gradual_rollout_config: self.gradual_rollout_config,
            web: self.web,
            backend: self.backend,
            network_config: self.network_config,
            created_at: self.created_at.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "created_at",
                    "created_at was not specified but it is required when building GetEnvironmentOutput",
                )
            })?,
            updated_at: self.updated_at,
            _request_id: self._request_id,
        })
    }
}