Class: AWSCDK::Cognito::UserPoolGroupProps

Inherits:
UserPoolGroupOptions
  • Object
show all
Defined in:
cognito/user_pool_group_props.rb

Overview

Props for UserPoolGroup construct.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of UserPoolGroupProps.

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.

  • user_pool (AWSCDK::Interfaces::AWSCognito::IUserPoolRef)

    The user pool to which this group is associated.



12
13
14
15
16
17
18
19
20
21
22
23
# File 'cognito/user_pool_group_props.rb', line 12

def initialize(description: nil, group_name: nil, precedence: nil, role: nil, user_pool:)
  @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?
  @user_pool = user_pool
  Jsii::Type.check_type(@user_pool, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5pbnRlcmZhY2VzLmF3c19jb2duaXRvLklVc2VyUG9vbFJlZiJ9")), "userPool")
end

Instance Attribute Details

#descriptionString? (readonly)

Note:

Default: - no description

A string containing the description of the group.

Returns:

  • (String, nil)


29
30
31
# File 'cognito/user_pool_group_props.rb', line 29

def description
  @description
end

#group_nameString? (readonly)

Note:

Default: - auto generate a name

The name of the group.

Must be unique.

Returns:

  • (String, nil)


36
37
38
# File 'cognito/user_pool_group_props.rb', line 36

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)


52
53
54
# File 'cognito/user_pool_group_props.rb', line 52

def precedence
  @precedence
end

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

Note:

Default: - no description

The role for the group.



57
58
59
# File 'cognito/user_pool_group_props.rb', line 57

def role
  @role
end

#user_poolAWSCDK::Interfaces::AWSCognito::IUserPoolRef (readonly)

The user pool to which this group is associated.



61
62
63
# File 'cognito/user_pool_group_props.rb', line 61

def user_pool
  @user_pool
end

Class Method Details

.jsii_propertiesObject



63
64
65
66
67
68
69
70
71
# File 'cognito/user_pool_group_props.rb', line 63

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

Instance Method Details

#to_jsiiObject



73
74
75
76
77
78
79
80
81
82
83
84
# File 'cognito/user_pool_group_props.rb', line 73

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