Class: Vellum::DatasetRowPushRequest

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

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id: OMIT, label:, inputs:, mocks: OMIT, workflow_trigger_id: OMIT, additional_properties: nil) ⇒ Vellum::DatasetRowPushRequest



32
33
34
35
36
37
38
39
40
41
42
# File 'lib/vellum_ai/types/dataset_row_push_request.rb', line 32

def initialize(id: OMIT, label:, inputs:, mocks: OMIT, workflow_trigger_id: OMIT, additional_properties: nil)
  @id = id if id != OMIT
  @label = label
  @inputs = inputs
  @mocks = mocks if mocks != OMIT
  @workflow_trigger_id = workflow_trigger_id if workflow_trigger_id != OMIT
  @additional_properties = additional_properties
  @_field_set = { "id": id, "label": label, "inputs": inputs, "mocks": mocks, "workflow_trigger_id": workflow_trigger_id }.reject do | _k, v |
  v == OMIT
end
end

Instance Attribute Details

#additional_properties ⇒ OpenStruct (readonly)



18
19
20
# File 'lib/vellum_ai/types/dataset_row_push_request.rb', line 18

def additional_properties
  @additional_properties
end

#id ⇒ String (readonly)



8
9
10
# File 'lib/vellum_ai/types/dataset_row_push_request.rb', line 8

def id
  @id
end

#inputs ⇒ Hash{String => Object} (readonly)



12
13
14
# File 'lib/vellum_ai/types/dataset_row_push_request.rb', line 12

def inputs
  @inputs
end

#label ⇒ String (readonly)



10
11
12
# File 'lib/vellum_ai/types/dataset_row_push_request.rb', line 10

def label
  @label
end

#mocks ⇒ Array<Hash{String => Object}> (readonly)



14
15
16
# File 'lib/vellum_ai/types/dataset_row_push_request.rb', line 14

def mocks
  @mocks
end

#workflow_trigger_id ⇒ String (readonly)



16
17
18
# File 'lib/vellum_ai/types/dataset_row_push_request.rb', line 16

def workflow_trigger_id
  @workflow_trigger_id
end

Class Method Details

.from_json(json_object:) ⇒ Vellum::DatasetRowPushRequest



47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# File 'lib/vellum_ai/types/dataset_row_push_request.rb', line 47

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"]
  inputs = parsed_json["inputs"]
  mocks = parsed_json["mocks"]
  workflow_trigger_id = parsed_json["workflow_trigger_id"]
  new(
    id: id,
    label: label,
    inputs: inputs,
    mocks: mocks,
    workflow_trigger_id: workflow_trigger_id,
    additional_properties: struct
  )
end

.validate_raw(obj:) ⇒ Void



76
77
78
79
80
81
82
# File 'lib/vellum_ai/types/dataset_row_push_request.rb', line 76

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.inputs.is_a?(Hash) != false || raise("Passed value for field obj.inputs is not the expected type, validation failed.")
  obj.mocks&.is_a?(Array) != false || raise("Passed value for field obj.mocks is not the expected type, validation failed.")
  obj.workflow_trigger_id&.is_a?(String) != false || raise("Passed value for field obj.workflow_trigger_id is not the expected type, validation failed.")
end

Instance Method Details

#to_json ⇒ String



67
68
69
# File 'lib/vellum_ai/types/dataset_row_push_request.rb', line 67

def to_json
  @_field_set&.to_json
end