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
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>Contains information about the destination receiving events.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Destination {
/// <p>The type of destination for events arriving from a channel. For channels used for a CloudTrail Lake integration, the value is <code>EVENT_DATA_STORE</code>. For service-linked channels, the value is <code>AWS_SERVICE</code>.</p>
pub r#type: crate::types::DestinationType,
/// <p>For channels used for a CloudTrail Lake integration, the location is the ARN of an event data store that receives events from a channel. For service-linked channels, the location is the name of the Amazon Web Services service.</p>
pub location: ::std::string::String,
}
impl Destination {
/// <p>The type of destination for events arriving from a channel. For channels used for a CloudTrail Lake integration, the value is <code>EVENT_DATA_STORE</code>. For service-linked channels, the value is <code>AWS_SERVICE</code>.</p>
pub fn r#type(&self) -> &crate::types::DestinationType {
&self.r#type
}
/// <p>For channels used for a CloudTrail Lake integration, the location is the ARN of an event data store that receives events from a channel. For service-linked channels, the location is the name of the Amazon Web Services service.</p>
pub fn location(&self) -> &str {
use std::ops::Deref;
self.location.deref()
}
}
impl Destination {
/// Creates a new builder-style object to manufacture [`Destination`](crate::types::Destination).
pub fn builder() -> crate::types::builders::DestinationBuilder {
crate::types::builders::DestinationBuilder::default()
}
}
/// A builder for [`Destination`](crate::types::Destination).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct DestinationBuilder {
pub(crate) r#type: ::std::option::Option<crate::types::DestinationType>,
pub(crate) location: ::std::option::Option<::std::string::String>,
}
impl DestinationBuilder {
/// <p>The type of destination for events arriving from a channel. For channels used for a CloudTrail Lake integration, the value is <code>EVENT_DATA_STORE</code>. For service-linked channels, the value is <code>AWS_SERVICE</code>.</p>
/// This field is required.
pub fn r#type(mut self, input: crate::types::DestinationType) -> Self {
self.r#type = ::std::option::Option::Some(input);
self
}
/// <p>The type of destination for events arriving from a channel. For channels used for a CloudTrail Lake integration, the value is <code>EVENT_DATA_STORE</code>. For service-linked channels, the value is <code>AWS_SERVICE</code>.</p>
pub fn set_type(mut self, input: ::std::option::Option<crate::types::DestinationType>) -> Self {
self.r#type = input;
self
}
/// <p>The type of destination for events arriving from a channel. For channels used for a CloudTrail Lake integration, the value is <code>EVENT_DATA_STORE</code>. For service-linked channels, the value is <code>AWS_SERVICE</code>.</p>
pub fn get_type(&self) -> &::std::option::Option<crate::types::DestinationType> {
&self.r#type
}
/// <p>For channels used for a CloudTrail Lake integration, the location is the ARN of an event data store that receives events from a channel. For service-linked channels, the location is the name of the Amazon Web Services service.</p>
/// This field is required.
pub fn location(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.location = ::std::option::Option::Some(input.into());
self
}
/// <p>For channels used for a CloudTrail Lake integration, the location is the ARN of an event data store that receives events from a channel. For service-linked channels, the location is the name of the Amazon Web Services service.</p>
pub fn set_location(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.location = input;
self
}
/// <p>For channels used for a CloudTrail Lake integration, the location is the ARN of an event data store that receives events from a channel. For service-linked channels, the location is the name of the Amazon Web Services service.</p>
pub fn get_location(&self) -> &::std::option::Option<::std::string::String> {
&self.location
}
/// Consumes the builder and constructs a [`Destination`](crate::types::Destination).
/// This method will fail if any of the following fields are not set:
/// - [`r#type`](crate::types::builders::DestinationBuilder::type)
/// - [`location`](crate::types::builders::DestinationBuilder::location)
pub fn build(self) -> ::std::result::Result<crate::types::Destination, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::types::Destination {
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 Destination",
)
})?,
location: self.location.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"location",
"location was not specified but it is required when building Destination",
)
})?,
})
}
}