Class: OpenAI::Realtime::UnknownServerEvent
- Inherits:
-
Object
- Object
- OpenAI::Realtime::UnknownServerEvent
- Includes:
- WebSocket::Protocol
- Defined in:
- lib/openai/helpers/realtime/unknown_server_event.rb
Overview
A valid JSON event whose discriminator is newer than this SDK version.
Direct Known Subclasses
Models::Realtime::UnknownTranslationServerEvent, UnknownTranslationServerEvent
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.
-
#inspect ⇒ Object
(also: #to_s)
Remote values, including the discriminator, require explicit access.
- #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.
16 17 18 19 20 21 22 23 24 25 |
# File 'lib/openai/helpers/realtime/unknown_server_event.rb', line 16 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)
13 14 15 |
# File 'lib/openai/helpers/realtime/unknown_server_event.rb', line 13 def data @data end |
#type ⇒ Symbol (readonly)
10 11 12 |
# File 'lib/openai/helpers/realtime/unknown_server_event.rb', line 10 def type @type end |
Instance Method Details
#inspect ⇒ Object Also known as: to_s
Remote values, including the discriminator, require explicit access.
31 |
# File 'lib/openai/helpers/realtime/unknown_server_event.rb', line 31 def inspect = "#<#{self.class}>" |
#to_h ⇒ Hash{Symbol=>Object}
28 |
# File 'lib/openai/helpers/realtime/unknown_server_event.rb', line 28 def to_h = @data |