Class: AWSCDK::AppSync::PartitionKey

Inherits:
PrimaryKey
  • Object
show all
Defined in:
app_sync/partition_key.rb

Overview

Specifies the assignment to the partition key.

It can be enhanced with the assignment of the sort key.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(pkey) ⇒ PartitionKey

Returns a new instance of PartitionKey.

Parameters:



12
13
14
15
# File 'app_sync/partition_key.rb', line 12

def initialize(pkey)
  Jsii::Type.check_type(pkey, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXBwc3luYy5Bc3NpZ24ifQ==")), "pkey")
  Jsii::Object.instance_method(:initialize).bind(self).call(pkey)
end

Class Method Details

.jsii_overridable_methodsObject



17
18
19
20
21
22
23
# File 'app_sync/partition_key.rb', line 17

def self.jsii_overridable_methods
  {
    :pkey => { kind: :property, name: "pkey", is_optional: false },
    :render_template => { kind: :method, name: "renderTemplate", is_optional: false },
    :sort => { kind: :method, name: "sort", is_optional: false },
  }
end

Instance Method Details

#pkeyAWSCDK::AppSync::Assign



26
27
28
# File 'app_sync/partition_key.rb', line 26

def pkey()
  jsii_get_property("pkey")
end

#render_templateString

Renders the key assignment to a VTL string.

Returns:

  • (String)


33
34
35
# File 'app_sync/partition_key.rb', line 33

def render_template()
  jsii_call_method("renderTemplate", [])
end

#sort(key) ⇒ AWSCDK::AppSync::SortKeyStep

Allows assigning a value to the sort key.

Parameters:

  • key (String)

Returns:



41
42
43
44
# File 'app_sync/partition_key.rb', line 41

def sort(key)
  Jsii::Type.check_type(key, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "key")
  jsii_call_method("sort", [key])
end