Class: Vapi::FallbackAzureSpeechTranscriber

Inherits:
Object
  • Object
show all
Defined in:
lib/vapi_server_sdk/types/fallback_azure_speech_transcriber.rb

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(language: OMIT, additional_properties: nil) ⇒ Vapi::FallbackAzureSpeechTranscriber



26
27
28
29
30
31
32
# File 'lib/vapi_server_sdk/types/fallback_azure_speech_transcriber.rb', line 26

def initialize(language: OMIT, additional_properties: nil)
  @language = language if language != OMIT
  @additional_properties = additional_properties
  @_field_set = { "language": language }.reject do |_k, v|
    v == OMIT
  end
end

Instance Attribute Details

#additional_propertiesOpenStruct (readonly)



14
15
16
# File 'lib/vapi_server_sdk/types/fallback_azure_speech_transcriber.rb', line 14

def additional_properties
  @additional_properties
end

#languageVapi::FallbackAzureSpeechTranscriberLanguage (readonly)



12
13
14
# File 'lib/vapi_server_sdk/types/fallback_azure_speech_transcriber.rb', line 12

def language
  @language
end

Class Method Details

.from_json(json_object:) ⇒ Vapi::FallbackAzureSpeechTranscriber

Deserialize a JSON object to an instance of FallbackAzureSpeechTranscriber



38
39
40
41
42
43
# File 'lib/vapi_server_sdk/types/fallback_azure_speech_transcriber.rb', line 38

def self.from_json(json_object:)
  struct = JSON.parse(json_object, object_class: OpenStruct)
  parsed_json = JSON.parse(json_object)
  language = parsed_json["language"]
  new(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.


58
59
60
# File 'lib/vapi_server_sdk/types/fallback_azure_speech_transcriber.rb', line 58

def self.validate_raw(obj:)
  obj.language&.is_a?(Vapi::FallbackAzureSpeechTranscriberLanguage) != 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 FallbackAzureSpeechTranscriber to a JSON object



48
49
50
# File 'lib/vapi_server_sdk/types/fallback_azure_speech_transcriber.rb', line 48

def to_json(*_args)
  @_field_set&.to_json
end