vapi_server_sdk 0.3.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 (208) hide show
  1. checksums.yaml +4 -4
  2. data/lib/requests.rb +2 -2
  3. data/lib/types_export.rb +83 -12
  4. data/lib/vapi_server_sdk/analytics/client.rb +41 -26
  5. data/lib/vapi_server_sdk/assistants/client.rb +84 -84
  6. data/lib/vapi_server_sdk/assistants/types/update_assistant_dto_server_messages_item.rb +1 -0
  7. data/lib/vapi_server_sdk/blocks/client.rb +0 -70
  8. data/lib/vapi_server_sdk/calls/client.rb +110 -76
  9. data/lib/vapi_server_sdk/files/client.rb +0 -70
  10. data/lib/vapi_server_sdk/knowledge_bases/client.rb +0 -70
  11. data/lib/vapi_server_sdk/logs/client.rb +15 -46
  12. data/lib/vapi_server_sdk/logs/types/logging_controller_logs_delete_query_request_type.rb +12 -0
  13. data/lib/vapi_server_sdk/phone_numbers/client.rb +0 -70
  14. data/lib/vapi_server_sdk/squads/client.rb +136 -78
  15. data/lib/vapi_server_sdk/test_suite_runs/client.rb +328 -0
  16. data/lib/vapi_server_sdk/test_suite_runs/types/test_suite_run_controller_find_all_paginated_request_sort_order.rb +10 -0
  17. data/lib/vapi_server_sdk/test_suite_tests/client.rb +331 -0
  18. data/lib/vapi_server_sdk/test_suite_tests/types/test_suite_test_controller_create_request.rb +81 -0
  19. data/lib/vapi_server_sdk/test_suite_tests/types/test_suite_test_controller_find_all_paginated_request_sort_order.rb +10 -0
  20. data/lib/vapi_server_sdk/test_suite_tests/types/test_suite_test_controller_remove_response.rb +82 -0
  21. data/lib/vapi_server_sdk/test_suite_tests/types/test_suite_test_controller_update_request.rb +81 -0
  22. data/lib/vapi_server_sdk/test_suites/client.rb +338 -0
  23. data/lib/vapi_server_sdk/test_suites/types/test_suite_controller_find_all_paginated_request_sort_order.rb +10 -0
  24. data/lib/vapi_server_sdk/tools/client.rb +0 -70
  25. data/lib/vapi_server_sdk/types/ai_edge_condition.rb +55 -0
  26. data/lib/vapi_server_sdk/types/analytics_operation_column.rb +1 -0
  27. data/lib/vapi_server_sdk/types/analytics_operation_operation.rb +1 -0
  28. data/lib/vapi_server_sdk/types/analytics_query.rb +4 -3
  29. data/lib/vapi_server_sdk/types/analytics_query_table.rb +9 -0
  30. data/lib/vapi_server_sdk/types/api_request.rb +165 -0
  31. data/lib/vapi_server_sdk/types/api_request_method.rb +8 -0
  32. data/lib/vapi_server_sdk/types/api_request_mode.rb +10 -0
  33. data/lib/vapi_server_sdk/types/artifact.rb +12 -2
  34. data/lib/vapi_server_sdk/types/artifact_plan.rb +56 -8
  35. data/lib/vapi_server_sdk/types/assistant.rb +27 -13
  36. data/lib/vapi_server_sdk/types/assistant_hook_action_base.rb +47 -0
  37. data/lib/vapi_server_sdk/types/assistant_hook_filter.rb +72 -0
  38. data/lib/vapi_server_sdk/types/assistant_hooks.rb +82 -0
  39. data/lib/vapi_server_sdk/types/assistant_overrides.rb +28 -14
  40. data/lib/vapi_server_sdk/types/assistant_overrides_server_messages_item.rb +1 -0
  41. data/lib/vapi_server_sdk/types/assistant_server_messages_item.rb +1 -0
  42. data/lib/vapi_server_sdk/types/azure_credential_region.rb +4 -2
  43. data/lib/vapi_server_sdk/types/azure_open_ai_credential_models_item.rb +1 -0
  44. data/lib/vapi_server_sdk/types/azure_open_ai_credential_region.rb +4 -2
  45. data/lib/vapi_server_sdk/types/backoff_plan.rb +80 -0
  46. data/lib/vapi_server_sdk/types/bash_tool_with_tool_call.rb +175 -0
  47. data/lib/vapi_server_sdk/types/bash_tool_with_tool_call_messages_item.rb +120 -0
  48. data/lib/vapi_server_sdk/types/byo_phone_number.rb +10 -1
  49. data/lib/vapi_server_sdk/types/byo_phone_number_status.rb +10 -0
  50. data/lib/vapi_server_sdk/types/call_ended_reason.rb +10 -1
  51. data/lib/vapi_server_sdk/types/cartesia_experimental_controls.rb +69 -0
  52. data/lib/vapi_server_sdk/types/cartesia_experimental_controls_emotion.rb +26 -0
  53. data/lib/vapi_server_sdk/types/cartesia_experimental_controls_speed.rb +11 -0
  54. data/lib/vapi_server_sdk/types/cartesia_voice.rb +24 -10
  55. data/lib/vapi_server_sdk/types/chat_completion_message.rb +80 -0
  56. data/lib/vapi_server_sdk/types/chat_completion_message_metadata.rb +94 -0
  57. data/lib/vapi_server_sdk/types/chat_completions_dto.rb +84 -0
  58. data/lib/vapi_server_sdk/types/client_inbound_message_end_call.rb +47 -0
  59. data/lib/vapi_server_sdk/types/client_inbound_message_message.rb +13 -0
  60. data/lib/vapi_server_sdk/types/client_inbound_message_transfer.rb +13 -3
  61. data/lib/vapi_server_sdk/types/client_message_conversation_update.rb +15 -2
  62. data/lib/vapi_server_sdk/types/client_message_hang.rb +22 -4
  63. data/lib/vapi_server_sdk/types/client_message_language_change_detected.rb +15 -3
  64. data/lib/vapi_server_sdk/types/client_message_message.rb +165 -181
  65. data/lib/vapi_server_sdk/types/client_message_metadata.rb +15 -3
  66. data/lib/vapi_server_sdk/types/client_message_model_output.rb +15 -3
  67. data/lib/vapi_server_sdk/types/client_message_speech_update.rb +11 -2
  68. data/lib/vapi_server_sdk/types/client_message_tool_calls.rb +15 -2
  69. data/lib/vapi_server_sdk/types/client_message_tool_calls_result.rb +15 -3
  70. data/lib/vapi_server_sdk/types/client_message_tool_calls_tool_with_tool_call_list_item.rb +116 -77
  71. data/lib/vapi_server_sdk/types/client_message_transcript.rb +12 -2
  72. data/lib/vapi_server_sdk/types/client_message_transcript_type.rb +10 -0
  73. data/lib/vapi_server_sdk/types/client_message_transfer_update.rb +11 -1
  74. data/lib/vapi_server_sdk/types/client_message_user_interrupted.rb +14 -4
  75. data/lib/vapi_server_sdk/types/client_message_voice_input.rb +15 -3
  76. data/lib/vapi_server_sdk/types/client_message_workflow_node_started.rb +67 -0
  77. data/lib/vapi_server_sdk/types/compliance_plan.rb +77 -0
  78. data/lib/vapi_server_sdk/types/computer_tool_with_tool_call.rb +199 -0
  79. data/lib/vapi_server_sdk/types/computer_tool_with_tool_call_messages_item.rb +120 -0
  80. data/lib/vapi_server_sdk/types/create_assistant_dto.rb +28 -14
  81. data/lib/vapi_server_sdk/types/create_assistant_dto_server_messages_item.rb +1 -0
  82. data/lib/vapi_server_sdk/types/create_azure_credential_dto_region.rb +4 -2
  83. data/lib/vapi_server_sdk/types/create_azure_open_ai_credential_dto_models_item.rb +1 -0
  84. data/lib/vapi_server_sdk/types/create_azure_open_ai_credential_dto_region.rb +4 -2
  85. data/lib/vapi_server_sdk/types/create_custom_knowledge_base_dto.rb +2 -4
  86. data/lib/vapi_server_sdk/types/create_test_suite_test_voice_dto.rb +90 -0
  87. data/lib/vapi_server_sdk/types/create_trieve_knowledge_base_dto.rb +34 -47
  88. data/lib/vapi_server_sdk/types/create_trieve_knowledge_base_dto_create_plan.rb +97 -0
  89. data/lib/vapi_server_sdk/types/create_vapi_phone_number_dto.rb +12 -4
  90. data/lib/vapi_server_sdk/types/create_workflow_dto.rb +80 -0
  91. data/lib/vapi_server_sdk/types/create_workflow_dto_nodes_item.rb +133 -0
  92. data/lib/vapi_server_sdk/types/custom_knowledge_base.rb +2 -4
  93. data/lib/vapi_server_sdk/types/deep_seek_model.rb +4 -3
  94. data/lib/vapi_server_sdk/types/deep_seek_model_model.rb +9 -0
  95. data/lib/vapi_server_sdk/types/deepgram_transcriber.rb +28 -2
  96. data/lib/vapi_server_sdk/types/deepgram_voice.rb +22 -2
  97. data/lib/vapi_server_sdk/types/edge.rb +87 -0
  98. data/lib/vapi_server_sdk/types/edge_condition.rb +107 -0
  99. data/lib/vapi_server_sdk/types/failed_edge_condition.rb +47 -0
  100. data/lib/vapi_server_sdk/types/fallback_cartesia_voice.rb +24 -9
  101. data/lib/vapi_server_sdk/types/fallback_deepgram_voice.rb +17 -2
  102. data/lib/vapi_server_sdk/types/fallback_play_ht_voice_model.rb +1 -0
  103. data/lib/vapi_server_sdk/types/fallback_rime_ai_voice_id_enum.rb +22 -20
  104. data/lib/vapi_server_sdk/types/fallback_rime_ai_voice_model.rb +1 -0
  105. data/lib/vapi_server_sdk/types/format_plan.rb +22 -2
  106. data/lib/vapi_server_sdk/types/format_plan_formatters_enabled_item.rb +22 -0
  107. data/lib/vapi_server_sdk/types/function_tool_with_tool_call.rb +1 -10
  108. data/lib/vapi_server_sdk/types/gather.rb +143 -0
  109. data/lib/vapi_server_sdk/types/ghl_tool_with_tool_call.rb +1 -9
  110. data/lib/vapi_server_sdk/types/google_model_model.rb +4 -0
  111. data/lib/vapi_server_sdk/types/groq_model_model.rb +1 -0
  112. data/lib/vapi_server_sdk/types/hangup.rb +67 -0
  113. data/lib/vapi_server_sdk/types/hook.rb +70 -0
  114. data/lib/vapi_server_sdk/types/hook_on.rb +9 -0
  115. data/lib/vapi_server_sdk/types/invite_user_dto.rb +11 -2
  116. data/lib/vapi_server_sdk/types/json_schema.rb +37 -2
  117. data/lib/vapi_server_sdk/types/log.rb +18 -18
  118. data/lib/vapi_server_sdk/types/logic_edge_condition.rb +55 -0
  119. data/lib/vapi_server_sdk/types/make_tool_with_tool_call.rb +1 -9
  120. data/lib/vapi_server_sdk/types/message_plan.rb +12 -2
  121. data/lib/vapi_server_sdk/types/open_ai_model.rb +1 -9
  122. data/lib/vapi_server_sdk/types/open_ai_model_fallback_models_item.rb +2 -0
  123. data/lib/vapi_server_sdk/types/open_ai_model_model.rb +2 -0
  124. data/lib/vapi_server_sdk/types/play_ht_voice_model.rb +1 -0
  125. data/lib/vapi_server_sdk/types/rime_ai_voice_id_enum.rb +22 -20
  126. data/lib/vapi_server_sdk/types/rime_ai_voice_model.rb +1 -0
  127. data/lib/vapi_server_sdk/types/say.rb +81 -0
  128. data/lib/vapi_server_sdk/types/say_hook.rb +81 -0
  129. data/lib/vapi_server_sdk/types/server.rb +17 -2
  130. data/lib/vapi_server_sdk/types/server_message_assistant_request.rb +12 -2
  131. data/lib/vapi_server_sdk/types/server_message_conversation_update.rb +12 -2
  132. data/lib/vapi_server_sdk/types/server_message_end_of_call_report.rb +11 -1
  133. data/lib/vapi_server_sdk/types/server_message_end_of_call_report_ended_reason.rb +10 -1
  134. data/lib/vapi_server_sdk/types/server_message_hang.rb +20 -2
  135. data/lib/vapi_server_sdk/types/server_message_knowledge_base_request.rb +14 -2
  136. data/lib/vapi_server_sdk/types/server_message_language_change_detected.rb +11 -1
  137. data/lib/vapi_server_sdk/types/server_message_message.rb +212 -237
  138. data/lib/vapi_server_sdk/types/server_message_model_output.rb +11 -1
  139. data/lib/vapi_server_sdk/types/server_message_phone_call_control.rb +18 -2
  140. data/lib/vapi_server_sdk/types/server_message_speech_update.rb +11 -1
  141. data/lib/vapi_server_sdk/types/server_message_status_update.rb +12 -2
  142. data/lib/vapi_server_sdk/types/server_message_status_update_ended_reason.rb +10 -1
  143. data/lib/vapi_server_sdk/types/server_message_tool_calls.rb +10 -2
  144. data/lib/vapi_server_sdk/types/server_message_tool_calls_tool_with_tool_call_list_item.rb +116 -77
  145. data/lib/vapi_server_sdk/types/server_message_transcript.rb +13 -2
  146. data/lib/vapi_server_sdk/types/server_message_transcript_type.rb +10 -0
  147. data/lib/vapi_server_sdk/types/server_message_transfer_destination_request.rb +12 -2
  148. data/lib/vapi_server_sdk/types/server_message_transfer_update.rb +11 -1
  149. data/lib/vapi_server_sdk/types/server_message_user_interrupted.rb +12 -2
  150. data/lib/vapi_server_sdk/types/server_message_voice_input.rb +11 -1
  151. data/lib/vapi_server_sdk/types/server_message_voice_request.rb +50 -2
  152. data/lib/vapi_server_sdk/types/stop_speaking_plan.rb +27 -2
  153. data/lib/vapi_server_sdk/types/subscription.rb +44 -14
  154. data/lib/vapi_server_sdk/types/sync_voice_library_dto_providers_item.rb +1 -0
  155. data/lib/vapi_server_sdk/types/test_suite.rb +104 -0
  156. data/lib/vapi_server_sdk/types/test_suite_run.rb +127 -0
  157. data/lib/vapi_server_sdk/types/test_suite_run_scorer_ai.rb +80 -0
  158. data/lib/vapi_server_sdk/types/test_suite_run_scorer_ai_result.rb +9 -0
  159. data/lib/vapi_server_sdk/types/test_suite_run_status.rb +10 -0
  160. data/lib/vapi_server_sdk/types/test_suite_run_test_attempt.rb +75 -0
  161. data/lib/vapi_server_sdk/types/{analytics_query_dto.rb → test_suite_run_test_attempt_call.rb} +19 -17
  162. data/lib/vapi_server_sdk/types/test_suite_run_test_result.rb +75 -0
  163. data/lib/vapi_server_sdk/types/test_suite_runs_paginated_response.rb +75 -0
  164. data/lib/vapi_server_sdk/types/test_suite_test_scorer_ai.rb +65 -0
  165. data/lib/vapi_server_sdk/types/test_suite_test_voice.rb +132 -0
  166. data/lib/vapi_server_sdk/types/test_suite_tests_paginated_response.rb +75 -0
  167. data/lib/vapi_server_sdk/types/test_suites_paginated_response.rb +75 -0
  168. data/lib/vapi_server_sdk/types/text_editor_tool_with_tool_call.rb +175 -0
  169. data/lib/vapi_server_sdk/types/text_editor_tool_with_tool_call_messages_item.rb +121 -0
  170. data/lib/vapi_server_sdk/types/time_range_step.rb +1 -0
  171. data/lib/vapi_server_sdk/types/tool_message_start.rb +18 -2
  172. data/lib/vapi_server_sdk/types/transfer.rb +74 -0
  173. data/lib/vapi_server_sdk/types/transfer_assistant_hook_action.rb +75 -0
  174. data/lib/vapi_server_sdk/types/{buy_phone_number_dto_fallback_destination.rb → transfer_assistant_hook_action_destination.rb} +9 -12
  175. data/lib/vapi_server_sdk/types/transfer_destination_assistant.rb +46 -0
  176. data/lib/vapi_server_sdk/types/transfer_plan.rb +37 -1
  177. data/lib/vapi_server_sdk/types/transfer_plan_mode.rb +4 -0
  178. data/lib/vapi_server_sdk/types/trieve_knowledge_base.rb +35 -44
  179. data/lib/vapi_server_sdk/types/{trieve_knowledge_base_vector_store_create_plan.rb → trieve_knowledge_base_chunk_plan.rb} +17 -11
  180. data/lib/vapi_server_sdk/types/trieve_knowledge_base_create.rb +59 -0
  181. data/lib/vapi_server_sdk/types/trieve_knowledge_base_create_plan.rb +96 -0
  182. data/lib/vapi_server_sdk/types/trieve_knowledge_base_import.rb +55 -0
  183. data/lib/vapi_server_sdk/types/{trieve_knowledge_base_vector_store_search_plan.rb → trieve_knowledge_base_search_plan.rb} +21 -12
  184. data/lib/vapi_server_sdk/types/{trieve_knowledge_base_vector_store_search_plan_search_type.rb → trieve_knowledge_base_search_plan_search_type.rb} +1 -1
  185. data/lib/vapi_server_sdk/types/twilio_phone_number.rb +11 -2
  186. data/lib/vapi_server_sdk/types/twilio_phone_number_status.rb +10 -0
  187. data/lib/vapi_server_sdk/types/update_azure_credential_dto_region.rb +4 -2
  188. data/lib/vapi_server_sdk/types/update_azure_open_ai_credential_dto_models_item.rb +1 -0
  189. data/lib/vapi_server_sdk/types/update_azure_open_ai_credential_dto_region.rb +4 -2
  190. data/lib/vapi_server_sdk/types/update_custom_knowledge_base_dto.rb +2 -4
  191. data/lib/vapi_server_sdk/types/update_test_suite_test_voice_dto.rb +90 -0
  192. data/lib/vapi_server_sdk/types/update_trieve_knowledge_base_dto.rb +34 -47
  193. data/lib/vapi_server_sdk/types/update_trieve_knowledge_base_dto_create_plan.rb +97 -0
  194. data/lib/vapi_server_sdk/types/vapi_model.rb +27 -1
  195. data/lib/vapi_server_sdk/types/vapi_phone_number.rb +29 -4
  196. data/lib/vapi_server_sdk/types/vapi_phone_number_status.rb +10 -0
  197. data/lib/vapi_server_sdk/types/vonage_phone_number.rb +11 -2
  198. data/lib/vapi_server_sdk/types/vonage_phone_number_status.rb +10 -0
  199. data/lib/vapi_server_sdk/types/workflow.rb +117 -0
  200. data/lib/vapi_server_sdk/types/workflow_nodes_item.rb +133 -0
  201. data/lib/vapi_server_sdk/types/xai_model.rb +4 -3
  202. data/lib/vapi_server_sdk/types/xai_model_model.rb +10 -0
  203. data/lib/vapi_server_sdk.rb +21 -0
  204. metadata +85 -11
  205. data/lib/vapi_server_sdk/types/buy_phone_number_dto.rb +0 -147
  206. data/lib/vapi_server_sdk/types/org_with_org_user.rb +0 -262
  207. data/lib/vapi_server_sdk/types/org_with_org_user_channel.rb +0 -10
  208. data/lib/vapi_server_sdk/types/org_with_org_user_role.rb +0 -9
