Class: Cadenya::Types::CreateMemoryEntryRequest

Inherits:
Object
  • Object
show all
Defined in:
lib/cadenya/types.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(workspace_id: nil, memory_layer_id: nil, metadata: nil, spec: nil) ⇒ CreateMemoryEntryRequest

Returns a new instance of CreateMemoryEntryRequest.



1616
1617
1618
1619
1620
1621
# File 'lib/cadenya/types.rb', line 1616

def initialize(workspace_id: nil, memory_layer_id: nil, metadata: nil, spec: nil)
  @workspace_id = workspace_id
  @memory_layer_id = memory_layer_id
  @metadata = 
  @spec = spec
end

Instance Attribute Details

#memory_layer_idObject (readonly)

Returns the value of attribute memory_layer_id.



1614
1615
1616
# File 'lib/cadenya/types.rb', line 1614

def memory_layer_id
  @memory_layer_id
end

#metadataObject (readonly)

Returns the value of attribute metadata.



1614
1615
1616
# File 'lib/cadenya/types.rb', line 1614

def 
  @metadata
end

#specObject (readonly)

Returns the value of attribute spec.



1614
1615
1616
# File 'lib/cadenya/types.rb', line 1614

def spec
  @spec
end

#workspace_idObject (readonly)

Returns the value of attribute workspace_id.



1614
1615
1616
# File 'lib/cadenya/types.rb', line 1614

def workspace_id
  @workspace_id
end

Class Method Details

.from_json(data) ⇒ Object



1623
1624
1625
1626
1627
1628
1629
1630
# File 'lib/cadenya/types.rb', line 1623

def self.from_json(data)
  new(
    workspace_id: data["workspaceId"],
    memory_layer_id: data["memoryLayerId"],
    metadata: data["metadata"].nil? ? nil : Types::CreateResourceMetadata.from_json(data["metadata"]),
    spec: data["spec"].nil? ? nil : Types.decode_MemoryEntryCreateSpec(data["spec"]),
  )
end

Instance Method Details

#to_hObject



1632
1633
1634
1635
1636
1637
1638
1639
# File 'lib/cadenya/types.rb', line 1632

def to_h
  {
    workspace_id: Util.plain(@workspace_id),
    memory_layer_id: Util.plain(@memory_layer_id),
    metadata: Util.plain(@metadata),
    spec: Util.plain(@spec),
  }.reject { |_k, v| v.nil? }
end