Class: Cadenya::Types::ObjectiveEventData_ToolResult

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(type: nil, tool_result: nil) ⇒ ObjectiveEventData_ToolResult

Returns a new instance of ObjectiveEventData_ToolResult.



8711
8712
8713
8714
# File 'lib/cadenya/types.rb', line 8711

def initialize(type: nil, tool_result: nil)
  @type = type
  @tool_result = tool_result
end

Instance Attribute Details

#tool_resultObject (readonly)

Returns the value of attribute tool_result.



8709
8710
8711
# File 'lib/cadenya/types.rb', line 8709

def tool_result
  @tool_result
end

#typeObject (readonly)

Returns the value of attribute type.



8709
8710
8711
# File 'lib/cadenya/types.rb', line 8709

def type
  @type
end

Class Method Details

.from_json(data) ⇒ Object



8716
8717
8718
8719
8720
8721
# File 'lib/cadenya/types.rb', line 8716

def self.from_json(data)
  new(
    type: data["type"],
    tool_result: data["toolResult"].nil? ? nil : Types::ToolResult.from_json(data["toolResult"]),
  )
end

Instance Method Details

#to_hObject



8723
8724
8725
8726
8727
8728
# File 'lib/cadenya/types.rb', line 8723

def to_h
  {
    type: Util.plain(@type),
    tool_result: Util.plain(@tool_result),
  }.reject { |_k, v| v.nil? }
end