Class: AWSCDK::DynamoDB::LocalSecondaryIndexProps
- Inherits:
-
SecondaryIndexProps
- Object
- SecondaryIndexProps
- AWSCDK::DynamoDB::LocalSecondaryIndexProps
- Defined in:
- dynamo_db/local_secondary_index_props.rb
Overview
Properties for a local secondary index.
Instance Attribute Summary collapse
-
#index_name ⇒ String
readonly
The name of the secondary index.
-
#non_key_attributes ⇒ Array<String>?
readonly
The non-key attributes that are projected into the secondary index.
-
#projection_type ⇒ AWSCDK::DynamoDB::ProjectionType?
readonly
The set of attributes that are projected into the secondary index.
-
#sort_key ⇒ AWSCDK::DynamoDB::Attribute
readonly
The attribute of a sort key for the local secondary index.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(index_name:, non_key_attributes: nil, projection_type: nil, sort_key:) ⇒ LocalSecondaryIndexProps
constructor
A new instance of LocalSecondaryIndexProps.
- #to_jsii ⇒ Object
Constructor Details
#initialize(index_name:, non_key_attributes: nil, projection_type: nil, sort_key:) ⇒ LocalSecondaryIndexProps
Returns a new instance of LocalSecondaryIndexProps.
11 12 13 14 15 16 17 18 19 20 |
# File 'dynamo_db/local_secondary_index_props.rb', line 11 def initialize(index_name:, non_key_attributes: nil, projection_type: nil, sort_key:) @index_name = index_name Jsii::Type.check_type(@index_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "indexName") @non_key_attributes = non_key_attributes Jsii::Type.check_type(@non_key_attributes, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "nonKeyAttributes") unless @non_key_attributes.nil? @projection_type = projection_type Jsii::Type.check_type(@projection_type, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZHluYW1vZGIuUHJvamVjdGlvblR5cGUifQ==")), "projectionType") unless @projection_type.nil? @sort_key = sort_key.is_a?(Hash) ? ::AWSCDK::DynamoDB::Attribute.new(**sort_key.transform_keys(&:to_sym)) : sort_key Jsii::Type.check_type(@sort_key, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZHluYW1vZGIuQXR0cmlidXRlIn0=")), "sortKey") end |
Instance Attribute Details
#index_name ⇒ String (readonly)
The name of the secondary index.
25 26 27 |
# File 'dynamo_db/local_secondary_index_props.rb', line 25 def index_name @index_name end |
#non_key_attributes ⇒ Array<String>? (readonly)
Note:
Default: - No additional attributes
The non-key attributes that are projected into the secondary index.
30 31 32 |
# File 'dynamo_db/local_secondary_index_props.rb', line 30 def non_key_attributes @non_key_attributes end |
#projection_type ⇒ AWSCDK::DynamoDB::ProjectionType? (readonly)
Note:
Default: ALL
The set of attributes that are projected into the secondary index.
35 36 37 |
# File 'dynamo_db/local_secondary_index_props.rb', line 35 def projection_type @projection_type end |
#sort_key ⇒ AWSCDK::DynamoDB::Attribute (readonly)
The attribute of a sort key for the local secondary index.
39 40 41 |
# File 'dynamo_db/local_secondary_index_props.rb', line 39 def sort_key @sort_key end |
Class Method Details
.jsii_properties ⇒ Object
41 42 43 44 45 46 47 48 |
# File 'dynamo_db/local_secondary_index_props.rb', line 41 def self.jsii_properties { :index_name => "indexName", :non_key_attributes => "nonKeyAttributes", :projection_type => "projectionType", :sort_key => "sortKey", } end |
Instance Method Details
#to_jsii ⇒ Object
50 51 52 53 54 55 56 57 58 59 60 |
# File 'dynamo_db/local_secondary_index_props.rb', line 50 def to_jsii result = {} result.merge!(super) result.merge!({ "indexName" => @index_name, "nonKeyAttributes" => @non_key_attributes, "projectionType" => @projection_type, "sortKey" => @sort_key, }) result.compact end |