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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>Contains information about an alias.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Alias {
/// <p>A friendly name that you can use to refer to a key. The value must begin with <code>alias/</code>.</p><important>
/// <p>Do not include confidential or sensitive information in this field. This field may be displayed in plaintext in CloudTrail logs and other output.</p>
/// </important>
pub alias_name: ::std::string::String,
/// <p>The <code>KeyARN</code> of the key associated with the alias.</p>
pub key_arn: ::std::option::Option<::std::string::String>,
}
impl Alias {
/// <p>A friendly name that you can use to refer to a key. The value must begin with <code>alias/</code>.</p><important>
/// <p>Do not include confidential or sensitive information in this field. This field may be displayed in plaintext in CloudTrail logs and other output.</p>
/// </important>
pub fn alias_name(&self) -> &str {
use std::ops::Deref;
self.alias_name.deref()
}
/// <p>The <code>KeyARN</code> of the key associated with the alias.</p>
pub fn key_arn(&self) -> ::std::option::Option<&str> {
self.key_arn.as_deref()
}
}
impl Alias {
/// Creates a new builder-style object to manufacture [`Alias`](crate::types::Alias).
pub fn builder() -> crate::types::builders::AliasBuilder {
crate::types::builders::AliasBuilder::default()
}
}
/// A builder for [`Alias`](crate::types::Alias).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct AliasBuilder {
pub(crate) alias_name: ::std::option::Option<::std::string::String>,
pub(crate) key_arn: ::std::option::Option<::std::string::String>,
}
impl AliasBuilder {
/// <p>A friendly name that you can use to refer to a key. The value must begin with <code>alias/</code>.</p><important>
/// <p>Do not include confidential or sensitive information in this field. This field may be displayed in plaintext in CloudTrail logs and other output.</p>
/// </important>
/// This field is required.
pub fn alias_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.alias_name = ::std::option::Option::Some(input.into());
self
}
/// <p>A friendly name that you can use to refer to a key. The value must begin with <code>alias/</code>.</p><important>
/// <p>Do not include confidential or sensitive information in this field. This field may be displayed in plaintext in CloudTrail logs and other output.</p>
/// </important>
pub fn set_alias_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.alias_name = input;
self
}
/// <p>A friendly name that you can use to refer to a key. The value must begin with <code>alias/</code>.</p><important>
/// <p>Do not include confidential or sensitive information in this field. This field may be displayed in plaintext in CloudTrail logs and other output.</p>
/// </important>
pub fn get_alias_name(&self) -> &::std::option::Option<::std::string::String> {
&self.alias_name
}
/// <p>The <code>KeyARN</code> of the key associated with the alias.</p>
pub fn key_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.key_arn = ::std::option::Option::Some(input.into());
self
}
/// <p>The <code>KeyARN</code> of the key associated with the alias.</p>
pub fn set_key_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.key_arn = input;
self
}
/// <p>The <code>KeyARN</code> of the key associated with the alias.</p>
pub fn get_key_arn(&self) -> &::std::option::Option<::std::string::String> {
&self.key_arn
}
/// Consumes the builder and constructs a [`Alias`](crate::types::Alias).
/// This method will fail if any of the following fields are not set:
/// - [`alias_name`](crate::types::builders::AliasBuilder::alias_name)
pub fn build(self) -> ::std::result::Result<crate::types::Alias, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::types::Alias {
alias_name: self.alias_name.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"alias_name",
"alias_name was not specified but it is required when building Alias",
)
})?,
key_arn: self.key_arn,
})
}
}