aws_sdk_kms/types/
_multi_region_key.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Describes the primary or replica key in a multi-Region key.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct MultiRegionKey {
7    /// <p>Displays the key ARN of a primary or replica key of a multi-Region key.</p>
8    pub arn: ::std::option::Option<::std::string::String>,
9    /// <p>Displays the Amazon Web Services Region of a primary or replica key in a multi-Region key.</p>
10    pub region: ::std::option::Option<::std::string::String>,
11}
12impl MultiRegionKey {
13    /// <p>Displays the key ARN of a primary or replica key of a multi-Region key.</p>
14    pub fn arn(&self) -> ::std::option::Option<&str> {
15        self.arn.as_deref()
16    }
17    /// <p>Displays the Amazon Web Services Region of a primary or replica key in a multi-Region key.</p>
18    pub fn region(&self) -> ::std::option::Option<&str> {
19        self.region.as_deref()
20    }
21}
22impl MultiRegionKey {
23    /// Creates a new builder-style object to manufacture [`MultiRegionKey`](crate::types::MultiRegionKey).
24    pub fn builder() -> crate::types::builders::MultiRegionKeyBuilder {
25        crate::types::builders::MultiRegionKeyBuilder::default()
26    }
27}
28
29/// A builder for [`MultiRegionKey`](crate::types::MultiRegionKey).
30#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
31#[non_exhaustive]
32pub struct MultiRegionKeyBuilder {
33    pub(crate) arn: ::std::option::Option<::std::string::String>,
34    pub(crate) region: ::std::option::Option<::std::string::String>,
35}
36impl MultiRegionKeyBuilder {
37    /// <p>Displays the key ARN of a primary or replica key of a multi-Region key.</p>
38    pub fn arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
39        self.arn = ::std::option::Option::Some(input.into());
40        self
41    }
42    /// <p>Displays the key ARN of a primary or replica key of a multi-Region key.</p>
43    pub fn set_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
44        self.arn = input;
45        self
46    }
47    /// <p>Displays the key ARN of a primary or replica key of a multi-Region key.</p>
48    pub fn get_arn(&self) -> &::std::option::Option<::std::string::String> {
49        &self.arn
50    }
51    /// <p>Displays the Amazon Web Services Region of a primary or replica key in a multi-Region key.</p>
52    pub fn region(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
53        self.region = ::std::option::Option::Some(input.into());
54        self
55    }
56    /// <p>Displays the Amazon Web Services Region of a primary or replica key in a multi-Region key.</p>
57    pub fn set_region(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
58        self.region = input;
59        self
60    }
61    /// <p>Displays the Amazon Web Services Region of a primary or replica key in a multi-Region key.</p>
62    pub fn get_region(&self) -> &::std::option::Option<::std::string::String> {
63        &self.region
64    }
65    /// Consumes the builder and constructs a [`MultiRegionKey`](crate::types::MultiRegionKey).
66    pub fn build(self) -> crate::types::MultiRegionKey {
67        crate::types::MultiRegionKey {
68            arn: self.arn,
69            region: self.region,
70        }
71    }
72}