Class: Vellum::SlimWorkflowDeployment
- Inherits:
-
Object
- Object
- Vellum::SlimWorkflowDeployment
- Defined in:
- lib/vellum_ai/types/slim_workflow_deployment.rb
Overview
A subset of a Workflow Deployment’s full details.
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
- #created ⇒ DateTime readonly
-
#description ⇒ String
readonly
A human-readable description of the workflow deployment.
-
#environment ⇒ Vellum::EnvironmentEnum
readonly
Deprecated.
- #id ⇒ String readonly
-
#input_variables ⇒ Object
readonly
it is executed.
-
#label ⇒ String
readonly
A human-readable label for the workflow deployment.
- #last_deployed_on ⇒ DateTime readonly
-
#name ⇒ String
readonly
A name that uniquely identifies this workflow deployment within its workspace.
-
#output_variables ⇒ Array<Vellum::VellumVariable>
readonly
The output variables this Workflow Deployment will produce when it is executed.
-
#status ⇒ Object
readonly
-
‘ARCHIVED` - Archived.
-
Class Method Summary collapse
Instance Method Summary collapse
- #initialize(id:, name:, label:, status: OMIT, environment: OMIT, created:, last_deployed_on:, input_variables:, output_variables:, description: OMIT, additional_properties: nil) ⇒ Vellum::SlimWorkflowDeployment constructor
- #to_json ⇒ String
Constructor Details
#initialize(id:, name:, label:, status: OMIT, environment: OMIT, created:, last_deployed_on:, input_variables:, output_variables:, description: OMIT, additional_properties: nil) ⇒ Vellum::SlimWorkflowDeployment
59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/vellum_ai/types/slim_workflow_deployment.rb', line 59 def initialize(id:, name:, label:, status: OMIT, environment: OMIT, created:, last_deployed_on:, input_variables:, output_variables:, description: 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 @input_variables = input_variables @output_variables = output_variables @description = description if description != 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, "input_variables": input_variables, "output_variables": output_variables, "description": description }.reject do | _k, v | v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
37 38 39 |
# File 'lib/vellum_ai/types/slim_workflow_deployment.rb', line 37 def additional_properties @additional_properties end |
#created ⇒ DateTime (readonly)
26 27 28 |
# File 'lib/vellum_ai/types/slim_workflow_deployment.rb', line 26 def created @created end |
#description ⇒ String (readonly)
Returns A human-readable description of the workflow deployment.
35 36 37 |
# File 'lib/vellum_ai/types/slim_workflow_deployment.rb', line 35 def description @description end |
#environment ⇒ Vellum::EnvironmentEnum (readonly)
Returns Deprecated. The value returned will always be ‘PRODUCTION’.
24 25 26 |
# File 'lib/vellum_ai/types/slim_workflow_deployment.rb', line 24 def environment @environment end |
#id ⇒ String (readonly)
14 15 16 |
# File 'lib/vellum_ai/types/slim_workflow_deployment.rb', line 14 def id @id end |
#input_variables ⇒ Object (readonly)
it is executed.
31 32 33 |
# File 'lib/vellum_ai/types/slim_workflow_deployment.rb', line 31 def input_variables @input_variables end |
#label ⇒ String (readonly)
Returns A human-readable label for the workflow deployment.
18 19 20 |
# File 'lib/vellum_ai/types/slim_workflow_deployment.rb', line 18 def label @label end |
#last_deployed_on ⇒ DateTime (readonly)
28 29 30 |
# File 'lib/vellum_ai/types/slim_workflow_deployment.rb', line 28 def last_deployed_on @last_deployed_on end |
#name ⇒ String (readonly)
Returns A name that uniquely identifies this workflow deployment within its workspace.
16 17 18 |
# File 'lib/vellum_ai/types/slim_workflow_deployment.rb', line 16 def name @name end |
#output_variables ⇒ Array<Vellum::VellumVariable> (readonly)
Returns The output variables this Workflow Deployment will produce when it is executed.
33 34 35 |
# File 'lib/vellum_ai/types/slim_workflow_deployment.rb', line 33 def output_variables @output_variables end |
#status ⇒ Object (readonly)
-
‘ARCHIVED` - Archived
22 23 24 |
# File 'lib/vellum_ai/types/slim_workflow_deployment.rb', line 22 def status @status end |
Class Method Details
.from_json(json_object:) ⇒ Vellum::SlimWorkflowDeployment
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 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 |
# File 'lib/vellum_ai/types/slim_workflow_deployment.rb', line 79 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 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, name: name, label: label, status: status, environment: environment, created: created, last_deployed_on: last_deployed_on, input_variables: input_variables, output_variables: output_variables, description: description, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
132 133 134 135 136 137 138 139 140 141 142 143 |
# File 'lib/vellum_ai/types/slim_workflow_deployment.rb', line 132 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.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_json ⇒ String
123 124 125 |
# File 'lib/vellum_ai/types/slim_workflow_deployment.rb', line 123 def to_json @_field_set&.to_json end |