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
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>Detailed data of an Proton component resource.</p>
/// <p>For more information about components, see <a href="https://docs.aws.amazon.com/proton/latest/userguide/ag-components.html">Proton components</a> in the <i>Proton User Guide</i>.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
pub struct Component {
    /// <p>The name of the component.</p>
    #[doc(hidden)]
    pub name: ::std::option::Option<::std::string::String>,
    /// <p>A description of the component.</p>
    #[doc(hidden)]
    pub description: ::std::option::Option<::std::string::String>,
    /// <p>The Amazon Resource Name (ARN) of the component.</p>
    #[doc(hidden)]
    pub arn: ::std::option::Option<::std::string::String>,
    /// <p>The name of the Proton environment that this component is associated with.</p>
    #[doc(hidden)]
    pub environment_name: ::std::option::Option<::std::string::String>,
    /// <p>The name of the service that <code>serviceInstanceName</code> is associated with. Provided when a component is attached to a service instance.</p>
    #[doc(hidden)]
    pub service_name: ::std::option::Option<::std::string::String>,
    /// <p>The name of the service instance that this component is attached to. Provided when a component is attached to a service instance.</p>
    #[doc(hidden)]
    pub service_instance_name: ::std::option::Option<::std::string::String>,
    /// <p>The time when the component was created.</p>
    #[doc(hidden)]
    pub created_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    /// <p>The time when the component was last modified.</p>
    #[doc(hidden)]
    pub last_modified_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    /// <p>The time when a deployment of the component was last attempted.</p>
    #[doc(hidden)]
    pub last_deployment_attempted_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    /// <p>The time when the component was last deployed successfully.</p>
    #[doc(hidden)]
    pub last_deployment_succeeded_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    /// <p>The component deployment status.</p>
    #[doc(hidden)]
    pub deployment_status: ::std::option::Option<crate::types::DeploymentStatus>,
    /// <p>The message associated with the component deployment status.</p>
    #[doc(hidden)]
    pub deployment_status_message: ::std::option::Option<::std::string::String>,
    /// <p>The service spec that the component uses to access service inputs. Provided when a component is attached to a service instance.</p>
    #[doc(hidden)]
    pub service_spec: ::std::option::Option<::std::string::String>,
    /// <p>The last token the client requested.</p>
    #[doc(hidden)]
    pub last_client_request_token: ::std::option::Option<::std::string::String>,
}
impl Component {
    /// <p>The name of the component.</p>
    pub fn name(&self) -> ::std::option::Option<&str> {
        self.name.as_deref()
    }
    /// <p>A description of the component.</p>
    pub fn description(&self) -> ::std::option::Option<&str> {
        self.description.as_deref()
    }
    /// <p>The Amazon Resource Name (ARN) of the component.</p>
    pub fn arn(&self) -> ::std::option::Option<&str> {
        self.arn.as_deref()
    }
    /// <p>The name of the Proton environment that this component is associated with.</p>
    pub fn environment_name(&self) -> ::std::option::Option<&str> {
        self.environment_name.as_deref()
    }
    /// <p>The name of the service that <code>serviceInstanceName</code> is associated with. Provided when a component is attached to a service instance.</p>
    pub fn service_name(&self) -> ::std::option::Option<&str> {
        self.service_name.as_deref()
    }
    /// <p>The name of the service instance that this component is attached to. Provided when a component is attached to a service instance.</p>
    pub fn service_instance_name(&self) -> ::std::option::Option<&str> {
        self.service_instance_name.as_deref()
    }
    /// <p>The time when the component was created.</p>
    pub fn created_at(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.created_at.as_ref()
    }
    /// <p>The time when the component was last modified.</p>
    pub fn last_modified_at(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.last_modified_at.as_ref()
    }
    /// <p>The time when a deployment of the component was last attempted.</p>
    pub fn last_deployment_attempted_at(
        &self,
    ) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.last_deployment_attempted_at.as_ref()
    }
    /// <p>The time when the component was last deployed successfully.</p>
    pub fn last_deployment_succeeded_at(
        &self,
    ) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.last_deployment_succeeded_at.as_ref()
    }
    /// <p>The component deployment status.</p>
    pub fn deployment_status(&self) -> ::std::option::Option<&crate::types::DeploymentStatus> {
        self.deployment_status.as_ref()
    }
    /// <p>The message associated with the component deployment status.</p>
    pub fn deployment_status_message(&self) -> ::std::option::Option<&str> {
        self.deployment_status_message.as_deref()
    }
    /// <p>The service spec that the component uses to access service inputs. Provided when a component is attached to a service instance.</p>
    pub fn service_spec(&self) -> ::std::option::Option<&str> {
        self.service_spec.as_deref()
    }
    /// <p>The last token the client requested.</p>
    pub fn last_client_request_token(&self) -> ::std::option::Option<&str> {
        self.last_client_request_token.as_deref()
    }
}
impl ::std::fmt::Debug for Component {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("Component");
        formatter.field("name", &self.name);
        formatter.field("description", &"*** Sensitive Data Redacted ***");
        formatter.field("arn", &self.arn);
        formatter.field("environment_name", &self.environment_name);
        formatter.field("service_name", &self.service_name);
        formatter.field("service_instance_name", &self.service_instance_name);
        formatter.field("created_at", &self.created_at);
        formatter.field("last_modified_at", &self.last_modified_at);
        formatter.field(
            "last_deployment_attempted_at",
            &self.last_deployment_attempted_at,
        );
        formatter.field(
            "last_deployment_succeeded_at",
            &self.last_deployment_succeeded_at,
        );
        formatter.field("deployment_status", &self.deployment_status);
        formatter.field(
            "deployment_status_message",
            &"*** Sensitive Data Redacted ***",
        );
        formatter.field("service_spec", &"*** Sensitive Data Redacted ***");
        formatter.field("last_client_request_token", &self.last_client_request_token);
        formatter.finish()
    }
}
impl Component {
    /// Creates a new builder-style object to manufacture [`Component`](crate::types::Component).
    pub fn builder() -> crate::types::builders::ComponentBuilder {
        crate::types::builders::ComponentBuilder::default()
    }
}

