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
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>The wrapper that contains the Audit Manager role information of the current user. This includes the role type and IAM Amazon Resource Name (ARN).</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Role {
/// <p>The type of customer persona.</p><note>
/// <p>In <code>CreateAssessment</code>, <code>roleType</code> can only be <code>PROCESS_OWNER</code>.</p>
/// <p>In <code>UpdateSettings</code>, <code>roleType</code> can only be <code>PROCESS_OWNER</code>.</p>
/// <p>In <code>BatchCreateDelegationByAssessment</code>, <code>roleType</code> can only be <code>RESOURCE_OWNER</code>.</p>
/// </note>
pub role_type: crate::types::RoleType,
/// <p>The Amazon Resource Name (ARN) of the IAM role.</p>
pub role_arn: ::std::string::String,
}
impl Role {
/// <p>The type of customer persona.</p><note>
/// <p>In <code>CreateAssessment</code>, <code>roleType</code> can only be <code>PROCESS_OWNER</code>.</p>
/// <p>In <code>UpdateSettings</code>, <code>roleType</code> can only be <code>PROCESS_OWNER</code>.</p>
/// <p>In <code>BatchCreateDelegationByAssessment</code>, <code>roleType</code> can only be <code>RESOURCE_OWNER</code>.</p>
/// </note>
pub fn role_type(&self) -> &crate::types::RoleType {
&self.role_type
}
/// <p>The Amazon Resource Name (ARN) of the IAM role.</p>
pub fn role_arn(&self) -> &str {
use std::ops::Deref;
self.role_arn.deref()
}
}
impl Role {
/// Creates a new builder-style object to manufacture [`Role`](crate::types::Role).
pub fn builder() -> crate::types::builders::RoleBuilder {
crate::types::builders::RoleBuilder::default()
}
}
/// A builder for [`Role`](crate::types::Role).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct RoleBuilder {
pub(crate) role_type: ::std::option::Option<crate::types::RoleType>,
pub(crate) role_arn: ::std::option::Option<::std::string::String>,
}
impl RoleBuilder {
/// <p>The type of customer persona.</p><note>
/// <p>In <code>CreateAssessment</code>, <code>roleType</code> can only be <code>PROCESS_OWNER</code>.</p>
/// <p>In <code>UpdateSettings</code>, <code>roleType</code> can only be <code>PROCESS_OWNER</code>.</p>
/// <p>In <code>BatchCreateDelegationByAssessment</code>, <code>roleType</code> can only be <code>RESOURCE_OWNER</code>.</p>
/// </note>
/// This field is required.
pub fn role_type(mut self, input: crate::types::RoleType) -> Self {
self.role_type = ::std::option::Option::Some(input);
self
}
/// <p>The type of customer persona.</p><note>
/// <p>In <code>CreateAssessment</code>, <code>roleType</code> can only be <code>PROCESS_OWNER</code>.</p>
/// <p>In <code>UpdateSettings</code>, <code>roleType</code> can only be <code>PROCESS_OWNER</code>.</p>
/// <p>In <code>BatchCreateDelegationByAssessment</code>, <code>roleType</code> can only be <code>RESOURCE_OWNER</code>.</p>
/// </note>
pub fn set_role_type(mut self, input: ::std::option::Option<crate::types::RoleType>) -> Self {
self.role_type = input;
self
}
/// <p>The type of customer persona.</p><note>
/// <p>In <code>CreateAssessment</code>, <code>roleType</code> can only be <code>PROCESS_OWNER</code>.</p>
/// <p>In <code>UpdateSettings</code>, <code>roleType</code> can only be <code>PROCESS_OWNER</code>.</p>
/// <p>In <code>BatchCreateDelegationByAssessment</code>, <code>roleType</code> can only be <code>RESOURCE_OWNER</code>.</p>
/// </note>
pub fn get_role_type(&self) -> &::std::option::Option<crate::types::RoleType> {
&self.role_type
}
/// <p>The Amazon Resource Name (ARN) of the IAM role.</p>
/// This field is required.
pub fn role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.role_arn = ::std::option::Option::Some(input.into());
self
}
/// <p>The Amazon Resource Name (ARN) of the IAM role.</p>
pub fn set_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.role_arn = input;
self
}
/// <p>The Amazon Resource Name (ARN) of the IAM role.</p>
pub fn get_role_arn(&self) -> &::std::option::Option<::std::string::String> {
&self.role_arn
}
/// Consumes the builder and constructs a [`Role`](crate::types::Role).
/// This method will fail if any of the following fields are not set:
/// - [`role_type`](crate::types::builders::RoleBuilder::role_type)
/// - [`role_arn`](crate::types::builders::RoleBuilder::role_arn)
pub fn build(self) -> ::std::result::Result<crate::types::Role, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::types::Role {
role_type: self.role_type.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"role_type",
"role_type was not specified but it is required when building Role",
)
})?,
role_arn: self.role_arn.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"role_arn",
"role_arn was not specified but it is required when building Role",
)
})?,
})
}
}