Class: AWSCDK::Cognito::StringAttributeProps

Inherits:
StringAttributeConstraints
  • Object
show all
Defined in:
cognito/string_attribute_props.rb

Overview

Props for constructing a StringAttr.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(max_len: nil, min_len: nil, mutable: nil) ⇒ StringAttributeProps

Returns a new instance of StringAttributeProps.

Parameters:

  • max_len (Numeric, nil) (defaults to: nil)

    Maximum length of this attribute.

  • min_len (Numeric, nil) (defaults to: nil)

    Minimum length of this attribute.

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

    Specifies whether the value of the attribute can be changed.



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

def initialize(max_len: nil, min_len: nil, mutable: nil)
  @max_len = max_len
  Jsii::Type.check_type(@max_len, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "maxLen") unless @max_len.nil?
  @min_len = min_len
  Jsii::Type.check_type(@min_len, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "minLen") unless @min_len.nil?
  @mutable = mutable
  Jsii::Type.check_type(@mutable, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "mutable") unless @mutable.nil?
end

Instance Attribute Details

#max_lenNumeric? (readonly)

Note:

Default: 2048

Maximum length of this attribute.

Returns:

  • (Numeric, nil)


24
25
26
# File 'cognito/string_attribute_props.rb', line 24

def max_len
  @max_len
end

#min_lenNumeric? (readonly)

Note:

Default: 0

Minimum length of this attribute.

Returns:

  • (Numeric, nil)


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

def min_len
  @min_len
end

#mutableBoolean? (readonly)

Note:

Default: false

Specifies whether the value of the attribute can be changed.

For any user pool attribute that's mapped to an identity provider attribute, you must set this parameter 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)


38
39
40
# File 'cognito/string_attribute_props.rb', line 38

def mutable
  @mutable
end

Class Method Details

.jsii_propertiesObject



40
41
42
43
44
45
46
# File 'cognito/string_attribute_props.rb', line 40

def self.jsii_properties
  {
    :max_len => "maxLen",
    :min_len => "minLen",
    :mutable => "mutable",
  }
end

Instance Method Details

#to_jsiiObject



48
49
50
51
52
53
54
55
56
57
# File 'cognito/string_attribute_props.rb', line 48

def to_jsii
  result = {}
  result.merge!(super)
  result.merge!({
    "maxLen" => @max_len,
    "minLen" => @min_len,
    "mutable" => @mutable,
  })
  result.compact
end