Class: Cadenya::Types::SetToolCallContentRequest_AudioBlock

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(data: nil, mime_type: nil) ⇒ SetToolCallContentRequest_AudioBlock

Returns a new instance of SetToolCallContentRequest_AudioBlock.



5116
5117
5118
5119
# File 'lib/cadenya/types.rb', line 5116

def initialize(data: nil, mime_type: nil)
  @data = data
  @mime_type = mime_type
end

Instance Attribute Details

#dataObject (readonly)

Returns the value of attribute data.



5114
5115
5116
# File 'lib/cadenya/types.rb', line 5114

def data
  @data
end

#mime_typeObject (readonly)

Returns the value of attribute mime_type.



5114
5115
5116
# File 'lib/cadenya/types.rb', line 5114

def mime_type
  @mime_type
end

Class Method Details

.from_json(data) ⇒ Object



5121
5122
5123
5124
5125
5126
# File 'lib/cadenya/types.rb', line 5121

def self.from_json(data)
  new(
    data: data["data"],
    mime_type: data["mimeType"],
  )
end

Instance Method Details

#to_hObject



5128
5129
5130
5131
5132
5133
# File 'lib/cadenya/types.rb', line 5128

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