Class: AWSCDK::AppSync::PrimaryKey

Inherits:
Jsii::Object
  • Object
show all
Defined in:
app_sync/primary_key.rb

Overview

Specifies the assignment to the primary key.

It either contains the full primary key or only the partition key.

Direct Known Subclasses

PartitionKey

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(pkey, skey = nil) ⇒ PrimaryKey

Returns a new instance of PrimaryKey.

Parameters:



13
14
15
16
17
# File 'app_sync/primary_key.rb', line 13

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

Class Method Details

.jsii_overridable_methodsObject



19
20
21
22
23
24
# File 'app_sync/primary_key.rb', line 19

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

.partition(key) ⇒ AWSCDK::AppSync::PartitionKeyStep

Allows assigning a value to the partition key.

Parameters:

  • key (String)

Returns:



30
31
32
33
# File 'app_sync/primary_key.rb', line 30

def self.partition(key)
  Jsii::Type.check_type(key, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "key")
  Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_appsync.PrimaryKey", "partition", [key])
end

Instance Method Details

#pkeyAWSCDK::AppSync::Assign



36
37
38
# File 'app_sync/primary_key.rb', line 36

def pkey()
  jsii_get_property("pkey")
end

#render_templateString

Renders the key assignment to a VTL string.

Returns:

  • (String)


43
44
45
# File 'app_sync/primary_key.rb', line 43

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