Class: AWSCDK::Cognito::AutoVerifiedAttrs

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

Overview

Attributes that can be automatically verified for users in a user pool.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(email: nil, phone: nil) ⇒ AutoVerifiedAttrs

Returns a new instance of AutoVerifiedAttrs.

Parameters:

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

    Whether the email address of the user should be auto verified at sign up.

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

    Whether the phone number of the user should be auto verified at sign up.



9
10
11
12
13
14
# File 'cognito/auto_verified_attrs.rb', line 9

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

Instance Attribute Details

#emailBoolean? (readonly)

Note:

Default: - true, if email is turned on for signIn. false, otherwise.

Whether the email address of the user should be auto verified at sign up.

Note: If both email and phone is set, Cognito only verifies the phone number. To also verify email, see here - https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-settings-email-phone-verification.html

Returns:

  • (Boolean, nil)


23
24
25
# File 'cognito/auto_verified_attrs.rb', line 23

def email
  @email
end

#phoneBoolean? (readonly)

Note:

Default: - true, if phone is turned on for signIn. false, otherwise.

Whether the phone number of the user should be auto verified at sign up.

Returns:

  • (Boolean, nil)


28
29
30
# File 'cognito/auto_verified_attrs.rb', line 28

def phone
  @phone
end

Class Method Details

.jsii_propertiesObject



30
31
32
33
34
35
# File 'cognito/auto_verified_attrs.rb', line 30

def self.jsii_properties
  {
    :email => "email",
    :phone => "phone",
  }
end

Instance Method Details

#to_jsiiObject



37
38
39
40
41
42
43
44
# File 'cognito/auto_verified_attrs.rb', line 37

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