Class: Vapi::AddVoiceToProviderDto

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

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(owner_id:, voice_id:, name:, additional_properties: nil) ⇒ Vapi::AddVoiceToProviderDto

Parameters:

  • owner_id (String)

    This is the owner_id of your shared voice which you want to add to your provider Account from Provider Voice Library

  • voice_id (String)

    This is the voice_id of the shared voice which you want to add to your provider Account from Provider Voice Library

  • name (String)

    This is the new name of the voice which you want to have once you have added voice to your provider Account from Provider Voice Library

  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



33
34
35
36
37
38
39
# File 'lib/vapi_server_sdk/types/add_voice_to_provider_dto.rb', line 33

def initialize(owner_id:, voice_id:, name:, additional_properties: nil)
  @owner_id = owner_id
  @voice_id = voice_id
  @name = name
  @additional_properties = additional_properties
  @_field_set = { "ownerId": owner_id, "voiceId": voice_id, "name": name }
end

Instance Attribute Details

#additional_propertiesOpenStruct (readonly)

Returns Additional properties unmapped to the current class definition.

Returns:

  • (OpenStruct)

    Additional properties unmapped to the current class definition



18
19
20
# File 'lib/vapi_server_sdk/types/add_voice_to_provider_dto.rb', line 18

def additional_properties
  @additional_properties
end

#nameString (readonly)

Returns This is the new name of the voice which you want to have once you have added voice to your provider Account from Provider Voice Library.

Returns:

  • (String)

    This is the new name of the voice which you want to have once you have added voice to your provider Account from Provider Voice Library



16
17
18
# File 'lib/vapi_server_sdk/types/add_voice_to_provider_dto.rb', line 16

def name
  @name
end

#owner_idString (readonly)

Returns This is the owner_id of your shared voice which you want to add to your provider Account from Provider Voice Library.

Returns:

  • (String)

    This is the owner_id of your shared voice which you want to add to your provider Account from Provider Voice Library



10
11
12
# File 'lib/vapi_server_sdk/types/add_voice_to_provider_dto.rb', line 10

def owner_id
  @owner_id
end

#voice_idString (readonly)

Returns This is the voice_id of the shared voice which you want to add to your provider Account from Provider Voice Library.

Returns:

  • (String)

    This is the voice_id of the shared voice which you want to add to your provider Account from Provider Voice Library



13
14
15
# File 'lib/vapi_server_sdk/types/add_voice_to_provider_dto.rb', line 13

def voice_id
  @voice_id
end

Class Method Details

.from_json(json_object:) ⇒ Vapi::AddVoiceToProviderDto

Deserialize a JSON object to an instance of AddVoiceToProviderDto

Parameters:

  • json_object (String)

Returns:



45
46
47
48
49
50
51
52
53
54
55
56
57
# File 'lib/vapi_server_sdk/types/add_voice_to_provider_dto.rb', line 45

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

Parameters:

  • obj (Object)

Returns:

  • (Void)


72
73
74
75
76
# File 'lib/vapi_server_sdk/types/add_voice_to_provider_dto.rb', line 72

def self.validate_raw(obj:)
  obj.owner_id.is_a?(String) != false || raise("Passed value for field obj.owner_id is not the expected type, validation failed.")
  obj.voice_id.is_a?(String) != false || raise("Passed value for field obj.voice_id is not the expected type, validation failed.")
  obj.name.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
end

Instance Method Details

#to_json(*_args) ⇒ String

Serialize an instance of AddVoiceToProviderDto to a JSON object

Returns:

  • (String)


62
63
64
# File 'lib/vapi_server_sdk/types/add_voice_to_provider_dto.rb', line 62

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