aws_sdk_cognitoidentityprovider/client/create_group.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2impl super::Client {
3 /// Constructs a fluent builder for the [`CreateGroup`](crate::operation::create_group::builders::CreateGroupFluentBuilder) operation.
4 ///
5 /// - The fluent builder is configurable:
6 /// - [`group_name(impl Into<String>)`](crate::operation::create_group::builders::CreateGroupFluentBuilder::group_name) / [`set_group_name(Option<String>)`](crate::operation::create_group::builders::CreateGroupFluentBuilder::set_group_name):<br>required: **true**<br><p>A name for the group. This name must be unique in your user pool.</p><br>
7 /// - [`user_pool_id(impl Into<String>)`](crate::operation::create_group::builders::CreateGroupFluentBuilder::user_pool_id) / [`set_user_pool_id(Option<String>)`](crate::operation::create_group::builders::CreateGroupFluentBuilder::set_user_pool_id):<br>required: **true**<br><p>The ID of the user pool where you want to create a user group.</p><br>
8 /// - [`description(impl Into<String>)`](crate::operation::create_group::builders::CreateGroupFluentBuilder::description) / [`set_description(Option<String>)`](crate::operation::create_group::builders::CreateGroupFluentBuilder::set_description):<br>required: **false**<br><p>A description of the group that you're creating.</p><br>
9 /// - [`role_arn(impl Into<String>)`](crate::operation::create_group::builders::CreateGroupFluentBuilder::role_arn) / [`set_role_arn(Option<String>)`](crate::operation::create_group::builders::CreateGroupFluentBuilder::set_role_arn):<br>required: **false**<br><p>The Amazon Resource Name (ARN) for the IAM role that you want to associate with the group. A group role primarily declares a preferred role for the credentials that you get from an identity pool. Amazon Cognito ID tokens have a <code>cognito:preferred_role</code> claim that presents the highest-precedence group that a user belongs to. Both ID and access tokens also contain a <code>cognito:groups</code> claim that list all the groups that a user is a member of.</p><br>
10 /// - [`precedence(i32)`](crate::operation::create_group::builders::CreateGroupFluentBuilder::precedence) / [`set_precedence(Option<i32>)`](crate::operation::create_group::builders::CreateGroupFluentBuilder::set_precedence):<br>required: **false**<br><p>A non-negative integer value that specifies the precedence of this group relative to the other groups that a user can belong to in the user pool. Zero is the highest precedence value. Groups with lower <code>Precedence</code> values take precedence over groups with higher or null <code>Precedence</code> values. If a user belongs to two or more groups, it is the group with the lowest precedence value whose role ARN is given in the user's tokens for the <code>cognito:roles</code> and <code>cognito:preferred_role</code> claims.</p> <p>Two groups can have the same <code>Precedence</code> value. If this happens, neither group takes precedence over the other. If two groups with the same <code>Precedence</code> have the same role ARN, that role is used in the <code>cognito:preferred_role</code> claim in tokens for users in each group. If the two groups have different role ARNs, the <code>cognito:preferred_role</code> claim isn't set in users' tokens.</p> <p>The default <code>Precedence</code> value is null. The maximum <code>Precedence</code> value is <code>2^31-1</code>.</p><br>
11 /// - On success, responds with [`CreateGroupOutput`](crate::operation::create_group::CreateGroupOutput) with field(s):
12 /// - [`group(Option<GroupType>)`](crate::operation::create_group::CreateGroupOutput::group): <p>The response object for a created group.</p>
13 /// - On failure, responds with [`SdkError<CreateGroupError>`](crate::operation::create_group::CreateGroupError)
14 pub fn create_group(&self) -> crate::operation::create_group::builders::CreateGroupFluentBuilder {
15 crate::operation::create_group::builders::CreateGroupFluentBuilder::new(self.handle.clone())
16 }
17}