Class: Cadenya::Types::ObjectiveEventData_ToolError

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_error: nil) ⇒ ObjectiveEventData_ToolError

Returns a new instance of ObjectiveEventData_ToolError.



8734
8735
8736
8737
# File 'lib/cadenya/types.rb', line 8734

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

Instance Attribute Details

#tool_errorObject (readonly)

Returns the value of attribute tool_error.



8732
8733
8734
# File 'lib/cadenya/types.rb', line 8732

def tool_error
  @tool_error
end

#typeObject (readonly)

Returns the value of attribute type.



8732
8733
8734
# File 'lib/cadenya/types.rb', line 8732

def type
  @type
end

Class Method Details

.from_json(data) ⇒ Object



8739
8740
8741
8742
8743
8744
# File 'lib/cadenya/types.rb', line 8739

def self.from_json(data)
  new(
    type: data["type"],
    tool_error: data["toolError"].nil? ? nil : Types::ToolError.from_json(data["toolError"]),
  )
end

Instance Method Details

#to_hObject



8746
8747
8748
8749
8750
8751
# File 'lib/cadenya/types.rb', line 8746

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