aws_sdk_mailmanager/operation/update_archive/
_update_archive_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>The request to update properties of an existing email archive.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct UpdateArchiveInput {
7    /// <p>The identifier of the archive to update.</p>
8    pub archive_id: ::std::option::Option<::std::string::String>,
9    /// <p>A new, unique name for the archive.</p>
10    pub archive_name: ::std::option::Option<::std::string::String>,
11    /// <p>A new retention period for emails in the archive.</p>
12    pub retention: ::std::option::Option<crate::types::ArchiveRetention>,
13}
14impl UpdateArchiveInput {
15    /// <p>The identifier of the archive to update.</p>
16    pub fn archive_id(&self) -> ::std::option::Option<&str> {
17        self.archive_id.as_deref()
18    }
19    /// <p>A new, unique name for the archive.</p>
20    pub fn archive_name(&self) -> ::std::option::Option<&str> {
21        self.archive_name.as_deref()
22    }
23    /// <p>A new retention period for emails in the archive.</p>
24    pub fn retention(&self) -> ::std::option::Option<&crate::types::ArchiveRetention> {
25        self.retention.as_ref()
26    }
27}
28impl UpdateArchiveInput {
29    /// Creates a new builder-style object to manufacture [`UpdateArchiveInput`](crate::operation::update_archive::UpdateArchiveInput).
30    pub fn builder() -> crate::operation::update_archive::builders::UpdateArchiveInputBuilder {
31        crate::operation::update_archive::builders::UpdateArchiveInputBuilder::default()
32    }
33}
34
35/// A builder for [`UpdateArchiveInput`](crate::operation::update_archive::UpdateArchiveInput).
36#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
37#[non_exhaustive]
38pub struct UpdateArchiveInputBuilder {
39    pub(crate) archive_id: ::std::option::Option<::std::string::String>,
40    pub(crate) archive_name: ::std::option::Option<::std::string::String>,
41    pub(crate) retention: ::std::option::Option<crate::types::ArchiveRetention>,
42}
43impl UpdateArchiveInputBuilder {
44    /// <p>The identifier of the archive to update.</p>
45    /// This field is required.
46    pub fn archive_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
47        self.archive_id = ::std::option::Option::Some(input.into());
48        self
49    }
50    /// <p>The identifier of the archive to update.</p>
51    pub fn set_archive_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
52        self.archive_id = input;
53        self
54    }
55    /// <p>The identifier of the archive to update.</p>
56    pub fn get_archive_id(&self) -> &::std::option::Option<::std::string::String> {
57        &self.archive_id
58    }
59    /// <p>A new, unique name for the archive.</p>
60    pub fn archive_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
61        self.archive_name = ::std::option::Option::Some(input.into());
62        self
63    }
64    /// <p>A new, unique name for the archive.</p>
65    pub fn set_archive_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
66        self.archive_name = input;
67        self
68    }
69    /// <p>A new, unique name for the archive.</p>
70    pub fn get_archive_name(&self) -> &::std::option::Option<::std::string::String> {
71        &self.archive_name
72    }
73    /// <p>A new retention period for emails in the archive.</p>
74    pub fn retention(mut self, input: crate::types::ArchiveRetention) -> Self {
75        self.retention = ::std::option::Option::Some(input);
76        self
77    }
78    /// <p>A new retention period for emails in the archive.</p>
79    pub fn set_retention(mut self, input: ::std::option::Option<crate::types::ArchiveRetention>) -> Self {
80        self.retention = input;
81        self
82    }
83    /// <p>A new retention period for emails in the archive.</p>
84    pub fn get_retention(&self) -> &::std::option::Option<crate::types::ArchiveRetention> {
85        &self.retention
86    }
87    /// Consumes the builder and constructs a [`UpdateArchiveInput`](crate::operation::update_archive::UpdateArchiveInput).
88    pub fn build(
89        self,
90    ) -> ::std::result::Result<crate::operation::update_archive::UpdateArchiveInput, ::aws_smithy_types::error::operation::BuildError> {
91        ::std::result::Result::Ok(crate::operation::update_archive::UpdateArchiveInput {
92            archive_id: self.archive_id,
93            archive_name: self.archive_name,
94            retention: self.retention,
95        })
96    }
97}