Class: AWSCDK::DynamoDB::Attribute

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
dynamo_db/attribute.rb

Overview

Represents an attribute for describing the key schema for the table and indexes.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name:, type:) ⇒ Attribute

Returns a new instance of Attribute.

Parameters:



9
10
11
12
13
14
# File 'dynamo_db/attribute.rb', line 9

def initialize(name:, type:)
  @name = name
  Jsii::Type.check_type(@name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "name")
  @type = type
  Jsii::Type.check_type(@type, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZHluYW1vZGIuQXR0cmlidXRlVHlwZSJ9")), "type")
end

Instance Attribute Details

#nameString (readonly)

The name of an attribute.

Returns:

  • (String)


19
20
21
# File 'dynamo_db/attribute.rb', line 19

def name
  @name
end

#typeAWSCDK::DynamoDB::AttributeType (readonly)

The data type of an attribute.



23
24
25
# File 'dynamo_db/attribute.rb', line 23

def type
  @type
end

Class Method Details

.jsii_propertiesObject



25
26
27
28
29
30
# File 'dynamo_db/attribute.rb', line 25

def self.jsii_properties
  {
    :name => "name",
    :type => "type",
  }
end

Instance Method Details

#to_jsiiObject



32
33
34
35
36
37
38
39
# File 'dynamo_db/attribute.rb', line 32

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