Class: AWSCDK::Cognito::StandardAttribute

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

Overview

Standard attribute that can be marked as required or mutable.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(mutable: nil, required: nil) ⇒ StandardAttribute

Returns a new instance of StandardAttribute.

Parameters:

  • mutable (Boolean, nil) (defaults to: nil)

    Specifies whether the value of the attribute can be changed.

  • required (Boolean, nil) (defaults to: nil)

    Specifies whether the attribute is required upon user registration.



11
12
13
14
15
16
# File 'cognito/standard_attribute.rb', line 11

def initialize(mutable: nil, required: nil)
  @mutable = mutable
  Jsii::Type.check_type(@mutable, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "mutable") unless @mutable.nil?
  @required = required
  Jsii::Type.check_type(@required, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "required") unless @required.nil?
end

Instance Attribute Details

#mutableBoolean? (readonly)

Note:

Default: true

Specifies whether the value of the attribute can be changed.

For any user pool attribute that's mapped to an identity provider attribute, this must be set to true. Amazon Cognito updates mapped attributes when users sign in to your application through an identity provider. If an attribute is immutable, Amazon Cognito throws an error when it attempts to update the attribute.

Returns:

  • (Boolean, nil)


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

def mutable
  @mutable
end

#requiredBoolean? (readonly)

Note:

Default: false

Specifies whether the attribute is required upon user registration.

If the attribute is required and the user does not provide a value, registration or sign-in will fail.

Returns:

  • (Boolean, nil)


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

def required
  @required
end

Class Method Details

.jsii_propertiesObject



35
36
37
38
39
40
# File 'cognito/standard_attribute.rb', line 35

def self.jsii_properties
  {
    :mutable => "mutable",
    :required => "required",
  }
end

Instance Method Details

#to_jsiiObject



42
43
44
45
46
47
48
49
# File 'cognito/standard_attribute.rb', line 42

def to_jsii
  result = {}
  result.merge!({
    "mutable" => @mutable,
    "required" => @required,
  })
  result.compact
end