1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>A custom type that specifies a <code>Region</code> and the <code>KmsKeyId</code> for a replica secret.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct ReplicaRegionType {
/// <p>A Region code. For a list of Region codes, see <a href="https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints">Name and code of Regions</a>.</p>
pub region: ::std::option::Option<::std::string::String>,
/// <p>The ARN, key ID, or alias of the KMS key to encrypt the secret. If you don't include this field, Secrets Manager uses <code>aws/secretsmanager</code>.</p>
pub kms_key_id: ::std::option::Option<::std::string::String>,
}
impl ReplicaRegionType {
/// <p>A Region code. For a list of Region codes, see <a href="https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints">Name and code of Regions</a>.</p>
pub fn region(&self) -> ::std::option::Option<&str> {
self.region.as_deref()
}
/// <p>The ARN, key ID, or alias of the KMS key to encrypt the secret. If you don't include this field, Secrets Manager uses <code>aws/secretsmanager</code>.</p>
pub fn kms_key_id(&self) -> ::std::option::Option<&str> {
self.kms_key_id.as_deref()
}
}
impl ReplicaRegionType {
/// Creates a new builder-style object to manufacture [`ReplicaRegionType`](crate::types::ReplicaRegionType).
pub fn builder() -> crate::types::builders::ReplicaRegionTypeBuilder {
crate::types::builders::ReplicaRegionTypeBuilder::default()
}
}
/// A builder for [`ReplicaRegionType`](crate::types::ReplicaRegionType).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct ReplicaRegionTypeBuilder {
pub(crate) region: ::std::option::Option<::std::string::String>,
pub(crate) kms_key_id: ::std::option::Option<::std::string::String>,
}
impl ReplicaRegionTypeBuilder {
/// <p>A Region code. For a list of Region codes, see <a href="https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints">Name and code of Regions</a>.</p>
pub fn region(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.region = ::std::option::Option::Some(input.into());
self
}
/// <p>A Region code. For a list of Region codes, see <a href="https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints">Name and code of Regions</a>.</p>
pub fn set_region(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.region = input;
self
}
/// <p>A Region code. For a list of Region codes, see <a href="https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints">Name and code of Regions</a>.</p>
pub fn get_region(&self) -> &::std::option::Option<::std::string::String> {
&self.region
}
/// <p>The ARN, key ID, or alias of the KMS key to encrypt the secret. If you don't include this field, Secrets Manager uses <code>aws/secretsmanager</code>.</p>
pub fn kms_key_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.kms_key_id = ::std::option::Option::Some(input.into());
self
}
/// <p>The ARN, key ID, or alias of the KMS key to encrypt the secret. If you don't include this field, Secrets Manager uses <code>aws/secretsmanager</code>.</p>
pub fn set_kms_key_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.kms_key_id = input;
self
}
/// <p>The ARN, key ID, or alias of the KMS key to encrypt the secret. If you don't include this field, Secrets Manager uses <code>aws/secretsmanager</code>.</p>
pub fn get_kms_key_id(&self) -> &::std::option::Option<::std::string::String> {
&self.kms_key_id
}
/// Consumes the builder and constructs a [`ReplicaRegionType`](crate::types::ReplicaRegionType).
pub fn build(self) -> crate::types::ReplicaRegionType {
crate::types::ReplicaRegionType {
region: self.region,
kms_key_id: self.kms_key_id,
}
}
}