@@ -15,6 +15,9 @@ module Vapi
15
15
  # - `call.phoneNumber`,
16
16
  # - `call.phoneNumberId`.
17
17
  attr_reader :phone_number
18
+ # @return [String] This is the type of the message. "voice-input" is sent when a generation is
19
+ # requested from voice provider.
20
+ attr_reader :type
18
21
  # @return [String] This is the ISO-8601 formatted timestamp of when the message was sent.
19
22
  attr_reader :timestamp
20
23
  # @return [Vapi::Artifact] This is a live version of the `call.artifact`.
@@ -54,6 +57,8 @@ module Vapi
54
57
  # This matches one of the following:
55
58
  # - `call.phoneNumber`,
56
59
  # - `call.phoneNumberId`.
60
+ # @param type [String] This is the type of the message. "voice-input" is sent when a generation is
61
+ # requested from voice provider.
57
62
  # @param timestamp [String] This is the ISO-8601 formatted timestamp of when the message was sent.
58
63
  # @param artifact [Vapi::Artifact] This is a live version of the `call.artifact`.
59
64
  # This matches what is stored on `call.artifact` after the call.
@@ -77,9 +82,10 @@ module Vapi
77
82
  # @param input [String] This is the voice input content
78
83
  # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
79
84
  # @return [Vapi::ServerMessageVoiceInput]
