Class: OpenAI::Realtime::UnknownServerEvent
- Inherits:
-
Object
- Object
- OpenAI::Realtime::UnknownServerEvent
- Defined in:
- lib/openai/helpers/realtime/unknown_server_event.rb
Overview
A valid JSON event whose discriminator is newer than this SDK version.
Instance Attribute Summary collapse
- #data ⇒ Hash{Symbol=>Object} readonly
- #type ⇒ Symbol readonly
Instance Method Summary collapse
-
#initialize(data:) ⇒ UnknownServerEvent
constructor
private
A new instance of UnknownServerEvent.
- #to_h ⇒ Hash{Symbol=>Object}
Constructor Details
#initialize(data:) ⇒ UnknownServerEvent
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of UnknownServerEvent.
14 15 16 17 18 19 20 21 22 23 |
# File 'lib/openai/helpers/realtime/unknown_server_event.rb', line 14 def initialize(data:) value = data.fetch(:type) unless value.is_a?(String) || value.is_a?(Symbol) raise ArgumentError, "Realtime server event type must be a string or symbol" end @type = value.to_sym @data = freeze_json(data) freeze end |
Instance Attribute Details
#data ⇒ Hash{Symbol=>Object} (readonly)
11 12 13 |
# File 'lib/openai/helpers/realtime/unknown_server_event.rb', line 11 def data @data end |
#type ⇒ Symbol (readonly)
8 9 10 |
# File 'lib/openai/helpers/realtime/unknown_server_event.rb', line 8 def type @type end |
Instance Method Details
#to_h ⇒ Hash{Symbol=>Object}
26 |
# File 'lib/openai/helpers/realtime/unknown_server_event.rb', line 26 def to_h = @data |