/// A builder for [`Component`](crate::types::Component).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
pub struct ComponentBuilder {
    pub(crate) name: ::std::option::Option<::std::string::String>,
    pub(crate) description: ::std::option::Option<::std::string::String>,
    pub(crate) arn: ::std::option::Option<::std::string::String>,
    pub(crate) environment_name: ::std::option::Option<::std::string::String>,
    pub(crate) service_name: ::std::option::Option<::std::string::String>,
    pub(crate) service_instance_name: ::std::option::Option<::std::string::String>,
    pub(crate) created_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) last_modified_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) last_deployment_attempted_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) last_deployment_succeeded_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) deployment_status: ::std::option::Option<crate::types::DeploymentStatus>,
    pub(crate) deployment_status_message: ::std::option::Option<::std::string::String>,
    pub(crate) service_spec: ::std::option::Option<::std::string::String>,
    pub(crate) last_client_request_token: ::std::option::Option<::std::string::String>,
}
impl ComponentBuilder {
    /// <p>The name of the component.</p>
    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the component.</p>
    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.name = input;
        self
    }
    /// <p>A description of the component.</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>A description of the component.</p>
    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.description = input;
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the component.</p>
    pub fn arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.arn = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the component.</p>
    pub fn set_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.arn = input;
        self
    }
    /// <p>The name of the Proton environment that this component is associated with.</p>
    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 Proton environment that this component is associated with.</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 service that <code>serviceInstanceName</code> is associated with. Provided when a component is attached to a service instance.</p>
    pub fn service_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.service_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the service that <code>serviceInstanceName</code> is associated with. Provided when a component is attached to a service instance.</p>
    pub fn set_service_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.service_name = input;
        self
    }
    /// <p>The name of the service instance that this component is attached to. Provided when a component is attached to a service instance.</p>
    pub fn service_instance_name(
        mut self,
        input: impl ::std::convert::Into<::std::string::String>,
    ) -> Self {
        self.service_instance_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the service instance that this component is attached to. Provided when a component is attached to a service instance.</p>
    pub fn set_service_instance_name(
        mut self,
        input: ::std::option::Option<::std::string::String>,
    ) -> Self {
        self.service_instance_name = input;
        self
    }
    /// <p>The time when the component was created.</p>
    pub fn created_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.created_at = ::std::option::Option::Some(input);
        self
    }
    /// <p>The time when the component was created.</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 when the component was last modified.</p>
    pub fn last_modified_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.last_modified_at = ::std::option::Option::Some(input);
        self
    }
    /// <p>The time when the component was last modified.</p>
    pub fn set_last_modified_at(
        mut self,
        input: ::std::option::Option<::aws_smithy_types::DateTime>,
    ) -> Self {
        self.last_modified_at = input;
        self
    }
    /// <p>The time when a deployment of the component was last attempted.</p>
    pub fn last_deployment_attempted_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.last_deployment_attempted_at = ::std::option::Option::Some(input);
        self
    }
    /// <p>The time when a deployment of the component was last attempted.</p>
    pub fn set_last_deployment_attempted_at(
        mut self,
        input: ::std::option::Option<::aws_smithy_types::DateTime>,
    ) -> Self {
        self.last_deployment_attempted_at = input;
        self
    }
    /// <p>The time when the component was last deployed successfully.</p>
    pub fn last_deployment_succeeded_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.last_deployment_succeeded_at = ::std::option::Option::Some(input);
        self
    }
    /// <p>The time when the component was last deployed successfully.</p>
    pub fn set_last_deployment_succeeded_at(
        mut self,
        input: ::std::option::Option<::aws_smithy_types::DateTime>,
    ) -> Self {
        self.last_deployment_succeeded_at = input;
        self
    }
    /// <p>The component deployment status.</p>
    pub fn deployment_status(mut self, input: crate::types::DeploymentStatus) -> Self {
        self.deployment_status = ::std::option::Option::Some(input);
        self
    }
    /// <p>The component deployment status.</p>
    pub fn set_deployment_status(
        mut self,
        input: ::std::option::Option<crate::types::DeploymentStatus>,
    ) -> Self {
        self.deployment_status = input;
        self
    }
    /// <p>The message associated with the component deployment status.</p>
    pub fn deployment_status_message(
        mut self,
        input: impl ::std::convert::Into<::std::string::String>,
    ) -> Self {
        self.deployment_status_message = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The message associated with the component deployment status.</p>
    pub fn set_deployment_status_message(
        mut self,
        input: ::std::option::Option<::std::string::String>,
    ) -> Self {
        self.deployment_status_message = input;
        self
    }
    /// <p>The service spec that the component uses to access service inputs. Provided when a component is attached to a service instance.</p>
    pub fn service_spec(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.service_spec = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The service spec that the component uses to access service inputs. Provided when a component is attached to a service instance.</p>
    pub fn set_service_spec(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.service_spec = input;
        self
    }
    /// <p>The last token the client requested.</p>
    pub fn last_client_request_token(
        mut self,
        input: impl ::std::convert::Into<::std::string::String>,
    ) -> Self {
        self.last_client_request_token = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The last token the client requested.</p>
    pub fn set_last_client_request_token(
        mut self,
        input: ::std::option::Option<::std::string::String>,
    ) -> Self {
        self.last_client_request_token = input;
        self
    }
    /// Consumes the builder and constructs a [`Component`](crate::types::Component).
    pub fn build(self) -> crate::types::Component {
        crate::types::Component {
            name: self.name,
            description: self.description,
            arn: self.arn,
            environment_name: self.environment_name,
            service_name: self.service_name,
            service_instance_name: self.service_instance_name,
            created_at: self.created_at,
            last_modified_at: self.last_modified_at,
            last_deployment_attempted_at: self.last_deployment_attempted_at,
            last_deployment_succeeded_at: self.last_deployment_succeeded_at,
            deployment_status: self.deployment_status,
            deployment_status_message: self.deployment_status_message,
            service_spec: self.service_spec,
            last_client_request_token: self.last_client_request_token,
        }
    }
}
impl ::std::fmt::Debug for ComponentBuilder {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("ComponentBuilder");
        formatter.field("name", &self.name);
        formatter.field("description", &"*** Sensitive Data Redacted ***");
        formatter.field("arn", &self.arn);
        formatter.field("environment_name", &self.environment_name);
        formatter.field("service_name", &self.service_name);
        formatter.field("service_instance_name", &self.service_instance_name);
        formatter.field("created_at", &self.created_at);
        formatter.field("last_modified_at", &self.last_modified_at);
        formatter.field(
            "last_deployment_attempted_at",
            &self.last_deployment_attempted_at,
        );
        formatter.field(
            "last_deployment_succeeded_at",
            &self.last_deployment_succeeded_at,
        );
        formatter.field("deployment_status", &self.deployment_status);
        formatter.field(
            "deployment_status_message",
            &"*** Sensitive Data Redacted ***",
        );
        formatter.field("service_spec", &"*** Sensitive Data Redacted ***");
        formatter.field("last_client_request_token", &self.last_client_request_token);
        formatter.finish()
    }
}