vapi_server_sdk 0.4.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (170) hide show
  1. checksums.yaml +4 -4
  2. data/lib/requests.rb +2 -2
  3. data/lib/types_export.rb +60 -14
  4. data/lib/vapi_server_sdk/analytics/client.rb +41 -12
  5. data/lib/vapi_server_sdk/assistants/client.rb +80 -14
  6. data/lib/vapi_server_sdk/assistants/types/update_assistant_dto_server_messages_item.rb +1 -0
  7. data/lib/vapi_server_sdk/calls/client.rb +104 -6
  8. data/lib/vapi_server_sdk/logs/client.rb +2 -2
  9. data/lib/vapi_server_sdk/squads/client.rb +128 -8
  10. data/lib/vapi_server_sdk/test_suite_runs/client.rb +328 -0
  11. data/lib/vapi_server_sdk/test_suite_runs/types/test_suite_run_controller_find_all_paginated_request_sort_order.rb +10 -0
  12. data/lib/vapi_server_sdk/test_suite_tests/client.rb +331 -0
  13. data/lib/vapi_server_sdk/test_suite_tests/types/test_suite_test_controller_create_request.rb +81 -0
  14. data/lib/vapi_server_sdk/test_suite_tests/types/test_suite_test_controller_find_all_paginated_request_sort_order.rb +10 -0
  15. data/lib/vapi_server_sdk/test_suite_tests/types/test_suite_test_controller_remove_response.rb +82 -0
  16. data/lib/vapi_server_sdk/test_suite_tests/types/test_suite_test_controller_update_request.rb +81 -0
  17. data/lib/vapi_server_sdk/test_suites/client.rb +338 -0
  18. data/lib/vapi_server_sdk/test_suites/types/test_suite_controller_find_all_paginated_request_sort_order.rb +10 -0
  19. data/lib/vapi_server_sdk/types/{semantic_edge_condition.rb → ai_edge_condition.rb} +9 -11
  20. data/lib/vapi_server_sdk/types/analytics_operation_column.rb +1 -0
  21. data/lib/vapi_server_sdk/types/analytics_operation_operation.rb +1 -0
  22. data/lib/vapi_server_sdk/types/analytics_query.rb +4 -3
  23. data/lib/vapi_server_sdk/types/analytics_query_table.rb +9 -0
  24. data/lib/vapi_server_sdk/types/api_request.rb +165 -0
  25. data/lib/vapi_server_sdk/types/api_request_method.rb +8 -0
  26. data/lib/vapi_server_sdk/types/api_request_mode.rb +10 -0
  27. data/lib/vapi_server_sdk/types/artifact.rb +12 -2
  28. data/lib/vapi_server_sdk/types/artifact_plan.rb +56 -8
  29. data/lib/vapi_server_sdk/types/assistant.rb +27 -13
  30. data/lib/vapi_server_sdk/types/assistant_hook_action_base.rb +47 -0
  31. data/lib/vapi_server_sdk/types/assistant_hook_filter.rb +72 -0
  32. data/lib/vapi_server_sdk/types/assistant_hooks.rb +82 -0
  33. data/lib/vapi_server_sdk/types/assistant_overrides.rb +28 -14
  34. data/lib/vapi_server_sdk/types/assistant_overrides_server_messages_item.rb +1 -0
  35. data/lib/vapi_server_sdk/types/assistant_server_messages_item.rb +1 -0
  36. data/lib/vapi_server_sdk/types/azure_open_ai_credential_models_item.rb +1 -0
  37. data/lib/vapi_server_sdk/types/backoff_plan.rb +80 -0
  38. data/lib/vapi_server_sdk/types/byo_phone_number.rb +10 -1
  39. data/lib/vapi_server_sdk/types/byo_phone_number_status.rb +10 -0
  40. data/lib/vapi_server_sdk/types/call_ended_reason.rb +10 -1
  41. data/lib/vapi_server_sdk/types/cartesia_experimental_controls.rb +69 -0
  42. data/lib/vapi_server_sdk/types/cartesia_experimental_controls_emotion.rb +26 -0
  43. data/lib/vapi_server_sdk/types/cartesia_experimental_controls_speed.rb +11 -0
  44. data/lib/vapi_server_sdk/types/cartesia_voice.rb +24 -10
  45. data/lib/vapi_server_sdk/types/chat_completion_message.rb +80 -0
  46. data/lib/vapi_server_sdk/types/chat_completion_message_metadata.rb +94 -0
  47. data/lib/vapi_server_sdk/types/chat_completions_dto.rb +84 -0
  48. data/lib/vapi_server_sdk/types/client_inbound_message_transfer.rb +13 -3
  49. data/lib/vapi_server_sdk/types/client_message_conversation_update.rb +15 -2
  50. data/lib/vapi_server_sdk/types/client_message_hang.rb +22 -4
  51. data/lib/vapi_server_sdk/types/client_message_language_change_detected.rb +15 -3
  52. data/lib/vapi_server_sdk/types/client_message_message.rb +165 -181
  53. data/lib/vapi_server_sdk/types/client_message_metadata.rb +15 -3
  54. data/lib/vapi_server_sdk/types/client_message_model_output.rb +15 -3
  55. data/lib/vapi_server_sdk/types/client_message_speech_update.rb +11 -2
  56. data/lib/vapi_server_sdk/types/client_message_tool_calls.rb +15 -2
  57. data/lib/vapi_server_sdk/types/client_message_tool_calls_result.rb +15 -3
  58. data/lib/vapi_server_sdk/types/client_message_transcript.rb +12 -2
  59. data/lib/vapi_server_sdk/types/client_message_transcript_type.rb +10 -0
  60. data/lib/vapi_server_sdk/types/client_message_transfer_update.rb +11 -1
  61. data/lib/vapi_server_sdk/types/client_message_user_interrupted.rb +14 -4
  62. data/lib/vapi_server_sdk/types/client_message_voice_input.rb +15 -3
  63. data/lib/vapi_server_sdk/types/client_message_workflow_node_started.rb +67 -0
  64. data/lib/vapi_server_sdk/types/compliance_plan.rb +77 -0
  65. data/lib/vapi_server_sdk/types/create_assistant_dto.rb +28 -14
  66. data/lib/vapi_server_sdk/types/create_assistant_dto_server_messages_item.rb +1 -0
  67. data/lib/vapi_server_sdk/types/create_azure_open_ai_credential_dto_models_item.rb +1 -0
  68. data/lib/vapi_server_sdk/types/create_test_suite_test_voice_dto.rb +90 -0
  69. data/lib/vapi_server_sdk/types/create_vapi_phone_number_dto.rb +12 -4
  70. data/lib/vapi_server_sdk/types/create_workflow_dto.rb +2 -9
  71. data/lib/vapi_server_sdk/types/create_workflow_dto_nodes_item.rb +104 -52
  72. data/lib/vapi_server_sdk/types/deep_seek_model.rb +4 -3
  73. data/lib/vapi_server_sdk/types/deep_seek_model_model.rb +9 -0
  74. data/lib/vapi_server_sdk/types/deepgram_transcriber.rb +28 -2
  75. data/lib/vapi_server_sdk/types/deepgram_voice.rb +22 -2
  76. data/lib/vapi_server_sdk/types/edge.rb +9 -2
  77. data/lib/vapi_server_sdk/types/edge_condition.rb +32 -19
  78. data/lib/vapi_server_sdk/types/failed_edge_condition.rb +47 -0
  79. data/lib/vapi_server_sdk/types/fallback_cartesia_voice.rb +24 -9
  80. data/lib/vapi_server_sdk/types/fallback_deepgram_voice.rb +17 -2
  81. data/lib/vapi_server_sdk/types/fallback_play_ht_voice_model.rb +1 -0
  82. data/lib/vapi_server_sdk/types/fallback_rime_ai_voice_id_enum.rb +22 -20
  83. data/lib/vapi_server_sdk/types/fallback_rime_ai_voice_model.rb +1 -0
  84. data/lib/vapi_server_sdk/types/format_plan.rb +22 -2
  85. data/lib/vapi_server_sdk/types/format_plan_formatters_enabled_item.rb +22 -0
  86. data/lib/vapi_server_sdk/types/gather.rb +81 -25
  87. data/lib/vapi_server_sdk/types/google_model_model.rb +4 -0
  88. data/lib/vapi_server_sdk/types/groq_model_model.rb +1 -0
  89. data/lib/vapi_server_sdk/types/hangup.rb +67 -0
  90. data/lib/vapi_server_sdk/types/hook.rb +70 -0
  91. data/lib/vapi_server_sdk/types/hook_on.rb +9 -0
  92. data/lib/vapi_server_sdk/types/invite_user_dto.rb +11 -2
  93. data/lib/vapi_server_sdk/types/json_schema.rb +26 -2
  94. data/lib/vapi_server_sdk/types/{programmatic_edge_condition.rb → logic_edge_condition.rb} +13 -15
  95. data/lib/vapi_server_sdk/types/message_plan.rb +12 -2
  96. data/lib/vapi_server_sdk/types/open_ai_model.rb +1 -9
  97. data/lib/vapi_server_sdk/types/open_ai_model_fallback_models_item.rb +2 -0
  98. data/lib/vapi_server_sdk/types/open_ai_model_model.rb +2 -0
  99. data/lib/vapi_server_sdk/types/play_ht_voice_model.rb +1 -0
  100. data/lib/vapi_server_sdk/types/rime_ai_voice_id_enum.rb +22 -20
  101. data/lib/vapi_server_sdk/types/rime_ai_voice_model.rb +1 -0
  102. data/lib/vapi_server_sdk/types/say.rb +23 -14
  103. data/lib/vapi_server_sdk/types/say_hook.rb +81 -0
  104. data/lib/vapi_server_sdk/types/server.rb +17 -2
  105. data/lib/vapi_server_sdk/types/server_message_assistant_request.rb +12 -2
  106. data/lib/vapi_server_sdk/types/server_message_conversation_update.rb +12 -2
  107. data/lib/vapi_server_sdk/types/server_message_end_of_call_report.rb +11 -1
  108. data/lib/vapi_server_sdk/types/server_message_end_of_call_report_ended_reason.rb +10 -1
  109. data/lib/vapi_server_sdk/types/server_message_hang.rb +20 -2
  110. data/lib/vapi_server_sdk/types/server_message_knowledge_base_request.rb +14 -2
  111. data/lib/vapi_server_sdk/types/server_message_language_change_detected.rb +11 -1
  112. data/lib/vapi_server_sdk/types/server_message_message.rb +212 -237
  113. data/lib/vapi_server_sdk/types/server_message_model_output.rb +11 -1
  114. data/lib/vapi_server_sdk/types/server_message_phone_call_control.rb +18 -2
  115. data/lib/vapi_server_sdk/types/server_message_speech_update.rb +11 -1
  116. data/lib/vapi_server_sdk/types/server_message_status_update.rb +12 -2
  117. data/lib/vapi_server_sdk/types/server_message_status_update_ended_reason.rb +10 -1
  118. data/lib/vapi_server_sdk/types/server_message_tool_calls.rb +10 -2
  119. data/lib/vapi_server_sdk/types/server_message_transcript.rb +13 -2
  120. data/lib/vapi_server_sdk/types/server_message_transcript_type.rb +10 -0
  121. data/lib/vapi_server_sdk/types/server_message_transfer_destination_request.rb +12 -2
  122. data/lib/vapi_server_sdk/types/server_message_transfer_update.rb +11 -1
  123. data/lib/vapi_server_sdk/types/server_message_user_interrupted.rb +12 -2
  124. data/lib/vapi_server_sdk/types/server_message_voice_input.rb +11 -1
  125. data/lib/vapi_server_sdk/types/server_message_voice_request.rb +50 -2
  126. data/lib/vapi_server_sdk/types/stop_speaking_plan.rb +27 -2
  127. data/lib/vapi_server_sdk/types/subscription.rb +33 -5
  128. data/lib/vapi_server_sdk/types/sync_voice_library_dto_providers_item.rb +1 -0
  129. data/lib/vapi_server_sdk/types/test_suite.rb +104 -0
  130. data/lib/vapi_server_sdk/types/test_suite_run.rb +127 -0
  131. data/lib/vapi_server_sdk/types/test_suite_run_scorer_ai.rb +80 -0
  132. data/lib/vapi_server_sdk/types/test_suite_run_scorer_ai_result.rb +9 -0
  133. data/lib/vapi_server_sdk/types/test_suite_run_status.rb +10 -0
  134. data/lib/vapi_server_sdk/types/test_suite_run_test_attempt.rb +75 -0
  135. data/lib/vapi_server_sdk/types/{analytics_query_dto.rb → test_suite_run_test_attempt_call.rb} +19 -17
  136. data/lib/vapi_server_sdk/types/test_suite_run_test_result.rb +75 -0
  137. data/lib/vapi_server_sdk/types/test_suite_runs_paginated_response.rb +75 -0
  138. data/lib/vapi_server_sdk/types/test_suite_test_scorer_ai.rb +65 -0
  139. data/lib/vapi_server_sdk/types/test_suite_test_voice.rb +132 -0
  140. data/lib/vapi_server_sdk/types/test_suite_tests_paginated_response.rb +75 -0
  141. data/lib/vapi_server_sdk/types/test_suites_paginated_response.rb +75 -0
  142. data/lib/vapi_server_sdk/types/time_range_step.rb +1 -0
  143. data/lib/vapi_server_sdk/types/tool_message_start.rb +18 -2
  144. data/lib/vapi_server_sdk/types/transfer.rb +74 -0
  145. data/lib/vapi_server_sdk/types/transfer_assistant_hook_action.rb +75 -0
  146. data/lib/vapi_server_sdk/types/{buy_phone_number_dto_fallback_destination.rb → transfer_assistant_hook_action_destination.rb} +9 -12
  147. data/lib/vapi_server_sdk/types/transfer_destination_assistant.rb +46 -0
  148. data/lib/vapi_server_sdk/types/transfer_plan.rb +37 -1
  149. data/lib/vapi_server_sdk/types/transfer_plan_mode.rb +4 -0
  150. data/lib/vapi_server_sdk/types/trieve_knowledge_base_search_plan.rb +12 -1
  151. data/lib/vapi_server_sdk/types/twilio_phone_number.rb +11 -2
  152. data/lib/vapi_server_sdk/types/twilio_phone_number_status.rb +10 -0
  153. data/lib/vapi_server_sdk/types/update_azure_open_ai_credential_dto_models_item.rb +1 -0
  154. data/lib/vapi_server_sdk/types/update_test_suite_test_voice_dto.rb +90 -0
  155. data/lib/vapi_server_sdk/types/vapi_phone_number.rb +29 -4
  156. data/lib/vapi_server_sdk/types/vapi_phone_number_status.rb +10 -0
  157. data/lib/vapi_server_sdk/types/vonage_phone_number.rb +11 -2
  158. data/lib/vapi_server_sdk/types/vonage_phone_number_status.rb +10 -0
  159. data/lib/vapi_server_sdk/types/workflow.rb +1 -9
  160. data/lib/vapi_server_sdk/types/workflow_nodes_item.rb +104 -52
  161. data/lib/vapi_server_sdk/types/xai_model.rb +4 -3
  162. data/lib/vapi_server_sdk/types/xai_model_model.rb +10 -0
  163. data/lib/vapi_server_sdk.rb +21 -0
  164. metadata +61 -12
  165. data/lib/vapi_server_sdk/types/buy_phone_number_dto.rb +0 -147
  166. data/lib/vapi_server_sdk/types/org_with_org_user.rb +0 -262
  167. data/lib/vapi_server_sdk/types/org_with_org_user_channel.rb +0 -10
  168. data/lib/vapi_server_sdk/types/org_with_org_user_role.rb +0 -9
  169. data/lib/vapi_server_sdk/types/update_workflow_dto.rb +0 -82
  170. data/lib/vapi_server_sdk/types/update_workflow_dto_nodes_item.rb +0 -81
