aws-sdk-proton 1.101.0

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

/// <p>Detailed data of an Proton service resource.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
pub struct Service {
    /// <p>The name of the service.</p>
    pub name: ::std::string::String,
    /// <p>A description of the service.</p>
    pub description: ::std::option::Option<::std::string::String>,
    /// <p>The Amazon Resource Name (ARN) of the service.</p>
    pub arn: ::std::string::String,
    /// <p>The name of the service template.</p>
    pub template_name: ::std::string::String,
    /// <p>The time when the service was created.</p>
    pub created_at: ::aws_smithy_types::DateTime,
    /// <p>The time when the service was last modified.</p>
    pub last_modified_at: ::aws_smithy_types::DateTime,
    /// <p>The status of the service.</p>
    pub status: crate::types::ServiceStatus,
    /// <p>A service status message.</p>
    pub status_message: ::std::option::Option<::std::string::String>,
    /// <p>The formatted specification that defines the service.</p>
    pub spec: ::std::string::String,
    /// <p>The service pipeline detail data.</p>
    pub pipeline: ::std::option::Option<crate::types::ServicePipeline>,
    /// <p>The Amazon Resource Name (ARN) of the repository connection. For more information, see <a href="https://docs.aws.amazon.com/proton/latest/userguide/setting-up-for-service.html#setting-up-vcontrol">Setting up an AWS CodeStar connection</a> in the <i>Proton User Guide</i>.</p>
    pub repository_connection_arn: ::std::option::Option<::std::string::String>,
    /// <p>The ID of the source code repository.</p>
    pub repository_id: ::std::option::Option<::std::string::String>,
    /// <p>The name of the code repository branch that holds the code that's deployed in Proton.</p>
    pub branch_name: ::std::option::Option<::std::string::String>,
}
impl Service {
    /// <p>The name of the service.</p>
    pub fn name(&self) -> &str {
        use std::ops::Deref;
        self.name.deref()
    }
    /// <p>A description of the service.</p>
    pub fn description(&self) -> ::std::option::Option<&str> {
        self.description.as_deref()
    }
    /// <p>The Amazon Resource Name (ARN) of the service.</p>
    pub fn arn(&self) -> &str {
        use std::ops::Deref;
        self.arn.deref()
    }
    /// <p>The name of the service template.</p>
    pub fn template_name(&self) -> &str {
        use std::ops::Deref;
        self.template_name.deref()
    }
    /// <p>The time when the service was created.</p>
    pub fn created_at(&self) -> &::aws_smithy_types::DateTime {
        &self.created_at
    }
    /// <p>The time when the service was last modified.</p>
    pub fn last_modified_at(&self) -> &::aws_smithy_types::DateTime {
        &self.last_modified_at
    }
    /// <p>The status of the service.</p>
    pub fn status(&self) -> &crate::types::ServiceStatus {
        &self.status
    }
    /// <p>A service status message.</p>
    pub fn status_message(&self) -> ::std::option::Option<&str> {
        self.status_message.as_deref()
    }
    /// <p>The formatted specification that defines the service.</p>
    pub fn spec(&self) -> &str {
        use std::ops::Deref;
        self.spec.deref()
    }
    /// <p>The service pipeline detail data.</p>
    pub fn pipeline(&self) -> ::std::option::Option<&crate::types::ServicePipeline> {
        self.pipeline.as_ref()
    }
    /// <p>The Amazon Resource Name (ARN) of the repository connection. For more information, see <a href="https://docs.aws.amazon.com/proton/latest/userguide/setting-up-for-service.html#setting-up-vcontrol">Setting up an AWS CodeStar connection</a> in the <i>Proton User Guide</i>.</p>
    pub fn repository_connection_arn(&self) -> ::std::option::Option<&str> {
        self.repository_connection_arn.as_deref()
    }
    /// <p>The ID of the source code repository.</p>
    pub fn repository_id(&self) -> ::std::option::Option<&str> {
        self.repository_id.as_deref()
    }
    /// <p>The name of the code repository branch that holds the code that's deployed in Proton.</p>
    pub fn branch_name(&self) -> ::std::option::Option<&str> {
        self.branch_name.as_deref()
    }
}
impl ::std::fmt::Debug for Service {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("Service");
        formatter.field("name", &self.name);
        formatter.field("description", &"*** Sensitive Data Redacted ***");
        formatter.field("arn", &self.arn);
        formatter.field("template_name", &self.template_name);
        formatter.field("created_at", &self.created_at);
        formatter.field("last_modified_at", &self.last_modified_at);
        formatter.field("status", &self.status);
        formatter.field("status_message", &"*** Sensitive Data Redacted ***");
        formatter.field("spec", &"*** Sensitive Data Redacted ***");
        formatter.field("pipeline", &self.pipeline);
        formatter.field("repository_connection_arn", &self.repository_connection_arn);
        formatter.field("repository_id", &self.repository_id);
        formatter.field("branch_name", &self.branch_name);
        formatter.finish()
    }
}
impl Service {
    /// Creates a new builder-style object to manufacture [`Service`](crate::types::Service).
    pub fn builder() -> crate::types::builders::ServiceBuilder {
        crate::types::builders::ServiceBuilder::default()
    }
}

