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
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>A resource group that contains Amazon Web Services resources. You can assign resources to the group by associating either of the following elements with the group:</p>
/// <ul>
/// <li>
/// <p><code>ResourceQuery</code> - Use a resource query to specify a set of tag keys and values. All resources in the same Amazon Web Services Region and Amazon Web Services account that have those keys with the same values are included in the group. You can add a resource query when you create the group, or later by using the <code>PutGroupConfiguration</code> operation.</p></li>
/// <li>
/// <p><code>GroupConfiguration</code> - Use a service configuration to associate the group with an Amazon Web Services service. The configuration specifies which resource types can be included in the group.</p></li>
/// </ul>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Group {
/// <p>The Amazon resource name (ARN) of the resource group.</p>
pub group_arn: ::std::string::String,
/// <p>The name of the resource group.</p>
pub name: ::std::string::String,
/// <p>The description of the resource group.</p>
pub description: ::std::option::Option<::std::string::String>,
/// <p>The critical rank of the application group on a scale of 1 to 10, with a rank of 1 being the most critical, and a rank of 10 being least critical.</p>
pub criticality: ::std::option::Option<i32>,
/// <p>A name, email address or other identifier for the person or group who is considered as the owner of this application group within your organization.</p>
pub owner: ::std::option::Option<::std::string::String>,
/// <p>The name of the application group, which you can change at any time.</p>
pub display_name: ::std::option::Option<::std::string::String>,
/// <p>A tag that defines the application group membership. This tag is only supported for application groups.</p>
pub application_tag: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
}
impl Group {
/// <p>The Amazon resource name (ARN) of the resource group.</p>
pub fn group_arn(&self) -> &str {
use std::ops::Deref;
self.group_arn.deref()
}
/// <p>The name of the resource group.</p>
pub fn name(&self) -> &str {
use std::ops::Deref;
self.name.deref()
}
/// <p>The description of the resource group.</p>
pub fn description(&self) -> ::std::option::Option<&str> {
self.description.as_deref()
}
/// <p>The critical rank of the application group on a scale of 1 to 10, with a rank of 1 being the most critical, and a rank of 10 being least critical.</p>
pub fn criticality(&self) -> ::std::option::Option<i32> {
self.criticality
}
/// <p>A name, email address or other identifier for the person or group who is considered as the owner of this application group within your organization.</p>
pub fn owner(&self) -> ::std::option::Option<&str> {
self.owner.as_deref()
}
/// <p>The name of the application group, which you can change at any time.</p>
pub fn display_name(&self) -> ::std::option::Option<&str> {
self.display_name.as_deref()
}
/// <p>A tag that defines the application group membership. This tag is only supported for application groups.</p>
pub fn application_tag(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
self.application_tag.as_ref()
}
}
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) group_arn: ::std::option::Option<::std::string::String>,
pub(crate) name: ::std::option::Option<::std::string::String>,
pub(crate) description: ::std::option::Option<::std::string::String>,
pub(crate) criticality: ::std::option::Option<i32>,
pub(crate) owner: ::std::option::Option<::std::string::String>,
pub(crate) display_name: ::std::option::Option<::std::string::String>,
pub(crate) application_tag: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
}
impl GroupBuilder {
/// <p>The Amazon resource name (ARN) of the resource group.</p>
/// This field is required.
pub fn group_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.group_arn = ::std::option::Option::Some(input.into());
self
}
/// <p>The Amazon resource name (ARN) of the resource group.</p>
pub fn set_group_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.group_arn = input;
self
}
/// <p>The Amazon resource name (ARN) of the resource group.</p>
pub fn get_group_arn(&self) -> &::std::option::Option<::std::string::String> {
&self.group_arn
}
/// <p>The name of the resource group.</p>
/// This field is required.
pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.name = ::std::option::Option::Some(input.into());
self
}
/// <p>The name of the resource group.</p>
pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.name = input;
self
}
/// <p>The name of the resource group.</p>
pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
&self.name
}
/// <p>The description of the resource group.</p>
pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.description = ::std::option::Option::Some(input.into());
self
}
/// <p>The description of the resource group.</p>
pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.description = input;
self
}
/// <p>The description of the resource group.</p>
pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
&self.description
}
/// <p>The critical rank of the application group on a scale of 1 to 10, with a rank of 1 being the most critical, and a rank of 10 being least critical.</p>
pub fn criticality(mut self, input: i32) -> Self {
self.criticality = ::std::option::Option::Some(input);
self
}
/// <p>The critical rank of the application group on a scale of 1 to 10, with a rank of 1 being the most critical, and a rank of 10 being least critical.</p>
pub fn set_criticality(mut self, input: ::std::option::Option<i32>) -> Self {
self.criticality = input;
self
}
/// <p>The critical rank of the application group on a scale of 1 to 10, with a rank of 1 being the most critical, and a rank of 10 being least critical.</p>
pub fn get_criticality(&self) -> &::std::option::Option<i32> {
&self.criticality
}
/// <p>A name, email address or other identifier for the person or group who is considered as the owner of this application group within your organization.</p>
pub fn owner(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.owner = ::std::option::Option::Some(input.into());
self
}
/// <p>A name, email address or other identifier for the person or group who is considered as the owner of this application group within your organization.</p>
pub fn set_owner(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.owner = input;
self
}
/// <p>A name, email address or other identifier for the person or group who is considered as the owner of this application group within your organization.</p>
pub fn get_owner(&self) -> &::std::option::Option<::std::string::String> {
&self.owner
}
/// <p>The name of the application group, which you can change at any time.</p>
pub fn display_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.display_name = ::std::option::Option::Some(input.into());
self
}
/// <p>The name of the application group, which you can change at any time.</p>
pub fn set_display_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.display_name = input;
self
}
/// <p>The name of the application group, which you can change at any time.</p>
pub fn get_display_name(&self) -> &::std::option::Option<::std::string::String> {
&self.display_name
}
/// Adds a key-value pair to `application_tag`.
///
/// To override the contents of this collection use [`set_application_tag`](Self::set_application_tag).
///
/// <p>A tag that defines the application group membership. This tag is only supported for application groups.</p>
pub fn application_tag(
mut self,
k: impl ::std::convert::Into<::std::string::String>,
v: impl ::std::convert::Into<::std::string::String>,
) -> Self {
let mut hash_map = self.application_tag.unwrap_or_default();
hash_map.insert(k.into(), v.into());
self.application_tag = ::std::option::Option::Some(hash_map);
self
}
/// <p>A tag that defines the application group membership. This tag is only supported for application groups.</p>
pub fn set_application_tag(
mut self,
input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
) -> Self {
self.application_tag = input;
self
}
/// <p>A tag that defines the application group membership. This tag is only supported for application groups.</p>
pub fn get_application_tag(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
&self.application_tag
}
/// Consumes the builder and constructs a [`Group`](crate::types::Group).
/// This method will fail if any of the following fields are not set:
/// - [`group_arn`](crate::types::builders::GroupBuilder::group_arn)
/// - [`name`](crate::types::builders::GroupBuilder::name)
pub fn build(self) -> ::std::result::Result<crate::types::Group, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::types::Group {
group_arn: self.group_arn.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"group_arn",
"group_arn was not specified but it is required when building Group",
)
})?,
name: self.name.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"name",
"name was not specified but it is required when building Group",
)
})?,
description: self.description,
criticality: self.criticality,
owner: self.owner,
display_name: self.display_name,
application_tag: self.application_tag,
})
}
}