aws_sdk_greengrass/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    /// A client token used to correlate requests and responses.
7    pub amzn_client_token: ::std::option::Option<::std::string::String>,
8    /// Information about the initial version of the group.
9    pub initial_version: ::std::option::Option<crate::types::GroupVersion>,
10    /// The name of the group.
11    pub name: ::std::option::Option<::std::string::String>,
12    /// Tag(s) to add to the new resource.
13    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
14}
15impl CreateGroupInput {
16    /// A client token used to correlate requests and responses.
17    pub fn amzn_client_token(&self) -> ::std::option::Option<&str> {
18        self.amzn_client_token.as_deref()
19    }
20    /// Information about the initial version of the group.
21    pub fn initial_version(&self) -> ::std::option::Option<&crate::types::GroupVersion> {
22        self.initial_version.as_ref()
23    }
24    /// The name of the group.
25    pub fn name(&self) -> ::std::option::Option<&str> {
26        self.name.as_deref()
27    }
28    /// Tag(s) to add to the new resource.
29    pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
30        self.tags.as_ref()
31    }
32}
33impl CreateGroupInput {
34    /// Creates a new builder-style object to manufacture [`CreateGroupInput`](crate::operation::create_group::CreateGroupInput).
35    pub fn builder() -> crate::operation::create_group::builders::CreateGroupInputBuilder {
36        crate::operation::create_group::builders::CreateGroupInputBuilder::default()
37    }
38}
39
40/// A builder for [`CreateGroupInput`](crate::operation::create_group::CreateGroupInput).
41#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
42#[non_exhaustive]
43pub struct CreateGroupInputBuilder {
44    pub(crate) amzn_client_token: ::std::option::Option<::std::string::String>,
45    pub(crate) initial_version: ::std::option::Option<crate::types::GroupVersion>,
46    pub(crate) name: ::std::option::Option<::std::string::String>,
47    pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
48}
49impl CreateGroupInputBuilder {
50    /// A client token used to correlate requests and responses.
51    pub fn amzn_client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
52        self.amzn_client_token = ::std::option::Option::Some(input.into());
53        self
54    }
55    /// A client token used to correlate requests and responses.
56    pub fn set_amzn_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
57        self.amzn_client_token = input;
58        self
59    }
60    /// A client token used to correlate requests and responses.
61    pub fn get_amzn_client_token(&self) -> &::std::option::Option<::std::string::String> {
62        &self.amzn_client_token
63    }
64    /// Information about the initial version of the group.
65    pub fn initial_version(mut self, input: crate::types::GroupVersion) -> Self {
66        self.initial_version = ::std::option::Option::Some(input);
67        self
68    }
69    /// Information about the initial version of the group.
70    pub fn set_initial_version(mut self, input: ::std::option::Option<crate::types::GroupVersion>) -> Self {
71        self.initial_version = input;
72        self
73    }
74    /// Information about the initial version of the group.
75    pub fn get_initial_version(&self) -> &::std::option::Option<crate::types::GroupVersion> {
76        &self.initial_version
77    }
78    /// The name of the group.
79    /// This field is required.
80    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
81        self.name = ::std::option::Option::Some(input.into());
82        self
83    }
84    /// The name of the group.
85    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
86        self.name = input;
87        self
88    }
89    /// The name of the group.
90    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
91        &self.name
92    }
93    /// Adds a key-value pair to `tags`.
94    ///
95    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
96    ///
97    /// Tag(s) to add to the new resource.
98    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
99        let mut hash_map = self.tags.unwrap_or_default();
100        hash_map.insert(k.into(), v.into());
101        self.tags = ::std::option::Option::Some(hash_map);
102        self
103    }
104    /// Tag(s) to add to the new resource.
105    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
106        self.tags = input;
107        self
108    }
109    /// Tag(s) to add to the new resource.
110    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
111        &self.tags
112    }
113    /// Consumes the builder and constructs a [`CreateGroupInput`](crate::operation::create_group::CreateGroupInput).
114    pub fn build(self) -> ::std::result::Result<crate::operation::create_group::CreateGroupInput, ::aws_smithy_types::error::operation::BuildError> {
115        ::std::result::Result::Ok(crate::operation::create_group::CreateGroupInput {
116            amzn_client_token: self.amzn_client_token,
117            initial_version: self.initial_version,
118            name: self.name,
119            tags: self.tags,
120        })
121    }
122}