80
- def initialize(input:, phone_number: OMIT, timestamp: OMIT, artifact: OMIT, assistant: OMIT, customer: OMIT,
85
+ def initialize(type:, input:, phone_number: OMIT, timestamp: OMIT, artifact: OMIT, assistant: OMIT, customer: OMIT,
81
86
  call: OMIT, additional_properties: nil)
82
87
  @phone_number = phone_number if phone_number != OMIT
88
+ @type = type
83
89
  @timestamp = timestamp if timestamp != OMIT
84
90
  @artifact = artifact if artifact != OMIT
85
91
  @assistant = assistant if assistant != OMIT
@@ -89,6 +95,7 @@ module Vapi
89
95
  @additional_properties = additional_properties
90
96
  @_field_set = {
91
97
  "phoneNumber": phone_number,
98
+ "type": type,
92
99
  "timestamp": timestamp,
93
100
  "artifact": artifact,
94
101
  "assistant": assistant,
@@ -113,6 +120,7 @@ module Vapi
113
120
  phone_number = parsed_json["phoneNumber"].to_json
114
121
  phone_number = Vapi::ServerMessageVoiceInputPhoneNumber.from_json(json_object: phone_number)
115
122
  end
123
+ type = parsed_json["type"]
116
124
  timestamp = parsed_json["timestamp"]
117
125
  if parsed_json["artifact"].nil?
118
126
  artifact = nil
@@ -141,6 +149,7 @@ module Vapi
141
149
  input = parsed_json["input"]
142
150
  new(
143
151
  phone_number: phone_number,
152
+ type: type,
144
153
  timestamp: timestamp,
145
154
  artifact: artifact,
146
155
  assistant: assistant,
@@ -166,6 +175,7 @@ module Vapi
166
175
  # @return [Void]
167
176
  def self.validate_raw(obj:)
168
177
  obj.phone_number.nil? || Vapi::ServerMessageVoiceInputPhoneNumber.validate_raw(obj: obj.phone_number)
178
+ obj.type.is_a?(String) != false || raise("Passed value for field obj.type is not the expected type, validation failed.")
169
179
  obj.timestamp&.is_a?(String) != false || raise("Passed value for field obj.timestamp is not the expected type, validation failed.")
170
180
  obj.artifact.nil? || Vapi::Artifact.validate_raw(obj: obj.artifact)
171
181
  obj.assistant.nil? || Vapi::CreateAssistantDto.validate_raw(obj: obj.assistant)
@@ -15,6 +15,28 @@ module Vapi
15
15
  # - `call.phoneNumber`,
16
16
  # - `call.phoneNumberId`.
17
17
  attr_reader :phone_number
18
+ # @return [String] This is the type of the message. "voice-request" is sent when using
19
+ # `assistant.voice={ "type": "custom-voice" }`.
20
+ # Here is what the request will look like:
21
+ # POST https://{assistant.voice.server.url}
22
+ # Content-Type: application/json
23
+ # {
24
+ # "messsage": {
25
+ # "type": "voice-request",
26
+ # "text": "Hello, world!",
27
+ # "sampleRate": 24000,
28
+ # ...other metadata about the call...
29
+ # }
30
+ # }
31
+ # The expected response is 1-channel 16-bit raw PCM audio at the sample rate
32
+ # specified in the request. Here is how the response will be piped to the
33
+ # transport:
34
+ # ```
35
+ # response.on('data', (chunk: Buffer) => {
36
+ # outputStream.write(chunk);
37
+ # });
38
+ # ```
39
+ attr_reader :type
18
40
  # @return [String] This is the ISO-8601 formatted timestamp of when the message was sent.
19
41
  attr_reader :timestamp
20
42
  # @return [Vapi::Artifact] This is a live version of the `call.artifact`.
@@ -56,6 +78,27 @@ module Vapi
56
78
  # This matches one of the following:
57
79
  # - `call.phoneNumber`,
58
80
  # - `call.phoneNumberId`.
81
+ # @param type [String] This is the type of the message. "voice-request" is sent when using
82
+ # `assistant.voice={ "type": "custom-voice" }`.
83
+ # Here is what the request will look like:
84
+ # POST https://{assistant.voice.server.url}
85
+ # Content-Type: application/json
86
+ # {
87
+ # "messsage": {
88
+ # "type": "voice-request",
89
+ # "text": "Hello, world!",
90
+ # "sampleRate": 24000,
91
+ # ...other metadata about the call...
92
+ # }
93
+ # }
94
+ # The expected response is 1-channel 16-bit raw PCM audio at the sample rate
95
+ # specified in the request. Here is how the response will be piped to the
96
+ # transport:
97
+ # ```
98
+ # response.on('data', (chunk: Buffer) => {
99
+ # outputStream.write(chunk);
100
+ # });
101
+ # ```
59
102
  # @param timestamp [String] This is the ISO-8601 formatted timestamp of when the message was sent.
60
103
  # @param artifact [Vapi::Artifact] This is a live version of the `call.artifact`.
61
104
  # This matches what is stored on `call.artifact` after the call.
@@ -80,9 +123,10 @@ module Vapi
80
123
  # @param sample_rate [Float] This is the sample rate to be synthesized.
81
124
  # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
82
125
  # @return [Vapi::ServerMessageVoiceRequest]
83
- def initialize(text:, sample_rate:, phone_number: OMIT, timestamp: OMIT, artifact: OMIT, assistant: OMIT,
84
- customer: OMIT, call: OMIT, additional_properties: nil)
126
+ def initialize(type:, text:, sample_rate:, phone_number: OMIT, timestamp: OMIT, artifact: OMIT, assistant: OMIT, customer: OMIT,
127
+ call: OMIT, additional_properties: nil)
85
128
  @phone_number = phone_number if phone_number != OMIT
129
+ @type = type
86
130
  @timestamp = timestamp if timestamp != OMIT
87
131
  @artifact = artifact if artifact != OMIT
88
132
  @assistant = assistant if assistant != OMIT
@@ -93,6 +137,7 @@ module Vapi
93
137
  @additional_properties = additional_properties
94
138
  @_field_set = {
95
139
  "phoneNumber": phone_number,
140
+ "type": type,
96
141
  "timestamp": timestamp,
97
142
  "artifact": artifact,
98
143
  "assistant": assistant,
@@ -118,6 +163,7 @@ module Vapi
118
163
  phone_number = parsed_json["phoneNumber"].to_json
119
164
  phone_number = Vapi::ServerMessageVoiceRequestPhoneNumber.from_json(json_object: phone_number)
120
165
  end
166
+ type = parsed_json["type"]
121
167
  timestamp = parsed_json["timestamp"]
122
168
  if parsed_json["artifact"].nil?
123
169
  artifact = nil
@@ -147,6 +193,7 @@ module Vapi
147
193
  sample_rate = parsed_json["sampleRate"]
148
194
  new(
149
195
  phone_number: phone_number,
196
+ type: type,
150
197
  timestamp: timestamp,
151
198
  artifact: artifact,
152
199
  assistant: assistant,
@@ -173,6 +220,7 @@ module Vapi
173
220
  # @return [Void]
174
221
  def self.validate_raw(obj:)
175
222
  obj.phone_number.nil? || Vapi::ServerMessageVoiceRequestPhoneNumber.validate_raw(obj: obj.phone_number)
223
+ obj.type.is_a?(String) != false || raise("Passed value for field obj.type is not the expected type, validation failed.")
176
224
  obj.timestamp&.is_a?(String) != false || raise("Passed value for field obj.timestamp is not the expected type, validation failed.")
177
225
  obj.artifact.nil? || Vapi::Artifact.validate_raw(obj: obj.artifact)
178
226
  obj.assistant.nil? || Vapi::CreateAssistantDto.validate_raw(obj: obj.assistant)
@@ -32,6 +32,14 @@ module Vapi
32
32
  # Defaults to 1.
33
33
  # @default 1
34
34
  attr_reader :backoff_seconds
35
+ # @return [Array<String>] These are the phrases that will never interrupt the assistant, even if numWords
36
+ # threshold is met.
37
+ # These are typically acknowledgement or backchanneling phrases.
38
+ attr_reader :acknowledgement_phrases
39
+ # @return [Array<String>] These are the phrases that will always interrupt the assistant immediately,
40
+ # regardless of numWords.
41
+ # These are typically phrases indicating disagreement or desire to stop.
42
+ attr_reader :interruption_phrases
35
43
  # @return [OpenStruct] Additional properties unmapped to the current class definition
36
44
  attr_reader :additional_properties
37
45
  # @return [Object]
@@ -64,17 +72,28 @@ module Vapi
64
72
  # being interrupted.
65
73
  # Defaults to 1.
66
74
  # @default 1
75
+ # @param acknowledgement_phrases [Array<String>] These are the phrases that will never interrupt the assistant, even if numWords
76
+ # threshold is met.
77
+ # These are typically acknowledgement or backchanneling phrases.
78
+ # @param interruption_phrases [Array<String>] These are the phrases that will always interrupt the assistant immediately,
79
+ # regardless of numWords.
80
+ # These are typically phrases indicating disagreement or desire to stop.
67
81
  # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
68
82
  # @return [Vapi::StopSpeakingPlan]
69
- def initialize(num_words: OMIT, voice_seconds: OMIT, backoff_seconds: OMIT, additional_properties: nil)
83
+ def initialize(num_words: OMIT, voice_seconds: OMIT, backoff_seconds: OMIT, acknowledgement_phrases: OMIT,
84
+ interruption_phrases: OMIT, additional_properties: nil)
70
85
  @num_words = num_words if num_words != OMIT
71
86
  @voice_seconds = voice_seconds if voice_seconds != OMIT
72
87
  @backoff_seconds = backoff_seconds if backoff_seconds != OMIT
88
+ @acknowledgement_phrases = acknowledgement_phrases if acknowledgement_phrases != OMIT
89
+ @interruption_phrases = interruption_phrases if interruption_phrases != OMIT
73
90
  @additional_properties = additional_properties
74
91
  @_field_set = {
75
92
  "numWords": num_words,
76
93
  "voiceSeconds": voice_seconds,
77
- "backoffSeconds": backoff_seconds
94
+ "backoffSeconds": backoff_seconds,
95
+ "acknowledgementPhrases": acknowledgement_phrases,
96
+ "interruptionPhrases": interruption_phrases
78
97
  }.reject do |_k, v|
79
98
  v == OMIT
80
99
  end
@@ -90,10 +109,14 @@ module Vapi
90
109
  num_words = parsed_json["numWords"]
91
110
  voice_seconds = parsed_json["voiceSeconds"]
92
111
  backoff_seconds = parsed_json["backoffSeconds"]
112
+ acknowledgement_phrases = parsed_json["acknowledgementPhrases"]
113
+ interruption_phrases = parsed_json["interruptionPhrases"]
93
114
  new(
94
115
  num_words: num_words,
95
116
  voice_seconds: voice_seconds,
96
117
  backoff_seconds: backoff_seconds,
118
+ acknowledgement_phrases: acknowledgement_phrases,
119
+ interruption_phrases: interruption_phrases,
97
120
  additional_properties: struct
98
121
  )
99
122
  end
@@ -115,6 +138,8 @@ module Vapi
115
138
  obj.num_words&.is_a?(Float) != false || raise("Passed value for field obj.num_words is not the expected type, validation failed.")
116
139
  obj.voice_seconds&.is_a?(Float) != false || raise("Passed value for field obj.voice_seconds is not the expected type, validation failed.")
117
140
  obj.backoff_seconds&.is_a?(Float) != false || raise("Passed value for field obj.backoff_seconds is not the expected type, validation failed.")
141
+ obj.acknowledgement_phrases&.is_a?(Array) != false || raise("Passed value for field obj.acknowledgement_phrases is not the expected type, validation failed.")
142
+ obj.interruption_phrases&.is_a?(Array) != false || raise("Passed value for field obj.interruption_phrases is not the expected type, validation failed.")
118
143
  end
119
144
  end
120
145
  end
@@ -23,10 +23,15 @@ module Vapi
23
23
  # @return [String] This is the number of credits the subscription currently has.
24
24
  # Note: This is a string to avoid floating point precision issues.
25
25
  attr_reader :credits
26
- # @return [Float] This is the total concurrency limit for the subscription.
27
- attr_reader :concurrency_limit
26
+ # @return [Float] This is the total number of active calls (concurrency) across all orgs under
27
+ # this subscription.
28
+ attr_reader :concurrency_counter
28
29
  # @return [Float] This is the default concurrency limit for the subscription.
29
30
  attr_reader :concurrency_limit_included
31
+ # @return [Float] This is the number of free phone numbers the subscription has
32
+ attr_reader :phone_numbers_counter
33
+ # @return [Float] This is the maximum number of free phone numbers the subscription can have
34
+ attr_reader :phone_numbers_included
30
35
  # @return [Float] This is the purchased add-on concurrency limit for the subscription.
31
36
  attr_reader :concurrency_limit_purchased
32
37
  # @return [Float] This is the ID of the monthly job that charges for subscription add ons and
@@ -60,10 +65,13 @@ module Vapi
60
65
  attr_reader :referred_by_email
61
66
  # @return [Vapi::AutoReloadPlan] This is the auto reload plan configured for the subscription.
62
67
  attr_reader :auto_reload_plan
63
- # @return [Float] The number of minutes included in the subscription. Enterprise only.
68
+ # @return [Float] The number of minutes included in the subscription.
64
69
  attr_reader :minutes_included
65
- # @return [Float] The number of minutes used in the subscription. Enterprise only.
70
+ # @return [Float] The number of minutes used in the subscription.
66
71
  attr_reader :minutes_used
72
+ # @return [DateTime] This is the timestamp at which the number of monthly free minutes is scheduled
73
+ # to reset at.
74
+ attr_reader :minutes_used_next_reset_at
67
75
  # @return [Float] The per minute charge on minutes that exceed the included minutes. Enterprise
68
76
  # only.
69
77
  attr_reader :minutes_overage_cost
@@ -98,8 +106,11 @@ module Vapi
98
106
  # with past due payments.
99
107
  # @param credits [String] This is the number of credits the subscription currently has.
100
108
  # Note: This is a string to avoid floating point precision issues.
101
- # @param concurrency_limit [Float] This is the total concurrency limit for the subscription.
109
+ # @param concurrency_counter [Float] This is the total number of active calls (concurrency) across all orgs under
110
+ # this subscription.
102
111
  # @param concurrency_limit_included [Float] This is the default concurrency limit for the subscription.
112
+ # @param phone_numbers_counter [Float] This is the number of free phone numbers the subscription has
113
+ # @param phone_numbers_included [Float] This is the maximum number of free phone numbers the subscription can have
103
114
  # @param concurrency_limit_purchased [Float] This is the purchased add-on concurrency limit for the subscription.
104
115
  # @param monthly_charge_schedule_id [Float] This is the ID of the monthly job that charges for subscription add ons and
105
116
  # phone numbers.
@@ -120,8 +131,10 @@ module Vapi
120
131
  # @param stripe_customer_email [String] This is the customer's email on Stripe.
121
132
  # @param referred_by_email [String] This is the email of the referrer for the subscription.
122
133
  # @param auto_reload_plan [Vapi::AutoReloadPlan] This is the auto reload plan configured for the subscription.
123
- # @param minutes_included [Float] The number of minutes included in the subscription. Enterprise only.
124
- # @param minutes_used [Float] The number of minutes used in the subscription. Enterprise only.
134
+ # @param minutes_included [Float] The number of minutes included in the subscription.
135
+ # @param minutes_used [Float] The number of minutes used in the subscription.
136
+ # @param minutes_used_next_reset_at [DateTime] This is the timestamp at which the number of monthly free minutes is scheduled
137
+ # to reset at.
125
138
  # @param minutes_overage_cost [Float] The per minute charge on minutes that exceed the included minutes. Enterprise
126
139
  # only.
127
140
  # @param providers_included [Array<String>] The list of providers included in the subscription. Enterprise only.
@@ -135,16 +148,18 @@ module Vapi
135
148
  # @param coupon_usage_left [String] This is the number of credits left obtained from a coupon.
136
149
  # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
137
150
  # @return [Vapi::Subscription]
138
- def initialize(id:, created_at:, updated_at:, type:, status:, credits:, concurrency_limit:,
139
- concurrency_limit_included:, concurrency_limit_purchased:, monthly_charge_schedule_id: OMIT, monthly_credit_check_schedule_id: OMIT, stripe_customer_id: OMIT, stripe_payment_method_id: OMIT, slack_support_enabled: OMIT, slack_channel_id: OMIT, hipaa_enabled: OMIT, hipaa_common_paper_agreement_id: OMIT, stripe_payment_method_fingerprint: OMIT, stripe_customer_email: OMIT, referred_by_email: OMIT, auto_reload_plan: OMIT, minutes_included: OMIT, minutes_used: OMIT, minutes_overage_cost: OMIT, providers_included: OMIT, outbound_calls_daily_limit: OMIT, outbound_calls_counter: OMIT, outbound_calls_counter_next_reset_at: OMIT, coupon_ids: OMIT, coupon_usage_left: OMIT, additional_properties: nil)
151
+ def initialize(id:, created_at:, updated_at:, type:, status:, credits:, concurrency_counter:,
152
+ concurrency_limit_included:, concurrency_limit_purchased:, phone_numbers_counter: OMIT, phone_numbers_included: OMIT, monthly_charge_schedule_id: OMIT, monthly_credit_check_schedule_id: OMIT, stripe_customer_id: OMIT, stripe_payment_method_id: OMIT, slack_support_enabled: OMIT, slack_channel_id: OMIT, hipaa_enabled: OMIT, hipaa_common_paper_agreement_id: OMIT, stripe_payment_method_fingerprint: OMIT, stripe_customer_email: OMIT, referred_by_email: OMIT, auto_reload_plan: OMIT, minutes_included: OMIT, minutes_used: OMIT, minutes_used_next_reset_at: OMIT, minutes_overage_cost: OMIT, providers_included: OMIT, outbound_calls_daily_limit: OMIT, outbound_calls_counter: OMIT, outbound_calls_counter_next_reset_at: OMIT, coupon_ids: OMIT, coupon_usage_left: OMIT, additional_properties: nil)
140
153
  @id = id
141
154
  @created_at = created_at
142
155
  @updated_at = updated_at
143
156
  @type = type
144
157
  @status = status
145
158
  @credits = credits
146
- @concurrency_limit = concurrency_limit
159
+ @concurrency_counter = concurrency_counter
147
160
  @concurrency_limit_included = concurrency_limit_included
161
+ @phone_numbers_counter = phone_numbers_counter if phone_numbers_counter != OMIT
162
+ @phone_numbers_included = phone_numbers_included if phone_numbers_included != OMIT
148
163
  @concurrency_limit_purchased = concurrency_limit_purchased
149
164
  @monthly_charge_schedule_id = monthly_charge_schedule_id if monthly_charge_schedule_id != OMIT
150
165
  @monthly_credit_check_schedule_id = monthly_credit_check_schedule_id if monthly_credit_check_schedule_id != OMIT
@@ -162,6 +177,7 @@ module Vapi
162
177
  @auto_reload_plan = auto_reload_plan if auto_reload_plan != OMIT
163
178
  @minutes_included = minutes_included if minutes_included != OMIT
164
179
  @minutes_used = minutes_used if minutes_used != OMIT
180
+ @minutes_used_next_reset_at = minutes_used_next_reset_at if minutes_used_next_reset_at != OMIT
165
181
  @minutes_overage_cost = minutes_overage_cost if minutes_overage_cost != OMIT
166
182
  @providers_included = providers_included if providers_included != OMIT
167
183
  @outbound_calls_daily_limit = outbound_calls_daily_limit if outbound_calls_daily_limit != OMIT
@@ -179,8 +195,10 @@ module Vapi
179
195
  "type": type,
180
196
  "status": status,
181
197
  "credits": credits,
182
- "concurrencyLimit": concurrency_limit,
198
+ "concurrencyCounter": concurrency_counter,
183
199
  "concurrencyLimitIncluded": concurrency_limit_included,
200
+ "phoneNumbersCounter": phone_numbers_counter,
201
+ "phoneNumbersIncluded": phone_numbers_included,
184
202
  "concurrencyLimitPurchased": concurrency_limit_purchased,
185
203
  "monthlyChargeScheduleId": monthly_charge_schedule_id,
186
204
  "monthlyCreditCheckScheduleId": monthly_credit_check_schedule_id,
@@ -196,6 +214,7 @@ module Vapi
196
214
  "autoReloadPlan": auto_reload_plan,
197
215
  "minutesIncluded": minutes_included,
198
216
  "minutesUsed": minutes_used,
217
+ "minutesUsedNextResetAt": minutes_used_next_reset_at,
199
218
  "minutesOverageCost": minutes_overage_cost,
200
219
  "providersIncluded": providers_included,
201
220
  "outboundCallsDailyLimit": outbound_calls_daily_limit,
@@ -221,8 +240,10 @@ module Vapi
221
240
  type = parsed_json["type"]
222
241
  status = parsed_json["status"]
223
242
  credits = parsed_json["credits"]
224
- concurrency_limit = parsed_json["concurrencyLimit"]
243
+ concurrency_counter = parsed_json["concurrencyCounter"]
225
244
  concurrency_limit_included = parsed_json["concurrencyLimitIncluded"]
245
+ phone_numbers_counter = parsed_json["phoneNumbersCounter"]
246
+ phone_numbers_included = parsed_json["phoneNumbersIncluded"]
226
247
  concurrency_limit_purchased = parsed_json["concurrencyLimitPurchased"]
227
248
  monthly_charge_schedule_id = parsed_json["monthlyChargeScheduleId"]
228
249
  monthly_credit_check_schedule_id = parsed_json["monthlyCreditCheckScheduleId"]
@@ -243,6 +264,9 @@ module Vapi
243
264
  end
244
265
  minutes_included = parsed_json["minutesIncluded"]
245
266
  minutes_used = parsed_json["minutesUsed"]
267
+ minutes_used_next_reset_at = unless parsed_json["minutesUsedNextResetAt"].nil?
268
+ DateTime.parse(parsed_json["minutesUsedNextResetAt"])
269
+ end
246
270
  minutes_overage_cost = parsed_json["minutesOverageCost"]
247
271
  providers_included = parsed_json["providersIncluded"]
248
272
  outbound_calls_daily_limit = parsed_json["outboundCallsDailyLimit"]
@@ -259,8 +283,10 @@ module Vapi
259
283
  type: type,
260
284
  status: status,
261
285
  credits: credits,
262
- concurrency_limit: concurrency_limit,
286
+ concurrency_counter: concurrency_counter,
263
287
  concurrency_limit_included: concurrency_limit_included,
288
+ phone_numbers_counter: phone_numbers_counter,
289
+ phone_numbers_included: phone_numbers_included,
264
290
  concurrency_limit_purchased: concurrency_limit_purchased,
265
291
  monthly_charge_schedule_id: monthly_charge_schedule_id,
266
292
  monthly_credit_check_schedule_id: monthly_credit_check_schedule_id,
@@ -276,6 +302,7 @@ module Vapi
276
302
  auto_reload_plan: auto_reload_plan,
277
303
  minutes_included: minutes_included,
278
304
  minutes_used: minutes_used,
305
+ minutes_used_next_reset_at: minutes_used_next_reset_at,
279
306
  minutes_overage_cost: minutes_overage_cost,
280
307
  providers_included: providers_included,
281
308
  outbound_calls_daily_limit: outbound_calls_daily_limit,
@@ -307,8 +334,10 @@ module Vapi
307
334
  obj.type.is_a?(Vapi::SubscriptionType) != false || raise("Passed value for field obj.type is not the expected type, validation failed.")
308
335
  obj.status.is_a?(Vapi::SubscriptionStatus) != false || raise("Passed value for field obj.status is not the expected type, validation failed.")
309
336
  obj.credits.is_a?(String) != false || raise("Passed value for field obj.credits is not the expected type, validation failed.")
310
- obj.concurrency_limit.is_a?(Float) != false || raise("Passed value for field obj.concurrency_limit is not the expected type, validation failed.")
337
+ obj.concurrency_counter.is_a?(Float) != false || raise("Passed value for field obj.concurrency_counter is not the expected type, validation failed.")
311
338
  obj.concurrency_limit_included.is_a?(Float) != false || raise("Passed value for field obj.concurrency_limit_included is not the expected type, validation failed.")
339
+ obj.phone_numbers_counter&.is_a?(Float) != false || raise("Passed value for field obj.phone_numbers_counter is not the expected type, validation failed.")
340
+ obj.phone_numbers_included&.is_a?(Float) != false || raise("Passed value for field obj.phone_numbers_included is not the expected type, validation failed.")
312
341
  obj.concurrency_limit_purchased.is_a?(Float) != false || raise("Passed value for field obj.concurrency_limit_purchased is not the expected type, validation failed.")
313
342
  obj.monthly_charge_schedule_id&.is_a?(Float) != false || raise("Passed value for field obj.monthly_charge_schedule_id is not the expected type, validation failed.")
314
343
  obj.monthly_credit_check_schedule_id&.is_a?(Float) != false || raise("Passed value for field obj.monthly_credit_check_schedule_id is not the expected type, validation failed.")
@@ -324,6 +353,7 @@ module Vapi
324
353
  obj.auto_reload_plan.nil? || Vapi::AutoReloadPlan.validate_raw(obj: obj.auto_reload_plan)
325
354
  obj.minutes_included&.is_a?(Float) != false || raise("Passed value for field obj.minutes_included is not the expected type, validation failed.")
326
355
  obj.minutes_used&.is_a?(Float) != false || raise("Passed value for field obj.minutes_used is not the expected type, validation failed.")
356
+ obj.minutes_used_next_reset_at&.is_a?(DateTime) != false || raise("Passed value for field obj.minutes_used_next_reset_at is not the expected type, validation failed.")
327
357
  obj.minutes_overage_cost&.is_a?(Float) != false || raise("Passed value for field obj.minutes_overage_cost is not the expected type, validation failed.")
328
358
  obj.providers_included&.is_a?(Array) != false || raise("Passed value for field obj.providers_included is not the expected type, validation failed.")
329
359
  obj.outbound_calls_daily_limit&.is_a?(Float) != false || raise("Passed value for field obj.outbound_calls_daily_limit is not the expected type, validation failed.")
@@ -9,6 +9,7 @@ module Vapi
9
9
  DEEPGRAM = "deepgram"
10
10
  LMNT = "lmnt"
11
11
  NEETS = "neets"
12
+ NEUPHONIC = "neuphonic"
12
13
  OPENAI = "openai"
13
14
  PLAYHT = "playht"
14
15
  RIME_AI = "rime-ai"
@@ -0,0 +1,104 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "date"
4
+ require "ostruct"
5
+ require "json"
6
+
7
+ module Vapi
8
+ class TestSuite
9
+ # @return [String] This is the unique identifier for the test suite.
10
+ attr_reader :id
11
+ # @return [String] This is the unique identifier for the org that this test suite belongs to.
12
+ attr_reader :org_id
13
+ # @return [DateTime] This is the ISO 8601 date-time string of when the test suite was created.
14
+ attr_reader :created_at
15
+ # @return [DateTime] This is the ISO 8601 date-time string of when the test suite was last updated.
16
+ attr_reader :updated_at
17
+ # @return [String] This is the name of the test suite.
18
+ attr_reader :name
19
+ # @return [String] This is the phone number ID associated with this test suite.
20
+ attr_reader :phone_number_id
21
+ # @return [OpenStruct] Additional properties unmapped to the current class definition
22
+ attr_reader :additional_properties
23
+ # @return [Object]
24
+ attr_reader :_field_set
25
+ protected :_field_set
26
+
27
+ OMIT = Object.new
28
+
29
+ # @param id [String] This is the unique identifier for the test suite.
30
+ # @param org_id [String] This is the unique identifier for the org that this test suite belongs to.
31
+ # @param created_at [DateTime] This is the ISO 8601 date-time string of when the test suite was created.
32
+ # @param updated_at [DateTime] This is the ISO 8601 date-time string of when the test suite was last updated.
33
+ # @param name [String] This is the name of the test suite.
34
+ # @param phone_number_id [String] This is the phone number ID associated with this test suite.
35
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
36
+ # @return [Vapi::TestSuite]
37
+ def initialize(id:, org_id:, created_at:, updated_at:, name: OMIT, phone_number_id: OMIT,
38
+ additional_properties: nil)
39
+ @id = id
40
+ @org_id = org_id
41
+ @created_at = created_at
42
+ @updated_at = updated_at
43
+ @name = name if name != OMIT
44
+ @phone_number_id = phone_number_id if phone_number_id != OMIT
45
+ @additional_properties = additional_properties
46
+ @_field_set = {
47
+ "id": id,
48
+ "orgId": org_id,
49
+ "createdAt": created_at,
50
+ "updatedAt": updated_at,
51
+ "name": name,
52
+ "phoneNumberId": phone_number_id
53
+ }.reject do |_k, v|
54
+ v == OMIT
55
+ end
56
+ end
57
+
58
+ # Deserialize a JSON object to an instance of TestSuite
59
+ #
60
+ # @param json_object [String]
61
+ # @return [Vapi::TestSuite]
62
+ def self.from_json(json_object:)
63
+ struct = JSON.parse(json_object, object_class: OpenStruct)
64
+ parsed_json = JSON.parse(json_object)
65
+ id = parsed_json["id"]
66
+ org_id = parsed_json["orgId"]
67
+ created_at = (DateTime.parse(parsed_json["createdAt"]) unless parsed_json["createdAt"].nil?)
68
+ updated_at = (DateTime.parse(parsed_json["updatedAt"]) unless parsed_json["updatedAt"].nil?)
69
+ name = parsed_json["name"]
70
+ phone_number_id = parsed_json["phoneNumberId"]
71
+ new(
72
+ id: id,
73
+ org_id: org_id,
74
+ created_at: created_at,
75
+ updated_at: updated_at,
76
+ name: name,
77
+ phone_number_id: phone_number_id,
78
+ additional_properties: struct
79
+ )
80
+ end
81
+
82
+ # Serialize an instance of TestSuite to a JSON object
83
+ #
84
+ # @return [String]
85
+ def to_json(*_args)
86
+ @_field_set&.to_json
87
+ end
88
+
89
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
90
+ # hash and check each fields type against the current object's property
91
+ # definitions.
92
+ #
93
+ # @param obj [Object]
94
+ # @return [Void]
95
+ def self.validate_raw(obj:)
96
+ obj.id.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
97
+ obj.org_id.is_a?(String) != false || raise("Passed value for field obj.org_id is not the expected type, validation failed.")
98
+ obj.created_at.is_a?(DateTime) != false || raise("Passed value for field obj.created_at is not the expected type, validation failed.")
99
+ obj.updated_at.is_a?(DateTime) != false || raise("Passed value for field obj.updated_at is not the expected type, validation failed.")
100
+ obj.name&.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
101
+ obj.phone_number_id&.is_a?(String) != false || raise("Passed value for field obj.phone_number_id is not the expected type, validation failed.")
102
+ end
103
+ end
104
+ end
@@ -0,0 +1,127 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "test_suite_run_status"
4
+ require "date"
5
+ require_relative "test_suite_run_test_result"
6
+ require "ostruct"
7
+ require "json"
8
+
9
+ module Vapi
10
+ class TestSuiteRun
11
+ # @return [Vapi::TestSuiteRunStatus] This is the current status of the test suite run.
12
+ attr_reader :status
13
+ # @return [String] This is the unique identifier for the test suite run.
14
+ attr_reader :id
15
+ # @return [String] This is the unique identifier for the organization this run belongs to.
16
+ attr_reader :org_id
17
+ # @return [String] This is the unique identifier for the test suite this run belongs to.
18
+ attr_reader :test_suite_id
19
+ # @return [DateTime] This is the ISO 8601 date-time string of when the test suite run was created.
20
+ attr_reader :created_at
21
+ # @return [DateTime] This is the ISO 8601 date-time string of when the test suite run was last
22
+ # updated.
23
+ attr_reader :updated_at
24
+ # @return [Array<Vapi::TestSuiteRunTestResult>] These are the results of the tests in this test suite run.
25
+ attr_reader :test_results
26
+ # @return [String] This is the name of the test suite run.
27
+ attr_reader :name
28
+ # @return [OpenStruct] Additional properties unmapped to the current class definition
29
+ attr_reader :additional_properties
30
+ # @return [Object]
31
+ attr_reader :_field_set
32
+ protected :_field_set
33
+
34
+ OMIT = Object.new
35
+
36
+ # @param status [Vapi::TestSuiteRunStatus] This is the current status of the test suite run.
37
+ # @param id [String] This is the unique identifier for the test suite run.
38
+ # @param org_id [String] This is the unique identifier for the organization this run belongs to.
39
+ # @param test_suite_id [String] This is the unique identifier for the test suite this run belongs to.
40
+ # @param created_at [DateTime] This is the ISO 8601 date-time string of when the test suite run was created.
41
+ # @param updated_at [DateTime] This is the ISO 8601 date-time string of when the test suite run was last
42
+ # updated.
43
+ # @param test_results [Array<Vapi::TestSuiteRunTestResult>] These are the results of the tests in this test suite run.
44
+ # @param name [String] This is the name of the test suite run.
45
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
46
+ # @return [Vapi::TestSuiteRun]
47
+ def initialize(status:, id:, org_id:, test_suite_id:, created_at:, updated_at:, test_results:, name: OMIT,
48
+ additional_properties: nil)
49
+ @status = status
50
+ @id = id
51
+ @org_id = org_id
52
+ @test_suite_id = test_suite_id
53
+ @created_at = created_at
54
+ @updated_at = updated_at
55
+ @test_results = test_results
56
+ @name = name if name != OMIT
57
+ @additional_properties = additional_properties
58
+ @_field_set = {
59
+ "status": status,
60
+ "id": id,
61
+ "orgId": org_id,
62
+ "testSuiteId": test_suite_id,
63
+ "createdAt": created_at,
64
+ "updatedAt": updated_at,
65
+ "testResults": test_results,
66
+ "name": name
67
+ }.reject do |_k, v|
68
+ v == OMIT
69
+ end
70
+ end
71
+
72
+ # Deserialize a JSON object to an instance of TestSuiteRun
73
+ #
74
+ # @param json_object [String]
75
+ # @return [Vapi::TestSuiteRun]
76
+ def self.from_json(json_object:)
77
+ struct = JSON.parse(json_object, object_class: OpenStruct)
78
+ parsed_json = JSON.parse(json_object)
79
+ status = parsed_json["status"]
80
+ id = parsed_json["id"]
81
+ org_id = parsed_json["orgId"]
82
+ test_suite_id = parsed_json["testSuiteId"]
83
+ created_at = (DateTime.parse(parsed_json["createdAt"]) unless parsed_json["createdAt"].nil?)
84
+ updated_at = (DateTime.parse(parsed_json["updatedAt"]) unless parsed_json["updatedAt"].nil?)
85
+ test_results = parsed_json["testResults"]&.map do |item|
86
+ item = item.to_json
87
+ Vapi::TestSuiteRunTestResult.from_json(json_object: item)
88
+ end
89
+ name = parsed_json["name"]
90
+ new(
91
+ status: status,
92
+ id: id,
93
+ org_id: org_id,
94
+ test_suite_id: test_suite_id,
95
+ created_at: created_at,
96
+ updated_at: updated_at,
97
+ test_results: test_results,
98
+ name: name,
99
+ additional_properties: struct
100
+ )
101
+ end
102
+
103
+ # Serialize an instance of TestSuiteRun to a JSON object
104
+ #
105
+ # @return [String]
106
+ def to_json(*_args)
107
+ @_field_set&.to_json
108
+ end
109
+
110
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
111
+ # hash and check each fields type against the current object's property
112
+ # definitions.
113
+ #
114
+ # @param obj [Object]
115
+ # @return [Void]
116
+ def self.validate_raw(obj:)
117
+ obj.status.is_a?(Vapi::TestSuiteRunStatus) != false || raise("Passed value for field obj.status is not the expected type, validation failed.")
118
+ obj.id.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
119
+ obj.org_id.is_a?(String) != false || raise("Passed value for field obj.org_id is not the expected type, validation failed.")
120
+ obj.test_suite_id.is_a?(String) != false || raise("Passed value for field obj.test_suite_id is not the expected type, validation failed.")
121
+ obj.created_at.is_a?(DateTime) != false || raise("Passed value for field obj.created_at is not the expected type, validation failed.")
122
+ obj.updated_at.is_a?(DateTime) != false || raise("Passed value for field obj.updated_at is not the expected type, validation failed.")
123
+ obj.test_results.is_a?(Array) != false || raise("Passed value for field obj.test_results is not the expected type, validation failed.")
124
+ obj.name&.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
125
+ end
126
+ end
127
+ end