Class: Cadenya::Types::CreateMemoryLayerRequest

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, metadata: nil, spec: nil) ⇒ CreateMemoryLayerRequest

Returns a new instance of CreateMemoryLayerRequest.



1645
1646
1647
1648
1649
# File 'lib/cadenya/types.rb', line 1645

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

Instance Attribute Details

#metadataObject (readonly)

Returns the value of attribute metadata.



1643
1644
1645
# File 'lib/cadenya/types.rb', line 1643

def 
  @metadata
end

#specObject (readonly)

Returns the value of attribute spec.



1643
1644
1645
# File 'lib/cadenya/types.rb', line 1643

def spec
  @spec
end

#workspace_idObject (readonly)

Returns the value of attribute workspace_id.



1643
1644
1645
# File 'lib/cadenya/types.rb', line 1643

def workspace_id
  @workspace_id
end

Class Method Details

.from_json(data) ⇒ Object



1651
1652
1653
1654
1655
1656
1657
# File 'lib/cadenya/types.rb', line 1651

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

Instance Method Details

#to_hObject



1659
1660
1661
1662
1663
1664
1665
# File 'lib/cadenya/types.rb', line 1659

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