@@ -1,5 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require_relative "analytics_query_table"
3
4
  require_relative "analytics_query_group_by_item"
4
5
  require_relative "time_range"
5
6
  require_relative "analytics_operation"
@@ -8,7 +9,7 @@ require "json"
8
9
 
9
10
  module Vapi
10
11
  class AnalyticsQuery
11
- # @return [String] This is the table you want to query.
12
+ # @return [Vapi::AnalyticsQueryTable] This is the table you want to query.
12
13
  attr_reader :table
13
14
  # @return [Array<Vapi::AnalyticsQueryGroupByItem>] This is the list of columns you want to group by.
14
15
  attr_reader :group_by
@@ -27,7 +28,7 @@ module Vapi
27
28
 
28
29
  OMIT = Object.new
29
30
 
30
- # @param table [String] This is the table you want to query.
31
+ # @param table [Vapi::AnalyticsQueryTable] This is the table you want to query.
31
32
  # @param group_by [Array<Vapi::AnalyticsQueryGroupByItem>] This is the list of columns you want to group by.
32
33
  # @param name [String] This is the name of the query. This will be used to identify the query in the
33
34
  # response.
@@ -97,7 +98,7 @@ module Vapi
97
98
  # @param obj [Object]
98
99
  # @return [Void]
99
100
  def self.validate_raw(obj:)
