aws_sdk_paymentcryptography/operation/create_alias/_create_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 CreateAliasInput {
6 /// <p>A friendly name that you can use to refer to a key. An alias must begin with <code>alias/</code> followed by a name, for example <code>alias/ExampleAlias</code>. It can contain only alphanumeric characters, forward slashes (/), underscores (_), and dashes (-).</p><important>
7 /// <p>Don't include personal, confidential or sensitive information in this field. This field may be displayed in plaintext in CloudTrail logs and other output.</p>
8 /// </important>
9 pub alias_name: ::std::option::Option<::std::string::String>,
10 /// <p>The <code>KeyARN</code> of the key to associate with the alias.</p>
11 pub key_arn: ::std::option::Option<::std::string::String>,
12}
13impl CreateAliasInput {
14 /// <p>A friendly name that you can use to refer to a key. An alias must begin with <code>alias/</code> followed by a name, for example <code>alias/ExampleAlias</code>. It can contain only alphanumeric characters, forward slashes (/), underscores (_), and dashes (-).</p><important>
15 /// <p>Don't include personal, confidential or sensitive information in this field. This field may be displayed in plaintext in CloudTrail logs and other output.</p>
16 /// </important>
17 pub fn alias_name(&self) -> ::std::option::Option<&str> {
18 self.alias_name.as_deref()
19 }
20 /// <p>The <code>KeyARN</code> of the key to associate with the alias.</p>
21 pub fn key_arn(&self) -> ::std::option::Option<&str> {
22 self.key_arn.as_deref()
23 }
24}
25impl CreateAliasInput {
26 /// Creates a new builder-style object to manufacture [`CreateAliasInput`](crate::operation::create_alias::CreateAliasInput).
27 pub fn builder() -> crate::operation::create_alias::builders::CreateAliasInputBuilder {
28 crate::operation::create_alias::builders::CreateAliasInputBuilder::default()
29 }
30}
31
32/// A builder for [`CreateAliasInput`](crate::operation::create_alias::CreateAliasInput).
33#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
34#[non_exhaustive]
35pub struct CreateAliasInputBuilder {
36 pub(crate) alias_name: ::std::option::Option<::std::string::String>,
37 pub(crate) key_arn: ::std::option::Option<::std::string::String>,
38}
39impl CreateAliasInputBuilder {
40 /// <p>A friendly name that you can use to refer to a key. An alias must begin with <code>alias/</code> followed by a name, for example <code>alias/ExampleAlias</code>. It can contain only alphanumeric characters, forward slashes (/), underscores (_), and dashes (-).</p><important>
41 /// <p>Don't include personal, confidential or sensitive information in this field. This field may be displayed in plaintext in CloudTrail logs and other output.</p>
42 /// </important>
43 /// This field is required.
44 pub fn alias_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
45 self.alias_name = ::std::option::Option::Some(input.into());
46 self
47 }
48 /// <p>A friendly name that you can use to refer to a key. An alias must begin with <code>alias/</code> followed by a name, for example <code>alias/ExampleAlias</code>. It can contain only alphanumeric characters, forward slashes (/), underscores (_), and dashes (-).</p><important>
49 /// <p>Don't include personal, confidential or sensitive information in this field. This field may be displayed in plaintext in CloudTrail logs and other output.</p>
50 /// </important>
51 pub fn set_alias_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
52 self.alias_name = input;
53 self
54 }
55 /// <p>A friendly name that you can use to refer to a key. An alias must begin with <code>alias/</code> followed by a name, for example <code>alias/ExampleAlias</code>. It can contain only alphanumeric characters, forward slashes (/), underscores (_), and dashes (-).</p><important>
56 /// <p>Don't include personal, confidential or sensitive information in this field. This field may be displayed in plaintext in CloudTrail logs and other output.</p>
57 /// </important>
58 pub fn get_alias_name(&self) -> &::std::option::Option<::std::string::String> {
59 &self.alias_name
60 }
61 /// <p>The <code>KeyARN</code> of the key to associate with the alias.</p>
62 pub fn key_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
63 self.key_arn = ::std::option::Option::Some(input.into());
64 self
65 }
66 /// <p>The <code>KeyARN</code> of the key to associate with the alias.</p>
67 pub fn set_key_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
68 self.key_arn = input;
69 self
70 }
71 /// <p>The <code>KeyARN</code> of the key to associate with the alias.</p>
72 pub fn get_key_arn(&self) -> &::std::option::Option<::std::string::String> {
73 &self.key_arn
74 }
75 /// Consumes the builder and constructs a [`CreateAliasInput`](crate::operation::create_alias::CreateAliasInput).
76 pub fn build(self) -> ::std::result::Result<crate::operation::create_alias::CreateAliasInput, ::aws_smithy_types::error::operation::BuildError> {
77 ::std::result::Result::Ok(crate::operation::create_alias::CreateAliasInput {
78 alias_name: self.alias_name,
79 key_arn: self.key_arn,
80 })
81 }
82}