aws_sdk_xray/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 case-sensitive name of the new group. Default is a reserved name and names must be unique.</p>
7    pub group_name: ::std::option::Option<::std::string::String>,
8    /// <p>The filter expression defining criteria by which to group traces.</p>
9    pub filter_expression: ::std::option::Option<::std::string::String>,
10    /// <p>The structure containing configurations related to insights.</p>
11    /// <ul>
12    /// <li>
13    /// <p>The InsightsEnabled boolean can be set to true to enable insights for the new group or false to disable insights for the new group.</p></li>
14    /// <li>
15    /// <p>The NotificationsEnabled boolean can be set to true to enable insights notifications for the new group. Notifications may only be enabled on a group with InsightsEnabled set to true.</p></li>
16    /// </ul>
17    pub insights_configuration: ::std::option::Option<crate::types::InsightsConfiguration>,
18    /// <p>A map that contains one or more tag keys and tag values to attach to an X-Ray group. For more information about ways to use tags, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html">Tagging Amazon Web Services resources</a> in the <i>Amazon Web Services General Reference</i>.</p>
19    /// <p>The following restrictions apply to tags:</p>
20    /// <ul>
21    /// <li>
22    /// <p>Maximum number of user-applied tags per resource: 50</p></li>
23    /// <li>
24    /// <p>Maximum tag key length: 128 Unicode characters</p></li>
25    /// <li>
26    /// <p>Maximum tag value length: 256 Unicode characters</p></li>
27    /// <li>
28    /// <p>Valid values for key and value: a-z, A-Z, 0-9, space, and the following characters: _ . : / = + - and @</p></li>
29    /// <li>
30    /// <p>Tag keys and values are case sensitive.</p></li>
31    /// <li>
32    /// <p>Don't use <code>aws:</code> as a prefix for keys; it's reserved for Amazon Web Services use.</p></li>
33    /// </ul>
34    pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
35}
36impl CreateGroupInput {
37    /// <p>The case-sensitive name of the new group. Default is a reserved name and names must be unique.</p>
38    pub fn group_name(&self) -> ::std::option::Option<&str> {
39        self.group_name.as_deref()
40    }
41    /// <p>The filter expression defining criteria by which to group traces.</p>
42    pub fn filter_expression(&self) -> ::std::option::Option<&str> {
43        self.filter_expression.as_deref()
44    }
45    /// <p>The structure containing configurations related to insights.</p>
46    /// <ul>
47    /// <li>
48    /// <p>The InsightsEnabled boolean can be set to true to enable insights for the new group or false to disable insights for the new group.</p></li>
49    /// <li>
50    /// <p>The NotificationsEnabled boolean can be set to true to enable insights notifications for the new group. Notifications may only be enabled on a group with InsightsEnabled set to true.</p></li>
51    /// </ul>
52    pub fn insights_configuration(&self) -> ::std::option::Option<&crate::types::InsightsConfiguration> {
53        self.insights_configuration.as_ref()
54    }
55    /// <p>A map that contains one or more tag keys and tag values to attach to an X-Ray group. For more information about ways to use tags, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html">Tagging Amazon Web Services resources</a> in the <i>Amazon Web Services General Reference</i>.</p>
56    /// <p>The following restrictions apply to tags:</p>
57    /// <ul>
58    /// <li>
59    /// <p>Maximum number of user-applied tags per resource: 50</p></li>
60    /// <li>
61    /// <p>Maximum tag key length: 128 Unicode characters</p></li>
62    /// <li>
63    /// <p>Maximum tag value length: 256 Unicode characters</p></li>
64    /// <li>
65    /// <p>Valid values for key and value: a-z, A-Z, 0-9, space, and the following characters: _ . : / = + - and @</p></li>
66    /// <li>
67    /// <p>Tag keys and values are case sensitive.</p></li>
68    /// <li>
69    /// <p>Don't use <code>aws:</code> as a prefix for keys; it's reserved for Amazon Web Services use.</p></li>
70    /// </ul>
71    ///
72    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.tags.is_none()`.
73    pub fn tags(&self) -> &[crate::types::Tag] {
74        self.tags.as_deref().unwrap_or_default()
75    }
76}
77impl CreateGroupInput {
78    /// Creates a new builder-style object to manufacture [`CreateGroupInput`](crate::operation::create_group::CreateGroupInput).
79    pub fn builder() -> crate::operation::create_group::builders::CreateGroupInputBuilder {
80        crate::operation::create_group::builders::CreateGroupInputBuilder::default()
81    }
82}
83
84/// A builder for [`CreateGroupInput`](crate::operation::create_group::CreateGroupInput).
85#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
86#[non_exhaustive]
87pub struct CreateGroupInputBuilder {
88    pub(crate) group_name: ::std::option::Option<::std::string::String>,
89    pub(crate) filter_expression: ::std::option::Option<::std::string::String>,
90    pub(crate) insights_configuration: ::std::option::Option<crate::types::InsightsConfiguration>,
91    pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
92}
93impl CreateGroupInputBuilder {
94    /// <p>The case-sensitive name of the new group. Default is a reserved name and names must be unique.</p>
95    /// This field is required.
96    pub fn group_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
97        self.group_name = ::std::option::Option::Some(input.into());
98        self
99    }
100    /// <p>The case-sensitive name of the new group. Default is a reserved name and names must be unique.</p>
101    pub fn set_group_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
102        self.group_name = input;
103        self
104    }
105    /// <p>The case-sensitive name of the new group. Default is a reserved name and names must be unique.</p>
106    pub fn get_group_name(&self) -> &::std::option::Option<::std::string::String> {
107        &self.group_name
108    }
109    /// <p>The filter expression defining criteria by which to group traces.</p>
110    pub fn filter_expression(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
111        self.filter_expression = ::std::option::Option::Some(input.into());
112        self
113    }
114    /// <p>The filter expression defining criteria by which to group traces.</p>
115    pub fn set_filter_expression(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
116        self.filter_expression = input;
117        self
118    }
119    /// <p>The filter expression defining criteria by which to group traces.</p>
120    pub fn get_filter_expression(&self) -> &::std::option::Option<::std::string::String> {
121        &self.filter_expression
122    }
123    /// <p>The structure containing configurations related to insights.</p>
124    /// <ul>
125    /// <li>
126    /// <p>The InsightsEnabled boolean can be set to true to enable insights for the new group or false to disable insights for the new group.</p></li>
127    /// <li>
128    /// <p>The NotificationsEnabled boolean can be set to true to enable insights notifications for the new group. Notifications may only be enabled on a group with InsightsEnabled set to true.</p></li>
129    /// </ul>
130    pub fn insights_configuration(mut self, input: crate::types::InsightsConfiguration) -> Self {
131        self.insights_configuration = ::std::option::Option::Some(input);
132        self
133    }
134    /// <p>The structure containing configurations related to insights.</p>
135    /// <ul>
136    /// <li>
137    /// <p>The InsightsEnabled boolean can be set to true to enable insights for the new group or false to disable insights for the new group.</p></li>
138    /// <li>
139    /// <p>The NotificationsEnabled boolean can be set to true to enable insights notifications for the new group. Notifications may only be enabled on a group with InsightsEnabled set to true.</p></li>
140    /// </ul>
141    pub fn set_insights_configuration(mut self, input: ::std::option::Option<crate::types::InsightsConfiguration>) -> Self {
142        self.insights_configuration = input;
143        self
144    }
145    /// <p>The structure containing configurations related to insights.</p>
146    /// <ul>
147    /// <li>
148    /// <p>The InsightsEnabled boolean can be set to true to enable insights for the new group or false to disable insights for the new group.</p></li>
149    /// <li>
150    /// <p>The NotificationsEnabled boolean can be set to true to enable insights notifications for the new group. Notifications may only be enabled on a group with InsightsEnabled set to true.</p></li>
151    /// </ul>
152    pub fn get_insights_configuration(&self) -> &::std::option::Option<crate::types::InsightsConfiguration> {
153        &self.insights_configuration
154    }
155    /// Appends an item to `tags`.
156    ///
157    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
158    ///
159    /// <p>A map that contains one or more tag keys and tag values to attach to an X-Ray group. For more information about ways to use tags, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html">Tagging Amazon Web Services resources</a> in the <i>Amazon Web Services General Reference</i>.</p>
160    /// <p>The following restrictions apply to tags:</p>
161    /// <ul>
162    /// <li>
163    /// <p>Maximum number of user-applied tags per resource: 50</p></li>
164    /// <li>
165    /// <p>Maximum tag key length: 128 Unicode characters</p></li>
166    /// <li>
167    /// <p>Maximum tag value length: 256 Unicode characters</p></li>
168    /// <li>
169    /// <p>Valid values for key and value: a-z, A-Z, 0-9, space, and the following characters: _ . : / = + - and @</p></li>
170    /// <li>
171    /// <p>Tag keys and values are case sensitive.</p></li>
172    /// <li>
173    /// <p>Don't use <code>aws:</code> as a prefix for keys; it's reserved for Amazon Web Services use.</p></li>
174    /// </ul>
175    pub fn tags(mut self, input: crate::types::Tag) -> Self {
176        let mut v = self.tags.unwrap_or_default();
177        v.push(input);
178        self.tags = ::std::option::Option::Some(v);
179        self
180    }
181    /// <p>A map that contains one or more tag keys and tag values to attach to an X-Ray group. For more information about ways to use tags, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html">Tagging Amazon Web Services resources</a> in the <i>Amazon Web Services General Reference</i>.</p>
182    /// <p>The following restrictions apply to tags:</p>
183    /// <ul>
184    /// <li>
185    /// <p>Maximum number of user-applied tags per resource: 50</p></li>
186    /// <li>
187    /// <p>Maximum tag key length: 128 Unicode characters</p></li>
188    /// <li>
189    /// <p>Maximum tag value length: 256 Unicode characters</p></li>
190    /// <li>
191    /// <p>Valid values for key and value: a-z, A-Z, 0-9, space, and the following characters: _ . : / = + - and @</p></li>
192    /// <li>
193    /// <p>Tag keys and values are case sensitive.</p></li>
194    /// <li>
195    /// <p>Don't use <code>aws:</code> as a prefix for keys; it's reserved for Amazon Web Services use.</p></li>
196    /// </ul>
197    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
198        self.tags = input;
199        self
200    }
201    /// <p>A map that contains one or more tag keys and tag values to attach to an X-Ray group. For more information about ways to use tags, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html">Tagging Amazon Web Services resources</a> in the <i>Amazon Web Services General Reference</i>.</p>
202    /// <p>The following restrictions apply to tags:</p>
203    /// <ul>
204    /// <li>
205    /// <p>Maximum number of user-applied tags per resource: 50</p></li>
206    /// <li>
207    /// <p>Maximum tag key length: 128 Unicode characters</p></li>
208    /// <li>
209    /// <p>Maximum tag value length: 256 Unicode characters</p></li>
210    /// <li>
211    /// <p>Valid values for key and value: a-z, A-Z, 0-9, space, and the following characters: _ . : / = + - and @</p></li>
212    /// <li>
213    /// <p>Tag keys and values are case sensitive.</p></li>
214    /// <li>
215    /// <p>Don't use <code>aws:</code> as a prefix for keys; it's reserved for Amazon Web Services use.</p></li>
216    /// </ul>
217    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
218        &self.tags
219    }
220    /// Consumes the builder and constructs a [`CreateGroupInput`](crate::operation::create_group::CreateGroupInput).
221    pub fn build(self) -> ::std::result::Result<crate::operation::create_group::CreateGroupInput, ::aws_smithy_types::error::operation::BuildError> {
222        ::std::result::Result::Ok(crate::operation::create_group::CreateGroupInput {
223            group_name: self.group_name,
224            filter_expression: self.filter_expression,
225            insights_configuration: self.insights_configuration,
226            tags: self.tags,
227        })
228    }
229}