100
- obj.table.is_a?(String) != false || raise("Passed value for field obj.table is not the expected type, validation failed.")
101
+ obj.table.is_a?(Vapi::AnalyticsQueryTable) != false || raise("Passed value for field obj.table is not the expected type, validation failed.")
101
102
  obj.group_by&.is_a?(Array) != false || raise("Passed value for field obj.group_by is not the expected type, validation failed.")
102
103
  obj.name.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
103
104
  obj.time_range.nil? || Vapi::TimeRange.validate_raw(obj: obj.time_range)
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Vapi
4
+ # This is the table you want to query.
5
+ class AnalyticsQueryTable
6
+ CALL = "call"
7
+ SUBSCRIPTION = "subscription"
8
+ end
9
+ end
@@ -0,0 +1,165 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "api_request_method"
4
+ require_relative "json_schema"
5
+ require_relative "api_request_mode"
6
+ require_relative "hook"
7
+ require "ostruct"
8
+ require "json"
9
+
10
+ module Vapi
11
+ class ApiRequest
12
+ # @return [Vapi::ApiRequestMethod]
13
+ attr_reader :method
14
+ # @return [String] Api endpoint to send requests to.
15
+ attr_reader :url
16
+ # @return [Vapi::JsonSchema] These are the custom headers to include in the Api Request sent.
17
+ # Each key-value pair represents a header name and its value.
18
+ attr_reader :headers
19
+ # @return [Vapi::JsonSchema] This defined the JSON body of your Api Request. For example, if `body_schema`
20
+ # included "my_field": "my_gather_statement.user_age", then the json body sent to
21
+ # the server would have that particular value assign to it.
22
+ # Right now, only data from gather statements are supported.
23
+ attr_reader :body
24
+ # @return [Vapi::ApiRequestMode] This is the mode of the Api Request.
25
+ # We only support BLOCKING and BACKGROUND for now.
26
+ attr_reader :mode
27
+ # @return [Array<Vapi::Hook>] This is a list of hooks for a task.
28
+ # Each hook is a list of tasks to run on a trigger (such as on start, on failure,
29
+ # etc).
30
+ # Only Say is supported for now.
31
+ attr_reader :hooks
32
+ # @return [Vapi::JsonSchema] This is the schema for the outputs of the Api Request.
33
+ attr_reader :output
34
+ # @return [String]
35
+ attr_reader :name
36
+ # @return [Hash{String => Object}] This is for metadata you want to store on the task.
37
+ attr_reader :metadata
38
+ # @return [OpenStruct] Additional properties unmapped to the current class definition
39
+ attr_reader :additional_properties
40
+ # @return [Object]
41
+ attr_reader :_field_set
42
+ protected :_field_set
43
+
44
+ OMIT = Object.new
45
+
46
+ # @param method [Vapi::ApiRequestMethod]
47
+ # @param url [String] Api endpoint to send requests to.
48
+ # @param headers [Vapi::JsonSchema] These are the custom headers to include in the Api Request sent.
49
+ # Each key-value pair represents a header name and its value.
50
+ # @param body [Vapi::JsonSchema] This defined the JSON body of your Api Request. For example, if `body_schema`
51
+ # included "my_field": "my_gather_statement.user_age", then the json body sent to
52
+ # the server would have that particular value assign to it.
53
+ # Right now, only data from gather statements are supported.
54
+ # @param mode [Vapi::ApiRequestMode] This is the mode of the Api Request.
55
+ # We only support BLOCKING and BACKGROUND for now.
56
+ # @param hooks [Array<Vapi::Hook>] This is a list of hooks for a task.
57
+ # Each hook is a list of tasks to run on a trigger (such as on start, on failure,
58
+ # etc).
59
+ # Only Say is supported for now.
60
+ # @param output [Vapi::JsonSchema] This is the schema for the outputs of the Api Request.
61
+ # @param name [String]
62
+ # @param metadata [Hash{String => Object}] This is for metadata you want to store on the task.
63
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
64
+ # @return [Vapi::ApiRequest]
65
+ def initialize(method:, url:, mode:, name:, headers: OMIT, body: OMIT, hooks: OMIT, output: OMIT, metadata: OMIT,
66
+ additional_properties: nil)
67
+ @method = method
68
+ @url = url
69
+ @headers = headers if headers != OMIT
70
+ @body = body if body != OMIT
71
+ @mode = mode
72
+ @hooks = hooks if hooks != OMIT
73
+ @output = output if output != OMIT
74
+ @name = name
75
+ @metadata = metadata if metadata != OMIT
76
+ @additional_properties = additional_properties
77
+ @_field_set = {
78
+ "method": method,
79
+ "url": url,
80
+ "headers": headers,
81
+ "body": body,
82
+ "mode": mode,
83
+ "hooks": hooks,
84
+ "output": output,
85
+ "name": name,
86
+ "metadata": metadata
87
+ }.reject do |_k, v|
88
+ v == OMIT
89
+ end
90
+ end
91
+
92
+ # Deserialize a JSON object to an instance of ApiRequest
93
+ #
94
+ # @param json_object [String]
95
+ # @return [Vapi::ApiRequest]
96
+ def self.from_json(json_object:)
97
+ struct = JSON.parse(json_object, object_class: OpenStruct)
98
+ parsed_json = JSON.parse(json_object)
99
+ method = parsed_json["method"]
100
+ url = parsed_json["url"]
101
+ if parsed_json["headers"].nil?
102
+ headers = nil
103
+ else
104
+ headers = parsed_json["headers"].to_json
105
+ headers = Vapi::JsonSchema.from_json(json_object: headers)
106
+ end
107
+ if parsed_json["body"].nil?
108
+ body = nil
109
+ else
110
+ body = parsed_json["body"].to_json
111
+ body = Vapi::JsonSchema.from_json(json_object: body)
112
+ end
113
+ mode = parsed_json["mode"]
114
+ hooks = parsed_json["hooks"]&.map do |item|
115
+ item = item.to_json
116
+ Vapi::Hook.from_json(json_object: item)
117
+ end
118
+ if parsed_json["output"].nil?
119
+ output = nil
120
+ else
121
+ output = parsed_json["output"].to_json
122
+ output = Vapi::JsonSchema.from_json(json_object: output)
123
+ end
124
+ name = parsed_json["name"]
125
+ metadata = parsed_json["metadata"]
126
+ new(
127
+ method: method,
128
+ url: url,
129
+ headers: headers,
130
+ body: body,
131
+ mode: mode,
132
+ hooks: hooks,
133
+ output: output,
134
+ name: name,
135
+ metadata: metadata,
136
+ additional_properties: struct
137
+ )
138
+ end
139
+
140
+ # Serialize an instance of ApiRequest to a JSON object
141
+ #
142
+ # @return [String]
143
+ def to_json(*_args)
144
+ @_field_set&.to_json
145
+ end
146
+
147
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
148
+ # hash and check each fields type against the current object's property
149
+ # definitions.
150
+ #
151
+ # @param obj [Object]
152
+ # @return [Void]
153
+ def self.validate_raw(obj:)
154
+ obj.method.is_a?(Vapi::ApiRequestMethod) != false || raise("Passed value for field obj.method is not the expected type, validation failed.")
155
+ obj.url.is_a?(String) != false || raise("Passed value for field obj.url is not the expected type, validation failed.")
156
+ obj.headers.nil? || Vapi::JsonSchema.validate_raw(obj: obj.headers)
157
+ obj.body.nil? || Vapi::JsonSchema.validate_raw(obj: obj.body)
158
+ obj.mode.is_a?(Vapi::ApiRequestMode) != false || raise("Passed value for field obj.mode is not the expected type, validation failed.")
159
+ obj.hooks&.is_a?(Array) != false || raise("Passed value for field obj.hooks is not the expected type, validation failed.")
160
+ obj.output.nil? || Vapi::JsonSchema.validate_raw(obj: obj.output)
161
+ obj.name.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
162
+ obj.metadata&.is_a?(Hash) != false || raise("Passed value for field obj.metadata is not the expected type, validation failed.")
163
+ end
164
+ end
165
+ end
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Vapi
4
+ class ApiRequestMethod
5
+ POST = "POST"
6
+ GET = "GET"
7
+ end
8
+ end
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Vapi
4
+ # This is the mode of the Api Request.
5
+ # We only support BLOCKING and BACKGROUND for now.
6
+ class ApiRequestMode
7
+ BLOCKING = "blocking"
8
+ BACKGROUND = "background"
9
+ end
10
+ end
@@ -27,6 +27,9 @@ module Vapi
27
27
  # @return [String] This is the transcript of the call. This is derived from `artifact.messages` but
