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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct AcquireRoleInput {
/// <p>The Amazon Resource Name (ARN) of the role template to create the role from.</p>
/// <p>For more information about ARNs, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Amazon Resource Names (ARNs)</a> in the <i>Amazon Web Services General Reference</i>.</p>
pub template_arn: ::std::option::Option<::std::string::String>,
/// <p>The minor version of the role template to use. If you do not specify a minor version, the service uses the template's default minor version.</p>
pub template_minor_version: ::std::option::Option<i32>,
/// <p>A map of values to substitute for the parameters that are defined in the role template version. Each key is a parameter name from the template, and each value is a structure that contains the replacement values for that parameter.</p>
pub replacement_values: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::ReplacementValueEntry>>,
}
impl AcquireRoleInput {
/// <p>The Amazon Resource Name (ARN) of the role template to create the role from.</p>
/// <p>For more information about ARNs, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Amazon Resource Names (ARNs)</a> in the <i>Amazon Web Services General Reference</i>.</p>
pub fn template_arn(&self) -> ::std::option::Option<&str> {
self.template_arn.as_deref()
}
/// <p>The minor version of the role template to use. If you do not specify a minor version, the service uses the template's default minor version.</p>
pub fn template_minor_version(&self) -> ::std::option::Option<i32> {
self.template_minor_version
}
/// <p>A map of values to substitute for the parameters that are defined in the role template version. Each key is a parameter name from the template, and each value is a structure that contains the replacement values for that parameter.</p>
pub fn replacement_values(
&self,
) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, crate::types::ReplacementValueEntry>> {
self.replacement_values.as_ref()
}
}
impl AcquireRoleInput {
/// Creates a new builder-style object to manufacture [`AcquireRoleInput`](crate::operation::acquire_role::AcquireRoleInput).
pub fn builder() -> crate::operation::acquire_role::builders::AcquireRoleInputBuilder {
crate::operation::acquire_role::builders::AcquireRoleInputBuilder::default()
}
}
/// A builder for [`AcquireRoleInput`](crate::operation::acquire_role::AcquireRoleInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct AcquireRoleInputBuilder {
pub(crate) template_arn: ::std::option::Option<::std::string::String>,
pub(crate) template_minor_version: ::std::option::Option<i32>,
pub(crate) replacement_values: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::ReplacementValueEntry>>,
}
impl AcquireRoleInputBuilder {
/// <p>The Amazon Resource Name (ARN) of the role template to create the role from.</p>
/// <p>For more information about ARNs, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Amazon Resource Names (ARNs)</a> in the <i>Amazon Web Services General Reference</i>.</p>
/// This field is required.
pub fn template_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.template_arn = ::std::option::Option::Some(input.into());
self
}
/// <p>The Amazon Resource Name (ARN) of the role template to create the role from.</p>
/// <p>For more information about ARNs, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Amazon Resource Names (ARNs)</a> in the <i>Amazon Web Services General Reference</i>.</p>
pub fn set_template_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.template_arn = input;
self
}
/// <p>The Amazon Resource Name (ARN) of the role template to create the role from.</p>
/// <p>For more information about ARNs, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Amazon Resource Names (ARNs)</a> in the <i>Amazon Web Services General Reference</i>.</p>
pub fn get_template_arn(&self) -> &::std::option::Option<::std::string::String> {
&self.template_arn
}
/// <p>The minor version of the role template to use. If you do not specify a minor version, the service uses the template's default minor version.</p>
pub fn template_minor_version(mut self, input: i32) -> Self {
self.template_minor_version = ::std::option::Option::Some(input);
self
}
/// <p>The minor version of the role template to use. If you do not specify a minor version, the service uses the template's default minor version.</p>
pub fn set_template_minor_version(mut self, input: ::std::option::Option<i32>) -> Self {
self.template_minor_version = input;
self
}
/// <p>The minor version of the role template to use. If you do not specify a minor version, the service uses the template's default minor version.</p>
pub fn get_template_minor_version(&self) -> &::std::option::Option<i32> {
&self.template_minor_version
}
/// Adds a key-value pair to `replacement_values`.
///
/// To override the contents of this collection use [`set_replacement_values`](Self::set_replacement_values).
///
/// <p>A map of values to substitute for the parameters that are defined in the role template version. Each key is a parameter name from the template, and each value is a structure that contains the replacement values for that parameter.</p>
pub fn replacement_values(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::ReplacementValueEntry) -> Self {
let mut hash_map = self.replacement_values.unwrap_or_default();
hash_map.insert(k.into(), v);
self.replacement_values = ::std::option::Option::Some(hash_map);
self
}
/// <p>A map of values to substitute for the parameters that are defined in the role template version. Each key is a parameter name from the template, and each value is a structure that contains the replacement values for that parameter.</p>
pub fn set_replacement_values(
mut self,
input: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::ReplacementValueEntry>>,
) -> Self {
self.replacement_values = input;
self
}
/// <p>A map of values to substitute for the parameters that are defined in the role template version. Each key is a parameter name from the template, and each value is a structure that contains the replacement values for that parameter.</p>
pub fn get_replacement_values(
&self,
) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::ReplacementValueEntry>> {
&self.replacement_values
}
/// Consumes the builder and constructs a [`AcquireRoleInput`](crate::operation::acquire_role::AcquireRoleInput).
pub fn build(self) -> ::std::result::Result<crate::operation::acquire_role::AcquireRoleInput, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::operation::acquire_role::AcquireRoleInput {
template_arn: self.template_arn,
template_minor_version: self.template_minor_version,
replacement_values: self.replacement_values,
})
}
}