aws_sdk_resourcegroups/operation/create_group/
_create_group_output.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 CreateGroupOutput {
6    /// <p>The description of the resource group.</p>
7    pub group: ::std::option::Option<crate::types::Group>,
8    /// <p>The resource query associated with the 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>
9    pub resource_query: ::std::option::Option<crate::types::ResourceQuery>,
10    /// <p>The tags associated with the group.</p>
11    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
12    /// <p>The service configuration associated with the resource group. For details about the syntax of a service configuration, see <a href="https://docs.aws.amazon.com/ARG/latest/APIReference/about-slg.html">Service configurations for Resource Groups</a>.</p>
13    pub group_configuration: ::std::option::Option<crate::types::GroupConfiguration>,
14    _request_id: Option<String>,
15}
16impl CreateGroupOutput {
17    /// <p>The description of the resource group.</p>
18    pub fn group(&self) -> ::std::option::Option<&crate::types::Group> {
19        self.group.as_ref()
20    }
21    /// <p>The resource query associated with the 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>
22    pub fn resource_query(&self) -> ::std::option::Option<&crate::types::ResourceQuery> {
23        self.resource_query.as_ref()
24    }
25    /// <p>The tags associated with the group.</p>
26    pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
27        self.tags.as_ref()
28    }
29    /// <p>The service configuration associated with the resource group. For details about the syntax of a service configuration, see <a href="https://docs.aws.amazon.com/ARG/latest/APIReference/about-slg.html">Service configurations for Resource Groups</a>.</p>
30    pub fn group_configuration(&self) -> ::std::option::Option<&crate::types::GroupConfiguration> {
31        self.group_configuration.as_ref()
32    }
33}
34impl ::aws_types::request_id::RequestId for CreateGroupOutput {
35    fn request_id(&self) -> Option<&str> {
36        self._request_id.as_deref()
37    }
38}
39impl CreateGroupOutput {
40    /// Creates a new builder-style object to manufacture [`CreateGroupOutput`](crate::operation::create_group::CreateGroupOutput).
41    pub fn builder() -> crate::operation::create_group::builders::CreateGroupOutputBuilder {
42        crate::operation::create_group::builders::CreateGroupOutputBuilder::default()
43    }
44}
45
46/// A builder for [`CreateGroupOutput`](crate::operation::create_group::CreateGroupOutput).
47#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
48#[non_exhaustive]
49pub struct CreateGroupOutputBuilder {
50    pub(crate) group: ::std::option::Option<crate::types::Group>,
51    pub(crate) resource_query: ::std::option::Option<crate::types::ResourceQuery>,
52    pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
53    pub(crate) group_configuration: ::std::option::Option<crate::types::GroupConfiguration>,
54    _request_id: Option<String>,
55}
56impl CreateGroupOutputBuilder {
57    /// <p>The description of the resource group.</p>
58    pub fn group(mut self, input: crate::types::Group) -> Self {
59        self.group = ::std::option::Option::Some(input);
60        self
61    }
62    /// <p>The description of the resource group.</p>
63    pub fn set_group(mut self, input: ::std::option::Option<crate::types::Group>) -> Self {
64        self.group = input;
65        self
66    }
67    /// <p>The description of the resource group.</p>
68    pub fn get_group(&self) -> &::std::option::Option<crate::types::Group> {
69        &self.group
70    }
71    /// <p>The resource query associated with the 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>
72    pub fn resource_query(mut self, input: crate::types::ResourceQuery) -> Self {
73        self.resource_query = ::std::option::Option::Some(input);
74        self
75    }
76    /// <p>The resource query associated with the 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>
77    pub fn set_resource_query(mut self, input: ::std::option::Option<crate::types::ResourceQuery>) -> Self {
78        self.resource_query = input;
79        self
80    }
81    /// <p>The resource query associated with the 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>
82    pub fn get_resource_query(&self) -> &::std::option::Option<crate::types::ResourceQuery> {
83        &self.resource_query
84    }
85    /// Adds a key-value pair to `tags`.
86    ///
87    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
88    ///
89    /// <p>The tags associated with the group.</p>
90    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
91        let mut hash_map = self.tags.unwrap_or_default();
92        hash_map.insert(k.into(), v.into());
93        self.tags = ::std::option::Option::Some(hash_map);
94        self
95    }
96    /// <p>The tags associated with the group.</p>
97    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
98        self.tags = input;
99        self
100    }
101    /// <p>The tags associated with the group.</p>
102    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
103        &self.tags
104    }
105    /// <p>The service configuration associated with the resource group. For details about the syntax of a service configuration, see <a href="https://docs.aws.amazon.com/ARG/latest/APIReference/about-slg.html">Service configurations for Resource Groups</a>.</p>
106    pub fn group_configuration(mut self, input: crate::types::GroupConfiguration) -> Self {
107        self.group_configuration = ::std::option::Option::Some(input);
108        self
109    }
110    /// <p>The service configuration associated with the resource group. For details about the syntax of a service configuration, see <a href="https://docs.aws.amazon.com/ARG/latest/APIReference/about-slg.html">Service configurations for Resource Groups</a>.</p>
111    pub fn set_group_configuration(mut self, input: ::std::option::Option<crate::types::GroupConfiguration>) -> Self {
112        self.group_configuration = input;
113        self
114    }
115    /// <p>The service configuration associated with the resource group. For details about the syntax of a service configuration, see <a href="https://docs.aws.amazon.com/ARG/latest/APIReference/about-slg.html">Service configurations for Resource Groups</a>.</p>
116    pub fn get_group_configuration(&self) -> &::std::option::Option<crate::types::GroupConfiguration> {
117        &self.group_configuration
118    }
119    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
120        self._request_id = Some(request_id.into());
121        self
122    }
123
124    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
125        self._request_id = request_id;
126        self
127    }
128    /// Consumes the builder and constructs a [`CreateGroupOutput`](crate::operation::create_group::CreateGroupOutput).
129    pub fn build(self) -> crate::operation::create_group::CreateGroupOutput {
130        crate::operation::create_group::CreateGroupOutput {
131            group: self.group,
132            resource_query: self.resource_query,
133            tags: self.tags,
134            group_configuration: self.group_configuration,
135            _request_id: self._request_id,
136        }
137    }
138}