aws_sdk_eventbridge/operation/create_archive/_create_archive_input.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct CreateArchiveInput {
6 /// <p>The name for the archive to create.</p>
7 pub archive_name: ::std::option::Option<::std::string::String>,
8 /// <p>The ARN of the event bus that sends events to the archive.</p>
9 pub event_source_arn: ::std::option::Option<::std::string::String>,
10 /// <p>A description for the archive.</p>
11 pub description: ::std::option::Option<::std::string::String>,
12 /// <p>An event pattern to use to filter events sent to the archive.</p>
13 pub event_pattern: ::std::option::Option<::std::string::String>,
14 /// <p>The number of days to retain events for. Default value is 0. If set to 0, events are retained indefinitely</p>
15 pub retention_days: ::std::option::Option<i32>,
16 /// <p>The identifier of the KMS customer managed key for EventBridge to use, if you choose to use a customer managed key to encrypt this archive. The identifier can be the key Amazon Resource Name (ARN), KeyId, key alias, or key alias ARN.</p>
17 /// <p>If you do not specify a customer managed key identifier, EventBridge uses an Amazon Web Services owned key to encrypt the archive.</p>
18 /// <p>For more information, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/viewing-keys.html">Identify and view keys</a> in the <i>Key Management Service Developer Guide</i>.</p><important>
19 /// <p>If you have specified that EventBridge use a customer managed key for encrypting the source event bus, we strongly recommend you also specify a customer managed key for any archives for the event bus as well.</p>
20 /// <p>For more information, see <a href="https://docs.aws.amazon.com/eventbridge/latest/userguide/encryption-archives.html">Encrypting archives</a> in the <i>Amazon EventBridge User Guide</i>.</p>
21 /// </important>
22 pub kms_key_identifier: ::std::option::Option<::std::string::String>,
23}
24impl CreateArchiveInput {
25 /// <p>The name for the archive to create.</p>
26 pub fn archive_name(&self) -> ::std::option::Option<&str> {
27 self.archive_name.as_deref()
28 }
29 /// <p>The ARN of the event bus that sends events to the archive.</p>
30 pub fn event_source_arn(&self) -> ::std::option::Option<&str> {
31 self.event_source_arn.as_deref()
32 }
33 /// <p>A description for the archive.</p>
34 pub fn description(&self) -> ::std::option::Option<&str> {
35 self.description.as_deref()
36 }
37 /// <p>An event pattern to use to filter events sent to the archive.</p>
38 pub fn event_pattern(&self) -> ::std::option::Option<&str> {
39 self.event_pattern.as_deref()
40 }
41 /// <p>The number of days to retain events for. Default value is 0. If set to 0, events are retained indefinitely</p>
42 pub fn retention_days(&self) -> ::std::option::Option<i32> {
43 self.retention_days
44 }
45 /// <p>The identifier of the KMS customer managed key for EventBridge to use, if you choose to use a customer managed key to encrypt this archive. The identifier can be the key Amazon Resource Name (ARN), KeyId, key alias, or key alias ARN.</p>
46 /// <p>If you do not specify a customer managed key identifier, EventBridge uses an Amazon Web Services owned key to encrypt the archive.</p>
47 /// <p>For more information, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/viewing-keys.html">Identify and view keys</a> in the <i>Key Management Service Developer Guide</i>.</p><important>
48 /// <p>If you have specified that EventBridge use a customer managed key for encrypting the source event bus, we strongly recommend you also specify a customer managed key for any archives for the event bus as well.</p>
49 /// <p>For more information, see <a href="https://docs.aws.amazon.com/eventbridge/latest/userguide/encryption-archives.html">Encrypting archives</a> in the <i>Amazon EventBridge User Guide</i>.</p>
50 /// </important>
51 pub fn kms_key_identifier(&self) -> ::std::option::Option<&str> {
52 self.kms_key_identifier.as_deref()
53 }
54}
55impl CreateArchiveInput {
56 /// Creates a new builder-style object to manufacture [`CreateArchiveInput`](crate::operation::create_archive::CreateArchiveInput).
57 pub fn builder() -> crate::operation::create_archive::builders::CreateArchiveInputBuilder {
58 crate::operation::create_archive::builders::CreateArchiveInputBuilder::default()
59 }
60}
61
62/// A builder for [`CreateArchiveInput`](crate::operation::create_archive::CreateArchiveInput).
63#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
64#[non_exhaustive]
65pub struct CreateArchiveInputBuilder {
66 pub(crate) archive_name: ::std::option::Option<::std::string::String>,
67 pub(crate) event_source_arn: ::std::option::Option<::std::string::String>,
68 pub(crate) description: ::std::option::Option<::std::string::String>,
69 pub(crate) event_pattern: ::std::option::Option<::std::string::String>,
70 pub(crate) retention_days: ::std::option::Option<i32>,
71 pub(crate) kms_key_identifier: ::std::option::Option<::std::string::String>,
72}
73impl CreateArchiveInputBuilder {
74 /// <p>The name for the archive to create.</p>
75 /// This field is required.
76 pub fn archive_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
77 self.archive_name = ::std::option::Option::Some(input.into());
78 self
79 }
80 /// <p>The name for the archive to create.</p>
81 pub fn set_archive_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
82 self.archive_name = input;
83 self
84 }
85 /// <p>The name for the archive to create.</p>
86 pub fn get_archive_name(&self) -> &::std::option::Option<::std::string::String> {
87 &self.archive_name
88 }
89 /// <p>The ARN of the event bus that sends events to the archive.</p>
90 /// This field is required.
91 pub fn event_source_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
92 self.event_source_arn = ::std::option::Option::Some(input.into());
93 self
94 }
95 /// <p>The ARN of the event bus that sends events to the archive.</p>
96 pub fn set_event_source_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
97 self.event_source_arn = input;
98 self
99 }
100 /// <p>The ARN of the event bus that sends events to the archive.</p>
101 pub fn get_event_source_arn(&self) -> &::std::option::Option<::std::string::String> {
102 &self.event_source_arn
103 }
104 /// <p>A description for the archive.</p>
105 pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
106 self.description = ::std::option::Option::Some(input.into());
107 self
108 }
109 /// <p>A description for the archive.</p>
110 pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
111 self.description = input;
112 self
113 }
114 /// <p>A description for the archive.</p>
115 pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
116 &self.description
117 }
118 /// <p>An event pattern to use to filter events sent to the archive.</p>
119 pub fn event_pattern(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
120 self.event_pattern = ::std::option::Option::Some(input.into());
121 self
122 }
123 /// <p>An event pattern to use to filter events sent to the archive.</p>
124 pub fn set_event_pattern(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
125 self.event_pattern = input;
126 self
127 }
128 /// <p>An event pattern to use to filter events sent to the archive.</p>
129 pub fn get_event_pattern(&self) -> &::std::option::Option<::std::string::String> {
130 &self.event_pattern
131 }
132 /// <p>The number of days to retain events for. Default value is 0. If set to 0, events are retained indefinitely</p>
133 pub fn retention_days(mut self, input: i32) -> Self {
134 self.retention_days = ::std::option::Option::Some(input);
135 self
136 }
137 /// <p>The number of days to retain events for. Default value is 0. If set to 0, events are retained indefinitely</p>
138 pub fn set_retention_days(mut self, input: ::std::option::Option<i32>) -> Self {
139 self.retention_days = input;
140 self
141 }
142 /// <p>The number of days to retain events for. Default value is 0. If set to 0, events are retained indefinitely</p>
143 pub fn get_retention_days(&self) -> &::std::option::Option<i32> {
144 &self.retention_days
145 }
146 /// <p>The identifier of the KMS customer managed key for EventBridge to use, if you choose to use a customer managed key to encrypt this archive. The identifier can be the key Amazon Resource Name (ARN), KeyId, key alias, or key alias ARN.</p>
147 /// <p>If you do not specify a customer managed key identifier, EventBridge uses an Amazon Web Services owned key to encrypt the archive.</p>
148 /// <p>For more information, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/viewing-keys.html">Identify and view keys</a> in the <i>Key Management Service Developer Guide</i>.</p><important>
149 /// <p>If you have specified that EventBridge use a customer managed key for encrypting the source event bus, we strongly recommend you also specify a customer managed key for any archives for the event bus as well.</p>
150 /// <p>For more information, see <a href="https://docs.aws.amazon.com/eventbridge/latest/userguide/encryption-archives.html">Encrypting archives</a> in the <i>Amazon EventBridge User Guide</i>.</p>
151 /// </important>
152 pub fn kms_key_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
153 self.kms_key_identifier = ::std::option::Option::Some(input.into());
154 self
155 }
156 /// <p>The identifier of the KMS customer managed key for EventBridge to use, if you choose to use a customer managed key to encrypt this archive. The identifier can be the key Amazon Resource Name (ARN), KeyId, key alias, or key alias ARN.</p>
157 /// <p>If you do not specify a customer managed key identifier, EventBridge uses an Amazon Web Services owned key to encrypt the archive.</p>
158 /// <p>For more information, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/viewing-keys.html">Identify and view keys</a> in the <i>Key Management Service Developer Guide</i>.</p><important>
159 /// <p>If you have specified that EventBridge use a customer managed key for encrypting the source event bus, we strongly recommend you also specify a customer managed key for any archives for the event bus as well.</p>
160 /// <p>For more information, see <a href="https://docs.aws.amazon.com/eventbridge/latest/userguide/encryption-archives.html">Encrypting archives</a> in the <i>Amazon EventBridge User Guide</i>.</p>
161 /// </important>
162 pub fn set_kms_key_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
163 self.kms_key_identifier = input;
164 self
165 }
166 /// <p>The identifier of the KMS customer managed key for EventBridge to use, if you choose to use a customer managed key to encrypt this archive. The identifier can be the key Amazon Resource Name (ARN), KeyId, key alias, or key alias ARN.</p>
167 /// <p>If you do not specify a customer managed key identifier, EventBridge uses an Amazon Web Services owned key to encrypt the archive.</p>
168 /// <p>For more information, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/viewing-keys.html">Identify and view keys</a> in the <i>Key Management Service Developer Guide</i>.</p><important>
169 /// <p>If you have specified that EventBridge use a customer managed key for encrypting the source event bus, we strongly recommend you also specify a customer managed key for any archives for the event bus as well.</p>
170 /// <p>For more information, see <a href="https://docs.aws.amazon.com/eventbridge/latest/userguide/encryption-archives.html">Encrypting archives</a> in the <i>Amazon EventBridge User Guide</i>.</p>
171 /// </important>
172 pub fn get_kms_key_identifier(&self) -> &::std::option::Option<::std::string::String> {
173 &self.kms_key_identifier
174 }
175 /// Consumes the builder and constructs a [`CreateArchiveInput`](crate::operation::create_archive::CreateArchiveInput).
176 pub fn build(
177 self,
178 ) -> ::std::result::Result<crate::operation::create_archive::CreateArchiveInput, ::aws_smithy_types::error::operation::BuildError> {
179 ::std::result::Result::Ok(crate::operation::create_archive::CreateArchiveInput {
180 archive_name: self.archive_name,
181 event_source_arn: self.event_source_arn,
182 description: self.description,
183 event_pattern: self.event_pattern,
184 retention_days: self.retention_days,
185 kms_key_identifier: self.kms_key_identifier,
186 })
187 }
188}