Class: Vapi::UpdateWorkflowDto
- Inherits:
-
Object
- Object
- Vapi::UpdateWorkflowDto
- Defined in:
- lib/vapi_server_sdk/types/update_workflow_dto.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
- #edges ⇒ Array<Vapi::Edge> readonly
- #name ⇒ String readonly
- #nodes ⇒ Array<Vapi::UpdateWorkflowDtoNodesItem> readonly
Class Method Summary collapse
-
.from_json(json_object:) ⇒ Vapi::UpdateWorkflowDto
Deserialize a JSON object to an instance of UpdateWorkflowDto.
-
.validate_raw(obj:) ⇒ Void
Leveraged for Union-type generation, validate_raw attempts to parse the given hash and check each fields type against the current object’s property definitions.
Instance Method Summary collapse
- #initialize(nodes: OMIT, name: OMIT, edges: OMIT, additional_properties: nil) ⇒ Vapi::UpdateWorkflowDto constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of UpdateWorkflowDto to a JSON object.
Constructor Details
#initialize(nodes: OMIT, name: OMIT, edges: OMIT, additional_properties: nil) ⇒ Vapi::UpdateWorkflowDto
29 30 31 32 33 34 35 36 37 |
# File 'lib/vapi_server_sdk/types/update_workflow_dto.rb', line 29 def initialize(nodes: OMIT, name: OMIT, edges: OMIT, additional_properties: nil) @nodes = nodes if nodes != OMIT @name = name if name != OMIT @edges = edges if edges != OMIT @additional_properties = additional_properties @_field_set = { "nodes": nodes, "name": name, "edges": edges }.reject do |_k, v| v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
17 18 19 |
# File 'lib/vapi_server_sdk/types/update_workflow_dto.rb', line 17 def additional_properties @additional_properties end |
#edges ⇒ Array<Vapi::Edge> (readonly)
15 16 17 |
# File 'lib/vapi_server_sdk/types/update_workflow_dto.rb', line 15 def edges @edges end |
#name ⇒ String (readonly)
13 14 15 |
# File 'lib/vapi_server_sdk/types/update_workflow_dto.rb', line 13 def name @name end |
#nodes ⇒ Array<Vapi::UpdateWorkflowDtoNodesItem> (readonly)
11 12 13 |
# File 'lib/vapi_server_sdk/types/update_workflow_dto.rb', line 11 def nodes @nodes end |
Class Method Details
.from_json(json_object:) ⇒ Vapi::UpdateWorkflowDto
Deserialize a JSON object to an instance of UpdateWorkflowDto
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/vapi_server_sdk/types/update_workflow_dto.rb', line 43 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) nodes = parsed_json["nodes"]&.map do |item| item = item.to_json Vapi::UpdateWorkflowDtoNodesItem.from_json(json_object: item) end name = parsed_json["name"] edges = parsed_json["edges"]&.map do |item| item = item.to_json Vapi::Edge.from_json(json_object: item) end new( nodes: nodes, name: name, edges: edges, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
Leveraged for Union-type generation, validate_raw attempts to parse the given
hash and check each fields type against the current object's property
definitions.
76 77 78 79 80 |
# File 'lib/vapi_server_sdk/types/update_workflow_dto.rb', line 76 def self.validate_raw(obj:) obj.nodes&.is_a?(Array) != false || raise("Passed value for field obj.nodes 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.edges&.is_a?(Array) != false || raise("Passed value for field obj.edges is not the expected type, validation failed.") end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of UpdateWorkflowDto to a JSON object
66 67 68 |
# File 'lib/vapi_server_sdk/types/update_workflow_dto.rb', line 66 def to_json(*_args) @_field_set&.to_json end |