Class: AWSCDK::Cognito::UserVerificationConfig

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

Overview

User pool configuration for user self sign up.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(email_body: nil, email_style: nil, email_subject: nil, sms_message: nil) ⇒ UserVerificationConfig

Returns a new instance of UserVerificationConfig.

Parameters:

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

    The email body template for the verification email sent to the user upon sign up.

  • email_style (AWSCDK::Cognito::VerificationEmailStyle, nil) (defaults to: nil)

    Emails can be verified either using a code or a link.

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

    The email subject template for the verification email sent to the user upon sign up.

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

    The message template for the verification SMS sent to the user upon sign up.



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

def initialize(email_body: nil, email_style: nil, email_subject: nil, sms_message: nil)
  @email_body = email_body
  Jsii::Type.check_type(@email_body, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "emailBody") unless @email_body.nil?
  @email_style = email_style
  Jsii::Type.check_type(@email_style, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY29nbml0by5WZXJpZmljYXRpb25FbWFpbFN0eWxlIn0=")), "emailStyle") unless @email_style.nil?
  @email_subject = email_subject
  Jsii::Type.check_type(@email_subject, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "emailSubject") unless @email_subject.nil?
  @sms_message = sms_message
  Jsii::Type.check_type(@sms_message, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "smsMessage") unless @sms_message.nil?
end

Instance Attribute Details

#email_bodyString? (readonly)

Note:

Default: - 'The verification code to your new account is ####' if VerificationEmailStyle.CODE is chosen, 'Verify your account by clicking on Email##' if VerificationEmailStyle.LINK is chosen.

The email body template for the verification email sent to the user upon sign up.

See https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-pool-settings-message-templates.html to learn more about message templates.

Returns:

  • (String, nil)


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

def email_body
  @email_body
end

#email_styleAWSCDK::Cognito::VerificationEmailStyle? (readonly)

Note:

Default: VerificationEmailStyle.CODE

Emails can be verified either using a code or a link.

Learn more at https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-pool-settings-email-verification-message-customization.html



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

def email_style
  @email_style
end

#email_subjectString? (readonly)

Note:

Default: 'Verify your new account'

The email subject template for the verification email sent to the user upon sign up.

See https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-pool-settings-message-templates.html to learn more about message templates.

Returns:

  • (String, nil)


44
45
46
# File 'cognito/user_verification_config.rb', line 44

def email_subject
  @email_subject
end

#sms_messageString? (readonly)

Note:

Default: - 'The verification code to your new account is ####' if VerificationEmailStyle.CODE is chosen, not configured if VerificationEmailStyle.LINK is chosen

The message template for the verification SMS sent to the user upon sign up.

See https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-pool-settings-message-templates.html to learn more about message templates.

Returns:

  • (String, nil)


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

def sms_message
  @sms_message
end

Class Method Details

.jsii_propertiesObject



54
55
56
57
58
59
60
61
# File 'cognito/user_verification_config.rb', line 54

def self.jsii_properties
  {
    :email_body => "emailBody",
    :email_style => "emailStyle",
    :email_subject => "emailSubject",
    :sms_message => "smsMessage",
  }
end

Instance Method Details

#to_jsiiObject



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

def to_jsii
  result = {}
  result.merge!({
    "emailBody" => @email_body,
    "emailStyle" => @email_style,
    "emailSubject" => @email_subject,
    "smsMessage" => @sms_message,
  })
  result.compact
end