Class: Vapi::GhlToolProviderDetails

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

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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

Parameters:

  • template_url (String) (defaults to: OMIT)

    This is the Template URL or the Snapshot URL corresponding to the Template.

  • setup_instructions (Array<Vapi::ToolTemplateSetup>) (defaults to: OMIT)
  • workflow_id (String) (defaults to: OMIT)
  • workflow_name (String) (defaults to: OMIT)
  • webhook_hook_id (String) (defaults to: OMIT)
  • webhook_hook_name (String) (defaults to: OMIT)
  • location_id (String) (defaults to: OMIT)
  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



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

Returns Additional properties unmapped to the current class definition.

Returns:

  • (OpenStruct)

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

Returns:

  • (String)


22
23
24
# File 'lib/vapi_server_sdk/types/ghl_tool_provider_details.rb', line 22

def location_id
  @location_id
end

#setup_instructionsArray<Vapi::ToolTemplateSetup> (readonly)

Returns:



12
13
14
# File 'lib/vapi_server_sdk/types/ghl_tool_provider_details.rb', line 12

def setup_instructions
  @setup_instructions
end

#template_urlString (readonly)

Returns This is the Template URL or the Snapshot URL corresponding to the Template.

Returns:

  • (String)

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

Returns:

  • (String)


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

Returns:

  • (String)


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

Returns:

  • (String)


14
15
16
# File 'lib/vapi_server_sdk/types/ghl_tool_provider_details.rb', line 14

def workflow_id
  @workflow_id
end

#workflow_nameString (readonly)

Returns:

  • (String)


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

Parameters:

  • json_object (String)

Returns:



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.

Parameters:

  • obj (Object)

Returns:

  • (Void)


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

Returns:

  • (String)


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