aws_sdk_iam/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 path to the group. For more information about paths, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html">IAM identifiers</a> in the <i>IAM User Guide</i>.</p>
7    /// <p>This parameter is optional. If it is not included, it defaults to a slash (/).</p>
8    /// <p>This parameter allows (through its <a href="http://wikipedia.org/wiki/regex">regex pattern</a>) a string of characters consisting of either a forward slash (/) by itself or a string that must begin and end with forward slashes. In addition, it can contain any ASCII character from the ! (<code>\u0021</code>) through the DEL character (<code>\u007F</code>), including most punctuation characters, digits, and upper and lowercased letters.</p>
9    pub path: ::std::option::Option<::std::string::String>,
10    /// <p>The name of the group to create. Do not include the path in this value.</p>
11    /// <p>IAM user, group, role, and policy names must be unique within the account. Names are not distinguished by case. For example, you cannot create resources named both "MyResource" and "myresource".</p>
12    pub group_name: ::std::option::Option<::std::string::String>,
13}
14impl CreateGroupInput {
15    /// <p>The path to the group. For more information about paths, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html">IAM identifiers</a> in the <i>IAM User Guide</i>.</p>
16    /// <p>This parameter is optional. If it is not included, it defaults to a slash (/).</p>
17    /// <p>This parameter allows (through its <a href="http://wikipedia.org/wiki/regex">regex pattern</a>) a string of characters consisting of either a forward slash (/) by itself or a string that must begin and end with forward slashes. In addition, it can contain any ASCII character from the ! (<code>\u0021</code>) through the DEL character (<code>\u007F</code>), including most punctuation characters, digits, and upper and lowercased letters.</p>
18    pub fn path(&self) -> ::std::option::Option<&str> {
19        self.path.as_deref()
20    }
21    /// <p>The name of the group to create. Do not include the path in this value.</p>
22    /// <p>IAM user, group, role, and policy names must be unique within the account. Names are not distinguished by case. For example, you cannot create resources named both "MyResource" and "myresource".</p>
23    pub fn group_name(&self) -> ::std::option::Option<&str> {
24        self.group_name.as_deref()
25    }
26}
27impl CreateGroupInput {
28    /// Creates a new builder-style object to manufacture [`CreateGroupInput`](crate::operation::create_group::CreateGroupInput).
29    pub fn builder() -> crate::operation::create_group::builders::CreateGroupInputBuilder {
30        crate::operation::create_group::builders::CreateGroupInputBuilder::default()
31    }
32}
33
34/// A builder for [`CreateGroupInput`](crate::operation::create_group::CreateGroupInput).
35#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
36#[non_exhaustive]
37pub struct CreateGroupInputBuilder {
38    pub(crate) path: ::std::option::Option<::std::string::String>,
39    pub(crate) group_name: ::std::option::Option<::std::string::String>,
40}
41impl CreateGroupInputBuilder {
42    /// <p>The path to the group. For more information about paths, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html">IAM identifiers</a> in the <i>IAM User Guide</i>.</p>
43    /// <p>This parameter is optional. If it is not included, it defaults to a slash (/).</p>
44    /// <p>This parameter allows (through its <a href="http://wikipedia.org/wiki/regex">regex pattern</a>) a string of characters consisting of either a forward slash (/) by itself or a string that must begin and end with forward slashes. In addition, it can contain any ASCII character from the ! (<code>\u0021</code>) through the DEL character (<code>\u007F</code>), including most punctuation characters, digits, and upper and lowercased letters.</p>
45    pub fn path(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
46        self.path = ::std::option::Option::Some(input.into());
47        self
48    }
49    /// <p>The path to the group. For more information about paths, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html">IAM identifiers</a> in the <i>IAM User Guide</i>.</p>
50    /// <p>This parameter is optional. If it is not included, it defaults to a slash (/).</p>
51    /// <p>This parameter allows (through its <a href="http://wikipedia.org/wiki/regex">regex pattern</a>) a string of characters consisting of either a forward slash (/) by itself or a string that must begin and end with forward slashes. In addition, it can contain any ASCII character from the ! (<code>\u0021</code>) through the DEL character (<code>\u007F</code>), including most punctuation characters, digits, and upper and lowercased letters.</p>
52    pub fn set_path(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
53        self.path = input;
54        self
55    }
56    /// <p>The path to the group. For more information about paths, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html">IAM identifiers</a> in the <i>IAM User Guide</i>.</p>
57    /// <p>This parameter is optional. If it is not included, it defaults to a slash (/).</p>
58    /// <p>This parameter allows (through its <a href="http://wikipedia.org/wiki/regex">regex pattern</a>) a string of characters consisting of either a forward slash (/) by itself or a string that must begin and end with forward slashes. In addition, it can contain any ASCII character from the ! (<code>\u0021</code>) through the DEL character (<code>\u007F</code>), including most punctuation characters, digits, and upper and lowercased letters.</p>
59    pub fn get_path(&self) -> &::std::option::Option<::std::string::String> {
60        &self.path
61    }
62    /// <p>The name of the group to create. Do not include the path in this value.</p>
63    /// <p>IAM user, group, role, and policy names must be unique within the account. Names are not distinguished by case. For example, you cannot create resources named both "MyResource" and "myresource".</p>
64    /// This field is required.
65    pub fn group_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
66        self.group_name = ::std::option::Option::Some(input.into());
67        self
68    }
69    /// <p>The name of the group to create. Do not include the path in this value.</p>
70    /// <p>IAM user, group, role, and policy names must be unique within the account. Names are not distinguished by case. For example, you cannot create resources named both "MyResource" and "myresource".</p>
71    pub fn set_group_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
72        self.group_name = input;
73        self
74    }
75    /// <p>The name of the group to create. Do not include the path in this value.</p>
76    /// <p>IAM user, group, role, and policy names must be unique within the account. Names are not distinguished by case. For example, you cannot create resources named both "MyResource" and "myresource".</p>
77    pub fn get_group_name(&self) -> &::std::option::Option<::std::string::String> {
78        &self.group_name
79    }
80    /// Consumes the builder and constructs a [`CreateGroupInput`](crate::operation::create_group::CreateGroupInput).
81    pub fn build(self) -> ::std::result::Result<crate::operation::create_group::CreateGroupInput, ::aws_smithy_types::error::operation::BuildError> {
82        ::std::result::Result::Ok(crate::operation::create_group::CreateGroupInput {
83            path: self.path,
84            group_name: self.group_name,
85        })
86    }
87}