28
28
  # provided for convenience.
29
29
  attr_reader :transcript
30
+ # @return [String] This is the packet capture url for the call. This is only available for `phone`
31
+ # type calls where phone number's provider is `vapi` or `byo-phone-number`.
32
+ attr_reader :pcap_url
30
33
  # @return [OpenStruct] Additional properties unmapped to the current class definition
31
34
  attr_reader :additional_properties
32
35
  # @return [Object]
@@ -48,10 +51,12 @@ module Vapi
48
51
  # playback of the recording with artifact.messages timestamps.
49
52
  # @param transcript [String] This is the transcript of the call. This is derived from `artifact.messages` but
50
53
  # provided for convenience.
54
+ # @param pcap_url [String] This is the packet capture url for the call. This is only available for `phone`
55
+ # type calls where phone number's provider is `vapi` or `byo-phone-number`.
51
56
  # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
52
57
  # @return [Vapi::Artifact]
53
58
  def initialize(messages: OMIT, messages_open_ai_formatted: OMIT, recording_url: OMIT, stereo_recording_url: OMIT,
54
- video_recording_url: OMIT, video_recording_start_delay_seconds: OMIT, transcript: OMIT, additional_properties: nil)
59
+ video_recording_url: OMIT, video_recording_start_delay_seconds: OMIT, transcript: OMIT, pcap_url: OMIT, additional_properties: nil)
55
60
  @messages = messages if messages != OMIT
