Class: Vapi::Assistants::UpdateAssistantDtoVoice

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

Overview

These are the options for the assistant’s voice.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(member:, discriminant:) ⇒ Vapi::Assistants::UpdateAssistantDtoVoice

Parameters:

  • member (Object)
  • discriminant (String)


29
30
31
32
# File 'lib/vapi_server_sdk/assistants/types/update_assistant_dto_voice.rb', line 29

def initialize(member:, discriminant:)
  @member = member
  @discriminant = discriminant
end

Instance Attribute Details

#discriminantString (readonly)

Returns:

  • (String)


21
22
23
# File 'lib/vapi_server_sdk/assistants/types/update_assistant_dto_voice.rb', line 21

def discriminant
  @discriminant
end

#memberObject (readonly)

Returns:

  • (Object)


19
20
21
# File 'lib/vapi_server_sdk/assistants/types/update_assistant_dto_voice.rb', line 19

def member
  @member
end

Class Method Details

._11_labs(member:) ⇒ Vapi::Assistants::UpdateAssistantDtoVoice



153
154
155
# File 'lib/vapi_server_sdk/assistants/types/update_assistant_dto_voice.rb', line 153

def self._11_labs(member:)
  new(member: member, discriminant: "11labs")
end

.azure(member:) ⇒ Vapi::Assistants::UpdateAssistantDtoVoice



135
136
137
# File 'lib/vapi_server_sdk/assistants/types/update_assistant_dto_voice.rb', line 135

def self.azure(member:)
  new(member: member, discriminant: "azure")
end

.cartesia(member:) ⇒ Vapi::Assistants::UpdateAssistantDtoVoice



141
142
143
# File 'lib/vapi_server_sdk/assistants/types/update_assistant_dto_voice.rb', line 141

def self.cartesia(member:)
  new(member: member, discriminant: "cartesia")
end

.deepgram(member:) ⇒ Vapi::Assistants::UpdateAssistantDtoVoice



147
148
149
# File 'lib/vapi_server_sdk/assistants/types/update_assistant_dto_voice.rb', line 147

def self.deepgram(member:)
  new(member: member, discriminant: "deepgram")
end

.from_json(json_object:) ⇒ Vapi::Assistants::UpdateAssistantDtoVoice

Deserialize a JSON object to an instance of UpdateAssistantDtoVoice

Parameters:

  • json_object (String)

Returns:



38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# File 'lib/vapi_server_sdk/assistants/types/update_assistant_dto_voice.rb', line 38

def self.from_json(json_object:)
  struct = JSON.parse(json_object, object_class: OpenStruct)
  member = case struct.provider
           when "azure"
             Vapi::AzureVoice.from_json(json_object: json_object)
           when "cartesia"
             Vapi::CartesiaVoice.from_json(json_object: json_object)
           when "deepgram"
             Vapi::DeepgramVoice.from_json(json_object: json_object)
           when "11labs"
             Vapi::ElevenLabsVoice.from_json(json_object: json_object)
           when "lmnt"
             Vapi::LmntVoice.from_json(json_object: json_object)
           when "neets"
             Vapi::NeetsVoice.from_json(json_object: json_object)
           when "openai"
             Vapi::OpenAiVoice.from_json(json_object: json_object)
           when "playht"
             Vapi::PlayHtVoice.from_json(json_object: json_object)
           when "rime-ai"
             Vapi::RimeAiVoice.from_json(json_object: json_object)
           else
             Vapi::AzureVoice.from_json(json_object: json_object)
           end
  new(member: member, discriminant: struct.provider)
end

.lmnt(member:) ⇒ Vapi::Assistants::UpdateAssistantDtoVoice



159
160
161
# File 'lib/vapi_server_sdk/assistants/types/update_assistant_dto_voice.rb', line 159

def self.lmnt(member:)
  new(member: member, discriminant: "lmnt")
end

.neets(member:) ⇒ Vapi::Assistants::UpdateAssistantDtoVoice



