aws_sdk_paymentcryptography/operation/update_alias/
_update_alias_input.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 UpdateAliasInput {
6    /// <p>The alias whose associated key is changing.</p>
7    pub alias_name: ::std::option::Option<::std::string::String>,
8    /// <p>The <code>KeyARN</code> for the key that you are updating or removing from the alias.</p>
9    pub key_arn: ::std::option::Option<::std::string::String>,
10}
11impl UpdateAliasInput {
12    /// <p>The alias whose associated key is changing.</p>
13    pub fn alias_name(&self) -> ::std::option::Option<&str> {
14        self.alias_name.as_deref()
15    }
16    /// <p>The <code>KeyARN</code> for the key that you are updating or removing from the alias.</p>
17    pub fn key_arn(&self) -> ::std::option::Option<&str> {
18        self.key_arn.as_deref()
19    }
20}
21impl UpdateAliasInput {
22    /// Creates a new builder-style object to manufacture [`UpdateAliasInput`](crate::operation::update_alias::UpdateAliasInput).
23    pub fn builder() -> crate::operation::update_alias::builders::UpdateAliasInputBuilder {
24        crate::operation::update_alias::builders::UpdateAliasInputBuilder::default()
25    }
26}
27
28/// A builder for [`UpdateAliasInput`](crate::operation::update_alias::UpdateAliasInput).
29#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
30#[non_exhaustive]
31pub struct UpdateAliasInputBuilder {
32    pub(crate) alias_name: ::std::option::Option<::std::string::String>,
33    pub(crate) key_arn: ::std::option::Option<::std::string::String>,
34}
35impl UpdateAliasInputBuilder {
36    /// <p>The alias whose associated key is changing.</p>
37    /// This field is required.
38    pub fn alias_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
39        self.alias_name = ::std::option::Option::Some(input.into());
40        self
41    }
42    /// <p>The alias whose associated key is changing.</p>
43    pub fn set_alias_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
44        self.alias_name = input;
45        self
46    }
47    /// <p>The alias whose associated key is changing.</p>
48    pub fn get_alias_name(&self) -> &::std::option::Option<::std::string::String> {
49        &self.alias_name
50    }
51    /// <p>The <code>KeyARN</code> for the key that you are updating or removing from the alias.</p>
52    pub fn key_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
53        self.key_arn = ::std::option::Option::Some(input.into());
54        self
55    }
56    /// <p>The <code>KeyARN</code> for the key that you are updating or removing from the alias.</p>
57    pub fn set_key_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
58        self.key_arn = input;
59        self
60    }
61    /// <p>The <code>KeyARN</code> for the key that you are updating or removing from the alias.</p>
62    pub fn get_key_arn(&self) -> &::std::option::Option<::std::string::String> {
63        &self.key_arn
64    }
65    /// Consumes the builder and constructs a [`UpdateAliasInput`](crate::operation::update_alias::UpdateAliasInput).
66    pub fn build(self) -> ::std::result::Result<crate::operation::update_alias::UpdateAliasInput, ::aws_smithy_types::error::operation::BuildError> {
67        ::std::result::Result::Ok(crate::operation::update_alias::UpdateAliasInput {
68            alias_name: self.alias_name,
69            key_arn: self.key_arn,
70        })
71    }
72}