Class: Vellum::WorkflowDeploymentHistoryItem

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

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id:, workflow_deployment_id:, timestamp:, label:, name:, input_variables:, output_variables:, description: OMIT, additional_properties: nil) ⇒ Vellum::WorkflowDeploymentHistoryItem

Parameters:

  • id (String)
  • workflow_deployment_id (String)
  • timestamp (DateTime)
  • label (String)

    A human-readable label for the workflow deployment

  • name (String)

    A name that uniquely identifies this workflow deployment within its workspace

  • input_variables (Array<Vellum::VellumVariable>)
  • output_variables (Array<Vellum::VellumVariable>)
  • description (String) (defaults to: OMIT)

    A human-readable description of the workflow deployment

  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



43
44
45
46
47
48
49
50
51
52
53
54
55
56
# File 'lib/vellum_ai/types/workflow_deployment_history_item.rb', line 43

def initialize(id:, workflow_deployment_id:, timestamp:, label:, name:, input_variables:, output_variables:, description: OMIT, additional_properties: nil)
  @id = id
  @workflow_deployment_id = workflow_deployment_id
  @timestamp = timestamp
  @label = label
  @name = name
  @input_variables = input_variables
  @output_variables = output_variables
  @description = description if description != OMIT
  @additional_properties = additional_properties
  @_field_set = { "id": id, "workflow_deployment_id": workflow_deployment_id, "timestamp": timestamp, "label": label, "name": name, "input_variables": input_variables, "output_variables": output_variables, "description": description }.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



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

def additional_properties
  @additional_properties
end

#descriptionString (readonly)

Returns A human-readable description of the workflow deployment.

Returns:

  • (String)

    A human-readable description of the workflow deployment



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

def description
  @description
end

#idString (readonly)

Returns:

  • (String)


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

def id
  @id
end

#input_variablesArray<Vellum::VellumVariable> (readonly)

Returns:



20
21
22
# File 'lib/vellum_ai/types/workflow_deployment_history_item.rb', line 20

def input_variables
  @input_variables
end

#labelString (readonly)

Returns A human-readable label for the workflow deployment.

Returns:

  • (String)

    A human-readable label for the workflow deployment



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

def label
  @label
end

#nameString (readonly)

Returns A name that uniquely identifies this workflow deployment within its workspace.

Returns:

  • (String)

    A name that uniquely identifies this workflow deployment within its workspace



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

def name
  @name
end

#output_variablesArray<Vellum::VellumVariable> (readonly)

Returns:



22
23
24
# File 'lib/vellum_ai/types/workflow_deployment_history_item.rb', line 22

def output_variables
  @output_variables
end

#timestampDateTime (readonly)

Returns:

  • (DateTime)


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

def timestamp
  @timestamp
end

#workflow_deployment_idString (readonly)

Returns:

  • (String)


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

def workflow_deployment_id
  @workflow_deployment_id
end

Class Method Details

.from_json(json_object:) ⇒ Vellum::WorkflowDeploymentHistoryItem

Parameters:

  • json_object (String)

Returns:



61
62
63
64
65
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
# File 'lib/vellum_ai/types/workflow_deployment_history_item.rb', line 61

def self.from_json(json_object:)
  struct = JSON.parse(json_object, object_class: OpenStruct)
  parsed_json = JSON.parse(json_object)
  id = parsed_json["id"]
  workflow_deployment_id = parsed_json["workflow_deployment_id"]
  timestamp = unless parsed_json["timestamp"].nil?
  DateTime.parse(parsed_json["timestamp"])
else
  nil
end
  label = parsed_json["label"]
  name = parsed_json["name"]
  input_variables = parsed_json["input_variables"]&.map do | item |
  item = item.to_json
  Vellum::VellumVariable.from_json(json_object: item)
end
  output_variables = parsed_json["output_variables"]&.map do | item |
  item = item.to_json
  Vellum::VellumVariable.from_json(json_object: item)
end
  description = parsed_json["description"]
  new(
    id: id,
    workflow_deployment_id: workflow_deployment_id,
    timestamp: timestamp,
    label: label,
    name: name,
    input_variables: input_variables,
    output_variables: output_variables,
    description: description,
    additional_properties: struct
  )
end

.validate_raw(obj:) ⇒ Void

Parameters:

  • obj (Object)

Returns:

  • (Void)


106
107
108
109
110
111
112
113
114
115
# File 'lib/vellum_ai/types/workflow_deployment_history_item.rb', line 106

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.workflow_deployment_id.is_a?(String) != false || raise("Passed value for field obj.workflow_deployment_id is not the expected type, validation failed.")
  obj.timestamp.is_a?(DateTime) != false || raise("Passed value for field obj.timestamp 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.")
  obj.input_variables.is_a?(Array) != false || raise("Passed value for field obj.input_variables is not the expected type, validation failed.")
  obj.output_variables.is_a?(Array) != false || raise("Passed value for field obj.output_variables is not the expected type, validation failed.")
  obj.description&.is_a?(String) != false || raise("Passed value for field obj.description is not the expected type, validation failed.")
end

Instance Method Details

#to_jsonString

Returns:

  • (String)


97
98
99
# File 'lib/vellum_ai/types/workflow_deployment_history_item.rb', line 97

def to_json
  @_field_set&.to_json
end