165
166
167
# File 'lib/vapi_server_sdk/assistants/types/update_assistant_dto_voice.rb', line 165

def self.neets(member:)
  new(member: member, discriminant: "neets")
end

.openai(member:) ⇒ Vapi::Assistants::UpdateAssistantDtoVoice



171
172
173
# File 'lib/vapi_server_sdk/assistants/types/update_assistant_dto_voice.rb', line 171

def self.openai(member:)
  new(member: member, discriminant: "openai")
end

.playht(member:) ⇒ Vapi::Assistants::UpdateAssistantDtoVoice



177
178
179
# File 'lib/vapi_server_sdk/assistants/types/update_assistant_dto_voice.rb', line 177

def self.playht(member:)
  new(member: member, discriminant: "playht")
end

.rime_ai(member:) ⇒ Vapi::Assistants::UpdateAssistantDtoVoice



183
184
185
# File 'lib/vapi_server_sdk/assistants/types/update_assistant_dto_voice.rb', line 183

def self.rime_ai(member:)
  new(member: member, discriminant: "rime-ai")
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.

Parameters:

  • obj (Object)

Returns:

  • (Void)


100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
# File 'lib/vapi_server_sdk/assistants/types/update_assistant_dto_voice.rb', line 100

def self.validate_raw(obj:)
  case obj.provider
  when "azure"
    Vapi::AzureVoice.validate_raw(obj: obj)
  when "cartesia"
    Vapi::CartesiaVoice.validate_raw(obj: obj)
  when "deepgram"
    Vapi::DeepgramVoice.validate_raw(obj: obj)
  when "11labs"
    Vapi::ElevenLabsVoice.validate_raw(obj: obj)
  when "lmnt"
    Vapi::LmntVoice.validate_raw(obj: obj)
  when "neets"
    Vapi::NeetsVoice.validate_raw(obj: obj)
  when "openai"
    Vapi::OpenAiVoice.validate_raw(obj: obj)
  when "playht"
    Vapi::PlayHtVoice.validate_raw(obj: obj)
  when "rime-ai"
    Vapi::RimeAiVoice.validate_raw(obj: obj)
  else
    raise("Passed value matched no type within the union, validation failed.")
  end
end

Instance Method Details

#is_a?(obj) ⇒ Boolean

For Union Types, is_a? functionality is delegated to the wrapped member.

Parameters:

  • obj (Object)

Returns:

  • (Boolean)


129
130
131
# File 'lib/vapi_server_sdk/assistants/types/update_assistant_dto_voice.rb', line 129

def is_a?(obj)
  @member.is_a?(obj)
end

#kind_of?Object



24
# File 'lib/vapi_server_sdk/assistants/types/update_assistant_dto_voice.rb', line 24

alias kind_of? is_a?

#to_json(*_args) ⇒ String

For Union Types, to_json functionality is delegated to the wrapped member.

Returns:

  • (String)


68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
# File 'lib/vapi_server_sdk/assistants/types/update_assistant_dto_voice.rb', line 68

def to_json(*_args)
  case @discriminant
  when "azure"
    { **@member.to_json, provider: @discriminant }.to_json
  when "cartesia"
    { **@member.to_json, provider: @discriminant }.to_json
  when "deepgram"
    { **@member.to_json, provider: @discriminant }.to_json
  when "11labs"
    { **@member.to_json, provider: @discriminant }.to_json
  when "lmnt"
    { **@member.to_json, provider: @discriminant }.to_json
  when "neets"
    { **@member.to_json, provider: @discriminant }.to_json
  when "openai"
    { **@member.to_json, provider: @discriminant }.to_json
  when "playht"
    { **@member.to_json, provider: @discriminant }.to_json
  when "rime-ai"
    { **@member.to_json, provider: @discriminant }.to_json
  else
    { "provider": @discriminant, value: @member }.to_json
  end
  @member.to_json
end