Class: Vellum::TestSuiteRunRead
- Inherits:
-
Object
- Object
- Vellum::TestSuiteRunRead
- Defined in:
- lib/vellum_ai/types/test_suite_run_read.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
- #created ⇒ DateTime readonly
-
#exec_config ⇒ Vellum::TestSuiteRunExecConfig
readonly
Configuration that defines how the Test Suite should be run.
- #id ⇒ String readonly
- #progress ⇒ Vellum::TestSuiteRunProgress readonly
-
#state ⇒ Object
readonly
-
‘CANCELLED` - Cancelled.
-
- #test_suite ⇒ Vellum::TestSuiteRunTestSuite readonly
Class Method Summary collapse
Instance Method Summary collapse
- #initialize(id:, created:, test_suite:, state:, exec_config: OMIT, progress: OMIT, additional_properties: nil) ⇒ Vellum::TestSuiteRunRead constructor
- #to_json ⇒ String
Constructor Details
#initialize(id:, created:, test_suite:, state:, exec_config: OMIT, progress: OMIT, additional_properties: nil) ⇒ Vellum::TestSuiteRunRead
50 51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/vellum_ai/types/test_suite_run_read.rb', line 50 def initialize(id:, created:, test_suite:, state:, exec_config: OMIT, progress: OMIT, additional_properties: nil) @id = id @created = created @test_suite = test_suite @state = state @exec_config = exec_config if exec_config != OMIT @progress = progress if progress != OMIT @additional_properties = additional_properties @_field_set = { "id": id, "created": created, "test_suite": test_suite, "state": state, "exec_config": exec_config, "progress": progress }.reject do | _k, v | v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
30 31 32 |
# File 'lib/vellum_ai/types/test_suite_run_read.rb', line 30 def additional_properties @additional_properties end |
#created ⇒ DateTime (readonly)
15 16 17 |
# File 'lib/vellum_ai/types/test_suite_run_read.rb', line 15 def created @created end |
#exec_config ⇒ Vellum::TestSuiteRunExecConfig (readonly)
Returns Configuration that defines how the Test Suite should be run.
26 27 28 |
# File 'lib/vellum_ai/types/test_suite_run_read.rb', line 26 def exec_config @exec_config end |
#id ⇒ String (readonly)
13 14 15 |
# File 'lib/vellum_ai/types/test_suite_run_read.rb', line 13 def id @id end |
#progress ⇒ Vellum::TestSuiteRunProgress (readonly)
28 29 30 |
# File 'lib/vellum_ai/types/test_suite_run_read.rb', line 28 def progress @progress end |
#state ⇒ Object (readonly)
-
‘CANCELLED` - Cancelled
24 25 26 |
# File 'lib/vellum_ai/types/test_suite_run_read.rb', line 24 def state @state end |
#test_suite ⇒ Vellum::TestSuiteRunTestSuite (readonly)
17 18 19 |
# File 'lib/vellum_ai/types/test_suite_run_read.rb', line 17 def test_suite @test_suite end |
Class Method Details
.from_json(json_object:) ⇒ Vellum::TestSuiteRunRead
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 |
# File 'lib/vellum_ai/types/test_suite_run_read.rb', line 66 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) id = parsed_json["id"] created = unless parsed_json["created"].nil? DateTime.parse(parsed_json["created"]) else nil end unless parsed_json["test_suite"].nil? test_suite = parsed_json["test_suite"].to_json test_suite = Vellum::TestSuiteRunTestSuite.from_json(json_object: test_suite) else test_suite = nil end state = parsed_json["state"] unless parsed_json["exec_config"].nil? exec_config = parsed_json["exec_config"].to_json exec_config = Vellum::TestSuiteRunExecConfig.from_json(json_object: exec_config) else exec_config = nil end unless parsed_json["progress"].nil? progress = parsed_json["progress"].to_json progress = Vellum::TestSuiteRunProgress.from_json(json_object: progress) else progress = nil end new( id: id, created: created, test_suite: test_suite, state: state, exec_config: exec_config, progress: progress, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
116 117 118 119 120 121 122 123 |
# File 'lib/vellum_ai/types/test_suite_run_read.rb', line 116 def self.validate_raw(obj:) obj.id.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.") obj.created.is_a?(DateTime) != false || raise("Passed value for field obj.created is not the expected type, validation failed.") Vellum::TestSuiteRunTestSuite.validate_raw(obj: obj.test_suite) obj.state.is_a?(Vellum::TestSuiteRunState) != false || raise("Passed value for field obj.state is not the expected type, validation failed.") obj.exec_config.nil? || Vellum::TestSuiteRunExecConfig.validate_raw(obj: obj.exec_config) obj.progress.nil? || Vellum::TestSuiteRunProgress.validate_raw(obj: obj.progress) end |
Instance Method Details
#to_json ⇒ String
107 108 109 |
# File 'lib/vellum_ai/types/test_suite_run_read.rb', line 107 def to_json @_field_set&.to_json end |