Class: AWSCDK::Cognito::StandardAttribute
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::Cognito::StandardAttribute
- Defined in:
- cognito/standard_attribute.rb
Overview
Standard attribute that can be marked as required or mutable.
Instance Attribute Summary collapse
-
#mutable ⇒ Boolean?
readonly
Specifies whether the value of the attribute can be changed.
-
#required ⇒ Boolean?
readonly
Specifies whether the attribute is required upon user registration.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(mutable: nil, required: nil) ⇒ StandardAttribute
constructor
A new instance of StandardAttribute.
- #to_jsii ⇒ Object
Constructor Details
#initialize(mutable: nil, required: nil) ⇒ StandardAttribute
Returns a new instance of StandardAttribute.
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
#mutable ⇒ Boolean? (readonly)
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.
26 27 28 |
# File 'cognito/standard_attribute.rb', line 26 def mutable @mutable end |
#required ⇒ Boolean? (readonly)
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.
33 34 35 |
# File 'cognito/standard_attribute.rb', line 33 def required @required end |
Class Method Details
.jsii_properties ⇒ Object
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_jsii ⇒ Object
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 |