Class: Vapi::UpdateWorkflowDto

Inherits:
Object
  • Object
show all
Defined in:
lib/vapi_server_sdk/types/update_workflow_dto.rb

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(nodes: OMIT, name: OMIT, edges: OMIT, additional_properties: nil) ⇒ Vapi::UpdateWorkflowDto

Parameters:

  • nodes (Array<Vapi::UpdateWorkflowDtoNodesItem>) (defaults to: OMIT)
  • name (String) (defaults to: OMIT)
  • edges (Array<Vapi::Edge>) (defaults to: OMIT)
  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



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_propertiesOpenStruct (readonly)

Returns Additional properties unmapped to the current class definition.

Returns:

  • (OpenStruct)

    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

#edgesArray<Vapi::Edge> (readonly)

Returns:



15
16
17
# File 'lib/vapi_server_sdk/types/update_workflow_dto.rb', line 15

def edges
  @edges
end

#nameString (readonly)

Returns:

  • (String)


13
14
15
# File 'lib/vapi_server_sdk/types/update_workflow_dto.rb', line 13

def name
  @name
end

#nodesArray<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

Parameters:

  • json_object (String)

Returns:



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.

Parameters:

  • obj (Object)

Returns:

  • (Void)


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

Returns:

  • (String)


66
67
68
# File 'lib/vapi_server_sdk/types/update_workflow_dto.rb', line 66

def to_json(*_args)
  @_field_set&.to_json
end