Class: Vellum::TestSuiteRunRead

Inherits:
Object
  • Object
show all
Defined in:
lib/vellum_ai/types/test_suite_run_read.rb

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id:, created:, test_suite:, state:, exec_config: OMIT, progress: OMIT, additional_properties: nil) ⇒ Vellum::TestSuiteRunRead

Parameters:

  • exec_config (Vellum::TestSuiteRunExecConfig) (defaults to: OMIT)

    Configuration that defines how the Test Suite should be run

  • progress (Vellum::TestSuiteRunProgress) (defaults to: OMIT)
  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



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_propertiesOpenStruct (readonly)

Returns Additional properties unmapped to the current class definition.

Returns:

  • (OpenStruct)

    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

#createdDateTime (readonly)

Returns:

  • (DateTime)


15
16
17
# File 'lib/vellum_ai/types/test_suite_run_read.rb', line 15

def created
  @created
end

#exec_configVellum::TestSuiteRunExecConfig (readonly)

Returns Configuration that defines how the Test Suite should be run.

Returns:



26
27
28
# File 'lib/vellum_ai/types/test_suite_run_read.rb', line 26

def exec_config
  @exec_config
end

#idString (readonly)

Returns:

  • (String)


13
14
15
# File 'lib/vellum_ai/types/test_suite_run_read.rb', line 13

def id
  @id
end

#progressVellum::TestSuiteRunProgress (readonly)



28
29
30
# File 'lib/vellum_ai/types/test_suite_run_read.rb', line 28

def progress
  @progress
end

#stateObject (readonly)

  • ‘CANCELLED` - Cancelled



24
25
26
# File 'lib/vellum_ai/types/test_suite_run_read.rb', line 24

def state
  @state
end

#test_suiteVellum::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

Parameters:

  • json_object (String)

Returns:



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

Parameters:

  • obj (Object)

Returns:

  • (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_jsonString

Returns:

  • (String)


107
108
109
# File 'lib/vellum_ai/types/test_suite_run_read.rb', line 107

def to_json
  @_field_set&.to_json
end