Class: Vapi::VariableExtractionAlias
- Inherits:
-
Object
- Object
- Vapi::VariableExtractionAlias
- Defined in:
- lib/vapi_server_sdk/types/variable_extraction_alias.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#key ⇒ String
readonly
This is the key of the variable.
-
#value ⇒ String
readonly
This is the value of the variable.
Class Method Summary collapse
-
.from_json(json_object:) ⇒ Vapi::VariableExtractionAlias
Deserialize a JSON object to an instance of VariableExtractionAlias.
-
.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(key:, value:, additional_properties: nil) ⇒ Vapi::VariableExtractionAlias constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of VariableExtractionAlias to a JSON object.
Constructor Details
#initialize(key:, value:, additional_properties: nil) ⇒ Vapi::VariableExtractionAlias
40 41 42 43 44 45 |
# File 'lib/vapi_server_sdk/types/variable_extraction_alias.rb', line 40 def initialize(key:, value:, additional_properties: nil) @key = key @value = value @additional_properties = additional_properties @_field_set = { "key": key, "value": value } end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
21 22 23 |
# File 'lib/vapi_server_sdk/types/variable_extraction_alias.rb', line 21 def additional_properties @additional_properties end |
#key ⇒ String (readonly)
Returns This is the key of the variable. This variable will be accessible during the call as ‘{key}` and stored in `call.artifact.variableValues` after the call. Rules:
-
Must start with a letter (a-z, A-Z).
-
Subsequent characters can be letters, numbers, or underscores.
-
Minimum length of 1 and maximum length of 40.
15 16 17 |
# File 'lib/vapi_server_sdk/types/variable_extraction_alias.rb', line 15 def key @key end |
#value ⇒ String (readonly)
Returns This is the value of the variable. This can reference existing variables, use filters, and perform transformations. Examples: “{name}”, “Vapi::VariableExtractionAlias.{customer{customer.email}”, “Hello | upcase}”.
19 20 21 |
# File 'lib/vapi_server_sdk/types/variable_extraction_alias.rb', line 19 def value @value end |
Class Method Details
.from_json(json_object:) ⇒ Vapi::VariableExtractionAlias
Deserialize a JSON object to an instance of VariableExtractionAlias
51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/vapi_server_sdk/types/variable_extraction_alias.rb', line 51 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) key = parsed_json["key"] value = parsed_json["value"] new( key: key, value: value, 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 |
# File 'lib/vapi_server_sdk/types/variable_extraction_alias.rb', line 76 def self.validate_raw(obj:) obj.key.is_a?(String) != false || raise("Passed value for field obj.key is not the expected type, validation failed.") obj.value.is_a?(String) != false || raise("Passed value for field obj.value is not the expected type, validation failed.") end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of VariableExtractionAlias to a JSON object
66 67 68 |
# File 'lib/vapi_server_sdk/types/variable_extraction_alias.rb', line 66 def to_json(*_args) @_field_set&.to_json end |