56
61
  @messages_open_ai_formatted = messages_open_ai_formatted if messages_open_ai_formatted != OMIT
57
62
  @recording_url = recording_url if recording_url != OMIT
@@ -61,6 +66,7 @@ module Vapi
61
66
  @video_recording_start_delay_seconds = video_recording_start_delay_seconds
62
67
  end
63
68
  @transcript = transcript if transcript != OMIT
69
+ @pcap_url = pcap_url if pcap_url != OMIT
64
70
  @additional_properties = additional_properties
65
71
  @_field_set = {
66
72
  "messages": messages,
@@ -69,7 +75,8 @@ module Vapi
69
75
  "stereoRecordingUrl": stereo_recording_url,
70
76
  "videoRecordingUrl": video_recording_url,
71
77
  "videoRecordingStartDelaySeconds": video_recording_start_delay_seconds,
72
- "transcript": transcript
78
+ "transcript": transcript,
79
+ "pcapUrl": pcap_url
73
80
  }.reject do |_k, v|
74
81
  v == OMIT
75
82
  end
@@ -95,6 +102,7 @@ module Vapi
95
102
  video_recording_url = parsed_json["videoRecordingUrl"]
96
103
  video_recording_start_delay_seconds = parsed_json["videoRecordingStartDelaySeconds"]
97
104
  transcript = parsed_json["transcript"]
105
+ pcap_url = parsed_json["pcapUrl"]
98
106
  new(
99
107
  messages: messages,
100
108
  messages_open_ai_formatted: messages_open_ai_formatted,
@@ -103,6 +111,7 @@ module Vapi
103
111
  video_recording_url: video_recording_url,
104
112
  video_recording_start_delay_seconds: video_recording_start_delay_seconds,
105
113
  transcript: transcript,
114
+ pcap_url: pcap_url,
106
115
  additional_properties: struct
107
116
  )
108
117
  end
@@ -128,6 +137,7 @@ module Vapi
128
137
  obj.video_recording_url&.is_a?(String) != false || raise("Passed value for field obj.video_recording_url is not the expected type, validation failed.")
129
138
  obj.video_recording_start_delay_seconds&.is_a?(Float) != false || raise("Passed value for field obj.video_recording_start_delay_seconds is not the expected type, validation failed.")
130
139
  obj.transcript&.is_a?(String) != false || raise("Passed value for field obj.transcript is not the expected type, validation failed.")
140
+ obj.pcap_url&.is_a?(String) != false || raise("Passed value for field obj.pcap_url is not the expected type, validation failed.")
131
141
  end
132
142
  end
133
143
  end
@@ -9,9 +9,10 @@ module Vapi
9
9
  # @return [Boolean] This determines whether assistant's calls are recorded. Defaults to true.
10
10
  # Usage:
11
11
  # - If you don't want to record the calls, set this to false.
12
- # - If you want to record the calls when `assistant.hipaaEnabled`, explicity set
13
- # this to true and make sure to provide S3 or GCP credentials on the Provider
14
- # Credentials page in the Dashboard.
12
+ # - If you want to record the calls when `assistant.hipaaEnabled` (deprecated) or
13
+ # `assistant.compliancePlan.hipaaEnabled` explicity set this to true and make sure
14
+ # to provide S3 or GCP credentials on the Provider Credentials page in the
15
+ # Dashboard.
15
16
  # You can find the recording at `call.artifact.recordingUrl` and
16
17
  # `call.artifact.stereoRecordingUrl` after the call is ended.
17
18
  # @default true
@@ -22,6 +23,25 @@ module Vapi
22
23
  # call is ended.
23
24
  # @default false
24
25
  attr_reader :video_recording_enabled
26
+ # @return [Boolean] This determines whether the SIP packet capture is enabled. Defaults to true.
27
+ # Only relevant for `phone` type calls where phone number's provider is `vapi` or
28
+ # `byo-phone-number`.
29
+ # You can find the packet capture at `call.artifact.pcapUrl` after the call is
30
+ # ended.
31
+ # @default true
32
+ attr_reader :pcap_enabled
33
+ # @return [String] This is the path where the SIP packet capture will be uploaded. This is only
34
+ # used if you have provided S3 or GCP credentials on the Provider Credentials page
35
+ # in the Dashboard.
36
+ # If credential.s3PathPrefix or credential.bucketPlan.path is set, this will
37
+ # append to it.
38
+ # Usage:
39
+ # - If you want to upload the packet capture to a specific path, set this to the
40
+ # path. Example: `/my-assistant-captures`.
41
+ # - If you want to upload the packet capture to the root of the bucket, set this
42
+ # to `/`.
43
+ # @default '/'
44
+ attr_reader :pcap_s_3_path_prefix
25
45
  # @return [Vapi::TranscriptPlan] This is the plan for `call.artifact.transcript`. To disable, set
26
46
  # `transcriptPlan.enabled` to false.
27
47
  attr_reader :transcript_plan
@@ -48,9 +68,10 @@ module Vapi
48
68
  # @param recording_enabled [Boolean] This determines whether assistant's calls are recorded. Defaults to true.
49
69
  # Usage:
50
70
  # - If you don't want to record the calls, set this to false.
51
- # - If you want to record the calls when `assistant.hipaaEnabled`, explicity set
52
- # this to true and make sure to provide S3 or GCP credentials on the Provider
53
- # Credentials page in the Dashboard.
71
+ # - If you want to record the calls when `assistant.hipaaEnabled` (deprecated) or
72
+ # `assistant.compliancePlan.hipaaEnabled` explicity set this to true and make sure
73
+ # to provide S3 or GCP credentials on the Provider Credentials page in the
74
+ # Dashboard.
54
75
  # You can find the recording at `call.artifact.recordingUrl` and
55
76
  # `call.artifact.stereoRecordingUrl` after the call is ended.
56
77
  # @default true
@@ -59,6 +80,23 @@ module Vapi
59
80
  # You can find the video recording at `call.artifact.videoRecordingUrl` after the
60
81
  # call is ended.
61
82
  # @default false
83
+ # @param pcap_enabled [Boolean] This determines whether the SIP packet capture is enabled. Defaults to true.
84
+ # Only relevant for `phone` type calls where phone number's provider is `vapi` or
85
+ # `byo-phone-number`.
86
+ # You can find the packet capture at `call.artifact.pcapUrl` after the call is
87
+ # ended.
88
+ # @default true
89
+ # @param pcap_s_3_path_prefix [String] This is the path where the SIP packet capture will be uploaded. This is only
90
+ # used if you have provided S3 or GCP credentials on the Provider Credentials page
91
+ # in the Dashboard.
92
+ # If credential.s3PathPrefix or credential.bucketPlan.path is set, this will
93
+ # append to it.
94
+ # Usage:
95
+ # - If you want to upload the packet capture to a specific path, set this to the
96
+ # path. Example: `/my-assistant-captures`.
97
+ # - If you want to upload the packet capture to the root of the bucket, set this
98
+ # to `/`.
99
+ # @default '/'
62
100
  # @param transcript_plan [Vapi::TranscriptPlan] This is the plan for `call.artifact.transcript`. To disable, set
