aws_sdk_kms/operation/replicate_key/
_replicate_key_output.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 ReplicateKeyOutput {
6    /// <p>Displays details about the new replica key, including its Amazon Resource Name (<a href="https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-id-key-ARN">key ARN</a>) and <a href="https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html">Key states of KMS keys</a>. It also includes the ARN and Amazon Web Services Region of its primary key and other replica keys.</p>
7    pub replica_key_metadata: ::std::option::Option<crate::types::KeyMetadata>,
8    /// <p>The key policy of the new replica key. The value is a key policy document in JSON format.</p>
9    pub replica_policy: ::std::option::Option<::std::string::String>,
10    /// <p>The tags on the new replica key. The value is a list of tag key and tag value pairs.</p>
11    pub replica_tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
12    _request_id: Option<String>,
13}
14impl ReplicateKeyOutput {
15    /// <p>Displays details about the new replica key, including its Amazon Resource Name (<a href="https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-id-key-ARN">key ARN</a>) and <a href="https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html">Key states of KMS keys</a>. It also includes the ARN and Amazon Web Services Region of its primary key and other replica keys.</p>
16    pub fn replica_key_metadata(&self) -> ::std::option::Option<&crate::types::KeyMetadata> {
17        self.replica_key_metadata.as_ref()
18    }
19    /// <p>The key policy of the new replica key. The value is a key policy document in JSON format.</p>
20    pub fn replica_policy(&self) -> ::std::option::Option<&str> {
21        self.replica_policy.as_deref()
22    }
23    /// <p>The tags on the new replica key. The value is a list of tag key and tag value pairs.</p>
24    ///
25    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.replica_tags.is_none()`.
26    pub fn replica_tags(&self) -> &[crate::types::Tag] {
27        self.replica_tags.as_deref().unwrap_or_default()
28    }
29}
30impl ::aws_types::request_id::RequestId for ReplicateKeyOutput {
31    fn request_id(&self) -> Option<&str> {
32        self._request_id.as_deref()
33    }
34}
35impl ReplicateKeyOutput {
36    /// Creates a new builder-style object to manufacture [`ReplicateKeyOutput`](crate::operation::replicate_key::ReplicateKeyOutput).
37    pub fn builder() -> crate::operation::replicate_key::builders::ReplicateKeyOutputBuilder {
38        crate::operation::replicate_key::builders::ReplicateKeyOutputBuilder::default()
39    }
40}
41
42/// A builder for [`ReplicateKeyOutput`](crate::operation::replicate_key::ReplicateKeyOutput).
43#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
44#[non_exhaustive]
45pub struct ReplicateKeyOutputBuilder {
46    pub(crate) replica_key_metadata: ::std::option::Option<crate::types::KeyMetadata>,
47    pub(crate) replica_policy: ::std::option::Option<::std::string::String>,
48    pub(crate) replica_tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
49    _request_id: Option<String>,
50}
51impl ReplicateKeyOutputBuilder {
52    /// <p>Displays details about the new replica key, including its Amazon Resource Name (<a href="https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-id-key-ARN">key ARN</a>) and <a href="https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html">Key states of KMS keys</a>. It also includes the ARN and Amazon Web Services Region of its primary key and other replica keys.</p>
53    pub fn replica_key_metadata(mut self, input: crate::types::KeyMetadata) -> Self {
54        self.replica_key_metadata = ::std::option::Option::Some(input);
55        self
56    }
57    /// <p>Displays details about the new replica key, including its Amazon Resource Name (<a href="https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-id-key-ARN">key ARN</a>) and <a href="https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html">Key states of KMS keys</a>. It also includes the ARN and Amazon Web Services Region of its primary key and other replica keys.</p>
58    pub fn set_replica_key_metadata(mut self, input: ::std::option::Option<crate::types::KeyMetadata>) -> Self {
59        self.replica_key_metadata = input;
60        self
61    }
62    /// <p>Displays details about the new replica key, including its Amazon Resource Name (<a href="https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-id-key-ARN">key ARN</a>) and <a href="https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html">Key states of KMS keys</a>. It also includes the ARN and Amazon Web Services Region of its primary key and other replica keys.</p>
63    pub fn get_replica_key_metadata(&self) -> &::std::option::Option<crate::types::KeyMetadata> {
64        &self.replica_key_metadata
65    }
66    /// <p>The key policy of the new replica key. The value is a key policy document in JSON format.</p>
67    pub fn replica_policy(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
68        self.replica_policy = ::std::option::Option::Some(input.into());
69        self
70    }
71    /// <p>The key policy of the new replica key. The value is a key policy document in JSON format.</p>
72    pub fn set_replica_policy(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
73        self.replica_policy = input;
74        self
75    }
76    /// <p>The key policy of the new replica key. The value is a key policy document in JSON format.</p>
77    pub fn get_replica_policy(&self) -> &::std::option::Option<::std::string::String> {
78        &self.replica_policy
79    }
80    /// Appends an item to `replica_tags`.
81    ///
82    /// To override the contents of this collection use [`set_replica_tags`](Self::set_replica_tags).
83    ///
84    /// <p>The tags on the new replica key. The value is a list of tag key and tag value pairs.</p>
85    pub fn replica_tags(mut self, input: crate::types::Tag) -> Self {
86        let mut v = self.replica_tags.unwrap_or_default();
87        v.push(input);
88        self.replica_tags = ::std::option::Option::Some(v);
89        self
90    }
91    /// <p>The tags on the new replica key. The value is a list of tag key and tag value pairs.</p>
92    pub fn set_replica_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
93        self.replica_tags = input;
94        self
95    }
96    /// <p>The tags on the new replica key. The value is a list of tag key and tag value pairs.</p>
97    pub fn get_replica_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
98        &self.replica_tags
99    }
100    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
101        self._request_id = Some(request_id.into());
102        self
103    }
104
105    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
106        self._request_id = request_id;
107        self
108    }
109    /// Consumes the builder and constructs a [`ReplicateKeyOutput`](crate::operation::replicate_key::ReplicateKeyOutput).
110    pub fn build(self) -> crate::operation::replicate_key::ReplicateKeyOutput {
111        crate::operation::replicate_key::ReplicateKeyOutput {
112            replica_key_metadata: self.replica_key_metadata,
113            replica_policy: self.replica_policy,
114            replica_tags: self.replica_tags,
115            _request_id: self._request_id,
116        }
117    }
118}