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
@@ -0,0 +1,80 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "test_suite_run_scorer_ai_result"
4
+ require "ostruct"
5
+ require "json"
6
+
7
+ module Vapi
8
+ class TestSuiteRunScorerAi
9
+ # @return [String] This is the type of the scorer, which must be AI.
10
+ attr_reader :type
11
+ # @return [Vapi::TestSuiteRunScorerAiResult] This is the result of the test suite.
12
+ attr_reader :result
13
+ # @return [String] This is the reasoning provided by the AI scorer.
14
+ attr_reader :reasoning
15
+ # @return [String] This is the rubric used by the AI scorer.
16
+ attr_reader :rubric
17
+ # @return [OpenStruct] Additional properties unmapped to the current class definition
18
+ attr_reader :additional_properties
19
+ # @return [Object]
20
+ attr_reader :_field_set
21
+ protected :_field_set
22
+
23
+ OMIT = Object.new
24
+
25
+ # @param type [String] This is the type of the scorer, which must be AI.
26
+ # @param result [Vapi::TestSuiteRunScorerAiResult] This is the result of the test suite.
27
+ # @param reasoning [String] This is the reasoning provided by the AI scorer.
28
+ # @param rubric [String] This is the rubric used by the AI scorer.
29
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
30
+ # @return [Vapi::TestSuiteRunScorerAi]
31
+ def initialize(type:, result:, reasoning:, rubric:, additional_properties: nil)
32
+ @type = type
33
+ @result = result
34
+ @reasoning = reasoning
35
+ @rubric = rubric
36
+ @additional_properties = additional_properties
37
+ @_field_set = { "type": type, "result": result, "reasoning": reasoning, "rubric": rubric }
38
+ end
39
+
40
+ # Deserialize a JSON object to an instance of TestSuiteRunScorerAi
41
+ #
42
+ # @param json_object [String]
43
+ # @return [Vapi::TestSuiteRunScorerAi]
44
+ def self.from_json(json_object:)
45
+ struct = JSON.parse(json_object, object_class: OpenStruct)
46
+ parsed_json = JSON.parse(json_object)
47
+ type = parsed_json["type"]
48
+ result = parsed_json["result"]
49
+ reasoning = parsed_json["reasoning"]
50
+ rubric = parsed_json["rubric"]
51
+ new(
52
+ type: type,
53
+ result: result,
54
+ reasoning: reasoning,
55
+ rubric: rubric,
56
+ additional_properties: struct
57
+ )
58
+ end
59
+
60
+ # Serialize an instance of TestSuiteRunScorerAi to a JSON object
61
+ #
62
+ # @return [String]
63
+ def to_json(*_args)
64
+ @_field_set&.to_json
65
+ end
66
+
67
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
68
+ # hash and check each fields type against the current object's property
69
+ # definitions.
70
+ #
71
+ # @param obj [Object]
72
+ # @return [Void]
73
+ def self.validate_raw(obj:)
74
+ obj.type.is_a?(String) != false || raise("Passed value for field obj.type is not the expected type, validation failed.")
75
+ obj.result.is_a?(Vapi::TestSuiteRunScorerAiResult) != false || raise("Passed value for field obj.result is not the expected type, validation failed.")
76
+ obj.reasoning.is_a?(String) != false || raise("Passed value for field obj.reasoning is not the expected type, validation failed.")
77
+ obj.rubric.is_a?(String) != false || raise("Passed value for field obj.rubric is not the expected type, validation failed.")
78
+ end
79
+ end
80
+ end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Vapi
4
+ # This is the result of the test suite.
5
+ class TestSuiteRunScorerAiResult
6
+ PASS = "pass"
7
+ FAIL = "fail"
8
+ end
9
+ end
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Vapi
4
+ # This is the current status of the test suite run.
5
+ class TestSuiteRunStatus
6
+ QUEUED = "queued"
7
+ IN_PROGRESS = "in-progress"
8
+ COMPLETED = "completed"
9
+ end
10
+ end
@@ -0,0 +1,75 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "test_suite_run_scorer_ai"
4
+ require_relative "test_suite_run_test_attempt_call"
5
+ require "ostruct"
6
+ require "json"
7
+
8
+ module Vapi
9
+ class TestSuiteRunTestAttempt
10
+ # @return [Array<Vapi::TestSuiteRunScorerAi>] These are the results of the scorers used to evaluate the test attempt.
11
+ attr_reader :scorer_results
12
+ # @return [Vapi::TestSuiteRunTestAttemptCall] This is the call made during the test attempt.
13
+ attr_reader :call
14
+ # @return [OpenStruct] Additional properties unmapped to the current class definition
15
+ attr_reader :additional_properties
16
+ # @return [Object]
17
+ attr_reader :_field_set
18
+ protected :_field_set
19
+
20
+ OMIT = Object.new
21
+
22
+ # @param scorer_results [Array<Vapi::TestSuiteRunScorerAi>] These are the results of the scorers used to evaluate the test attempt.
23
+ # @param call [Vapi::TestSuiteRunTestAttemptCall] This is the call made during the test attempt.
24
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
25
+ # @return [Vapi::TestSuiteRunTestAttempt]
26
+ def initialize(scorer_results:, call:, additional_properties: nil)
27
+ @scorer_results = scorer_results
28
+ @call = call
29
+ @additional_properties = additional_properties
30
+ @_field_set = { "scorerResults": scorer_results, "call": call }
31
+ end
32
+
33
+ # Deserialize a JSON object to an instance of TestSuiteRunTestAttempt
34
+ #
35
+ # @param json_object [String]
36
+ # @return [Vapi::TestSuiteRunTestAttempt]
37
+ def self.from_json(json_object:)
38
+ struct = JSON.parse(json_object, object_class: OpenStruct)
39
+ parsed_json = JSON.parse(json_object)
40
+ scorer_results = parsed_json["scorerResults"]&.map do |item|
41
+ item = item.to_json
42
+ Vapi::TestSuiteRunScorerAi.from_json(json_object: item)
43
+ end
44
+ if parsed_json["call"].nil?
45
+ call = nil
46
+ else
47
+ call = parsed_json["call"].to_json
48
+ call = Vapi::TestSuiteRunTestAttemptCall.from_json(json_object: call)
49
+ end
50
+ new(
51
+ scorer_results: scorer_results,
52
+ call: call,
53
+ additional_properties: struct
54
+ )
55
+ end
56
+
57
+ # Serialize an instance of TestSuiteRunTestAttempt to a JSON object
58
+ #
59
+ # @return [String]
60
+ def to_json(*_args)
61
+ @_field_set&.to_json
62
+ end
63
+
64
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
65
+ # hash and check each fields type against the current object's property
66
+ # definitions.
67
+ #
68
+ # @param obj [Object]
69
+ # @return [Void]
70
+ def self.validate_raw(obj:)
71
+ obj.scorer_results.is_a?(Array) != false || raise("Passed value for field obj.scorer_results is not the expected type, validation failed.")
72
+ Vapi::TestSuiteRunTestAttemptCall.validate_raw(obj: obj.call)
73
+ end
74
+ end
75
+ end
@@ -1,13 +1,13 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative "analytics_query"
3
+ require_relative "artifact"
4
4
  require "ostruct"
