Class: Cadenya::Types::ToolSetUsage

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(agent_variation: nil, agent: nil, model: nil, assigned_at: nil) ⇒ ToolSetUsage

Returns a new instance of ToolSetUsage.



6369
6370
6371
6372
6373
6374
# File 'lib/cadenya/types.rb', line 6369

def initialize(agent_variation: nil, agent: nil, model: nil, assigned_at: nil)
  @agent_variation = agent_variation
  @agent = agent
  @model = model
  @assigned_at = assigned_at
end

Instance Attribute Details

#agentObject (readonly)

Returns the value of attribute agent.



6367
6368
6369
# File 'lib/cadenya/types.rb', line 6367

def agent
  @agent
end

#agent_variationObject (readonly)

Returns the value of attribute agent_variation.



6367
6368
6369
# File 'lib/cadenya/types.rb', line 6367

def agent_variation
  @agent_variation
end

#assigned_atObject (readonly)

Returns the value of attribute assigned_at.



6367
6368
6369
# File 'lib/cadenya/types.rb', line 6367

def assigned_at
  @assigned_at
end

#modelObject (readonly)

Returns the value of attribute model.



6367
6368
6369
# File 'lib/cadenya/types.rb', line 6367

def model
  @model
end

Class Method Details

.from_json(data) ⇒ Object



6376
6377
6378
6379
6380
6381
6382
6383
# File 'lib/cadenya/types.rb', line 6376

def self.from_json(data)
  new(
    agent_variation: data["agentVariation"].nil? ? nil : Types::ResourceMetadata.from_json(data["agentVariation"]),
    agent: data["agent"].nil? ? nil : Types::ResourceMetadata.from_json(data["agent"]),
    model: data["model"].nil? ? nil : Types::ResourceMetadata.from_json(data["model"]),
    assigned_at: data["assignedAt"].nil? ? nil : Time.iso8601(data["assignedAt"]),
  )
end

Instance Method Details

#to_hObject



6385
6386
6387
6388
6389
6390
6391
6392
# File 'lib/cadenya/types.rb', line 6385

def to_h
  {
    agent_variation: Util.plain(@agent_variation),
    agent: Util.plain(@agent),
    model: Util.plain(@model),
    assigned_at: Util.plain(@assigned_at),
  }.reject { |_k, v| v.nil? }
end