Class: Vellum::TestSuiteRunExecutionMetricDefinition
- Inherits:
-
Object
- Object
- Vellum::TestSuiteRunExecutionMetricDefinition
- Defined in:
- lib/vellum_ai/types/test_suite_run_execution_metric_definition.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
- #id ⇒ String readonly
- #label ⇒ String readonly
- #name ⇒ String readonly
Class Method Summary collapse
Instance Method Summary collapse
- #initialize(id: OMIT, label: OMIT, name: OMIT, additional_properties: nil) ⇒ Vellum::TestSuiteRunExecutionMetricDefinition constructor
- #to_json ⇒ String
Constructor Details
#initialize(id: OMIT, label: OMIT, name: OMIT, additional_properties: nil) ⇒ Vellum::TestSuiteRunExecutionMetricDefinition
26 27 28 29 30 31 32 33 34 |
# File 'lib/vellum_ai/types/test_suite_run_execution_metric_definition.rb', line 26 def initialize(id: OMIT, label: OMIT, name: OMIT, additional_properties: nil) @id = id if id != OMIT @label = label if label != OMIT @name = name if name != OMIT @additional_properties = additional_properties @_field_set = { "id": id, "label": label, "name": name }.reject do | _k, v | v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
14 15 16 |
# File 'lib/vellum_ai/types/test_suite_run_execution_metric_definition.rb', line 14 def additional_properties @additional_properties end |
#id ⇒ String (readonly)
8 9 10 |
# File 'lib/vellum_ai/types/test_suite_run_execution_metric_definition.rb', line 8 def id @id end |
#label ⇒ String (readonly)
10 11 12 |
# File 'lib/vellum_ai/types/test_suite_run_execution_metric_definition.rb', line 10 def label @label end |
#name ⇒ String (readonly)
12 13 14 |
# File 'lib/vellum_ai/types/test_suite_run_execution_metric_definition.rb', line 12 def name @name end |
Class Method Details
.from_json(json_object:) ⇒ Vellum::TestSuiteRunExecutionMetricDefinition
40 41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/vellum_ai/types/test_suite_run_execution_metric_definition.rb', line 40 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) id = parsed_json["id"] label = parsed_json["label"] name = parsed_json["name"] new( id: id, label: label, name: name, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
65 66 67 68 69 |
# File 'lib/vellum_ai/types/test_suite_run_execution_metric_definition.rb', line 65 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.label&.is_a?(String) != false || raise("Passed value for field obj.label 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.") end |
Instance Method Details
#to_json ⇒ String
56 57 58 |
# File 'lib/vellum_ai/types/test_suite_run_execution_metric_definition.rb', line 56 def to_json @_field_set&.to_json end |