Class: Vapi::CloneVoiceDto

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

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name:, files:, description: OMIT, labels: OMIT, additional_properties: nil) ⇒ Vapi::CloneVoiceDto

Parameters:

  • name (String)

    This is the name of the cloned voice in the provider account.

  • description (String) (defaults to: OMIT)

    This is the description of your cloned voice.

  • labels (String) (defaults to: OMIT)

    Serialized labels dictionary for the voice.

  • files (Array<String>)

    These are the files you want to use to clone your voice. Only Audio files are supported.

  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



32
33
34
35
36
37
38
39
40
41
# File 'lib/vapi_server_sdk/types/clone_voice_dto.rb', line 32

def initialize(name:, files:, description: OMIT, labels: OMIT, additional_properties: nil)
  @name = name
  @description = description if description != OMIT
  @labels = labels if labels != OMIT
  @files = files
  @additional_properties = additional_properties
  @_field_set = { "name": name, "description": description, "labels": labels, "files": files }.reject do |_k, v|
    v == OMIT
  end
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/clone_voice_dto.rb', line 18

def additional_properties
  @additional_properties
end

#descriptionString (readonly)

Returns This is the description of your cloned voice.

Returns:

  • (String)

    This is the description of your cloned voice.



11
12
13
# File 'lib/vapi_server_sdk/types/clone_voice_dto.rb', line 11

def description
  @description
end

#filesArray<String> (readonly)

Returns These are the files you want to use to clone your voice. Only Audio files are supported.

Returns:

  • (Array<String>)

    These are the files you want to use to clone your voice. Only Audio files are supported.



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

def files
  @files
end

#labelsString (readonly)

Returns Serialized labels dictionary for the voice.

Returns:

  • (String)

    Serialized labels dictionary for the voice.



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

def labels
  @labels
end

#nameString (readonly)

Returns This is the name of the cloned voice in the provider account.

Returns:

  • (String)

    This is the name of the cloned voice in the provider account.



9
10
11
# File 'lib/vapi_server_sdk/types/clone_voice_dto.rb', line 9

def name
  @name
end

Class Method Details

.from_json(json_object:) ⇒ Vapi::CloneVoiceDto

Deserialize a JSON object to an instance of CloneVoiceDto

Parameters:

  • json_object (String)

Returns:



47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# File 'lib/vapi_server_sdk/types/clone_voice_dto.rb', line 47

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


76
77
78
79
80
81
# File 'lib/vapi_server_sdk/types/clone_voice_dto.rb', line 76

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

Instance Method Details

#to_json(*_args) ⇒ String

Serialize an instance of CloneVoiceDto to a JSON object

Returns:

  • (String)


66
67
68
# File 'lib/vapi_server_sdk/types/clone_voice_dto.rb', line 66

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