Class: Cadenya::Types::CreateAgentVariationRequest

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

Returns a new instance of CreateAgentVariationRequest.



1587
1588
1589
1590
1591
1592
# File 'lib/cadenya/types.rb', line 1587

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

Instance Attribute Details

#agent_idObject (readonly)

Returns the value of attribute agent_id.



1585
1586
1587
# File 'lib/cadenya/types.rb', line 1585

def agent_id
  @agent_id
end

#metadataObject (readonly)

Returns the value of attribute metadata.



1585
1586
1587
# File 'lib/cadenya/types.rb', line 1585

def 
  @metadata
end

#specObject (readonly)

Returns the value of attribute spec.



1585
1586
1587
# File 'lib/cadenya/types.rb', line 1585

def spec
  @spec
end

#workspace_idObject (readonly)

Returns the value of attribute workspace_id.



1585
1586
1587
# File 'lib/cadenya/types.rb', line 1585

def workspace_id
  @workspace_id
end

Class Method Details

.from_json(data) ⇒ Object



1594
1595
1596
1597
1598
1599
1600
1601
# File 'lib/cadenya/types.rb', line 1594

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

Instance Method Details

#to_hObject



1603
1604
1605
1606
1607
1608
1609
1610
# File 'lib/cadenya/types.rb', line 1603

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