5
5
  require "json"
6
6
 
7
7
  module Vapi
8
- class AnalyticsQueryDto
9
- # @return [Array<Vapi::AnalyticsQuery>] This is the list of metric queries you want to perform.
10
- attr_reader :queries
8
+ class TestSuiteRunTestAttemptCall
9
+ # @return [Vapi::Artifact] This is the artifact associated with the call.
10
+ attr_reader :artifact
11
11
  # @return [OpenStruct] Additional properties unmapped to the current class definition
12
12
  attr_reader :additional_properties
13
13
  # @return [Object]
@@ -16,30 +16,32 @@ module Vapi
16
16
 
17
17
  OMIT = Object.new
18
18
 
19
- # @param queries [Array<Vapi::AnalyticsQuery>] This is the list of metric queries you want to perform.
19
+ # @param artifact [Vapi::Artifact] This is the artifact associated with the call.
20
20
  # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
21
- # @return [Vapi::AnalyticsQueryDto]
22
- def initialize(queries:, additional_properties: nil)
23
- @queries = queries
21
+ # @return [Vapi::TestSuiteRunTestAttemptCall]
22
+ def initialize(artifact:, additional_properties: nil)
23
+ @artifact = artifact
24
24
  @additional_properties = additional_properties
25
- @_field_set = { "queries": queries }
25
+ @_field_set = { "artifact": artifact }
26
26
  end
