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
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// A connection between CloudWatch and an external system — such as a source of telemetry or configuration data, a messaging destination, or a model provider.
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Integration {
/// The unique identifier of the integration.
pub integration_id: ::std::string::String,
/// The Amazon Resource Name (ARN) of the integration.
pub integration_arn: ::std::option::Option<::std::string::String>,
/// The type of external system that an integration connects to, such as a source of configuration data, a messaging destination, or a model provider.
pub integration_type: crate::types::IntegrationType,
/// The customer-provided name of the integration.
pub name: ::std::string::String,
/// The current lifecycle state of an integration.
pub status: crate::types::IntegrationStatus,
/// The authentication method that an integration uses to connect to its external system.
pub auth_type: ::std::option::Option<crate::types::AuthType>,
/// The Amazon Resource Name (ARN) of the secret that stores the integration's credentials.
pub credential_arn: ::std::option::Option<::std::string::String>,
/// The Amazon Resource Name (ARN) of the IAM role that CloudWatch assumes to access the external system.
pub role_arn: ::std::option::Option<::std::string::String>,
/// Provider-specific key/value attributes that configure the integration.
pub integration_attributes: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
/// The URL the customer visits to authorize the integration. Present while an OAuth authorization is pending.
pub authorization_url: ::std::option::Option<::std::string::String>,
/// A human-readable description of why the integration is in an ERROR or FAILED state. Present only when the integration has failed.
pub error_message: ::std::option::Option<::std::string::String>,
/// The time at which the integration was created.
pub created_at: ::std::option::Option<::aws_smithy_types::DateTime>,
/// The time at which the integration was last updated.
pub updated_at: ::std::option::Option<::aws_smithy_types::DateTime>,
/// Whether this integration is account-scoped (ACCOUNT, customer-created) or organization-scoped (ORGANIZATION, created by an org-enablement rule). Absent on legacy records is treated as ACCOUNT.
pub scope: ::std::option::Option<crate::types::Scope>,
}
impl Integration {
/// The unique identifier of the integration.
pub fn integration_id(&self) -> &str {
use std::ops::Deref;
self.integration_id.deref()
}
/// The Amazon Resource Name (ARN) of the integration.
pub fn integration_arn(&self) -> ::std::option::Option<&str> {
self.integration_arn.as_deref()
}
/// The type of external system that an integration connects to, such as a source of configuration data, a messaging destination, or a model provider.
pub fn integration_type(&self) -> &crate::types::IntegrationType {
&self.integration_type
}
/// The customer-provided name of the integration.
pub fn name(&self) -> &str {
use std::ops::Deref;
self.name.deref()
}
/// The current lifecycle state of an integration.
pub fn status(&self) -> &crate::types::IntegrationStatus {
&self.status
}
/// The authentication method that an integration uses to connect to its external system.
pub fn auth_type(&self) -> ::std::option::Option<&crate::types::AuthType> {
self.auth_type.as_ref()
}
/// The Amazon Resource Name (ARN) of the secret that stores the integration's credentials.
pub fn credential_arn(&self) -> ::std::option::Option<&str> {
self.credential_arn.as_deref()
}
/// The Amazon Resource Name (ARN) of the IAM role that CloudWatch assumes to access the external system.
pub fn role_arn(&self) -> ::std::option::Option<&str> {
self.role_arn.as_deref()
}
/// Provider-specific key/value attributes that configure the integration.
pub fn integration_attributes(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
self.integration_attributes.as_ref()
}
/// The URL the customer visits to authorize the integration. Present while an OAuth authorization is pending.
pub fn authorization_url(&self) -> ::std::option::Option<&str> {
self.authorization_url.as_deref()
}
/// A human-readable description of why the integration is in an ERROR or FAILED state. Present only when the integration has failed.
pub fn error_message(&self) -> ::std::option::Option<&str> {
self.error_message.as_deref()
}
/// The time at which the integration was created.
pub fn created_at(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
self.created_at.as_ref()
}
/// The time at which the integration was last updated.
pub fn updated_at(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
self.updated_at.as_ref()
}
/// Whether this integration is account-scoped (ACCOUNT, customer-created) or organization-scoped (ORGANIZATION, created by an org-enablement rule). Absent on legacy records is treated as ACCOUNT.
pub fn scope(&self) -> ::std::option::Option<&crate::types::Scope> {
self.scope.as_ref()
}
}
impl Integration {
/// Creates a new builder-style object to manufacture [`Integration`](crate::types::Integration).
pub fn builder() -> crate::types::builders::IntegrationBuilder {
crate::types::builders::IntegrationBuilder::default()
}
}
/// A builder for [`Integration`](crate::types::Integration).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct IntegrationBuilder {
pub(crate) integration_id: ::std::option::Option<::std::string::String>,
pub(crate) integration_arn: ::std::option::Option<::std::string::String>,
pub(crate) integration_type: ::std::option::Option<crate::types::IntegrationType>,
pub(crate) name: ::std::option::Option<::std::string::String>,
pub(crate) status: ::std::option::Option<crate::types::IntegrationStatus>,
pub(crate) auth_type: ::std::option::Option<crate::types::AuthType>,
pub(crate) credential_arn: ::std::option::Option<::std::string::String>,
pub(crate) role_arn: ::std::option::Option<::std::string::String>,
pub(crate) integration_attributes: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
pub(crate) authorization_url: ::std::option::Option<::std::string::String>,
pub(crate) error_message: ::std::option::Option<::std::string::String>,
pub(crate) created_at: ::std::option::Option<::aws_smithy_types::DateTime>,
pub(crate) updated_at: ::std::option::Option<::aws_smithy_types::DateTime>,
pub(crate) scope: ::std::option::Option<crate::types::Scope>,
}
impl IntegrationBuilder {
/// The unique identifier of the integration.
/// This field is required.
pub fn integration_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.integration_id = ::std::option::Option::Some(input.into());
self
}
/// The unique identifier of the integration.
pub fn set_integration_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.integration_id = input;
self
}
/// The unique identifier of the integration.
pub fn get_integration_id(&self) -> &::std::option::Option<::std::string::String> {
&self.integration_id
}
/// The Amazon Resource Name (ARN) of the integration.
pub fn integration_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.integration_arn = ::std::option::Option::Some(input.into());
self
}
/// The Amazon Resource Name (ARN) of the integration.
pub fn set_integration_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.integration_arn = input;
self
}
/// The Amazon Resource Name (ARN) of the integration.
pub fn get_integration_arn(&self) -> &::std::option::Option<::std::string::String> {
&self.integration_arn
}
/// The type of external system that an integration connects to, such as a source of configuration data, a messaging destination, or a model provider.
/// This field is required.
pub fn integration_type(mut self, input: crate::types::IntegrationType) -> Self {
self.integration_type = ::std::option::Option::Some(input);
self
}
/// The type of external system that an integration connects to, such as a source of configuration data, a messaging destination, or a model provider.
pub fn set_integration_type(mut self, input: ::std::option::Option<crate::types::IntegrationType>) -> Self {
self.integration_type = input;
self
}
/// The type of external system that an integration connects to, such as a source of configuration data, a messaging destination, or a model provider.
pub fn get_integration_type(&self) -> &::std::option::Option<crate::types::IntegrationType> {
&self.integration_type
}
/// The customer-provided name of the integration.
/// 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
}
/// The customer-provided name of the integration.
pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.name = input;
self
}
/// The customer-provided name of the integration.
pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
&self.name
}
/// The current lifecycle state of an integration.
/// This field is required.
pub fn status(mut self, input: crate::types::IntegrationStatus) -> Self {
self.status = ::std::option::Option::Some(input);
self
}
/// The current lifecycle state of an integration.
pub fn set_status(mut self, input: ::std::option::Option<crate::types::IntegrationStatus>) -> Self {
self.status = input;
self
}
/// The current lifecycle state of an integration.
pub fn get_status(&self) -> &::std::option::Option<crate::types::IntegrationStatus> {
&self.status
}
/// The authentication method that an integration uses to connect to its external system.
pub fn auth_type(mut self, input: crate::types::AuthType) -> Self {
self.auth_type = ::std::option::Option::Some(input);
self
}
/// The authentication method that an integration uses to connect to its external system.
pub fn set_auth_type(mut self, input: ::std::option::Option<crate::types::AuthType>) -> Self {
self.auth_type = input;
self
}
/// The authentication method that an integration uses to connect to its external system.
pub fn get_auth_type(&self) -> &::std::option::Option<crate::types::AuthType> {
&self.auth_type
}
/// The Amazon Resource Name (ARN) of the secret that stores the integration's credentials.
pub fn credential_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.credential_arn = ::std::option::Option::Some(input.into());
self
}
/// The Amazon Resource Name (ARN) of the secret that stores the integration's credentials.
pub fn set_credential_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.credential_arn = input;
self
}
/// The Amazon Resource Name (ARN) of the secret that stores the integration's credentials.
pub fn get_credential_arn(&self) -> &::std::option::Option<::std::string::String> {
&self.credential_arn
}
/// The Amazon Resource Name (ARN) of the IAM role that CloudWatch assumes to access the external system.
pub fn role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.role_arn = ::std::option::Option::Some(input.into());
self
}
/// The Amazon Resource Name (ARN) of the IAM role that CloudWatch assumes to access the external system.
pub fn set_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.role_arn = input;
self
}
/// The Amazon Resource Name (ARN) of the IAM role that CloudWatch assumes to access the external system.
pub fn get_role_arn(&self) -> &::std::option::Option<::std::string::String> {
&self.role_arn
}
/// Adds a key-value pair to `integration_attributes`.
///
/// To override the contents of this collection use [`set_integration_attributes`](Self::set_integration_attributes).
///
/// Provider-specific key/value attributes that configure the integration.
pub fn integration_attributes(
mut self,
k: impl ::std::convert::Into<::std::string::String>,
v: impl ::std::convert::Into<::std::string::String>,
) -> Self {
let mut hash_map = self.integration_attributes.unwrap_or_default();
hash_map.insert(k.into(), v.into());
self.integration_attributes = ::std::option::Option::Some(hash_map);
self
}
/// Provider-specific key/value attributes that configure the integration.
pub fn set_integration_attributes(
mut self,
input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
) -> Self {
self.integration_attributes = input;
self
}
/// Provider-specific key/value attributes that configure the integration.
pub fn get_integration_attributes(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
&self.integration_attributes
}
/// The URL the customer visits to authorize the integration. Present while an OAuth authorization is pending.
pub fn authorization_url(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.authorization_url = ::std::option::Option::Some(input.into());
self
}
/// The URL the customer visits to authorize the integration. Present while an OAuth authorization is pending.
pub fn set_authorization_url(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.authorization_url = input;
self
}
/// The URL the customer visits to authorize the integration. Present while an OAuth authorization is pending.
pub fn get_authorization_url(&self) -> &::std::option::Option<::std::string::String> {
&self.authorization_url
}
/// A human-readable description of why the integration is in an ERROR or FAILED state. Present only when the integration has failed.
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
}
/// A human-readable description of why the integration is in an ERROR or FAILED state. Present only when the integration has failed.
pub fn set_error_message(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.error_message = input;
self
}
/// A human-readable description of why the integration is in an ERROR or FAILED state. Present only when the integration has failed.
pub fn get_error_message(&self) -> &::std::option::Option<::std::string::String> {
&self.error_message
}
/// The time at which the integration was created.
pub fn created_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
self.created_at = ::std::option::Option::Some(input);
self
}
/// The time at which the integration was created.
pub fn set_created_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
self.created_at = input;
self
}
/// The time at which the integration was created.
pub fn get_created_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
&self.created_at
}
/// The time at which the integration was last updated.
pub fn updated_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
self.updated_at = ::std::option::Option::Some(input);
self
}
/// The time at which the integration was last updated.
pub fn set_updated_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
self.updated_at = input;
self
}
/// The time at which the integration was last updated.
pub fn get_updated_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
&self.updated_at
}
/// Whether this integration is account-scoped (ACCOUNT, customer-created) or organization-scoped (ORGANIZATION, created by an org-enablement rule). Absent on legacy records is treated as ACCOUNT.
pub fn scope(mut self, input: crate::types::Scope) -> Self {
self.scope = ::std::option::Option::Some(input);
self
}
/// Whether this integration is account-scoped (ACCOUNT, customer-created) or organization-scoped (ORGANIZATION, created by an org-enablement rule). Absent on legacy records is treated as ACCOUNT.
pub fn set_scope(mut self, input: ::std::option::Option<crate::types::Scope>) -> Self {
self.scope = input;
self
}
/// Whether this integration is account-scoped (ACCOUNT, customer-created) or organization-scoped (ORGANIZATION, created by an org-enablement rule). Absent on legacy records is treated as ACCOUNT.
pub fn get_scope(&self) -> &::std::option::Option<crate::types::Scope> {
&self.scope
}
/// Consumes the builder and constructs a [`Integration`](crate::types::Integration).
/// This method will fail if any of the following fields are not set:
/// - [`integration_id`](crate::types::builders::IntegrationBuilder::integration_id)
/// - [`integration_type`](crate::types::builders::IntegrationBuilder::integration_type)
/// - [`name`](crate::types::builders::IntegrationBuilder::name)
/// - [`status`](crate::types::builders::IntegrationBuilder::status)
pub fn build(self) -> ::std::result::Result<crate::types::Integration, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::types::Integration {
integration_id: self.integration_id.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"integration_id",
"integration_id was not specified but it is required when building Integration",
)
})?,
integration_arn: self.integration_arn,
integration_type: self.integration_type.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"integration_type",
"integration_type was not specified but it is required when building Integration",
)
})?,
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 Integration",
)
})?,
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 Integration",
)
})?,
auth_type: self.auth_type,
credential_arn: self.credential_arn,
role_arn: self.role_arn,
integration_attributes: self.integration_attributes,
authorization_url: self.authorization_url,
error_message: self.error_message,
created_at: self.created_at,
updated_at: self.updated_at,
scope: self.scope,
})
}
}