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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>Contains information about an IAM group entity.</p>
/// <p>This data type is used as a response element in the following operations:</p>
/// <ul>
/// <li>
/// <p><a href="https://docs.aws.amazon.com/IAM/latest/APIReference/API_CreateGroup.html">CreateGroup</a></p></li>
/// <li>
/// <p><a href="https://docs.aws.amazon.com/IAM/latest/APIReference/API_GetGroup.html">GetGroup</a></p></li>
/// <li>
/// <p><a href="https://docs.aws.amazon.com/IAM/latest/APIReference/API_ListGroups.html">ListGroups</a></p></li>
/// </ul>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Group {
/// <p>The path to the group. For more information about paths, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html">IAM identifiers</a> in the <i>IAM User Guide</i>.</p>
pub path: ::std::string::String,
/// <p>The friendly name that identifies the group.</p>
pub group_name: ::std::string::String,
/// <p>The stable and unique string identifying the group. For more information about IDs, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html">IAM identifiers</a> in the <i>IAM User Guide</i>.</p>
pub group_id: ::std::string::String,
/// <p>The Amazon Resource Name (ARN) specifying the group. For more information about ARNs and how to use them in policies, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html">IAM identifiers</a> in the <i>IAM User Guide</i>.</p>
pub arn: ::std::string::String,
/// <p>The date and time, in <a href="http://www.iso.org/iso/iso8601">ISO 8601 date-time format</a>, when the group was created.</p>
pub create_date: ::aws_smithy_types::DateTime,
}
impl Group {
/// <p>The path to the group. For more information about paths, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html">IAM identifiers</a> in the <i>IAM User Guide</i>.</p>
pub fn path(&self) -> &str {
use std::ops::Deref;
self.path.deref()
}
/// <p>The friendly name that identifies the group.</p>
pub fn group_name(&self) -> &str {
use std::ops::Deref;
self.group_name.deref()
}
/// <p>The stable and unique string identifying the group. For more information about IDs, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html">IAM identifiers</a> in the <i>IAM User Guide</i>.</p>
pub fn group_id(&self) -> &str {
use std::ops::Deref;
self.group_id.deref()
}
/// <p>The Amazon Resource Name (ARN) specifying the group. For more information about ARNs and how to use them in policies, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html">IAM identifiers</a> in the <i>IAM User Guide</i>.</p>
pub fn arn(&self) -> &str {
use std::ops::Deref;
self.arn.deref()
}
/// <p>The date and time, in <a href="http://www.iso.org/iso/iso8601">ISO 8601 date-time format</a>, when the group was created.</p>
pub fn create_date(&self) -> &::aws_smithy_types::DateTime {
&self.create_date
}
}
impl Group {
/// Creates a new builder-style object to manufacture [`Group`](crate::types::Group).
pub fn builder() -> crate::types::builders::GroupBuilder {
crate::types::builders::GroupBuilder::default()
}
}
/// A builder for [`Group`](crate::types::Group).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct GroupBuilder {
pub(crate) path: ::std::option::Option<::std::string::String>,
pub(crate) group_name: ::std::option::Option<::std::string::String>,
pub(crate) group_id: ::std::option::Option<::std::string::String>,
pub(crate) arn: ::std::option::Option<::std::string::String>,
pub(crate) create_date: ::std::option::Option<::aws_smithy_types::DateTime>,
}
impl GroupBuilder {
/// <p>The path to the group. For more information about paths, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html">IAM identifiers</a> in the <i>IAM User Guide</i>.</p>
/// This field is required.
pub fn path(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.path = ::std::option::Option::Some(input.into());
self
}
/// <p>The path to the group. For more information about paths, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html">IAM identifiers</a> in the <i>IAM User Guide</i>.</p>
pub fn set_path(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.path = input;
self
}
/// <p>The path to the group. For more information about paths, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html">IAM identifiers</a> in the <i>IAM User Guide</i>.</p>
pub fn get_path(&self) -> &::std::option::Option<::std::string::String> {
&self.path
}
/// <p>The friendly name that identifies the group.</p>
/// This field is required.
pub fn group_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.group_name = ::std::option::Option::Some(input.into());
self
}
/// <p>The friendly name that identifies the group.</p>
pub fn set_group_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.group_name = input;
self
}
/// <p>The friendly name that identifies the group.</p>
pub fn get_group_name(&self) -> &::std::option::Option<::std::string::String> {
&self.group_name
}
/// <p>The stable and unique string identifying the group. For more information about IDs, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html">IAM identifiers</a> in the <i>IAM User Guide</i>.</p>
/// This field is required.
pub fn group_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.group_id = ::std::option::Option::Some(input.into());
self
}
/// <p>The stable and unique string identifying the group. For more information about IDs, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html">IAM identifiers</a> in the <i>IAM User Guide</i>.</p>
pub fn set_group_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.group_id = input;
self
}
/// <p>The stable and unique string identifying the group. For more information about IDs, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html">IAM identifiers</a> in the <i>IAM User Guide</i>.</p>
pub fn get_group_id(&self) -> &::std::option::Option<::std::string::String> {
&self.group_id
}
/// <p>The Amazon Resource Name (ARN) specifying the group. For more information about ARNs and how to use them in policies, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html">IAM identifiers</a> in the <i>IAM User Guide</i>.</p>
/// This field is required.
pub fn arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.arn = ::std::option::Option::Some(input.into());
self
}
/// <p>The Amazon Resource Name (ARN) specifying the group. For more information about ARNs and how to use them in policies, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html">IAM identifiers</a> in the <i>IAM User Guide</i>.</p>
pub fn set_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.arn = input;
self
}
/// <p>The Amazon Resource Name (ARN) specifying the group. For more information about ARNs and how to use them in policies, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html">IAM identifiers</a> in the <i>IAM User Guide</i>.</p>
pub fn get_arn(&self) -> &::std::option::Option<::std::string::String> {
&self.arn
}
/// <p>The date and time, in <a href="http://www.iso.org/iso/iso8601">ISO 8601 date-time format</a>, when the group was created.</p>
/// This field is required.
pub fn create_date(mut self, input: ::aws_smithy_types::DateTime) -> Self {
self.create_date = ::std::option::Option::Some(input);
self
}
/// <p>The date and time, in <a href="http://www.iso.org/iso/iso8601">ISO 8601 date-time format</a>, when the group was created.</p>
pub fn set_create_date(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
self.create_date = input;
self
}
/// <p>The date and time, in <a href="http://www.iso.org/iso/iso8601">ISO 8601 date-time format</a>, when the group was created.</p>
pub fn get_create_date(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
&self.create_date
}
/// Consumes the builder and constructs a [`Group`](crate::types::Group).
/// This method will fail if any of the following fields are not set:
/// - [`path`](crate::types::builders::GroupBuilder::path)
/// - [`group_name`](crate::types::builders::GroupBuilder::group_name)
/// - [`group_id`](crate::types::builders::GroupBuilder::group_id)
/// - [`arn`](crate::types::builders::GroupBuilder::arn)
/// - [`create_date`](crate::types::builders::GroupBuilder::create_date)
pub fn build(self) -> ::std::result::Result<crate::types::Group, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::types::Group {
path: self.path.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"path",
"path was not specified but it is required when building Group",
)
})?,
group_name: self.group_name.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"group_name",
"group_name was not specified but it is required when building Group",
)
})?,
group_id: self.group_id.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"group_id",
"group_id was not specified but it is required when building Group",
)
})?,
arn: self.arn.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field("arn", "arn was not specified but it is required when building Group")
})?,
create_date: self.create_date.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"create_date",
"create_date was not specified but it is required when building Group",
)
})?,
})
}
}