Class: Vapi::CloneVoiceDto
- Inherits:
-
Object
- Object
- Vapi::CloneVoiceDto
- Defined in:
- lib/vapi_server_sdk/types/clone_voice_dto.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#description ⇒ String
readonly
This is the description of your cloned voice.
-
#files ⇒ Array<String>
readonly
These are the files you want to use to clone your voice.
-
#labels ⇒ String
readonly
Serialized labels dictionary for the voice.
-
#name ⇒ String
readonly
This is the name of the cloned voice in the provider account.
Class Method Summary collapse
-
.from_json(json_object:) ⇒ Vapi::CloneVoiceDto
Deserialize a JSON object to an instance of CloneVoiceDto.
-
.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(name:, files:, description: OMIT, labels: OMIT, additional_properties: nil) ⇒ Vapi::CloneVoiceDto constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of CloneVoiceDto to a JSON object.
Constructor Details
#initialize(name:, files:, description: OMIT, labels: OMIT, additional_properties: nil) ⇒ Vapi::CloneVoiceDto
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_properties ⇒ OpenStruct (readonly)
Returns 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 |
#description ⇒ String (readonly)
Returns 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 |
#files ⇒ Array<String> (readonly)
Returns 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 |
#labels ⇒ String (readonly)
Returns 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 |
#name ⇒ String (readonly)
Returns 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
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.
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
66 67 68 |
# File 'lib/vapi_server_sdk/types/clone_voice_dto.rb', line 66 def to_json(*_args) @_field_set&.to_json end |