Class: Vapi::UpdateTestSuiteTestVoiceDto
- Inherits:
-
Object
- Object
- Vapi::UpdateTestSuiteTestVoiceDto
- Defined in:
- lib/vapi_server_sdk/types/update_test_suite_test_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.
-
#name ⇒ String
readonly
This is the name of the test.
-
#num_attempts ⇒ Float
readonly
This is the number of attempts allowed for the test.
-
#scorers ⇒ Array<Vapi::TestSuiteTestScorerAi>
readonly
These are the scorers used to evaluate the test.
-
#script ⇒ String
readonly
This is the script to be used for the voice test.
Class Method Summary collapse
-
.from_json(json_object:) ⇒ Vapi::UpdateTestSuiteTestVoiceDto
Deserialize a JSON object to an instance of UpdateTestSuiteTestVoiceDto.
-
.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(scorers: OMIT, name: OMIT, script: OMIT, num_attempts: OMIT, additional_properties: nil) ⇒ Vapi::UpdateTestSuiteTestVoiceDto constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of UpdateTestSuiteTestVoiceDto to a JSON object.
Constructor Details
#initialize(scorers: OMIT, name: OMIT, script: OMIT, num_attempts: OMIT, additional_properties: nil) ⇒ Vapi::UpdateTestSuiteTestVoiceDto
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/vapi_server_sdk/types/update_test_suite_test_voice_dto.rb', line 31 def initialize(scorers: OMIT, name: OMIT, script: OMIT, num_attempts: OMIT, additional_properties: nil) @scorers = scorers if scorers != OMIT @name = name if name != OMIT @script = script if script != OMIT @num_attempts = num_attempts if num_attempts != OMIT @additional_properties = additional_properties @_field_set = { "scorers": scorers, "name": name, "script": script, "numAttempts": num_attempts }.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/update_test_suite_test_voice_dto.rb', line 18 def additional_properties @additional_properties end |
#name ⇒ String (readonly)
Returns This is the name of the test.
12 13 14 |
# File 'lib/vapi_server_sdk/types/update_test_suite_test_voice_dto.rb', line 12 def name @name end |
#num_attempts ⇒ Float (readonly)
Returns This is the number of attempts allowed for the test.
16 17 18 |
# File 'lib/vapi_server_sdk/types/update_test_suite_test_voice_dto.rb', line 16 def num_attempts @num_attempts end |
#scorers ⇒ Array<Vapi::TestSuiteTestScorerAi> (readonly)
Returns These are the scorers used to evaluate the test.
10 11 12 |
# File 'lib/vapi_server_sdk/types/update_test_suite_test_voice_dto.rb', line 10 def scorers @scorers end |
#script ⇒ String (readonly)
Returns This is the script to be used for the voice test.
14 15 16 |
# File 'lib/vapi_server_sdk/types/update_test_suite_test_voice_dto.rb', line 14 def script @script end |
Class Method Details
.from_json(json_object:) ⇒ Vapi::UpdateTestSuiteTestVoiceDto
Deserialize a JSON object to an instance of UpdateTestSuiteTestVoiceDto
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 |
# File 'lib/vapi_server_sdk/types/update_test_suite_test_voice_dto.rb', line 51 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) scorers = parsed_json["scorers"]&.map do |item| item = item.to_json Vapi::TestSuiteTestScorerAi.from_json(json_object: item) end name = parsed_json["name"] script = parsed_json["script"] num_attempts = parsed_json["numAttempts"] new( scorers: scorers, name: name, script: script, num_attempts: num_attempts, 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.
83 84 85 86 87 88 |
# File 'lib/vapi_server_sdk/types/update_test_suite_test_voice_dto.rb', line 83 def self.validate_raw(obj:) obj.scorers&.is_a?(Array) != false || raise("Passed value for field obj.scorers 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.") obj.script&.is_a?(String) != false || raise("Passed value for field obj.script is not the expected type, validation failed.") obj.num_attempts&.is_a?(Float) != false || raise("Passed value for field obj.num_attempts is not the expected type, validation failed.") end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of UpdateTestSuiteTestVoiceDto to a JSON object
73 74 75 |
# File 'lib/vapi_server_sdk/types/update_test_suite_test_voice_dto.rb', line 73 def to_json(*_args) @_field_set&.to_json end |