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
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>The details of the instance.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Instance {
/// <p>The Amazon Web Services Supply Chain instance identifier.</p>
pub instance_id: ::std::string::String,
/// <p>The Amazon Web Services account ID that owns the instance.</p>
pub aws_account_id: ::std::string::String,
/// <p>The state of the instance.</p>
pub state: crate::types::InstanceState,
/// <p>The Amazon Web Services Supply Chain instance error message. If the instance results in an unhealthy state, customers need to check the error message, delete the current instance, and recreate a new one based on the mitigation from the error message.</p>
pub error_message: ::std::option::Option<::std::string::String>,
/// <p>The WebApp DNS domain name of the instance.</p>
pub web_app_dns_domain: ::std::option::Option<::std::string::String>,
/// <p>The instance creation timestamp.</p>
pub created_time: ::std::option::Option<::aws_smithy_types::DateTime>,
/// <p>The instance last modified timestamp.</p>
pub last_modified_time: ::std::option::Option<::aws_smithy_types::DateTime>,
/// <p>The Amazon Web Services Supply Chain instance name.</p>
pub instance_name: ::std::option::Option<::std::string::String>,
/// <p>The Amazon Web Services Supply Chain instance description.</p>
pub instance_description: ::std::option::Option<::std::string::String>,
/// <p>The ARN (Amazon Resource Name) of the Key Management Service (KMS) key you optionally provided for encryption. If you did not provide anything here, AWS Supply Chain uses the Amazon Web Services owned KMS key and nothing is returned.</p>
pub kms_key_arn: ::std::option::Option<::std::string::String>,
/// <p>The version number of the instance.</p>
pub version_number: ::std::option::Option<f64>,
}
impl Instance {
/// <p>The Amazon Web Services Supply Chain instance identifier.</p>
pub fn instance_id(&self) -> &str {
use std::ops::Deref;
self.instance_id.deref()
}
/// <p>The Amazon Web Services account ID that owns the instance.</p>
pub fn aws_account_id(&self) -> &str {
use std::ops::Deref;
self.aws_account_id.deref()
}
/// <p>The state of the instance.</p>
pub fn state(&self) -> &crate::types::InstanceState {
&self.state
}
/// <p>The Amazon Web Services Supply Chain instance error message. If the instance results in an unhealthy state, customers need to check the error message, delete the current instance, and recreate a new one based on the mitigation from the error message.</p>
pub fn error_message(&self) -> ::std::option::Option<&str> {
self.error_message.as_deref()
}
/// <p>The WebApp DNS domain name of the instance.</p>
pub fn web_app_dns_domain(&self) -> ::std::option::Option<&str> {
self.web_app_dns_domain.as_deref()
}
/// <p>The instance creation timestamp.</p>
pub fn created_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
self.created_time.as_ref()
}
/// <p>The instance last modified timestamp.</p>
pub fn last_modified_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
self.last_modified_time.as_ref()
}
/// <p>The Amazon Web Services Supply Chain instance name.</p>
pub fn instance_name(&self) -> ::std::option::Option<&str> {
self.instance_name.as_deref()
}
/// <p>The Amazon Web Services Supply Chain instance description.</p>
pub fn instance_description(&self) -> ::std::option::Option<&str> {
self.instance_description.as_deref()
}
/// <p>The ARN (Amazon Resource Name) of the Key Management Service (KMS) key you optionally provided for encryption. If you did not provide anything here, AWS Supply Chain uses the Amazon Web Services owned KMS key and nothing is returned.</p>
pub fn kms_key_arn(&self) -> ::std::option::Option<&str> {
self.kms_key_arn.as_deref()
}
/// <p>The version number of the instance.</p>
pub fn version_number(&self) -> ::std::option::Option<f64> {
self.version_number
}
}
impl Instance {
/// Creates a new builder-style object to manufacture [`Instance`](crate::types::Instance).
pub fn builder() -> crate::types::builders::InstanceBuilder {
crate::types::builders::InstanceBuilder::default()
}
}
/// A builder for [`Instance`](crate::types::Instance).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct InstanceBuilder {
pub(crate) instance_id: ::std::option::Option<::std::string::String>,
pub(crate) aws_account_id: ::std::option::Option<::std::string::String>,
pub(crate) state: ::std::option::Option<crate::types::InstanceState>,
pub(crate) error_message: ::std::option::Option<::std::string::String>,
pub(crate) web_app_dns_domain: ::std::option::Option<::std::string::String>,
pub(crate) created_time: ::std::option::Option<::aws_smithy_types::DateTime>,
pub(crate) last_modified_time: ::std::option::Option<::aws_smithy_types::DateTime>,
pub(crate) instance_name: ::std::option::Option<::std::string::String>,
pub(crate) instance_description: ::std::option::Option<::std::string::String>,
pub(crate) kms_key_arn: ::std::option::Option<::std::string::String>,
pub(crate) version_number: ::std::option::Option<f64>,
}
impl InstanceBuilder {
/// <p>The Amazon Web Services Supply Chain instance identifier.</p>
/// This field is required.
pub fn instance_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.instance_id = ::std::option::Option::Some(input.into());
self
}
/// <p>The Amazon Web Services Supply Chain instance identifier.</p>
pub fn set_instance_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.instance_id = input;
self
}
/// <p>The Amazon Web Services Supply Chain instance identifier.</p>
pub fn get_instance_id(&self) -> &::std::option::Option<::std::string::String> {
&self.instance_id
}
/// <p>The Amazon Web Services account ID that owns the instance.</p>
/// This field is required.
pub fn aws_account_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.aws_account_id = ::std::option::Option::Some(input.into());
self
}
/// <p>The Amazon Web Services account ID that owns the instance.</p>
pub fn set_aws_account_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.aws_account_id = input;
self
}
/// <p>The Amazon Web Services account ID that owns the instance.</p>
pub fn get_aws_account_id(&self) -> &::std::option::Option<::std::string::String> {
&self.aws_account_id
}
/// <p>The state of the instance.</p>
/// This field is required.
pub fn state(mut self, input: crate::types::InstanceState) -> Self {
self.state = ::std::option::Option::Some(input);
self
}
/// <p>The state of the instance.</p>
pub fn set_state(mut self, input: ::std::option::Option<crate::types::InstanceState>) -> Self {
self.state = input;
self
}
/// <p>The state of the instance.</p>
pub fn get_state(&self) -> &::std::option::Option<crate::types::InstanceState> {
&self.state
}
/// <p>The Amazon Web Services Supply Chain instance error message. If the instance results in an unhealthy state, customers need to check the error message, delete the current instance, and recreate a new one based on the mitigation from the error message.</p>
pub fn error_message(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.error_message = ::std::option::Option::Some(input.into());
self
}
/// <p>The Amazon Web Services Supply Chain instance error message. If the instance results in an unhealthy state, customers need to check the error message, delete the current instance, and recreate a new one based on the mitigation from the error message.</p>
pub fn set_error_message(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.error_message = input;
self
}
/// <p>The Amazon Web Services Supply Chain instance error message. If the instance results in an unhealthy state, customers need to check the error message, delete the current instance, and recreate a new one based on the mitigation from the error message.</p>
pub fn get_error_message(&self) -> &::std::option::Option<::std::string::String> {
&self.error_message
}
/// <p>The WebApp DNS domain name of the instance.</p>
pub fn web_app_dns_domain(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.web_app_dns_domain = ::std::option::Option::Some(input.into());
self
}
/// <p>The WebApp DNS domain name of the instance.</p>
pub fn set_web_app_dns_domain(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.web_app_dns_domain = input;
self
}
/// <p>The WebApp DNS domain name of the instance.</p>
pub fn get_web_app_dns_domain(&self) -> &::std::option::Option<::std::string::String> {
&self.web_app_dns_domain
}
/// <p>The instance creation timestamp.</p>
pub fn created_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
self.created_time = ::std::option::Option::Some(input);
self
}
/// <p>The instance creation timestamp.</p>
pub fn set_created_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
self.created_time = input;
self
}
/// <p>The instance creation timestamp.</p>
pub fn get_created_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
&self.created_time
}
/// <p>The instance last modified timestamp.</p>
pub fn last_modified_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
self.last_modified_time = ::std::option::Option::Some(input);
self
}
/// <p>The instance last modified timestamp.</p>
pub fn set_last_modified_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
self.last_modified_time = input;
self
}
/// <p>The instance last modified timestamp.</p>
pub fn get_last_modified_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
&self.last_modified_time
}
/// <p>The Amazon Web Services Supply Chain instance name.</p>
pub fn instance_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.instance_name = ::std::option::Option::Some(input.into());
self
}
/// <p>The Amazon Web Services Supply Chain instance name.</p>
pub fn set_instance_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.instance_name = input;
self
}
/// <p>The Amazon Web Services Supply Chain instance name.</p>
pub fn get_instance_name(&self) -> &::std::option::Option<::std::string::String> {
&self.instance_name
}
/// <p>The Amazon Web Services Supply Chain instance description.</p>
pub fn instance_description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.instance_description = ::std::option::Option::Some(input.into());
self
}
/// <p>The Amazon Web Services Supply Chain instance description.</p>
pub fn set_instance_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.instance_description = input;
self
}
/// <p>The Amazon Web Services Supply Chain instance description.</p>
pub fn get_instance_description(&self) -> &::std::option::Option<::std::string::String> {
&self.instance_description
}
/// <p>The ARN (Amazon Resource Name) of the Key Management Service (KMS) key you optionally provided for encryption. If you did not provide anything here, AWS Supply Chain uses the Amazon Web Services owned KMS key and nothing is returned.</p>
pub fn kms_key_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.kms_key_arn = ::std::option::Option::Some(input.into());
self
}
/// <p>The ARN (Amazon Resource Name) of the Key Management Service (KMS) key you optionally provided for encryption. If you did not provide anything here, AWS Supply Chain uses the Amazon Web Services owned KMS key and nothing is returned.</p>
pub fn set_kms_key_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.kms_key_arn = input;
self
}
/// <p>The ARN (Amazon Resource Name) of the Key Management Service (KMS) key you optionally provided for encryption. If you did not provide anything here, AWS Supply Chain uses the Amazon Web Services owned KMS key and nothing is returned.</p>
pub fn get_kms_key_arn(&self) -> &::std::option::Option<::std::string::String> {
&self.kms_key_arn
}
/// <p>The version number of the instance.</p>
pub fn version_number(mut self, input: f64) -> Self {
self.version_number = ::std::option::Option::Some(input);
self
}
/// <p>The version number of the instance.</p>
pub fn set_version_number(mut self, input: ::std::option::Option<f64>) -> Self {
self.version_number = input;
self
}
/// <p>The version number of the instance.</p>
pub fn get_version_number(&self) -> &::std::option::Option<f64> {
&self.version_number
}
/// Consumes the builder and constructs a [`Instance`](crate::types::Instance).
/// This method will fail if any of the following fields are not set:
/// - [`instance_id`](crate::types::builders::InstanceBuilder::instance_id)
/// - [`aws_account_id`](crate::types::builders::InstanceBuilder::aws_account_id)
/// - [`state`](crate::types::builders::InstanceBuilder::state)
pub fn build(self) -> ::std::result::Result<crate::types::Instance, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::types::Instance {
instance_id: self.instance_id.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"instance_id",
"instance_id was not specified but it is required when building Instance",
)
})?,
aws_account_id: self.aws_account_id.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"aws_account_id",
"aws_account_id was not specified but it is required when building Instance",
)
})?,
state: self.state.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"state",
"state was not specified but it is required when building Instance",
)
})?,
error_message: self.error_message,
web_app_dns_domain: self.web_app_dns_domain,
created_time: self.created_time,
last_modified_time: self.last_modified_time,
instance_name: self.instance_name,
instance_description: self.instance_description,
kms_key_arn: self.kms_key_arn,
version_number: self.version_number,
})
}
}