Class: Vapi::TestSuiteRunTestResult
- Inherits:
-
Object
- Object
- Vapi::TestSuiteRunTestResult
- Defined in:
- lib/vapi_server_sdk/types/test_suite_run_test_result.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#attempts ⇒ Array<Vapi::TestSuiteRunTestAttempt>
readonly
These are the attempts made for this test.
-
#test ⇒ Vapi::TestSuiteTestVoice
readonly
This is the test that was run.
Class Method Summary collapse
-
.from_json(json_object:) ⇒ Vapi::TestSuiteRunTestResult
Deserialize a JSON object to an instance of TestSuiteRunTestResult.
-
.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(test:, attempts:, additional_properties: nil) ⇒ Vapi::TestSuiteRunTestResult constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of TestSuiteRunTestResult to a JSON object.
Constructor Details
#initialize(test:, attempts:, additional_properties: nil) ⇒ Vapi::TestSuiteRunTestResult
26 27 28 29 30 31 |
# File 'lib/vapi_server_sdk/types/test_suite_run_test_result.rb', line 26 def initialize(test:, attempts:, additional_properties: nil) @test = test @attempts = attempts @additional_properties = additional_properties @_field_set = { "test": test, "attempts": attempts } end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
15 16 17 |
# File 'lib/vapi_server_sdk/types/test_suite_run_test_result.rb', line 15 def additional_properties @additional_properties end |
#attempts ⇒ Array<Vapi::TestSuiteRunTestAttempt> (readonly)
Returns These are the attempts made for this test.
13 14 15 |
# File 'lib/vapi_server_sdk/types/test_suite_run_test_result.rb', line 13 def attempts @attempts end |
#test ⇒ Vapi::TestSuiteTestVoice (readonly)
Returns This is the test that was run.
11 12 13 |
# File 'lib/vapi_server_sdk/types/test_suite_run_test_result.rb', line 11 def test @test end |
Class Method Details
.from_json(json_object:) ⇒ Vapi::TestSuiteRunTestResult
Deserialize a JSON object to an instance of TestSuiteRunTestResult
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/vapi_server_sdk/types/test_suite_run_test_result.rb', line 37 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) if parsed_json["test"].nil? test = nil else test = parsed_json["test"].to_json test = Vapi::TestSuiteTestVoice.from_json(json_object: test) end attempts = parsed_json["attempts"]&.map do |item| item = item.to_json Vapi::TestSuiteRunTestAttempt.from_json(json_object: item) end new( test: test, attempts: 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.
70 71 72 73 |
# File 'lib/vapi_server_sdk/types/test_suite_run_test_result.rb', line 70 def self.validate_raw(obj:) Vapi::TestSuiteTestVoice.validate_raw(obj: obj.test) obj.attempts.is_a?(Array) != false || raise("Passed value for field obj.attempts is not the expected type, validation failed.") end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of TestSuiteRunTestResult to a JSON object
60 61 62 |
# File 'lib/vapi_server_sdk/types/test_suite_run_test_result.rb', line 60 def to_json(*_args) @_field_set&.to_json end |