Class: Vapi::FallbackOpenAiTranscriber
- Inherits:
-
Object
- Object
- Vapi::FallbackOpenAiTranscriber
- Defined in:
- lib/vapi_server_sdk/types/fallback_open_ai_transcriber.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#language ⇒ Vapi::FallbackOpenAiTranscriberLanguage
readonly
This is the language that will be set for the transcription.
-
#model ⇒ Vapi::FallbackOpenAiTranscriberModel
readonly
This is the model that will be used for the transcription.
Class Method Summary collapse
-
.from_json(json_object:) ⇒ Vapi::FallbackOpenAiTranscriber
Deserialize a JSON object to an instance of FallbackOpenAiTranscriber.
-
.validate_raw(obj:) ⇒ Void
Leveraged for Union-type generation, validate_raw attempts to parse the given hash and check each fields type against the current object’s property definitions.
Instance Method Summary collapse
- #initialize(model:, language: OMIT, additional_properties: nil) ⇒ Vapi::FallbackOpenAiTranscriber constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of FallbackOpenAiTranscriber to a JSON object.
Constructor Details
#initialize(model:, language: OMIT, additional_properties: nil) ⇒ Vapi::FallbackOpenAiTranscriber
26 27 28 29 30 31 32 33 |
# File 'lib/vapi_server_sdk/types/fallback_open_ai_transcriber.rb', line 26 def initialize(model:, language: OMIT, additional_properties: nil) @model = model @language = language if language != OMIT @additional_properties = additional_properties @_field_set = { "model": model, "language": language }.reject do |_k, v| v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
15 16 17 |
# File 'lib/vapi_server_sdk/types/fallback_open_ai_transcriber.rb', line 15 def additional_properties @additional_properties end |
#language ⇒ Vapi::FallbackOpenAiTranscriberLanguage (readonly)
13 14 15 |
# File 'lib/vapi_server_sdk/types/fallback_open_ai_transcriber.rb', line 13 def language @language end |
#model ⇒ Vapi::FallbackOpenAiTranscriberModel (readonly)
11 12 13 |
# File 'lib/vapi_server_sdk/types/fallback_open_ai_transcriber.rb', line 11 def model @model end |
Class Method Details
.from_json(json_object:) ⇒ Vapi::FallbackOpenAiTranscriber
Deserialize a JSON object to an instance of FallbackOpenAiTranscriber
39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/vapi_server_sdk/types/fallback_open_ai_transcriber.rb', line 39 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) model = parsed_json["model"] language = parsed_json["language"] new( model: model, language: language, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
Leveraged for Union-type generation, validate_raw attempts to parse the given
hash and check each fields type against the current object's property
definitions.
64 65 66 67 |
# File 'lib/vapi_server_sdk/types/fallback_open_ai_transcriber.rb', line 64 def self.validate_raw(obj:) obj.model.is_a?(Vapi::FallbackOpenAiTranscriberModel) != false || raise("Passed value for field obj.model is not the expected type, validation failed.") obj.language&.is_a?(Vapi::FallbackOpenAiTranscriberLanguage) != false || raise("Passed value for field obj.language is not the expected type, validation failed.") end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of FallbackOpenAiTranscriber to a JSON object
54 55 56 |
# File 'lib/vapi_server_sdk/types/fallback_open_ai_transcriber.rb', line 54 def to_json(*_args) @_field_set&.to_json end |