Class: Constructs::MetadataEntry

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
metadata_entry.rb

Overview

An entry in the construct metadata table.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data:, type:, trace: nil) ⇒ MetadataEntry

Returns a new instance of MetadataEntry.

Parameters:

  • data (Object)

    The data.

  • type (String)

    The metadata entry type.

  • trace (Array<String>, nil) (defaults to: nil)

    Stack trace at the point of adding the metadata.



10
11
12
13
14
15
16
17
# File 'metadata_entry.rb', line 10

def initialize(data:, type:, trace: nil)
  @data = data
  Jsii::Type.check_type(@data, "eyJwcmltaXRpdmUiOiJhbnkifQ==", "data")
  @type = type
  Jsii::Type.check_type(@type, "eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==", "type")
  @trace = trace
  Jsii::Type.check_type(@trace, "eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=", "trace") unless @trace.nil?
end

Instance Attribute Details

#dataObject (readonly)

The data.

Returns:

  • (Object)


22
23
24
# File 'metadata_entry.rb', line 22

def data
  @data
end

#traceArray<String>? (readonly)

Note:

Default: - no trace information

Stack trace at the point of adding the metadata.

Only available if add_metadata() is called with stackTrace: true.

Returns:

  • (Array<String>, nil)


33
34
35
# File 'metadata_entry.rb', line 33

def trace
  @trace
end

#typeString (readonly)

The metadata entry type.

Returns:

  • (String)


26
27
28
# File 'metadata_entry.rb', line 26

def type
  @type
end

Class Method Details

.jsii_propertiesObject



35
36
37
38
39
40
41
# File 'metadata_entry.rb', line 35

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

Instance Method Details

#to_jsiiObject



43
44
45
46
47
48
49
50
51
# File 'metadata_entry.rb', line 43

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