Class: Vellum::WorkflowDeploymentRead

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

Overview

A Workflow Deployment’s full details.

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id:, name:, label:, status: OMIT, environment: OMIT, created:, last_deployed_on:, last_deployed_history_item_id:, input_variables:, output_variables:, description: OMIT, display_data: OMIT, additional_properties: nil) ⇒ Vellum::WorkflowDeploymentRead

Parameters:

  • description (String) (defaults to: OMIT)

    A human-readable description of the workflow deployment

  • display_data (Vellum::WorkflowDeploymentDisplayData) (defaults to: OMIT)

    Information used to display this Workflow Deployment.

  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# File 'lib/vellum_ai/types/workflow_deployment_read.rb', line 70

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



44
45
46
# File 'lib/vellum_ai/types/workflow_deployment_read.rb', line 44

def additional_properties
  @additional_properties
end

#createdDateTime (readonly)

Returns:

  • (DateTime)


27
28
29
# File 'lib/vellum_ai/types/workflow_deployment_read.rb', line 27

def created
  @created
end

#descriptionString (readonly)

Returns A human-readable description of the workflow deployment.

Returns:

  • (String)

    A human-readable description of the workflow deployment



40
41
42
# File 'lib/vellum_ai/types/workflow_deployment_read.rb', line 40

def description
  @description
end

#display_dataVellum::WorkflowDeploymentDisplayData (readonly)

Returns Information used to display this Workflow Deployment.

Returns:



42
43
44
# File 'lib/vellum_ai/types/workflow_deployment_read.rb', line 42

def display_data
  @display_data
end

#environmentVellum::EnvironmentEnum (readonly)

Returns Deprecated. The value returned will always be ‘PRODUCTION’.

Returns:



25
26
27
# File 'lib/vellum_ai/types/workflow_deployment_read.rb', line 25

def environment
  @environment
end

#idString (readonly)

Returns:

  • (String)


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

def id
  @id
end

#input_variablesObject (readonly)

it is executed.



35
36
37
# File 'lib/vellum_ai/types/workflow_deployment_read.rb', line 35

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



19
20
21
# File 'lib/vellum_ai/types/workflow_deployment_read.rb', line 19

def label
  @label
end

#last_deployed_history_item_idObject (readonly)

Release Tag



32
33
34
# File 'lib/vellum_ai/types/workflow_deployment_read.rb', line 32

def last_deployed_history_item_id
  @last_deployed_history_item_id
end

#last_deployed_onDateTime (readonly)

Returns:

  • (DateTime)


29
30
31
# File 'lib/vellum_ai/types/workflow_deployment_read.rb', line 29

def last_deployed_on
  @last_deployed_on
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



17
18
19
# File 'lib/vellum_ai/types/workflow_deployment_read.rb', line 17

def name
  @name
end

#output_variablesObject (readonly)

executed.



38
39
40
# File 'lib/vellum_ai/types/workflow_deployment_read.rb', line 38

def output_variables
  @output_variables
end

#statusObject (readonly)

  • ‘ARCHIVED` - Archived



23
24
25
# File 'lib/vellum_ai/types/workflow_deployment_read.rb', line 23

def status
  @status
end

Class Method Details

.from_json(json_object:) ⇒ Vellum::WorkflowDeploymentRead

Parameters:

  • json_object (String)

Returns:



92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
# File 'lib/vellum_ai/types/workflow_deployment_read.rb', line 92

def self.from_json(json_object:)
  struct = JSON.parse(json_object, object_class: OpenStruct)
  parsed_json = JSON.parse(json_object)
  id = parsed_json["id"]
  name = parsed_json["name"]
  label = parsed_json["label"]
  status = parsed_json["status"]
  environment = parsed_json["environment"]
  created = unless parsed_json["created"].nil?
  DateTime.parse(parsed_json["created"])
else
  nil
end
  last_deployed_on = unless parsed_json["last_deployed_on"].nil?
  DateTime.parse(parsed_json["last_deployed_on"])
else
  nil
end
  last_deployed_history_item_id = parsed_json["last_deployed_history_item_id"]
  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"]
  unless parsed_json["display_data"].nil?
    display_data = parsed_json["display_data"].to_json
    display_data = Vellum::WorkflowDeploymentDisplayData.from_json(json_object: display_data)
  else
    display_data = nil
  end
  new(
    id: id,
    name: name,
    label: label,
    status: status,
    environment: environment,
    created: created,
    last_deployed_on: last_deployed_on,
    last_deployed_history_item_id: last_deployed_history_item_id,
    input_variables: input_variables,
    output_variables: output_variables,
    description: description,
    display_data: display_data,
    additional_properties: struct
  )
end

.validate_raw(obj:) ⇒ Void

Parameters:

  • obj (Object)

Returns:

  • (Void)


154
155
156
157
158
159
160
161
162
163
164
165
166
167
# File 'lib/vellum_ai/types/workflow_deployment_read.rb', line 154

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.name.is_a?(String) != false || raise("Passed value for field obj.name 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.status&.is_a?(Vellum::EntityStatus) != false || raise("Passed value for field obj.status is not the expected type, validation failed.")
  obj.environment&.is_a?(Vellum::EnvironmentEnum) != false || raise("Passed value for field obj.environment 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.")
  obj.last_deployed_on.is_a?(DateTime) != false || raise("Passed value for field obj.last_deployed_on is not the expected type, validation failed.")
  obj.last_deployed_history_item_id.is_a?(String) != false || raise("Passed value for field obj.last_deployed_history_item_id 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.")
  obj.display_data.nil? || Vellum::WorkflowDeploymentDisplayData.validate_raw(obj: obj.display_data)
end

Instance Method Details

#to_jsonString

Returns:

  • (String)


145
146
147
# File 'lib/vellum_ai/types/workflow_deployment_read.rb', line 145

def to_json
  @_field_set&.to_json
end