63
101
  # `transcriptPlan.enabled` to false.
64
102
  # @param recording_path [String] This is the path where the recording will be uploaded. This is only used if you
@@ -74,16 +112,20 @@ module Vapi
74
112
  # @default '/'
75
113
  # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
76
114
  # @return [Vapi::ArtifactPlan]
77
- def initialize(recording_enabled: OMIT, video_recording_enabled: OMIT, transcript_plan: OMIT, recording_path: OMIT,
78
- additional_properties: nil)
115
+ def initialize(recording_enabled: OMIT, video_recording_enabled: OMIT, pcap_enabled: OMIT,
116
+ pcap_s_3_path_prefix: OMIT, transcript_plan: OMIT, recording_path: OMIT, additional_properties: nil)
79
117
  @recording_enabled = recording_enabled if recording_enabled != OMIT
80
118
  @video_recording_enabled = video_recording_enabled if video_recording_enabled != OMIT
119
+ @pcap_enabled = pcap_enabled if pcap_enabled != OMIT
120
+ @pcap_s_3_path_prefix = pcap_s_3_path_prefix if pcap_s_3_path_prefix != OMIT
81
121
  @transcript_plan = transcript_plan if transcript_plan != OMIT
82
122
  @recording_path = recording_path if recording_path != OMIT
83
123
  @additional_properties = additional_properties
84
124
  @_field_set = {
85
125
  "recordingEnabled": recording_enabled,
86
126
  "videoRecordingEnabled": video_recording_enabled,
127
+ "pcapEnabled": pcap_enabled,
128
+ "pcapS3PathPrefix": pcap_s_3_path_prefix,
87
129
  "transcriptPlan": transcript_plan,
88
130
  "recordingPath": recording_path
89
131
  }.reject do |_k, v|
@@ -100,6 +142,8 @@ module Vapi
100
142
  parsed_json = JSON.parse(json_object)
101
143
  recording_enabled = parsed_json["recordingEnabled"]
102
144
  video_recording_enabled = parsed_json["videoRecordingEnabled"]
145
+ pcap_enabled = parsed_json["pcapEnabled"]
146
+ pcap_s_3_path_prefix = parsed_json["pcapS3PathPrefix"]
103
147
  if parsed_json["transcriptPlan"].nil?
104
148
  transcript_plan = nil
105
149
  else
@@ -110,6 +154,8 @@ module Vapi
110
154
  new(
111
155
  recording_enabled: recording_enabled,
112
156
  video_recording_enabled: video_recording_enabled,
157
+ pcap_enabled: pcap_enabled,
158
+ pcap_s_3_path_prefix: pcap_s_3_path_prefix,
113
159
  transcript_plan: transcript_plan,
114
160
  recording_path: recording_path,
115
161
  additional_properties: struct
@@ -132,6 +178,8 @@ module Vapi
132
178
  def self.validate_raw(obj:)
133
179
  obj.recording_enabled&.is_a?(Boolean) != false || raise("Passed value for field obj.recording_enabled is not the expected type, validation failed.")
134
180
  obj.video_recording_enabled&.is_a?(Boolean) != false || raise("Passed value for field obj.video_recording_enabled is not the expected type, validation failed.")
181
+ obj.pcap_enabled&.is_a?(Boolean) != false || raise("Passed value for field obj.pcap_enabled is not the expected type, validation failed.")
182
+ obj.pcap_s_3_path_prefix&.is_a?(String) != false || raise("Passed value for field obj.pcap_s_3_path_prefix is not the expected type, validation failed.")
135
183
  obj.transcript_plan.nil? || Vapi::TranscriptPlan.validate_raw(obj: obj.transcript_plan)
136
184
  obj.recording_path&.is_a?(String) != false || raise("Passed value for field obj.recording_path is not the expected type, validation failed.")
137
185
  end
@@ -10,6 +10,7 @@ require_relative "assistant_background_sound"
10
10
  require_relative "transport_configuration_twilio"
11
11
  require_relative "assistant_credentials_item"
12
12
  require_relative "twilio_voicemail_detection"
13
+ require_relative "compliance_plan"
13
14
  require_relative "analysis_plan"
14
15
  require_relative "artifact_plan"
15
16
  require_relative "message_plan"
@@ -17,6 +18,7 @@ require_relative "start_speaking_plan"
17
18
  require_relative "stop_speaking_plan"
18
19
  require_relative "monitor_plan"
19
20
  require_relative "server"
21
+ require_relative "assistant_hooks"
20
22
  require "date"
21
23
  require "ostruct"
22
24
  require "json"
@@ -45,10 +47,6 @@ module Vapi
45
47
  # transfer points).
46
48
  # @default 'assistant-speaks-first'
47
49
  attr_reader :first_message_mode
48
- # @return [Boolean] When this is enabled, no logs, recordings, or transcriptions will be stored. At
49
- # the end of the call, you will still receive an end-of-call-report message to
50
- # store on your server. Defaults to false.
51
- attr_reader :hipaa_enabled
52
50
  # @return [Array<Vapi::AssistantClientMessagesItem>] These are the messages that will be sent to your Client SDKs. Default is
53
51
  # tatus-update,transfer-update,transcript,tool-calls,user-interrupted,voice-input.
54
52
  # You can check the shape of the messages in ClientMessage schema.
@@ -107,6 +105,8 @@ module Vapi
107
105
  # @return [Array<String>] This list contains phrases that, if spoken by the assistant, will trigger the
108
106
  # call to be hung up. Case insensitive.
109
107
  attr_reader :end_call_phrases
108
+ # @return [Vapi::CompliancePlan]
109
+ attr_reader :compliance_plan
110
110
  # @return [Hash{String => Object}] This is for metadata you want to store on the assistant.
111
111
  attr_reader :metadata
112
112
  # @return [Vapi::AnalysisPlan] This is the plan for analysis of assistant's calls. Stored in `call.analysis`.
@@ -161,6 +161,8 @@ module Vapi
161
161
  # 2. phoneNumber.serverUrl
162
162
  # 3. org.serverUrl
163
163
  attr_reader :server
164
+ # @return [Array<Vapi::AssistantHooks>] This is a set of actions that will be performed on certain events.
165
+ attr_reader :hooks
164
166
  # @return [String] This is the unique identifier for the assistant.
165
167
  attr_reader :id
166
168
  # @return [String] This is the unique identifier for the org that this assistant belongs to.
@@ -194,9 +196,6 @@ module Vapi
194
196
  # state. (`assistant.model.messages` at call start, `call.messages` at squad
195
197
  # transfer points).
196
198
  # @default 'assistant-speaks-first'
197
- # @param hipaa_enabled [Boolean] When this is enabled, no logs, recordings, or transcriptions will be stored. At
198
- # the end of the call, you will still receive an end-of-call-report message to
199
- # store on your server. Defaults to false.
200
199
  # @param client_messages [Array<Vapi::AssistantClientMessagesItem>] These are the messages that will be sent to your Client SDKs. Default is
201
200
  # tatus-update,transfer-update,transcript,tool-calls,user-interrupted,voice-input.
202
201
  # You can check the shape of the messages in ClientMessage schema.
@@ -241,6 +240,7 @@ module Vapi
241
240
  # If unspecified, it will hang up without saying anything.
242
241
  # @param end_call_phrases [Array<String>] This list contains phrases that, if spoken by the assistant, will trigger the
243
242
  # call to be hung up. Case insensitive.
243
+ # @param compliance_plan [Vapi::CompliancePlan]
244
244
  # @param metadata [Hash{String => Object}] This is for metadata you want to store on the assistant.
245
245
  # @param analysis_plan [Vapi::AnalysisPlan] This is the plan for analysis of assistant's calls. Stored in `call.analysis`.
246
246
  # @param artifact_plan [Vapi::ArtifactPlan] This is the plan for artifacts generated during assistant's calls. Stored in
@@ -286,6 +286,7 @@ module Vapi
286
286
  # 1. assistant.server.url
287
287
  # 2. phoneNumber.serverUrl
288
288
  # 3. org.serverUrl
289
+ # @param hooks [Array<Vapi::AssistantHooks>] This is a set of actions that will be performed on certain events.
289
290
  # @param id [String] This is the unique identifier for the assistant.
290
291
  # @param org_id [String] This is the unique identifier for the org that this assistant belongs to.
291
292
  # @param created_at [DateTime] This is the ISO 8601 date-time string of when the assistant was created.
@@ -293,13 +294,12 @@ module Vapi
293
294
  # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
294
295
  # @return [Vapi::Assistant]
295
296
  def initialize(id:, org_id:, created_at:, updated_at:, transcriber: OMIT, model: OMIT, voice: OMIT, first_message: OMIT, first_message_mode: OMIT,
296
- hipaa_enabled: OMIT, client_messages: OMIT, server_messages: OMIT, silence_timeout_seconds: OMIT, max_duration_seconds: OMIT, background_sound: OMIT, background_denoising_enabled: OMIT, model_output_in_messages_enabled: OMIT, transport_configurations: OMIT, credentials: OMIT, name: OMIT, voicemail_detection: OMIT, voicemail_message: OMIT, end_call_message: OMIT, end_call_phrases: OMIT, metadata: OMIT, analysis_plan: OMIT, artifact_plan: OMIT, message_plan: OMIT, start_speaking_plan: OMIT, stop_speaking_plan: OMIT, monitor_plan: OMIT, credential_ids: OMIT, server: OMIT, additional_properties: nil)
297
+ client_messages: OMIT, server_messages: OMIT, silence_timeout_seconds: OMIT, max_duration_seconds: OMIT, background_sound: OMIT, background_denoising_enabled: OMIT, model_output_in_messages_enabled: OMIT, transport_configurations: OMIT, credentials: OMIT, name: OMIT, voicemail_detection: OMIT, voicemail_message: OMIT, end_call_message: OMIT, end_call_phrases: OMIT, compliance_plan: OMIT, metadata: OMIT, analysis_plan: OMIT, artifact_plan: OMIT, message_plan: OMIT, start_speaking_plan: OMIT, stop_speaking_plan: OMIT, monitor_plan: OMIT, credential_ids: OMIT, server: OMIT, hooks: OMIT, additional_properties: nil)
297
298
  @transcriber = transcriber if transcriber != OMIT