27
27
 
28
- # Deserialize a JSON object to an instance of AnalyticsQueryDto
28
+ # Deserialize a JSON object to an instance of TestSuiteRunTestAttemptCall
29
29
  #
30
30
  # @param json_object [String]
31
- # @return [Vapi::AnalyticsQueryDto]
31
+ # @return [Vapi::TestSuiteRunTestAttemptCall]
32
32
  def self.from_json(json_object:)
33
33
  struct = JSON.parse(json_object, object_class: OpenStruct)
34
34
  parsed_json = JSON.parse(json_object)
35
- queries = parsed_json["queries"]&.map do |item|
36
- item = item.to_json
37
- Vapi::AnalyticsQuery.from_json(json_object: item)
35
+ if parsed_json["artifact"].nil?
36
+ artifact = nil
37
+ else
38
+ artifact = parsed_json["artifact"].to_json
39
+ artifact = Vapi::Artifact.from_json(json_object: artifact)
38
40
  end
39
- new(queries: queries, additional_properties: struct)
41
+ new(artifact: artifact, additional_properties: struct)
40
42
  end
41
43
 
42
- # Serialize an instance of AnalyticsQueryDto to a JSON object
44
+ # Serialize an instance of TestSuiteRunTestAttemptCall to a JSON object
43
45
  #
44
46
  # @return [String]
45
47
  def to_json(*_args)
@@ -53,7 +55,7 @@ module Vapi
53
55
  # @param obj [Object]
54
56
  # @return [Void]
55
57
  def self.validate_raw(obj:)
56
- obj.queries.is_a?(Array) != false || raise("Passed value for field obj.queries is not the expected type, validation failed.")
58
+ Vapi::Artifact.validate_raw(obj: obj.artifact)
57
59
  end
58
60
  end
59
61
  end
