Class: Vellum::WorkflowExecutionSnapshottedBody
- Inherits:
-
Object
- Object
- Vellum::WorkflowExecutionSnapshottedBody
- Defined in:
- lib/vellum_ai/types/workflow_execution_snapshotted_body.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
- #edited_by ⇒ Vellum::VellumCodeResourceDefinition readonly
- #state ⇒ Hash{String => Object} readonly
- #workflow_definition ⇒ Vellum::VellumCodeResourceDefinition readonly
Class Method Summary collapse
Instance Method Summary collapse
- #initialize(workflow_definition:, edited_by: OMIT, state:, additional_properties: nil) ⇒ Vellum::WorkflowExecutionSnapshottedBody constructor
- #to_json ⇒ String
Constructor Details
#initialize(workflow_definition:, edited_by: OMIT, state:, additional_properties: nil) ⇒ Vellum::WorkflowExecutionSnapshottedBody
27 28 29 30 31 32 33 34 35 |
# File 'lib/vellum_ai/types/workflow_execution_snapshotted_body.rb', line 27 def initialize(workflow_definition:, edited_by: OMIT, state:, additional_properties: nil) @workflow_definition = workflow_definition @edited_by = edited_by if edited_by != OMIT @state = state @additional_properties = additional_properties @_field_set = { "workflow_definition": workflow_definition, "edited_by": edited_by, "state": state }.reject do | _k, v | v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
15 16 17 |
# File 'lib/vellum_ai/types/workflow_execution_snapshotted_body.rb', line 15 def additional_properties @additional_properties end |
#edited_by ⇒ Vellum::VellumCodeResourceDefinition (readonly)
11 12 13 |
# File 'lib/vellum_ai/types/workflow_execution_snapshotted_body.rb', line 11 def edited_by @edited_by end |
#state ⇒ Hash{String => Object} (readonly)
13 14 15 |
# File 'lib/vellum_ai/types/workflow_execution_snapshotted_body.rb', line 13 def state @state end |
#workflow_definition ⇒ Vellum::VellumCodeResourceDefinition (readonly)
9 10 11 |
# File 'lib/vellum_ai/types/workflow_execution_snapshotted_body.rb', line 9 def workflow_definition @workflow_definition end |
Class Method Details
.from_json(json_object:) ⇒ Vellum::WorkflowExecutionSnapshottedBody
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
# File 'lib/vellum_ai/types/workflow_execution_snapshotted_body.rb', line 40 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) unless parsed_json["workflow_definition"].nil? workflow_definition = parsed_json["workflow_definition"].to_json workflow_definition = Vellum::VellumCodeResourceDefinition.from_json(json_object: workflow_definition) else workflow_definition = nil end unless parsed_json["edited_by"].nil? edited_by = parsed_json["edited_by"].to_json edited_by = Vellum::VellumCodeResourceDefinition.from_json(json_object: edited_by) else edited_by = nil end state = parsed_json["state"] new( workflow_definition: workflow_definition, edited_by: edited_by, state: state, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
75 76 77 78 79 |
# File 'lib/vellum_ai/types/workflow_execution_snapshotted_body.rb', line 75 def self.validate_raw(obj:) Vellum::VellumCodeResourceDefinition.validate_raw(obj: obj.workflow_definition) obj.edited_by.nil? || Vellum::VellumCodeResourceDefinition.validate_raw(obj: obj.edited_by) obj.state.is_a?(Hash) != false || raise("Passed value for field obj.state is not the expected type, validation failed.") end |
Instance Method Details
#to_json ⇒ String
66 67 68 |
# File 'lib/vellum_ai/types/workflow_execution_snapshotted_body.rb', line 66 def to_json @_field_set&.to_json end |