Class: AWSCDK::Cognito::UserPoolGroupOptions

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
cognito/user_pool_group_options.rb

Overview

Options to create a UserPoolGroup.

Direct Known Subclasses

UserPoolGroupProps

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(description: nil, group_name: nil, precedence: nil, role: nil) ⇒ UserPoolGroupOptions

Returns a new instance of UserPoolGroupOptions.

Parameters:

  • description (String, nil) (defaults to: nil)

    A string containing the description of the group.

  • group_name (String, nil) (defaults to: nil)

    The name of the group.

  • precedence (Numeric, nil) (defaults to: nil)

    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.

  • role (AWSCDK::Interfaces::AWSIAM::IRoleRef, nil) (defaults to: nil)

    The role for the group.



11
12
13
14
15
16
17
18
19
20
# File 'cognito/user_pool_group_options.rb', line 11

def initialize(description: nil, group_name: nil, precedence: nil, role: nil)
  @description = description
  Jsii::Type.check_type(@description, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "description") unless @description.nil?
  @group_name = group_name
  Jsii::Type.check_type(@group_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "groupName") unless @group_name.nil?
  @precedence = precedence
  Jsii::Type.check_type(@precedence, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "precedence") unless @precedence.nil?
  @role = role
  Jsii::Type.check_type(@role, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5pbnRlcmZhY2VzLmF3c19pYW0uSVJvbGVSZWYifQ==")), "role") unless @role.nil?
end

Instance Attribute Details

#descriptionString? (readonly)

Note:

Default: - no description

A string containing the description of the group.

Returns:

  • (String, nil)


26
27
28
# File 'cognito/user_pool_group_options.rb', line 26

def description
  @description
end

#group_nameString? (readonly)

Note:

Default: - auto generate a name

The name of the group.

Must be unique.

Returns:

  • (String, nil)


33
34
35
# File 'cognito/user_pool_group_options.rb', line 33

def group_name
  @group_name
end

#precedenceNumeric? (readonly)

Note:

Default: - null

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 Precedence values take precedence over groups with higher or null Precedence 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 cognito:roles and cognito:preferred_role claims.

Two groups can have the same Precedence value. If this happens, neither group takes precedence over the other. If two groups with the same Precedence have the same role ARN, that role is used in the cognito:preferred_role claim in tokens for users in each group. If the two groups have different role ARNs, the cognito:preferred_role claim isn't set in users' tokens.

Returns:

  • (Numeric, nil)


49
50
51
# File 'cognito/user_pool_group_options.rb', line 49

def precedence
  @precedence
end

#roleAWSCDK::Interfaces::AWSIAM::IRoleRef? (readonly)

Note:

Default: - no description

The role for the group.



54
55
56
# File 'cognito/user_pool_group_options.rb', line 54

def role
  @role
end

Class Method Details

.jsii_propertiesObject



56
57
58
59
60
61
62
63
# File 'cognito/user_pool_group_options.rb', line 56

def self.jsii_properties
  {
    :description => "description",
    :group_name => "groupName",
    :precedence => "precedence",
    :role => "role",
  }
end

Instance Method Details

#to_jsiiObject



65
66
67
68
69
70
71
72
73
74
# File 'cognito/user_pool_group_options.rb', line 65

def to_jsii
  result = {}
  result.merge!({
    "description" => @description,
    "groupName" => @group_name,
    "precedence" => @precedence,
    "role" => @role,
  })
  result.compact
end