aws_sdk_resourcegroups/operation/create_group/
_create_group_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct CreateGroupInput {
6    /// <p>The name of the group, which is the identifier of the group in other operations. You can't change the name of a resource group after you create it. A resource group name can consist of letters, numbers, hyphens, periods, and underscores. The name cannot start with <code>AWS</code>, <code>aws</code>, or any other possible capitalization; these are reserved. A resource group name must be unique within each Amazon Web Services Region in your Amazon Web Services account.</p>
7    pub name: ::std::option::Option<::std::string::String>,
8    /// <p>The description of the resource group. Descriptions can consist of letters, numbers, hyphens, underscores, periods, and spaces.</p>
9    pub description: ::std::option::Option<::std::string::String>,
10    /// <p>The resource query that determines which Amazon Web Services resources are members of this group. For more information about resource queries, see <a href="https://docs.aws.amazon.com/ARG/latest/userguide/gettingstarted-query.html#gettingstarted-query-cli-tag">Create a tag-based group in Resource Groups</a>.</p><note>
11    /// <p>A resource group can contain either a <code>ResourceQuery</code> or a <code>Configuration</code>, but not both.</p>
12    /// </note>
13    pub resource_query: ::std::option::Option<crate::types::ResourceQuery>,
14    /// <p>The tags to add to the group. A tag is key-value pair string.</p>
15    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
16    /// <p>A configuration associates the resource group with an Amazon Web Services service and specifies how the service can interact with the resources in the group. A configuration is an array of <code>GroupConfigurationItem</code> elements. For details about the syntax of service configurations, see <a href="https://docs.aws.amazon.com/ARG/latest/APIReference/about-slg.html">Service configurations for Resource Groups</a>.</p><note>
17    /// <p>A resource group can contain either a <code>Configuration</code> or a <code>ResourceQuery</code>, but not both.</p>
18    /// </note>
19    pub configuration: ::std::option::Option<::std::vec::Vec<crate::types::GroupConfigurationItem>>,
20    /// <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>
21    pub criticality: ::std::option::Option<i32>,
22    /// <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>
23    pub owner: ::std::option::Option<::std::string::String>,
24    /// <p>The name of the application group, which you can change at any time.</p>
25    pub display_name: ::std::option::Option<::std::string::String>,
26}
27impl CreateGroupInput {
28    /// <p>The name of the group, which is the identifier of the group in other operations. You can't change the name of a resource group after you create it. A resource group name can consist of letters, numbers, hyphens, periods, and underscores. The name cannot start with <code>AWS</code>, <code>aws</code>, or any other possible capitalization; these are reserved. A resource group name must be unique within each Amazon Web Services Region in your Amazon Web Services account.</p>
29    pub fn name(&self) -> ::std::option::Option<&str> {
30        self.name.as_deref()
31    }
32    /// <p>The description of the resource group. Descriptions can consist of letters, numbers, hyphens, underscores, periods, and spaces.</p>
33    pub fn description(&self) -> ::std::option::Option<&str> {
34        self.description.as_deref()
35    }
36    /// <p>The resource query that determines which Amazon Web Services resources are members of this group. For more information about resource queries, see <a href="https://docs.aws.amazon.com/ARG/latest/userguide/gettingstarted-query.html#gettingstarted-query-cli-tag">Create a tag-based group in Resource Groups</a>.</p><note>
37    /// <p>A resource group can contain either a <code>ResourceQuery</code> or a <code>Configuration</code>, but not both.</p>
38    /// </note>
39    pub fn resource_query(&self) -> ::std::option::Option<&crate::types::ResourceQuery> {
40        self.resource_query.as_ref()
41    }
42    /// <p>The tags to add to the group. A tag is key-value pair string.</p>
43    pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
44        self.tags.as_ref()
45    }
46    /// <p>A configuration associates the resource group with an Amazon Web Services service and specifies how the service can interact with the resources in the group. A configuration is an array of <code>GroupConfigurationItem</code> elements. For details about the syntax of service configurations, see <a href="https://docs.aws.amazon.com/ARG/latest/APIReference/about-slg.html">Service configurations for Resource Groups</a>.</p><note>
47    /// <p>A resource group can contain either a <code>Configuration</code> or a <code>ResourceQuery</code>, but not both.</p>
48    /// </note>
49    ///
50    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.configuration.is_none()`.
51    pub fn configuration(&self) -> &[crate::types::GroupConfigurationItem] {
52        self.configuration.as_deref().unwrap_or_default()
53    }
54    /// <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>
55    pub fn criticality(&self) -> ::std::option::Option<i32> {
56        self.criticality
57    }
58    /// <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>
59    pub fn owner(&self) -> ::std::option::Option<&str> {
60        self.owner.as_deref()
61    }
62    /// <p>The name of the application group, which you can change at any time.</p>
63    pub fn display_name(&self) -> ::std::option::Option<&str> {
64        self.display_name.as_deref()
65    }
66}
67impl CreateGroupInput {
68    /// Creates a new builder-style object to manufacture [`CreateGroupInput`](crate::operation::create_group::CreateGroupInput).
69    pub fn builder() -> crate::operation::create_group::builders::CreateGroupInputBuilder {
70        crate::operation::create_group::builders::CreateGroupInputBuilder::default()
71    }
72}
73
74/// A builder for [`CreateGroupInput`](crate::operation::create_group::CreateGroupInput).
75#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
76#[non_exhaustive]
77pub struct CreateGroupInputBuilder {
78    pub(crate) name: ::std::option::Option<::std::string::String>,
79    pub(crate) description: ::std::option::Option<::std::string::String>,
80    pub(crate) resource_query: ::std::option::Option<crate::types::ResourceQuery>,
81    pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
82    pub(crate) configuration: ::std::option::Option<::std::vec::Vec<crate::types::GroupConfigurationItem>>,
83    pub(crate) criticality: ::std::option::Option<i32>,
84    pub(crate) owner: ::std::option::Option<::std::string::String>,
85    pub(crate) display_name: ::std::option::Option<::std::string::String>,
86}
87impl CreateGroupInputBuilder {
88    /// <p>The name of the group, which is the identifier of the group in other operations. You can't change the name of a resource group after you create it. A resource group name can consist of letters, numbers, hyphens, periods, and underscores. The name cannot start with <code>AWS</code>, <code>aws</code>, or any other possible capitalization; these are reserved. A resource group name must be unique within each Amazon Web Services Region in your Amazon Web Services account.</p>
89    /// This field is required.
90    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
91        self.name = ::std::option::Option::Some(input.into());
92        self
93    }
94    /// <p>The name of the group, which is the identifier of the group in other operations. You can't change the name of a resource group after you create it. A resource group name can consist of letters, numbers, hyphens, periods, and underscores. The name cannot start with <code>AWS</code>, <code>aws</code>, or any other possible capitalization; these are reserved. A resource group name must be unique within each Amazon Web Services Region in your Amazon Web Services account.</p>
95    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
96        self.name = input;
97        self
98    }
99    /// <p>The name of the group, which is the identifier of the group in other operations. You can't change the name of a resource group after you create it. A resource group name can consist of letters, numbers, hyphens, periods, and underscores. The name cannot start with <code>AWS</code>, <code>aws</code>, or any other possible capitalization; these are reserved. A resource group name must be unique within each Amazon Web Services Region in your Amazon Web Services account.</p>
100    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
101        &self.name
102    }
103    /// <p>The description of the resource group. Descriptions can consist of letters, numbers, hyphens, underscores, periods, and spaces.</p>
104    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
105        self.description = ::std::option::Option::Some(input.into());
106        self
107    }
108    /// <p>The description of the resource group. Descriptions can consist of letters, numbers, hyphens, underscores, periods, and spaces.</p>
109    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
110        self.description = input;
111        self
112    }
113    /// <p>The description of the resource group. Descriptions can consist of letters, numbers, hyphens, underscores, periods, and spaces.</p>
114    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
115        &self.description
116    }
117    /// <p>The resource query that determines which Amazon Web Services resources are members of this group. For more information about resource queries, see <a href="https://docs.aws.amazon.com/ARG/latest/userguide/gettingstarted-query.html#gettingstarted-query-cli-tag">Create a tag-based group in Resource Groups</a>.</p><note>
118    /// <p>A resource group can contain either a <code>ResourceQuery</code> or a <code>Configuration</code>, but not both.</p>
119    /// </note>
120    pub fn resource_query(mut self, input: crate::types::ResourceQuery) -> Self {
121        self.resource_query = ::std::option::Option::Some(input);
122        self
123    }
124    /// <p>The resource query that determines which Amazon Web Services resources are members of this group. For more information about resource queries, see <a href="https://docs.aws.amazon.com/ARG/latest/userguide/gettingstarted-query.html#gettingstarted-query-cli-tag">Create a tag-based group in Resource Groups</a>.</p><note>
125    /// <p>A resource group can contain either a <code>ResourceQuery</code> or a <code>Configuration</code>, but not both.</p>
126    /// </note>
127    pub fn set_resource_query(mut self, input: ::std::option::Option<crate::types::ResourceQuery>) -> Self {
128        self.resource_query = input;
129        self
130    }
131    /// <p>The resource query that determines which Amazon Web Services resources are members of this group. For more information about resource queries, see <a href="https://docs.aws.amazon.com/ARG/latest/userguide/gettingstarted-query.html#gettingstarted-query-cli-tag">Create a tag-based group in Resource Groups</a>.</p><note>
132    /// <p>A resource group can contain either a <code>ResourceQuery</code> or a <code>Configuration</code>, but not both.</p>
133    /// </note>
134    pub fn get_resource_query(&self) -> &::std::option::Option<crate::types::ResourceQuery> {
135        &self.resource_query
136    }
137    /// Adds a key-value pair to `tags`.
138    ///
139    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
140    ///
141    /// <p>The tags to add to the group. A tag is key-value pair string.</p>
142    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
143        let mut hash_map = self.tags.unwrap_or_default();
144        hash_map.insert(k.into(), v.into());
145        self.tags = ::std::option::Option::Some(hash_map);
146        self
147    }
148    /// <p>The tags to add to the group. A tag is key-value pair string.</p>
149    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
150        self.tags = input;
151        self
152    }
153    /// <p>The tags to add to the group. A tag is key-value pair string.</p>
154    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
155        &self.tags
156    }
157    /// Appends an item to `configuration`.
158    ///
159    /// To override the contents of this collection use [`set_configuration`](Self::set_configuration).
160    ///
161    /// <p>A configuration associates the resource group with an Amazon Web Services service and specifies how the service can interact with the resources in the group. A configuration is an array of <code>GroupConfigurationItem</code> elements. For details about the syntax of service configurations, see <a href="https://docs.aws.amazon.com/ARG/latest/APIReference/about-slg.html">Service configurations for Resource Groups</a>.</p><note>
162    /// <p>A resource group can contain either a <code>Configuration</code> or a <code>ResourceQuery</code>, but not both.</p>
163    /// </note>
164    pub fn configuration(mut self, input: crate::types::GroupConfigurationItem) -> Self {
165        let mut v = self.configuration.unwrap_or_default();
166        v.push(input);
167        self.configuration = ::std::option::Option::Some(v);
168        self
169    }
170    /// <p>A configuration associates the resource group with an Amazon Web Services service and specifies how the service can interact with the resources in the group. A configuration is an array of <code>GroupConfigurationItem</code> elements. For details about the syntax of service configurations, see <a href="https://docs.aws.amazon.com/ARG/latest/APIReference/about-slg.html">Service configurations for Resource Groups</a>.</p><note>
171    /// <p>A resource group can contain either a <code>Configuration</code> or a <code>ResourceQuery</code>, but not both.</p>
172    /// </note>
173    pub fn set_configuration(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::GroupConfigurationItem>>) -> Self {
174        self.configuration = input;
175        self
176    }
177    /// <p>A configuration associates the resource group with an Amazon Web Services service and specifies how the service can interact with the resources in the group. A configuration is an array of <code>GroupConfigurationItem</code> elements. For details about the syntax of service configurations, see <a href="https://docs.aws.amazon.com/ARG/latest/APIReference/about-slg.html">Service configurations for Resource Groups</a>.</p><note>
178    /// <p>A resource group can contain either a <code>Configuration</code> or a <code>ResourceQuery</code>, but not both.</p>
179    /// </note>
180    pub fn get_configuration(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::GroupConfigurationItem>> {
181        &self.configuration
182    }
183    /// <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>
184    pub fn criticality(mut self, input: i32) -> Self {
185        self.criticality = ::std::option::Option::Some(input);
186        self
187    }
188    /// <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>
189    pub fn set_criticality(mut self, input: ::std::option::Option<i32>) -> Self {
190        self.criticality = input;
191        self
192    }
193    /// <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>
194    pub fn get_criticality(&self) -> &::std::option::Option<i32> {
195        &self.criticality
196    }
197    /// <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>
198    pub fn owner(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
199        self.owner = ::std::option::Option::Some(input.into());
200        self
201    }
202    /// <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>
203    pub fn set_owner(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
204        self.owner = input;
205        self
206    }
207    /// <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>
208    pub fn get_owner(&self) -> &::std::option::Option<::std::string::String> {
209        &self.owner
210    }
211    /// <p>The name of the application group, which you can change at any time.</p>
212    pub fn display_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
213        self.display_name = ::std::option::Option::Some(input.into());
214        self
215    }
216    /// <p>The name of the application group, which you can change at any time.</p>
217    pub fn set_display_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
218        self.display_name = input;
219        self
220    }
221    /// <p>The name of the application group, which you can change at any time.</p>
222    pub fn get_display_name(&self) -> &::std::option::Option<::std::string::String> {
223        &self.display_name
224    }
225    /// Consumes the builder and constructs a [`CreateGroupInput`](crate::operation::create_group::CreateGroupInput).
226    pub fn build(self) -> ::std::result::Result<crate::operation::create_group::CreateGroupInput, ::aws_smithy_types::error::operation::BuildError> {
227        ::std::result::Result::Ok(crate::operation::create_group::CreateGroupInput {
228            name: self.name,
229            description: self.description,
230            resource_query: self.resource_query,
231            tags: self.tags,
232            configuration: self.configuration,
233            criticality: self.criticality,
234            owner: self.owner,
235            display_name: self.display_name,
236        })
237    }
238}