aws_sdk_synthetics/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 for the group. It can include any Unicode characters.</p>
7    /// <p>The names for all groups in your account, across all Regions, must be unique.</p>
8    pub name: ::std::option::Option<::std::string::String>,
9    /// <p>A list of key-value pairs to associate with the group. You can associate as many as 50 tags with a group.</p>
10    /// <p>Tags can help you organize and categorize your resources. You can also use them to scope user permissions, by granting a user permission to access or change only the resources that have certain tag values.</p>
11    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
12}
13impl CreateGroupInput {
14    /// <p>The name for the group. It can include any Unicode characters.</p>
15    /// <p>The names for all groups in your account, across all Regions, must be unique.</p>
16    pub fn name(&self) -> ::std::option::Option<&str> {
17        self.name.as_deref()
18    }
19    /// <p>A list of key-value pairs to associate with the group. You can associate as many as 50 tags with a group.</p>
20    /// <p>Tags can help you organize and categorize your resources. You can also use them to scope user permissions, by granting a user permission to access or change only the resources that have certain tag values.</p>
21    pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
22        self.tags.as_ref()
23    }
24}
25impl CreateGroupInput {
26    /// Creates a new builder-style object to manufacture [`CreateGroupInput`](crate::operation::create_group::CreateGroupInput).
27    pub fn builder() -> crate::operation::create_group::builders::CreateGroupInputBuilder {
28        crate::operation::create_group::builders::CreateGroupInputBuilder::default()
29    }
30}
31
32/// A builder for [`CreateGroupInput`](crate::operation::create_group::CreateGroupInput).
33#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
34#[non_exhaustive]
35pub struct CreateGroupInputBuilder {
36    pub(crate) name: ::std::option::Option<::std::string::String>,
37    pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
38}
39impl CreateGroupInputBuilder {
40    /// <p>The name for the group. It can include any Unicode characters.</p>
41    /// <p>The names for all groups in your account, across all Regions, must be unique.</p>
42    /// This field is required.
43    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
44        self.name = ::std::option::Option::Some(input.into());
45        self
46    }
47    /// <p>The name for the group. It can include any Unicode characters.</p>
48    /// <p>The names for all groups in your account, across all Regions, must be unique.</p>
49    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
50        self.name = input;
51        self
52    }
53    /// <p>The name for the group. It can include any Unicode characters.</p>
54    /// <p>The names for all groups in your account, across all Regions, must be unique.</p>
55    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
56        &self.name
57    }
58    /// Adds a key-value pair to `tags`.
59    ///
60    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
61    ///
62    /// <p>A list of key-value pairs to associate with the group. You can associate as many as 50 tags with a group.</p>
63    /// <p>Tags can help you organize and categorize your resources. You can also use them to scope user permissions, by granting a user permission to access or change only the resources that have certain tag values.</p>
64    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
65        let mut hash_map = self.tags.unwrap_or_default();
66        hash_map.insert(k.into(), v.into());
67        self.tags = ::std::option::Option::Some(hash_map);
68        self
69    }
70    /// <p>A list of key-value pairs to associate with the group. You can associate as many as 50 tags with a group.</p>
71    /// <p>Tags can help you organize and categorize your resources. You can also use them to scope user permissions, by granting a user permission to access or change only the resources that have certain tag values.</p>
72    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
73        self.tags = input;
74        self
75    }
76    /// <p>A list of key-value pairs to associate with the group. You can associate as many as 50 tags with a group.</p>
77    /// <p>Tags can help you organize and categorize your resources. You can also use them to scope user permissions, by granting a user permission to access or change only the resources that have certain tag values.</p>
78    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
79        &self.tags
80    }
81    /// Consumes the builder and constructs a [`CreateGroupInput`](crate::operation::create_group::CreateGroupInput).
82    pub fn build(self) -> ::std::result::Result<crate::operation::create_group::CreateGroupInput, ::aws_smithy_types::error::operation::BuildError> {
83        ::std::result::Result::Ok(crate::operation::create_group::CreateGroupInput {
84            name: self.name,
85            tags: self.tags,
86        })
87    }
88}