Class: Vapi::WorkflowOverrides
- Inherits:
-
Object
- Object
- Vapi::WorkflowOverrides
- Defined in:
- lib/vapi_server_sdk/types/workflow_overrides.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#variable_values ⇒ Hash{String => Object}
readonly
These are values that will be used to replace the template variables in the workflow messages and other text-based fields.
Class Method Summary collapse
-
.from_json(json_object:) ⇒ Vapi::WorkflowOverrides
Deserialize a JSON object to an instance of WorkflowOverrides.
-
.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(variable_values: OMIT, additional_properties: nil) ⇒ Vapi::WorkflowOverrides constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of WorkflowOverrides to a JSON object.
Constructor Details
#initialize(variable_values: OMIT, additional_properties: nil) ⇒ Vapi::WorkflowOverrides
37 38 39 40 41 42 43 |
# File 'lib/vapi_server_sdk/types/workflow_overrides.rb', line 37 def initialize(variable_values: OMIT, additional_properties: nil) @variable_values = variable_values if variable_values != OMIT @additional_properties = additional_properties @_field_set = { "variableValues": variable_values }.reject do |_k, v| v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
19 20 21 |
# File 'lib/vapi_server_sdk/types/workflow_overrides.rb', line 19 def additional_properties @additional_properties end |
#variable_values ⇒ Hash{String => Object} (readonly)
Returns These are values that will be used to replace the template variables in the workflow messages and other text-based fields. This uses LiquidJS syntax. liquidjs.com/tutorials/intro-to-liquid.html So for example, ‘name }` will be replaced with the value of `name` in `variableValues`. `| date: “%b %d, %Y, %I:%M %p”, “America/New_York”}` will be replaced with the current date and time in New York. Some VAPI reserved defaults:
-
customer - the customer object.
17 18 19 |
# File 'lib/vapi_server_sdk/types/workflow_overrides.rb', line 17 def variable_values @variable_values end |
Class Method Details
.from_json(json_object:) ⇒ Vapi::WorkflowOverrides
Deserialize a JSON object to an instance of WorkflowOverrides
49 50 51 52 53 54 |
# File 'lib/vapi_server_sdk/types/workflow_overrides.rb', line 49 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) variable_values = parsed_json["variableValues"] new(variable_values: variable_values, 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.
69 70 71 |
# File 'lib/vapi_server_sdk/types/workflow_overrides.rb', line 69 def self.validate_raw(obj:) obj.variable_values&.is_a?(Hash) != false || raise("Passed value for field obj.variable_values is not the expected type, validation failed.") end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of WorkflowOverrides to a JSON object
59 60 61 |
# File 'lib/vapi_server_sdk/types/workflow_overrides.rb', line 59 def to_json(*_args) @_field_set&.to_json end |