298
299
  @model = model if model != OMIT
299
300
  @voice = voice if voice != OMIT
300
301
  @first_message = first_message if first_message != OMIT
301
302
  @first_message_mode = first_message_mode if first_message_mode != OMIT
302
- @hipaa_enabled = hipaa_enabled if hipaa_enabled != OMIT
303
303
  @client_messages = client_messages if client_messages != OMIT
304
304
  @server_messages = server_messages if server_messages != OMIT
305
305
  @silence_timeout_seconds = silence_timeout_seconds if silence_timeout_seconds != OMIT
@@ -314,6 +314,7 @@ module Vapi
314
314
  @voicemail_message = voicemail_message if voicemail_message != OMIT
315
315
  @end_call_message = end_call_message if end_call_message != OMIT
316
316
  @end_call_phrases = end_call_phrases if end_call_phrases != OMIT
317
+ @compliance_plan = compliance_plan if compliance_plan != OMIT
317
318
  @metadata = metadata if metadata != OMIT
318
319
  @analysis_plan = analysis_plan if analysis_plan != OMIT
319
320
  @artifact_plan = artifact_plan if artifact_plan != OMIT
@@ -323,6 +324,7 @@ module Vapi
323
324
  @monitor_plan = monitor_plan if monitor_plan != OMIT
324
325
  @credential_ids = credential_ids if credential_ids != OMIT
325
326
  @server = server if server != OMIT
327
+ @hooks = hooks if hooks != OMIT
326
328
  @id = id
327
329
  @org_id = org_id
328
330
  @created_at = created_at
@@ -334,7 +336,6 @@ module Vapi
334
336
  "voice": voice,
335
337
  "firstMessage": first_message,
336
338
  "firstMessageMode": first_message_mode,
337
- "hipaaEnabled": hipaa_enabled,
338
339
  "clientMessages": client_messages,
339
340
  "serverMessages": server_messages,
340
341
  "silenceTimeoutSeconds": silence_timeout_seconds,
@@ -349,6 +350,7 @@ module Vapi
349
350
  "voicemailMessage": voicemail_message,
350
351
  "endCallMessage": end_call_message,
351
352
  "endCallPhrases": end_call_phrases,
353
+ "compliancePlan": compliance_plan,
352
354
  "metadata": metadata,
353
355
  "analysisPlan": analysis_plan,
354
356
  "artifactPlan": artifact_plan,
@@ -358,6 +360,7 @@ module Vapi
358
360
  "monitorPlan": monitor_plan,
359
361
  "credentialIds": credential_ids,
360
362
  "server": server,
363
+ "hooks": hooks,
361
364
  "id": id,
362
365
  "orgId": org_id,
363
366
  "createdAt": created_at,
@@ -394,7 +397,6 @@ module Vapi
394
397
  end
395
398
  first_message = parsed_json["firstMessage"]
396
399
  first_message_mode = parsed_json["firstMessageMode"]
397
- hipaa_enabled = parsed_json["hipaaEnabled"]
398
400
  client_messages = parsed_json["clientMessages"]
399
401
  server_messages = parsed_json["serverMessages"]
