aws_sdk_mailmanager/operation/create_archive/
_create_archive_input.rs1#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct CreateArchiveInput {
7 pub client_token: ::std::option::Option<::std::string::String>,
9 pub archive_name: ::std::option::Option<::std::string::String>,
11 pub retention: ::std::option::Option<crate::types::ArchiveRetention>,
13 pub kms_key_arn: ::std::option::Option<::std::string::String>,
15 pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
17}
18impl CreateArchiveInput {
19 pub fn client_token(&self) -> ::std::option::Option<&str> {
21 self.client_token.as_deref()
22 }
23 pub fn archive_name(&self) -> ::std::option::Option<&str> {
25 self.archive_name.as_deref()
26 }
27 pub fn retention(&self) -> ::std::option::Option<&crate::types::ArchiveRetention> {
29 self.retention.as_ref()
30 }
31 pub fn kms_key_arn(&self) -> ::std::option::Option<&str> {
33 self.kms_key_arn.as_deref()
34 }
35 pub fn tags(&self) -> &[crate::types::Tag] {
39 self.tags.as_deref().unwrap_or_default()
40 }
41}
42impl CreateArchiveInput {
43 pub fn builder() -> crate::operation::create_archive::builders::CreateArchiveInputBuilder {
45 crate::operation::create_archive::builders::CreateArchiveInputBuilder::default()
46 }
47}
48
49#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
51#[non_exhaustive]
52pub struct CreateArchiveInputBuilder {
53 pub(crate) client_token: ::std::option::Option<::std::string::String>,
54 pub(crate) archive_name: ::std::option::Option<::std::string::String>,
55 pub(crate) retention: ::std::option::Option<crate::types::ArchiveRetention>,
56 pub(crate) kms_key_arn: ::std::option::Option<::std::string::String>,
57 pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
58}
59impl CreateArchiveInputBuilder {
60 pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
62 self.client_token = ::std::option::Option::Some(input.into());
63 self
64 }
65 pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
67 self.client_token = input;
68 self
69 }
70 pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
72 &self.client_token
73 }
74 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 pub fn set_archive_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
82 self.archive_name = input;
83 self
84 }
85 pub fn get_archive_name(&self) -> &::std::option::Option<::std::string::String> {
87 &self.archive_name
88 }
89 pub fn retention(mut self, input: crate::types::ArchiveRetention) -> Self {
91 self.retention = ::std::option::Option::Some(input);
92 self
93 }
94 pub fn set_retention(mut self, input: ::std::option::Option<crate::types::ArchiveRetention>) -> Self {
96 self.retention = input;
97 self
98 }
99 pub fn get_retention(&self) -> &::std::option::Option<crate::types::ArchiveRetention> {
101 &self.retention
102 }
103 pub fn kms_key_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
105 self.kms_key_arn = ::std::option::Option::Some(input.into());
106 self
107 }
108 pub fn set_kms_key_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
110 self.kms_key_arn = input;
111 self
112 }
113 pub fn get_kms_key_arn(&self) -> &::std::option::Option<::std::string::String> {
115 &self.kms_key_arn
116 }
117 pub fn tags(mut self, input: crate::types::Tag) -> Self {
123 let mut v = self.tags.unwrap_or_default();
124 v.push(input);
125 self.tags = ::std::option::Option::Some(v);
126 self
127 }
128 pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
130 self.tags = input;
131 self
132 }
133 pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
135 &self.tags
136 }
137 pub fn build(
139 self,
140 ) -> ::std::result::Result<crate::operation::create_archive::CreateArchiveInput, ::aws_smithy_types::error::operation::BuildError> {
141 ::std::result::Result::Ok(crate::operation::create_archive::CreateArchiveInput {
142 client_token: self.client_token,
143 archive_name: self.archive_name,
144 retention: self.retention,
145 kms_key_arn: self.kms_key_arn,
146 tags: self.tags,
147 })
148 }
149}