Class: Vapi::AzureSpeechTranscriber
- Inherits:
-
Object
- Object
- Vapi::AzureSpeechTranscriber
- Defined in:
- lib/vapi_server_sdk/types/azure_speech_transcriber.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#fallback_plan ⇒ Vapi::FallbackTranscriberPlan
readonly
This is the plan for voice provider fallbacks in the event that the primary voice provider fails.
-
#language ⇒ Vapi::AzureSpeechTranscriberLanguage
readonly
This is the language that will be set for the transcription.
Class Method Summary collapse
-
.from_json(json_object:) ⇒ Vapi::AzureSpeechTranscriber
Deserialize a JSON object to an instance of AzureSpeechTranscriber.
-
.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(language: OMIT, fallback_plan: OMIT, additional_properties: nil) ⇒ Vapi::AzureSpeechTranscriber constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of AzureSpeechTranscriber to a JSON object.
Constructor Details
#initialize(language: OMIT, fallback_plan: OMIT, additional_properties: nil) ⇒ Vapi::AzureSpeechTranscriber
32 33 34 35 36 37 38 39 |
# File 'lib/vapi_server_sdk/types/azure_speech_transcriber.rb', line 32 def initialize(language: OMIT, fallback_plan: OMIT, additional_properties: nil) @language = language if language != OMIT @fallback_plan = fallback_plan if fallback_plan != OMIT @additional_properties = additional_properties @_field_set = { "language": language, "fallbackPlan": fallback_plan }.reject do |_k, v| v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
18 19 20 |
# File 'lib/vapi_server_sdk/types/azure_speech_transcriber.rb', line 18 def additional_properties @additional_properties end |
#fallback_plan ⇒ Vapi::FallbackTranscriberPlan (readonly)
Returns This is the plan for voice provider fallbacks in the event that the primary voice provider fails.
16 17 18 |
# File 'lib/vapi_server_sdk/types/azure_speech_transcriber.rb', line 16 def fallback_plan @fallback_plan end |
#language ⇒ Vapi::AzureSpeechTranscriberLanguage (readonly)
Returns This is the language that will be set for the transcription. The list of languages Azure supports can be found here: n.microsoft.com/en-us/azure/ai-services/speech-service/language-support?tabs=stt.
13 14 15 |
# File 'lib/vapi_server_sdk/types/azure_speech_transcriber.rb', line 13 def language @language end |
Class Method Details
.from_json(json_object:) ⇒ Vapi::AzureSpeechTranscriber
Deserialize a JSON object to an instance of AzureSpeechTranscriber
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/vapi_server_sdk/types/azure_speech_transcriber.rb', line 45 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) language = parsed_json["language"] if parsed_json["fallbackPlan"].nil? fallback_plan = nil else fallback_plan = parsed_json["fallbackPlan"].to_json fallback_plan = Vapi::FallbackTranscriberPlan.from_json(json_object: fallback_plan) end new( language: language, fallback_plan: fallback_plan, 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.
75 76 77 78 |
# File 'lib/vapi_server_sdk/types/azure_speech_transcriber.rb', line 75 def self.validate_raw(obj:) obj.language&.is_a?(Vapi::AzureSpeechTranscriberLanguage) != false || raise("Passed value for field obj.language is not the expected type, validation failed.") obj.fallback_plan.nil? || Vapi::FallbackTranscriberPlan.validate_raw(obj: obj.fallback_plan) end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of AzureSpeechTranscriber to a JSON object
65 66 67 |
# File 'lib/vapi_server_sdk/types/azure_speech_transcriber.rb', line 65 def to_json(*_args) @_field_set&.to_json end |