400
402
  silence_timeout_seconds = parsed_json["silenceTimeoutSeconds"]
@@ -420,6 +422,12 @@ module Vapi
420
422
  voicemail_message = parsed_json["voicemailMessage"]
421
423
  end_call_message = parsed_json["endCallMessage"]
422
424
  end_call_phrases = parsed_json["endCallPhrases"]
425
+ if parsed_json["compliancePlan"].nil?
426
+ compliance_plan = nil
427
+ else
428
+ compliance_plan = parsed_json["compliancePlan"].to_json
429
+ compliance_plan = Vapi::CompliancePlan.from_json(json_object: compliance_plan)
430
+ end
423
431
  metadata = parsed_json["metadata"]
424
432
  if parsed_json["analysisPlan"].nil?
425
433
  analysis_plan = nil
@@ -464,6 +472,10 @@ module Vapi
464
472
  server = parsed_json["server"].to_json
465
473
  server = Vapi::Server.from_json(json_object: server)
466
474
  end
475
+ hooks = parsed_json["hooks"]&.map do |item|
476
+ item = item.to_json
477
+ Vapi::AssistantHooks.from_json(json_object: item)
478
+ end
467
479
  id = parsed_json["id"]
468
480
  org_id = parsed_json["orgId"]
469
481
  created_at = (DateTime.parse(parsed_json["createdAt"]) unless parsed_json["createdAt"].nil?)
@@ -474,7 +486,6 @@ module Vapi
474
486
  voice: voice,
475
487
  first_message: first_message,
476
488
  first_message_mode: first_message_mode,
477
- hipaa_enabled: hipaa_enabled,
478
489
  client_messages: client_messages,
479
490
  server_messages: server_messages,
480
491
  silence_timeout_seconds: silence_timeout_seconds,
@@ -489,6 +500,7 @@ module Vapi
489
500
  voicemail_message: voicemail_message,
490
501
  end_call_message: end_call_message,
491
502
  end_call_phrases: end_call_phrases,
503
+ compliance_plan: compliance_plan,
492
504
  metadata: metadata,
493
505
  analysis_plan: analysis_plan,
494
506
  artifact_plan: artifact_plan,
@@ -498,6 +510,7 @@ module Vapi
498
510
  monitor_plan: monitor_plan,
499
511
  credential_ids: credential_ids,
500
512
  server: server,
513
+ hooks: hooks,
501
514
  id: id,
502
515
  org_id: org_id,
503
516
  created_at: created_at,
@@ -525,7 +538,6 @@ module Vapi
525
538
  obj.voice.nil? || Vapi::AssistantVoice.validate_raw(obj: obj.voice)
526
539
  obj.first_message&.is_a?(String) != false || raise("Passed value for field obj.first_message is not the expected type, validation failed.")
527
540
  obj.first_message_mode&.is_a?(Vapi::AssistantFirstMessageMode) != false || raise("Passed value for field obj.first_message_mode is not the expected type, validation failed.")
528
- obj.hipaa_enabled&.is_a?(Boolean) != false || raise("Passed value for field obj.hipaa_enabled is not the expected type, validation failed.")
529
541
  obj.client_messages&.is_a?(Array) != false || raise("Passed value for field obj.client_messages is not the expected type, validation failed.")
530
542
  obj.server_messages&.is_a?(Array) != false || raise("Passed value for field obj.server_messages is not the expected type, validation failed.")
531
543
  obj.silence_timeout_seconds&.is_a?(Float) != false || raise("Passed value for field obj.silence_timeout_seconds is not the expected type, validation failed.")
@@ -540,6 +552,7 @@ module Vapi
540
552
  obj.voicemail_message&.is_a?(String) != false || raise("Passed value for field obj.voicemail_message is not the expected type, validation failed.")
541
553
  obj.end_call_message&.is_a?(String) != false || raise("Passed value for field obj.end_call_message is not the expected type, validation failed.")
542
554
  obj.end_call_phrases&.is_a?(Array) != false || raise("Passed value for field obj.end_call_phrases is not the expected type, validation failed.")
555
+ obj.compliance_plan.nil? || Vapi::CompliancePlan.validate_raw(obj: obj.compliance_plan)
543
556
  obj.metadata&.is_a?(Hash) != false || raise("Passed value for field obj.metadata is not the expected type, validation failed.")
544
557
  obj.analysis_plan.nil? || Vapi::AnalysisPlan.validate_raw(obj: obj.analysis_plan)
545
558
  obj.artifact_plan.nil? || Vapi::ArtifactPlan.validate_raw(obj: obj.artifact_plan)
@@ -549,6 +562,7 @@ module Vapi
549
562
  obj.monitor_plan.nil? || Vapi::MonitorPlan.validate_raw(obj: obj.monitor_plan)
550
563
  obj.credential_ids&.is_a?(Array) != false || raise("Passed value for field obj.credential_ids is not the expected type, validation failed.")
551
564
  obj.server.nil? || Vapi::Server.validate_raw(obj: obj.server)
565
+ obj.hooks&.is_a?(Array) != false || raise("Passed value for field obj.hooks is not the expected type, validation failed.")
552
566
  obj.id.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
553
567
  obj.org_id.is_a?(String) != false || raise("Passed value for field obj.org_id is not the expected type, validation failed.")
554
568
  obj.created_at.is_a?(DateTime) != false || raise("Passed value for field obj.created_at is not the expected type, validation failed.")
@@ -0,0 +1,47 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "ostruct"
4
+ require "json"
5
+
6
+ module Vapi
7
+ class AssistantHookActionBase
8
+ # @return [OpenStruct] Additional properties unmapped to the current class definition
9
+ attr_reader :additional_properties
10
+ # @return [Object]
11
+ attr_reader :_field_set
12
+ protected :_field_set
13
+
14
+ OMIT = Object.new
15
+
16
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
17
+ # @return [Vapi::AssistantHookActionBase]
18
+ def initialize(additional_properties: nil)
19
+ @additional_properties = additional_properties
20
+ @_field_set = {}
21
+ end
22
+
23
+ # Deserialize a JSON object to an instance of AssistantHookActionBase
24
+ #
25
+ # @param json_object [String]
26
+ # @return [Vapi::AssistantHookActionBase]
27
+ def self.from_json(json_object:)
28
+ struct = JSON.parse(json_object, object_class: OpenStruct)
29
+ new(additional_properties: struct)
30
+ end
31
+
32
+ # Serialize an instance of AssistantHookActionBase to a JSON object
33
+ #
34
+ # @return [String]
35
+ def to_json(*_args)
36
+ @_field_set&.to_json
37
+ end
38
+
39
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
40
+ # hash and check each fields type against the current object's property
41
+ # definitions.
42
+ #
43
+ # @param obj [Object]
44
+ # @return [Void]
45
+ def self.validate_raw(obj:); end
46
+ end
47
+ end