@@ -0,0 +1,75 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "test_suite_test_voice"
4
+ require_relative "test_suite_run_test_attempt"
5
+ require "ostruct"
6
+ require "json"
7
+
8
+ module Vapi
9
+ class TestSuiteRunTestResult
10
+ # @return [Vapi::TestSuiteTestVoice] This is the test that was run.
11
+ attr_reader :test
12
+ # @return [Array<Vapi::TestSuiteRunTestAttempt>] These are the attempts made for this test.
13
+ attr_reader :attempts
14
+ # @return [OpenStruct] Additional properties unmapped to the current class definition
15
+ attr_reader :additional_properties
16
+ # @return [Object]
17
+ attr_reader :_field_set
18
+ protected :_field_set
19
+
20
+ OMIT = Object.new
21
+
22
+ # @param test [Vapi::TestSuiteTestVoice] This is the test that was run.
23
+ # @param attempts [Array<Vapi::TestSuiteRunTestAttempt>] These are the attempts made for this test.
24
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
25
+ # @return [Vapi::TestSuiteRunTestResult]
26
+ def initialize(test:, attempts:, additional_properties: nil)
27
+ @test = test
28
+ @attempts = attempts
29
+ @additional_properties = additional_properties
30
+ @_field_set = { "test": test, "attempts": attempts }
31
+ end
32
+
33
+ # Deserialize a JSON object to an instance of TestSuiteRunTestResult
34
+ #
35
+ # @param json_object [String]
36
+ # @return [Vapi::TestSuiteRunTestResult]
37
+ def self.from_json(json_object:)
38
+ struct = JSON.parse(json_object, object_class: OpenStruct)
39
+ parsed_json = JSON.parse(json_object)
40
+ if parsed_json["test"].nil?
41
+ test = nil
42
+ else
43
+ test = parsed_json["test"].to_json
44
+ test = Vapi::TestSuiteTestVoice.from_json(json_object: test)
45
+ end
46
+ attempts = parsed_json["attempts"]&.map do |item|
47
+ item = item.to_json
48
+ Vapi::TestSuiteRunTestAttempt.from_json(json_object: item)
49
+ end
50
+ new(
51
+ test: test,
52
+ attempts: attempts,
53
+ additional_properties: struct
54
+ )
55
+ end
56
+
57
+ # Serialize an instance of TestSuiteRunTestResult to a JSON object
58
+ #
59
+ # @return [String]
60
+ def to_json(*_args)
61
+ @_field_set&.to_json
62
+ end
63
+
64
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
65
+ # hash and check each fields type against the current object's property
66
+ # definitions.
67
+ #
68
+ # @param obj [Object]
69
+ # @return [Void]
70
+ def self.validate_raw(obj:)
71
+ Vapi::TestSuiteTestVoice.validate_raw(obj: obj.test)
72
+ obj.attempts.is_a?(Array) != false || raise("Passed value for field obj.attempts is not the expected type, validation failed.")
73
+ end
74
+ end
75
+ end
@@ -0,0 +1,75 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "test_suite_run"
4
+ require_relative "pagination_meta"
5
+ require "ostruct"
6
+ require "json"
7
+
8
+ module Vapi
9
+ class TestSuiteRunsPaginatedResponse
10
+ # @return [Array<Vapi::TestSuiteRun>]
11
+ attr_reader :results
12
+ # @return [Vapi::PaginationMeta]
13
+ attr_reader :metadata
14
+ # @return [OpenStruct] Additional properties unmapped to the current class definition
15
+ attr_reader :additional_properties
16
+ # @return [Object]
17
+ attr_reader :_field_set
18
+ protected :_field_set
19
+
20
+ OMIT = Object.new
21
+
22
+ # @param results [Array<Vapi::TestSuiteRun>]
23
+ # @param metadata [Vapi::PaginationMeta]
24
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
25
+ # @return [Vapi::TestSuiteRunsPaginatedResponse]
26
+ def initialize(results:, metadata:, additional_properties: nil)
27
+ @results = results
28
+ @metadata = metadata
29
+ @additional_properties = additional_properties
30
+ @_field_set = { "results": results, "metadata": metadata }
31
+ end
32
+
33
+ # Deserialize a JSON object to an instance of TestSuiteRunsPaginatedResponse
34
+ #
35
+ # @param json_object [String]
36
+ # @return [Vapi::TestSuiteRunsPaginatedResponse]
37
+ def self.from_json(json_object:)
38
+ struct = JSON.parse(json_object, object_class: OpenStruct)
39
+ parsed_json = JSON.parse(json_object)
40
+ results = parsed_json["results"]&.map do |item|
41
+ item = item.to_json
42
+ Vapi::TestSuiteRun.from_json(json_object: item)
43
+ end
44
+ if parsed_json["metadata"].nil?
45
+ metadata = nil
46
+ else
47
+ metadata = parsed_json["metadata"].to_json
48
+ metadata = Vapi::PaginationMeta.from_json(json_object: metadata)
49
+ end
50
+ new(
51
+ results: results,
52
+ metadata: metadata,
53
+ additional_properties: struct
54
+ )
55
+ end
56
+
57
+ # Serialize an instance of TestSuiteRunsPaginatedResponse to a JSON object
58
+ #
59
+ # @return [String]
60
+ def to_json(*_args)
61
+ @_field_set&.to_json
62
+ end
63
+
64
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
65
+ # hash and check each fields type against the current object's property
66
+ # definitions.
67
+ #
68
+ # @param obj [Object]
69
+ # @return [Void]
70
+ def self.validate_raw(obj:)
71
+ obj.results.is_a?(Array) != false || raise("Passed value for field obj.results is not the expected type, validation failed.")
72
+ Vapi::PaginationMeta.validate_raw(obj: obj.metadata)
73
+ end
74
+ end
75
+ end
@@ -0,0 +1,65 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "ostruct"
4
+ require "json"
5
+
6
+ module Vapi
7
+ class TestSuiteTestScorerAi
8
+ # @return [String] This is the type of the scorer, which must be AI.
9
+ attr_reader :type
10
+ # @return [String] This is the rubric used by the AI scorer.
11
+ attr_reader :rubric
12
+ # @return [OpenStruct] Additional properties unmapped to the current class definition
13
+ attr_reader :additional_properties
14
+ # @return [Object]
15
+ attr_reader :_field_set
16
+ protected :_field_set
17
+
18
+ OMIT = Object.new
19
+
20
+ # @param type [String] This is the type of the scorer, which must be AI.
21
+ # @param rubric [String] This is the rubric used by the AI scorer.
22
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
23
+ # @return [Vapi::TestSuiteTestScorerAi]
24
+ def initialize(type:, rubric:, additional_properties: nil)
25
+ @type = type
26
+ @rubric = rubric
27
+ @additional_properties = additional_properties
28
+ @_field_set = { "type": type, "rubric": rubric }
29
+ end
30
+
31
+ # Deserialize a JSON object to an instance of TestSuiteTestScorerAi
32
+ #
33
+ # @param json_object [String]
34
+ # @return [Vapi::TestSuiteTestScorerAi]
35
+ def self.from_json(json_object:)
36
+ struct = JSON.parse(json_object, object_class: OpenStruct)
37
+ parsed_json = JSON.parse(json_object)
38
+ type = parsed_json["type"]
39
+ rubric = parsed_json["rubric"]
40
+ new(
41
+ type: type,
42
+ rubric: rubric,
43
+ additional_properties: struct
44
+ )
45
+ end
46
+
47
+ # Serialize an instance of TestSuiteTestScorerAi to a JSON object
48
+ #
49
+ # @return [String]
50
+ def to_json(*_args)
51
+ @_field_set&.to_json
52
+ end
53
+
54
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
55
+ # hash and check each fields type against the current object's property
56
+ # definitions.
57
+ #
58
+ # @param obj [Object]
59
+ # @return [Void]
60
+ def self.validate_raw(obj:)
61
+ obj.type.is_a?(String) != false || raise("Passed value for field obj.type is not the expected type, validation failed.")
62
+ obj.rubric.is_a?(String) != false || raise("Passed value for field obj.rubric is not the expected type, validation failed.")
63
+ end
64
+ end
65
+ end
@@ -0,0 +1,132 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "test_suite_test_scorer_ai"
4
+ require "date"
5
+ require "ostruct"
6
+ require "json"
7
+
8
+ module Vapi
9
+ class TestSuiteTestVoice
10
+ # @return [Array<Vapi::TestSuiteTestScorerAi>] These are the scorers used to evaluate the test.
11
+ attr_reader :scorers
12
+ # @return [String] This is the unique identifier for the test.
13
+ attr_reader :id
14
+ # @return [String] This is the unique identifier for the test suite this test belongs to.
15
+ attr_reader :test_suite_id
16
+ # @return [String] This is the unique identifier for the organization this test belongs to.
17
+ attr_reader :org_id
18
+ # @return [DateTime] This is the ISO 8601 date-time string of when the test was created.
19
+ attr_reader :created_at
20
+ # @return [DateTime] This is the ISO 8601 date-time string of when the test was last updated.
21
+ attr_reader :updated_at
22
+ # @return [String] This is the name of the test.
23
+ attr_reader :name
24
+ # @return [String] This is the script to be used for the voice test.
25
+ attr_reader :script
26
+ # @return [Float] This is the number of attempts allowed for the test.
27
+ attr_reader :num_attempts
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 scorers [Array<Vapi::TestSuiteTestScorerAi>] These are the scorers used to evaluate the test.
37
+ # @param id [String] This is the unique identifier for the test.
38
+ # @param test_suite_id [String] This is the unique identifier for the test suite this test belongs to.
39
+ # @param org_id [String] This is the unique identifier for the organization this test belongs to.
40
+ # @param created_at [DateTime] This is the ISO 8601 date-time string of when the test was created.
41
+ # @param updated_at [DateTime] This is the ISO 8601 date-time string of when the test was last updated.
42
+ # @param name [String] This is the name of the test.
43
+ # @param script [String] This is the script to be used for the voice test.
44
+ # @param num_attempts [Float] This is the number of attempts allowed for the test.
45
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
46
+ # @return [Vapi::TestSuiteTestVoice]
47
+ def initialize(scorers:, id:, test_suite_id:, org_id:, created_at:, updated_at:, script:, name: OMIT,
48
+ num_attempts: OMIT, additional_properties: nil)
49
+ @scorers = scorers
50
+ @id = id
51
+ @test_suite_id = test_suite_id
52
+ @org_id = org_id
53
+ @created_at = created_at
54
+ @updated_at = updated_at
55
+ @name = name if name != OMIT
56
+ @script = script
57
+ @num_attempts = num_attempts if num_attempts != OMIT
58
+ @additional_properties = additional_properties
59
+ @_field_set = {
60
+ "scorers": scorers,
61
+ "id": id,
62
+ "testSuiteId": test_suite_id,
63
+ "orgId": org_id,
64
+ "createdAt": created_at,
65
+ "updatedAt": updated_at,
66
+ "name": name,
67
+ "script": script,
68
+ "numAttempts": num_attempts
69
+ }.reject do |_k, v|
70
+ v == OMIT
71
+ end
72
+ end
73
+
74
+ # Deserialize a JSON object to an instance of TestSuiteTestVoice
75
+ #
76
+ # @param json_object [String]
77
+ # @return [Vapi::TestSuiteTestVoice]
78
+ def self.from_json(json_object:)
79
+ struct = JSON.parse(json_object, object_class: OpenStruct)
80
+ parsed_json = JSON.parse(json_object)
81
+ scorers = parsed_json["scorers"]&.map do |item|
82
+ item = item.to_json
83
+ Vapi::TestSuiteTestScorerAi.from_json(json_object: item)
84
+ end
85
+ id = parsed_json["id"]
86
+ test_suite_id = parsed_json["testSuiteId"]
87
+ org_id = parsed_json["orgId"]
88
+ created_at = (DateTime.parse(parsed_json["createdAt"]) unless parsed_json["createdAt"].nil?)
89
+ updated_at = (DateTime.parse(parsed_json["updatedAt"]) unless parsed_json["updatedAt"].nil?)
90
+ name = parsed_json["name"]
91
+ script = parsed_json["script"]
92
+ num_attempts = parsed_json["numAttempts"]
93
+ new(
94
+ scorers: scorers,
95
+ id: id,
96
+ test_suite_id: test_suite_id,
97
+ org_id: org_id,
98
+ created_at: created_at,
99
+ updated_at: updated_at,
100
+ name: name,
101
+ script: script,
102
+ num_attempts: num_attempts,
103
+ additional_properties: struct
104
+ )
105
+ end
106
+
107
+ # Serialize an instance of TestSuiteTestVoice to a JSON object
108
+ #
109
+ # @return [String]
110
+ def to_json(*_args)
111
+ @_field_set&.to_json
112
+ end
113
+
114
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
115
+ # hash and check each fields type against the current object's property
116
+ # definitions.
117
+ #
118
+ # @param obj [Object]
119
+ # @return [Void]
120
+ def self.validate_raw(obj:)
121
+ obj.scorers.is_a?(Array) != false || raise("Passed value for field obj.scorers is not the expected type, validation failed.")
122
+ obj.id.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
123
+ obj.test_suite_id.is_a?(String) != false || raise("Passed value for field obj.test_suite_id is not the expected type, validation failed.")
124
+ obj.org_id.is_a?(String) != false || raise("Passed value for field obj.org_id is not the expected type, validation failed.")
125
+ obj.created_at.is_a?(DateTime) != false || raise("Passed value for field obj.created_at is not the expected type, validation failed.")
126
+ obj.updated_at.is_a?(DateTime) != false || raise("Passed value for field obj.updated_at is not the expected type, validation failed.")
127
+ obj.name&.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
128
+ obj.script.is_a?(String) != false || raise("Passed value for field obj.script is not the expected type, validation failed.")
129
+ obj.num_attempts&.is_a?(Float) != false || raise("Passed value for field obj.num_attempts is not the expected type, validation failed.")
130
+ end
131
+ end
132
+ end
@@ -0,0 +1,75 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "test_suite_test_voice"
4
+ require_relative "pagination_meta"
5
+ require "ostruct"
6
+ require "json"
7
+
8
+ module Vapi
9
+ class TestSuiteTestsPaginatedResponse
10
+ # @return [Array<Vapi::TestSuiteTestVoice>] A list of test suite tests.
11
+ attr_reader :results
12
+ # @return [Vapi::PaginationMeta] Metadata about the pagination.
13
+ attr_reader :metadata
14
+ # @return [OpenStruct] Additional properties unmapped to the current class definition
15
+ attr_reader :additional_properties
16
+ # @return [Object]
17
+ attr_reader :_field_set
18
+ protected :_field_set
19
+
20
+ OMIT = Object.new
21
+
22
+ # @param results [Array<Vapi::TestSuiteTestVoice>] A list of test suite tests.
23
+ # @param metadata [Vapi::PaginationMeta] Metadata about the pagination.
24
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
25
+ # @return [Vapi::TestSuiteTestsPaginatedResponse]
26
+ def initialize(results:, metadata:, additional_properties: nil)
27
+ @results = results
28
+ @metadata = metadata
29
+ @additional_properties = additional_properties
30
+ @_field_set = { "results": results, "metadata": metadata }
31
+ end
32
+
33
+ # Deserialize a JSON object to an instance of TestSuiteTestsPaginatedResponse
34
+ #
35
+ # @param json_object [String]
36
+ # @return [Vapi::TestSuiteTestsPaginatedResponse]
37
+ def self.from_json(json_object:)
38
+ struct = JSON.parse(json_object, object_class: OpenStruct)
39
+ parsed_json = JSON.parse(json_object)
40
+ results = parsed_json["results"]&.map do |item|
41
+ item = item.to_json
42
+ Vapi::TestSuiteTestVoice.from_json(json_object: item)
43
+ end
44
+ if parsed_json["metadata"].nil?
45
+ metadata = nil
46
+ else
47
+ metadata = parsed_json["metadata"].to_json
48
+ metadata = Vapi::PaginationMeta.from_json(json_object: metadata)
49
+ end
50
+ new(
51
+ results: results,
52
+ metadata: metadata,
53
+ additional_properties: struct
54
+ )
55
+ end
56
+
57
+ # Serialize an instance of TestSuiteTestsPaginatedResponse to a JSON object
58
+ #
59
+ # @return [String]
60
+ def to_json(*_args)
61
+ @_field_set&.to_json
62
+ end
63
+
64
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
65
+ # hash and check each fields type against the current object's property
66
+ # definitions.
67
+ #
68
+ # @param obj [Object]
69
+ # @return [Void]
70
+ def self.validate_raw(obj:)
71
+ obj.results.is_a?(Array) != false || raise("Passed value for field obj.results is not the expected type, validation failed.")
72
+ Vapi::PaginationMeta.validate_raw(obj: obj.metadata)
73
+ end
74
+ end
75
+ end