aws_sdk_secretsmanager/types/
_replication_status_type.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>A replication object consisting of a <code>RegionReplicationStatus</code> object and includes a Region, KMSKeyId, status, and status message.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct ReplicationStatusType {
7    /// <p>The Region where replication occurs.</p>
8    pub region: ::std::option::Option<::std::string::String>,
9    /// <p>Can be an <code>ARN</code>, <code>Key ID</code>, or <code>Alias</code>.</p>
10    pub kms_key_id: ::std::option::Option<::std::string::String>,
11    /// <p>The status can be <code>InProgress</code>, <code>Failed</code>, or <code>InSync</code>.</p>
12    pub status: ::std::option::Option<crate::types::StatusType>,
13    /// <p>Status message such as "<i>Secret with this name already exists in this region</i>".</p>
14    pub status_message: ::std::option::Option<::std::string::String>,
15    /// <p>The date that the secret was last accessed in the Region. This field is omitted if the secret has never been retrieved in the Region.</p>
16    pub last_accessed_date: ::std::option::Option<::aws_smithy_types::DateTime>,
17}
18impl ReplicationStatusType {
19    /// <p>The Region where replication occurs.</p>
20    pub fn region(&self) -> ::std::option::Option<&str> {
21        self.region.as_deref()
22    }
23    /// <p>Can be an <code>ARN</code>, <code>Key ID</code>, or <code>Alias</code>.</p>
24    pub fn kms_key_id(&self) -> ::std::option::Option<&str> {
25        self.kms_key_id.as_deref()
26    }
27    /// <p>The status can be <code>InProgress</code>, <code>Failed</code>, or <code>InSync</code>.</p>
28    pub fn status(&self) -> ::std::option::Option<&crate::types::StatusType> {
29        self.status.as_ref()
30    }
31    /// <p>Status message such as "<i>Secret with this name already exists in this region</i>".</p>
32    pub fn status_message(&self) -> ::std::option::Option<&str> {
33        self.status_message.as_deref()
34    }
35    /// <p>The date that the secret was last accessed in the Region. This field is omitted if the secret has never been retrieved in the Region.</p>
36    pub fn last_accessed_date(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
37        self.last_accessed_date.as_ref()
38    }
39}
40impl ReplicationStatusType {
41    /// Creates a new builder-style object to manufacture [`ReplicationStatusType`](crate::types::ReplicationStatusType).
42    pub fn builder() -> crate::types::builders::ReplicationStatusTypeBuilder {
43        crate::types::builders::ReplicationStatusTypeBuilder::default()
44    }
45}
46
47/// A builder for [`ReplicationStatusType`](crate::types::ReplicationStatusType).
48#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
49#[non_exhaustive]
50pub struct ReplicationStatusTypeBuilder {
51    pub(crate) region: ::std::option::Option<::std::string::String>,
52    pub(crate) kms_key_id: ::std::option::Option<::std::string::String>,
53    pub(crate) status: ::std::option::Option<crate::types::StatusType>,
54    pub(crate) status_message: ::std::option::Option<::std::string::String>,
55    pub(crate) last_accessed_date: ::std::option::Option<::aws_smithy_types::DateTime>,
56}
57impl ReplicationStatusTypeBuilder {
58    /// <p>The Region where replication occurs.</p>
59    pub fn region(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
60        self.region = ::std::option::Option::Some(input.into());
61        self
62    }
63    /// <p>The Region where replication occurs.</p>
64    pub fn set_region(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
65        self.region = input;
66        self
67    }
68    /// <p>The Region where replication occurs.</p>
69    pub fn get_region(&self) -> &::std::option::Option<::std::string::String> {
70        &self.region
71    }
72    /// <p>Can be an <code>ARN</code>, <code>Key ID</code>, or <code>Alias</code>.</p>
73    pub fn kms_key_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
74        self.kms_key_id = ::std::option::Option::Some(input.into());
75        self
76    }
77    /// <p>Can be an <code>ARN</code>, <code>Key ID</code>, or <code>Alias</code>.</p>
78    pub fn set_kms_key_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
79        self.kms_key_id = input;
80        self
81    }
82    /// <p>Can be an <code>ARN</code>, <code>Key ID</code>, or <code>Alias</code>.</p>
83    pub fn get_kms_key_id(&self) -> &::std::option::Option<::std::string::String> {
84        &self.kms_key_id
85    }
86    /// <p>The status can be <code>InProgress</code>, <code>Failed</code>, or <code>InSync</code>.</p>
87    pub fn status(mut self, input: crate::types::StatusType) -> Self {
88        self.status = ::std::option::Option::Some(input);
89        self
90    }
91    /// <p>The status can be <code>InProgress</code>, <code>Failed</code>, or <code>InSync</code>.</p>
92    pub fn set_status(mut self, input: ::std::option::Option<crate::types::StatusType>) -> Self {
93        self.status = input;
94        self
95    }
96    /// <p>The status can be <code>InProgress</code>, <code>Failed</code>, or <code>InSync</code>.</p>
97    pub fn get_status(&self) -> &::std::option::Option<crate::types::StatusType> {
98        &self.status
99    }
100    /// <p>Status message such as "<i>Secret with this name already exists in this region</i>".</p>
101    pub fn status_message(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
102        self.status_message = ::std::option::Option::Some(input.into());
103        self
104    }
105    /// <p>Status message such as "<i>Secret with this name already exists in this region</i>".</p>
106    pub fn set_status_message(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
107        self.status_message = input;
108        self
109    }
110    /// <p>Status message such as "<i>Secret with this name already exists in this region</i>".</p>
111    pub fn get_status_message(&self) -> &::std::option::Option<::std::string::String> {
112        &self.status_message
113    }
114    /// <p>The date that the secret was last accessed in the Region. This field is omitted if the secret has never been retrieved in the Region.</p>
115    pub fn last_accessed_date(mut self, input: ::aws_smithy_types::DateTime) -> Self {
116        self.last_accessed_date = ::std::option::Option::Some(input);
117        self
118    }
119    /// <p>The date that the secret was last accessed in the Region. This field is omitted if the secret has never been retrieved in the Region.</p>
120    pub fn set_last_accessed_date(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
121        self.last_accessed_date = input;
122        self
123    }
124    /// <p>The date that the secret was last accessed in the Region. This field is omitted if the secret has never been retrieved in the Region.</p>
125    pub fn get_last_accessed_date(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
126        &self.last_accessed_date
127    }
128    /// Consumes the builder and constructs a [`ReplicationStatusType`](crate::types::ReplicationStatusType).
129    pub fn build(self) -> crate::types::ReplicationStatusType {
130        crate::types::ReplicationStatusType {
131            region: self.region,
132            kms_key_id: self.kms_key_id,
133            status: self.status,
134            status_message: self.status_message,
135            last_accessed_date: self.last_accessed_date,
136        }
137    }
138}