/// A builder for [`Service`](crate::types::Service).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
#[non_exhaustive]
pub struct ServiceBuilder {
    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) template_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) status: ::std::option::Option<crate::types::ServiceStatus>,
    pub(crate) status_message: ::std::option::Option<::std::string::String>,
    pub(crate) spec: ::std::option::Option<::std::string::String>,
    pub(crate) pipeline: ::std::option::Option<crate::types::ServicePipeline>,
    pub(crate) repository_connection_arn: ::std::option::Option<::std::string::String>,
    pub(crate) repository_id: ::std::option::Option<::std::string::String>,
    pub(crate) branch_name: ::std::option::Option<::std::string::String>,
}
impl ServiceBuilder {
    /// <p>The name of the service.</p>
    /// This field is required.
    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 service.</p>
    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.name = input;
        self
    }
    /// <p>The name of the service.</p>
    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.name
    }
    /// <p>A description of the service.</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 service.</p>
    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.description = input;
        self
    }
    /// <p>A description of the service.</p>
    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
        &self.description
    }
    /// <p>The Amazon Resource Name (ARN) of the service.</p>
    /// This field is required.
    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 service.</p>
    pub fn set_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.arn = input;
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the service.</p>
    pub fn get_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.arn
    }
    /// <p>The name of the service template.</p>
    /// This field is required.
    pub fn template_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.template_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the service template.</p>
    pub fn set_template_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.template_name = input;
        self
    }
    /// <p>The name of the service template.</p>
    pub fn get_template_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.template_name
    }
    /// <p>The time when the service was created.</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 when the service 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 service was created.</p>
    pub fn get_created_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.created_at
    }
    /// <p>The time when the service was last modified.</p>
    /// This field is required.
    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 service 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 the service was last modified.</p>
    pub fn get_last_modified_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.last_modified_at
    }
    /// <p>The status of the service.</p>
    /// This field is required.
    pub fn status(mut self, input: crate::types::ServiceStatus) -> Self {
        self.status = ::std::option::Option::Some(input);
        self
    }
    /// <p>The status of the service.</p>
    pub fn set_status(mut self, input: ::std::option::Option<crate::types::ServiceStatus>) -> Self {
        self.status = input;
        self
    }
    /// <p>The status of the service.</p>
    pub fn get_status(&self) -> &::std::option::Option<crate::types::ServiceStatus> {
        &self.status
    }
    /// <p>A service status message.</p>
    pub fn status_message(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.status_message = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>A service status message.</p>
    pub fn set_status_message(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.status_message = input;
        self
    }
    /// <p>A service status message.</p>
    pub fn get_status_message(&self) -> &::std::option::Option<::std::string::String> {
        &self.status_message
    }
    /// <p>The formatted specification that defines the service.</p>
    /// This field is required.
    pub fn spec(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.spec = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The formatted specification that defines the service.</p>
    pub fn set_spec(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.spec = input;
        self
    }
    /// <p>The formatted specification that defines the service.</p>
    pub fn get_spec(&self) -> &::std::option::Option<::std::string::String> {
        &self.spec
    }
    /// <p>The service pipeline detail data.</p>
    pub fn pipeline(mut self, input: crate::types::ServicePipeline) -> Self {
        self.pipeline = ::std::option::Option::Some(input);
        self
    }
    /// <p>The service pipeline detail data.</p>
    pub fn set_pipeline(mut self, input: ::std::option::Option<crate::types::ServicePipeline>) -> Self {
        self.pipeline = input;
        self
    }
    /// <p>The service pipeline detail data.</p>
    pub fn get_pipeline(&self) -> &::std::option::Option<crate::types::ServicePipeline> {
        &self.pipeline
    }
    /// <p>The Amazon Resource Name (ARN) of the repository connection. For more information, see <a href="https://docs.aws.amazon.com/proton/latest/userguide/setting-up-for-service.html#setting-up-vcontrol">Setting up an AWS CodeStar connection</a> in the <i>Proton User Guide</i>.</p>
    pub fn repository_connection_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.repository_connection_arn = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the repository connection. For more information, see <a href="https://docs.aws.amazon.com/proton/latest/userguide/setting-up-for-service.html#setting-up-vcontrol">Setting up an AWS CodeStar connection</a> in the <i>Proton User Guide</i>.</p>
    pub fn set_repository_connection_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.repository_connection_arn = input;
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the repository connection. For more information, see <a href="https://docs.aws.amazon.com/proton/latest/userguide/setting-up-for-service.html#setting-up-vcontrol">Setting up an AWS CodeStar connection</a> in the <i>Proton User Guide</i>.</p>
    pub fn get_repository_connection_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.repository_connection_arn
    }
    /// <p>The ID of the source code repository.</p>
    pub fn repository_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.repository_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The ID of the source code repository.</p>
    pub fn set_repository_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.repository_id = input;
        self
    }
    /// <p>The ID of the source code repository.</p>
    pub fn get_repository_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.repository_id
    }
    /// <p>The name of the code repository branch that holds the code that's deployed in Proton.</p>
    pub fn branch_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.branch_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the code repository branch that holds the code that's deployed in Proton.</p>
    pub fn set_branch_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.branch_name = input;
        self
    }
    /// <p>The name of the code repository branch that holds the code that's deployed in Proton.</p>
    pub fn get_branch_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.branch_name
    }
    /// Consumes the builder and constructs a [`Service`](crate::types::Service).
    /// This method will fail if any of the following fields are not set:
    /// - [`name`](crate::types::builders::ServiceBuilder::name)
    /// - [`arn`](crate::types::builders::ServiceBuilder::arn)
    /// - [`template_name`](crate::types::builders::ServiceBuilder::template_name)
    /// - [`created_at`](crate::types::builders::ServiceBuilder::created_at)
    /// - [`last_modified_at`](crate::types::builders::ServiceBuilder::last_modified_at)
    /// - [`status`](crate::types::builders::ServiceBuilder::status)
    /// - [`spec`](crate::types::builders::ServiceBuilder::spec)
    pub fn build(self) -> ::std::result::Result<crate::types::Service, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::types::Service {
            name: self.name.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "name",
                    "name was not specified but it is required when building Service",
                )
            })?,
            description: self.description,
            arn: self.arn.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "arn",
                    "arn was not specified but it is required when building Service",
                )
            })?,
            template_name: self.template_name.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "template_name",
                    "template_name was not specified but it is required when building Service",
                )
            })?,
            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 Service",
                )
            })?,
            last_modified_at: self.last_modified_at.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "last_modified_at",
                    "last_modified_at was not specified but it is required when building Service",
                )
            })?,
            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 Service",
                )
            })?,
            status_message: self.status_message,
            spec: self.spec.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "spec",
                    "spec was not specified but it is required when building Service",
                )
            })?,
            pipeline: self.pipeline,
            repository_connection_arn: self.repository_connection_arn,
            repository_id: self.repository_id,
            branch_name: self.branch_name,
        })
    }
}
impl ::std::fmt::Debug for ServiceBuilder {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("ServiceBuilder");
        formatter.field("name", &self.name);
        formatter.field("description", &"*** Sensitive Data Redacted ***");
        formatter.field("arn", &self.arn);
        formatter.field("template_name", &self.template_name);
        formatter.field("created_at", &self.created_at);
        formatter.field("last_modified_at", &self.last_modified_at);
        formatter.field("status", &self.status);
        formatter.field("status_message", &"*** Sensitive Data Redacted ***");
        formatter.field("spec", &"*** Sensitive Data Redacted ***");
        formatter.field("pipeline", &self.pipeline);
        formatter.field("repository_connection_arn", &self.repository_connection_arn);
        formatter.field("repository_id", &self.repository_id);
        formatter.field("branch_name", &self.branch_name);
        formatter.finish()
    }
}