Class: Vapi::GhlToolProviderDetails
- Inherits:
-
Object
- Object
- Vapi::GhlToolProviderDetails
- Defined in:
- lib/vapi_server_sdk/types/ghl_tool_provider_details.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
- #location_id ⇒ String readonly
- #setup_instructions ⇒ Array<Vapi::ToolTemplateSetup> readonly
-
#template_url ⇒ String
readonly
This is the Template URL or the Snapshot URL corresponding to the Template.
- #webhook_hook_id ⇒ String readonly
- #webhook_hook_name ⇒ String readonly
- #workflow_id ⇒ String readonly
- #workflow_name ⇒ String readonly
Class Method Summary collapse
-
.from_json(json_object:) ⇒ Vapi::GhlToolProviderDetails
Deserialize a JSON object to an instance of GhlToolProviderDetails.
-
.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(template_url: OMIT, setup_instructions: OMIT, workflow_id: OMIT, workflow_name: OMIT, webhook_hook_id: OMIT, webhook_hook_name: OMIT, location_id: OMIT, additional_properties: nil) ⇒ Vapi::GhlToolProviderDetails constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of GhlToolProviderDetails to a JSON object.
Constructor Details
#initialize(template_url: OMIT, setup_instructions: OMIT, workflow_id: OMIT, workflow_name: OMIT, webhook_hook_id: OMIT, webhook_hook_name: OMIT, location_id: OMIT, additional_properties: nil) ⇒ Vapi::GhlToolProviderDetails
40 41 42 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/ghl_tool_provider_details.rb', line 40 def initialize(template_url: OMIT, setup_instructions: OMIT, workflow_id: OMIT, workflow_name: OMIT, webhook_hook_id: OMIT, webhook_hook_name: OMIT, location_id: OMIT, additional_properties: nil) @template_url = template_url if template_url != OMIT @setup_instructions = setup_instructions if setup_instructions != OMIT @workflow_id = workflow_id if workflow_id != OMIT @workflow_name = workflow_name if workflow_name != OMIT @webhook_hook_id = webhook_hook_id if webhook_hook_id != OMIT @webhook_hook_name = webhook_hook_name if webhook_hook_name != OMIT @location_id = location_id if location_id != OMIT @additional_properties = additional_properties @_field_set = { "templateUrl": template_url, "setupInstructions": setup_instructions, "workflowId": workflow_id, "workflowName": workflow_name, "webhookHookId": webhook_hook_id, "webhookHookName": webhook_hook_name, "locationId": location_id }.reject do |_k, v| v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
24 25 26 |
# File 'lib/vapi_server_sdk/types/ghl_tool_provider_details.rb', line 24 def additional_properties @additional_properties end |
#location_id ⇒ String (readonly)
22 23 24 |
# File 'lib/vapi_server_sdk/types/ghl_tool_provider_details.rb', line 22 def location_id @location_id end |
#setup_instructions ⇒ Array<Vapi::ToolTemplateSetup> (readonly)
12 13 14 |
# File 'lib/vapi_server_sdk/types/ghl_tool_provider_details.rb', line 12 def setup_instructions @setup_instructions end |
#template_url ⇒ String (readonly)
Returns This is the Template URL or the Snapshot URL corresponding to the Template.
10 11 12 |
# File 'lib/vapi_server_sdk/types/ghl_tool_provider_details.rb', line 10 def template_url @template_url end |
#webhook_hook_id ⇒ String (readonly)
18 19 20 |
# File 'lib/vapi_server_sdk/types/ghl_tool_provider_details.rb', line 18 def webhook_hook_id @webhook_hook_id end |
#webhook_hook_name ⇒ String (readonly)
20 21 22 |
# File 'lib/vapi_server_sdk/types/ghl_tool_provider_details.rb', line 20 def webhook_hook_name @webhook_hook_name end |
#workflow_id ⇒ String (readonly)
14 15 16 |
# File 'lib/vapi_server_sdk/types/ghl_tool_provider_details.rb', line 14 def workflow_id @workflow_id end |
#workflow_name ⇒ String (readonly)
16 17 18 |
# File 'lib/vapi_server_sdk/types/ghl_tool_provider_details.rb', line 16 def workflow_name @workflow_name end |
Class Method Details
.from_json(json_object:) ⇒ Vapi::GhlToolProviderDetails
Deserialize a JSON object to an instance of GhlToolProviderDetails
67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 |
# File 'lib/vapi_server_sdk/types/ghl_tool_provider_details.rb', line 67 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) template_url = parsed_json["templateUrl"] setup_instructions = parsed_json["setupInstructions"]&.map do |item| item = item.to_json Vapi::ToolTemplateSetup.from_json(json_object: item) end workflow_id = parsed_json["workflowId"] workflow_name = parsed_json["workflowName"] webhook_hook_id = parsed_json["webhookHookId"] webhook_hook_name = parsed_json["webhookHookName"] location_id = parsed_json["locationId"] new( template_url: template_url, setup_instructions: setup_instructions, workflow_id: workflow_id, workflow_name: workflow_name, webhook_hook_id: webhook_hook_id, webhook_hook_name: webhook_hook_name, location_id: location_id, 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.
105 106 107 108 109 110 111 112 113 |
# File 'lib/vapi_server_sdk/types/ghl_tool_provider_details.rb', line 105 def self.validate_raw(obj:) obj.template_url&.is_a?(String) != false || raise("Passed value for field obj.template_url is not the expected type, validation failed.") obj.setup_instructions&.is_a?(Array) != false || raise("Passed value for field obj.setup_instructions is not the expected type, validation failed.") obj.workflow_id&.is_a?(String) != false || raise("Passed value for field obj.workflow_id is not the expected type, validation failed.") obj.workflow_name&.is_a?(String) != false || raise("Passed value for field obj.workflow_name is not the expected type, validation failed.") obj.webhook_hook_id&.is_a?(String) != false || raise("Passed value for field obj.webhook_hook_id is not the expected type, validation failed.") obj.webhook_hook_name&.is_a?(String) != false || raise("Passed value for field obj.webhook_hook_name is not the expected type, validation failed.") obj.location_id&.is_a?(String) != false || raise("Passed value for field obj.location_id is not the expected type, validation failed.") end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of GhlToolProviderDetails to a JSON object
95 96 97 |
# File 'lib/vapi_server_sdk/types/ghl_tool_provider_details.rb', line 95 def to_json(*_args) @_field_set&.to_json end |