vapi_server_sdk 0.4.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/requests.rb +2 -2
- data/lib/types_export.rb +60 -14
- data/lib/vapi_server_sdk/analytics/client.rb +41 -12
- data/lib/vapi_server_sdk/assistants/client.rb +80 -14
- data/lib/vapi_server_sdk/assistants/types/update_assistant_dto_server_messages_item.rb +1 -0
- data/lib/vapi_server_sdk/calls/client.rb +104 -6
- data/lib/vapi_server_sdk/logs/client.rb +2 -2
- data/lib/vapi_server_sdk/squads/client.rb +128 -8
- data/lib/vapi_server_sdk/test_suite_runs/client.rb +328 -0
- data/lib/vapi_server_sdk/test_suite_runs/types/test_suite_run_controller_find_all_paginated_request_sort_order.rb +10 -0
- data/lib/vapi_server_sdk/test_suite_tests/client.rb +331 -0
- data/lib/vapi_server_sdk/test_suite_tests/types/test_suite_test_controller_create_request.rb +81 -0
- data/lib/vapi_server_sdk/test_suite_tests/types/test_suite_test_controller_find_all_paginated_request_sort_order.rb +10 -0
- data/lib/vapi_server_sdk/test_suite_tests/types/test_suite_test_controller_remove_response.rb +82 -0
- data/lib/vapi_server_sdk/test_suite_tests/types/test_suite_test_controller_update_request.rb +81 -0
- data/lib/vapi_server_sdk/test_suites/client.rb +338 -0
- data/lib/vapi_server_sdk/test_suites/types/test_suite_controller_find_all_paginated_request_sort_order.rb +10 -0
- data/lib/vapi_server_sdk/types/{semantic_edge_condition.rb → ai_edge_condition.rb} +9 -11
- data/lib/vapi_server_sdk/types/analytics_operation_column.rb +1 -0
- data/lib/vapi_server_sdk/types/analytics_operation_operation.rb +1 -0
- data/lib/vapi_server_sdk/types/analytics_query.rb +4 -3
- data/lib/vapi_server_sdk/types/analytics_query_table.rb +9 -0
- data/lib/vapi_server_sdk/types/api_request.rb +165 -0
- data/lib/vapi_server_sdk/types/api_request_method.rb +8 -0
- data/lib/vapi_server_sdk/types/api_request_mode.rb +10 -0
- data/lib/vapi_server_sdk/types/artifact.rb +12 -2
- data/lib/vapi_server_sdk/types/artifact_plan.rb +56 -8
- data/lib/vapi_server_sdk/types/assistant.rb +27 -13
- data/lib/vapi_server_sdk/types/assistant_hook_action_base.rb +47 -0
- data/lib/vapi_server_sdk/types/assistant_hook_filter.rb +72 -0
- data/lib/vapi_server_sdk/types/assistant_hooks.rb +82 -0
- data/lib/vapi_server_sdk/types/assistant_overrides.rb +28 -14
- data/lib/vapi_server_sdk/types/assistant_overrides_server_messages_item.rb +1 -0
- data/lib/vapi_server_sdk/types/assistant_server_messages_item.rb +1 -0
- data/lib/vapi_server_sdk/types/azure_open_ai_credential_models_item.rb +1 -0
- data/lib/vapi_server_sdk/types/backoff_plan.rb +80 -0
- data/lib/vapi_server_sdk/types/byo_phone_number.rb +10 -1
- data/lib/vapi_server_sdk/types/byo_phone_number_status.rb +10 -0
- data/lib/vapi_server_sdk/types/call_ended_reason.rb +10 -1
- data/lib/vapi_server_sdk/types/cartesia_experimental_controls.rb +69 -0
- data/lib/vapi_server_sdk/types/cartesia_experimental_controls_emotion.rb +26 -0
- data/lib/vapi_server_sdk/types/cartesia_experimental_controls_speed.rb +11 -0
- data/lib/vapi_server_sdk/types/cartesia_voice.rb +24 -10
- data/lib/vapi_server_sdk/types/chat_completion_message.rb +80 -0
- data/lib/vapi_server_sdk/types/chat_completion_message_metadata.rb +94 -0
- data/lib/vapi_server_sdk/types/chat_completions_dto.rb +84 -0
- data/lib/vapi_server_sdk/types/client_inbound_message_transfer.rb +13 -3
- data/lib/vapi_server_sdk/types/client_message_conversation_update.rb +15 -2
- data/lib/vapi_server_sdk/types/client_message_hang.rb +22 -4
- data/lib/vapi_server_sdk/types/client_message_language_change_detected.rb +15 -3
- data/lib/vapi_server_sdk/types/client_message_message.rb +165 -181
- data/lib/vapi_server_sdk/types/client_message_metadata.rb +15 -3
- data/lib/vapi_server_sdk/types/client_message_model_output.rb +15 -3
- data/lib/vapi_server_sdk/types/client_message_speech_update.rb +11 -2
- data/lib/vapi_server_sdk/types/client_message_tool_calls.rb +15 -2
- data/lib/vapi_server_sdk/types/client_message_tool_calls_result.rb +15 -3
- data/lib/vapi_server_sdk/types/client_message_transcript.rb +12 -2
- data/lib/vapi_server_sdk/types/client_message_transcript_type.rb +10 -0
- data/lib/vapi_server_sdk/types/client_message_transfer_update.rb +11 -1
- data/lib/vapi_server_sdk/types/client_message_user_interrupted.rb +14 -4
- data/lib/vapi_server_sdk/types/client_message_voice_input.rb +15 -3
- data/lib/vapi_server_sdk/types/client_message_workflow_node_started.rb +67 -0
- data/lib/vapi_server_sdk/types/compliance_plan.rb +77 -0
- data/lib/vapi_server_sdk/types/create_assistant_dto.rb +28 -14
- data/lib/vapi_server_sdk/types/create_assistant_dto_server_messages_item.rb +1 -0
- data/lib/vapi_server_sdk/types/create_azure_open_ai_credential_dto_models_item.rb +1 -0
- data/lib/vapi_server_sdk/types/create_test_suite_test_voice_dto.rb +90 -0
- data/lib/vapi_server_sdk/types/create_vapi_phone_number_dto.rb +12 -4
- data/lib/vapi_server_sdk/types/create_workflow_dto.rb +2 -9
- data/lib/vapi_server_sdk/types/create_workflow_dto_nodes_item.rb +104 -52
- data/lib/vapi_server_sdk/types/deep_seek_model.rb +4 -3
- data/lib/vapi_server_sdk/types/deep_seek_model_model.rb +9 -0
- data/lib/vapi_server_sdk/types/deepgram_transcriber.rb +28 -2
- data/lib/vapi_server_sdk/types/deepgram_voice.rb +22 -2
- data/lib/vapi_server_sdk/types/edge.rb +9 -2
- data/lib/vapi_server_sdk/types/edge_condition.rb +32 -19
- data/lib/vapi_server_sdk/types/failed_edge_condition.rb +47 -0
- data/lib/vapi_server_sdk/types/fallback_cartesia_voice.rb +24 -9
- data/lib/vapi_server_sdk/types/fallback_deepgram_voice.rb +17 -2
- data/lib/vapi_server_sdk/types/fallback_play_ht_voice_model.rb +1 -0
- data/lib/vapi_server_sdk/types/fallback_rime_ai_voice_id_enum.rb +22 -20
- data/lib/vapi_server_sdk/types/fallback_rime_ai_voice_model.rb +1 -0
- data/lib/vapi_server_sdk/types/format_plan.rb +22 -2
- data/lib/vapi_server_sdk/types/format_plan_formatters_enabled_item.rb +22 -0
- data/lib/vapi_server_sdk/types/gather.rb +81 -25
- data/lib/vapi_server_sdk/types/google_model_model.rb +4 -0
- data/lib/vapi_server_sdk/types/groq_model_model.rb +1 -0
- data/lib/vapi_server_sdk/types/hangup.rb +67 -0
- data/lib/vapi_server_sdk/types/hook.rb +70 -0
- data/lib/vapi_server_sdk/types/hook_on.rb +9 -0
- data/lib/vapi_server_sdk/types/invite_user_dto.rb +11 -2
- data/lib/vapi_server_sdk/types/json_schema.rb +26 -2
- data/lib/vapi_server_sdk/types/{programmatic_edge_condition.rb → logic_edge_condition.rb} +13 -15
- data/lib/vapi_server_sdk/types/message_plan.rb +12 -2
- data/lib/vapi_server_sdk/types/open_ai_model.rb +1 -9
- data/lib/vapi_server_sdk/types/open_ai_model_fallback_models_item.rb +2 -0
- data/lib/vapi_server_sdk/types/open_ai_model_model.rb +2 -0
- data/lib/vapi_server_sdk/types/play_ht_voice_model.rb +1 -0
- data/lib/vapi_server_sdk/types/rime_ai_voice_id_enum.rb +22 -20
- data/lib/vapi_server_sdk/types/rime_ai_voice_model.rb +1 -0
- data/lib/vapi_server_sdk/types/say.rb +23 -14
- data/lib/vapi_server_sdk/types/say_hook.rb +81 -0
- data/lib/vapi_server_sdk/types/server.rb +17 -2
- data/lib/vapi_server_sdk/types/server_message_assistant_request.rb +12 -2
- data/lib/vapi_server_sdk/types/server_message_conversation_update.rb +12 -2
- data/lib/vapi_server_sdk/types/server_message_end_of_call_report.rb +11 -1
- data/lib/vapi_server_sdk/types/server_message_end_of_call_report_ended_reason.rb +10 -1
- data/lib/vapi_server_sdk/types/server_message_hang.rb +20 -2
- data/lib/vapi_server_sdk/types/server_message_knowledge_base_request.rb +14 -2
- data/lib/vapi_server_sdk/types/server_message_language_change_detected.rb +11 -1
- data/lib/vapi_server_sdk/types/server_message_message.rb +212 -237
- data/lib/vapi_server_sdk/types/server_message_model_output.rb +11 -1
- data/lib/vapi_server_sdk/types/server_message_phone_call_control.rb +18 -2
- data/lib/vapi_server_sdk/types/server_message_speech_update.rb +11 -1
- data/lib/vapi_server_sdk/types/server_message_status_update.rb +12 -2
- data/lib/vapi_server_sdk/types/server_message_status_update_ended_reason.rb +10 -1
- data/lib/vapi_server_sdk/types/server_message_tool_calls.rb +10 -2
- data/lib/vapi_server_sdk/types/server_message_transcript.rb +13 -2
- data/lib/vapi_server_sdk/types/server_message_transcript_type.rb +10 -0
- data/lib/vapi_server_sdk/types/server_message_transfer_destination_request.rb +12 -2
- data/lib/vapi_server_sdk/types/server_message_transfer_update.rb +11 -1
- data/lib/vapi_server_sdk/types/server_message_user_interrupted.rb +12 -2
- data/lib/vapi_server_sdk/types/server_message_voice_input.rb +11 -1
- data/lib/vapi_server_sdk/types/server_message_voice_request.rb +50 -2
- data/lib/vapi_server_sdk/types/stop_speaking_plan.rb +27 -2
- data/lib/vapi_server_sdk/types/subscription.rb +33 -5
- data/lib/vapi_server_sdk/types/sync_voice_library_dto_providers_item.rb +1 -0
- data/lib/vapi_server_sdk/types/test_suite.rb +104 -0
- data/lib/vapi_server_sdk/types/test_suite_run.rb +127 -0
- data/lib/vapi_server_sdk/types/test_suite_run_scorer_ai.rb +80 -0
- data/lib/vapi_server_sdk/types/test_suite_run_scorer_ai_result.rb +9 -0
- data/lib/vapi_server_sdk/types/test_suite_run_status.rb +10 -0
- data/lib/vapi_server_sdk/types/test_suite_run_test_attempt.rb +75 -0
- data/lib/vapi_server_sdk/types/{analytics_query_dto.rb → test_suite_run_test_attempt_call.rb} +19 -17
- data/lib/vapi_server_sdk/types/test_suite_run_test_result.rb +75 -0
- data/lib/vapi_server_sdk/types/test_suite_runs_paginated_response.rb +75 -0
- data/lib/vapi_server_sdk/types/test_suite_test_scorer_ai.rb +65 -0
- data/lib/vapi_server_sdk/types/test_suite_test_voice.rb +132 -0
- data/lib/vapi_server_sdk/types/test_suite_tests_paginated_response.rb +75 -0
- data/lib/vapi_server_sdk/types/test_suites_paginated_response.rb +75 -0
- data/lib/vapi_server_sdk/types/time_range_step.rb +1 -0
- data/lib/vapi_server_sdk/types/tool_message_start.rb +18 -2
- data/lib/vapi_server_sdk/types/transfer.rb +74 -0
- data/lib/vapi_server_sdk/types/transfer_assistant_hook_action.rb +75 -0
- data/lib/vapi_server_sdk/types/{buy_phone_number_dto_fallback_destination.rb → transfer_assistant_hook_action_destination.rb} +9 -12
- data/lib/vapi_server_sdk/types/transfer_destination_assistant.rb +46 -0
- data/lib/vapi_server_sdk/types/transfer_plan.rb +37 -1
- data/lib/vapi_server_sdk/types/transfer_plan_mode.rb +4 -0
- data/lib/vapi_server_sdk/types/trieve_knowledge_base_search_plan.rb +12 -1
- data/lib/vapi_server_sdk/types/twilio_phone_number.rb +11 -2
- data/lib/vapi_server_sdk/types/twilio_phone_number_status.rb +10 -0
- data/lib/vapi_server_sdk/types/update_azure_open_ai_credential_dto_models_item.rb +1 -0
- data/lib/vapi_server_sdk/types/update_test_suite_test_voice_dto.rb +90 -0
- data/lib/vapi_server_sdk/types/vapi_phone_number.rb +29 -4
- data/lib/vapi_server_sdk/types/vapi_phone_number_status.rb +10 -0
- data/lib/vapi_server_sdk/types/vonage_phone_number.rb +11 -2
- data/lib/vapi_server_sdk/types/vonage_phone_number_status.rb +10 -0
- data/lib/vapi_server_sdk/types/workflow.rb +1 -9
- data/lib/vapi_server_sdk/types/workflow_nodes_item.rb +104 -52
- data/lib/vapi_server_sdk/types/xai_model.rb +4 -3
- data/lib/vapi_server_sdk/types/xai_model_model.rb +10 -0
- data/lib/vapi_server_sdk.rb +21 -0
- metadata +61 -12
- data/lib/vapi_server_sdk/types/buy_phone_number_dto.rb +0 -147
- data/lib/vapi_server_sdk/types/org_with_org_user.rb +0 -262
- data/lib/vapi_server_sdk/types/org_with_org_user_channel.rb +0 -10
- data/lib/vapi_server_sdk/types/org_with_org_user_role.rb +0 -9
- data/lib/vapi_server_sdk/types/update_workflow_dto.rb +0 -82
- data/lib/vapi_server_sdk/types/update_workflow_dto_nodes_item.rb +0 -81
@@ -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,
|
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
|
@@ -28,6 +28,10 @@ module Vapi
|
|
28
28
|
attr_reader :concurrency_counter
|
29
29
|
# @return [Float] This is the default concurrency limit for the subscription.
|
30
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
|
31
35
|
# @return [Float] This is the purchased add-on concurrency limit for the subscription.
|
32
36
|
attr_reader :concurrency_limit_purchased
|
33
37
|
# @return [Float] This is the ID of the monthly job that charges for subscription add ons and
|
@@ -61,10 +65,13 @@ module Vapi
|
|
61
65
|
attr_reader :referred_by_email
|
62
66
|
# @return [Vapi::AutoReloadPlan] This is the auto reload plan configured for the subscription.
|
63
67
|
attr_reader :auto_reload_plan
|
64
|
-
# @return [Float] The number of minutes included in the subscription.
|
68
|
+
# @return [Float] The number of minutes included in the subscription.
|
65
69
|
attr_reader :minutes_included
|
66
|
-
# @return [Float] The number of minutes used in the subscription.
|
70
|
+
# @return [Float] The number of minutes used in the subscription.
|
67
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
|
68
75
|
# @return [Float] The per minute charge on minutes that exceed the included minutes. Enterprise
|
69
76
|
# only.
|
70
77
|
attr_reader :minutes_overage_cost
|
@@ -102,6 +109,8 @@ module Vapi
|
|
102
109
|
# @param concurrency_counter [Float] This is the total number of active calls (concurrency) across all orgs under
|
103
110
|
# this subscription.
|
104
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
|
105
114
|
# @param concurrency_limit_purchased [Float] This is the purchased add-on concurrency limit for the subscription.
|
106
115
|
# @param monthly_charge_schedule_id [Float] This is the ID of the monthly job that charges for subscription add ons and
|
107
116
|
# phone numbers.
|
@@ -122,8 +131,10 @@ module Vapi
|
|
122
131
|
# @param stripe_customer_email [String] This is the customer's email on Stripe.
|
123
132
|
# @param referred_by_email [String] This is the email of the referrer for the subscription.
|
124
133
|
# @param auto_reload_plan [Vapi::AutoReloadPlan] This is the auto reload plan configured for the subscription.
|
125
|
-
# @param minutes_included [Float] The number of minutes included in the subscription.
|
126
|
-
# @param minutes_used [Float] The number of minutes used in the subscription.
|
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.
|
127
138
|
# @param minutes_overage_cost [Float] The per minute charge on minutes that exceed the included minutes. Enterprise
|
128
139
|
# only.
|
129
140
|
# @param providers_included [Array<String>] The list of providers included in the subscription. Enterprise only.
|
@@ -138,7 +149,7 @@ module Vapi
|
|
138
149
|
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
139
150
|
# @return [Vapi::Subscription]
|
140
151
|
def initialize(id:, created_at:, updated_at:, type:, status:, credits:, concurrency_counter:,
|
141
|
-
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)
|
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)
|
142
153
|
@id = id
|
143
154
|
@created_at = created_at
|
144
155
|
@updated_at = updated_at
|
@@ -147,6 +158,8 @@ module Vapi
|
|
147
158
|
@credits = credits
|
148
159
|
@concurrency_counter = concurrency_counter
|
149
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
|
150
163
|
@concurrency_limit_purchased = concurrency_limit_purchased
|
151
164
|
@monthly_charge_schedule_id = monthly_charge_schedule_id if monthly_charge_schedule_id != OMIT
|
152
165
|
@monthly_credit_check_schedule_id = monthly_credit_check_schedule_id if monthly_credit_check_schedule_id != OMIT
|
@@ -164,6 +177,7 @@ module Vapi
|
|
164
177
|
@auto_reload_plan = auto_reload_plan if auto_reload_plan != OMIT
|
165
178
|
@minutes_included = minutes_included if minutes_included != OMIT
|
166
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
|
167
181
|
@minutes_overage_cost = minutes_overage_cost if minutes_overage_cost != OMIT
|
168
182
|
@providers_included = providers_included if providers_included != OMIT
|
169
183
|
@outbound_calls_daily_limit = outbound_calls_daily_limit if outbound_calls_daily_limit != OMIT
|
@@ -183,6 +197,8 @@ module Vapi
|
|
183
197
|
"credits": credits,
|
184
198
|
"concurrencyCounter": concurrency_counter,
|
185
199
|
"concurrencyLimitIncluded": concurrency_limit_included,
|
200
|
+
"phoneNumbersCounter": phone_numbers_counter,
|
201
|
+
"phoneNumbersIncluded": phone_numbers_included,
|
186
202
|
"concurrencyLimitPurchased": concurrency_limit_purchased,
|
187
203
|
"monthlyChargeScheduleId": monthly_charge_schedule_id,
|
188
204
|
"monthlyCreditCheckScheduleId": monthly_credit_check_schedule_id,
|
@@ -198,6 +214,7 @@ module Vapi
|
|
198
214
|
"autoReloadPlan": auto_reload_plan,
|
199
215
|
"minutesIncluded": minutes_included,
|
200
216
|
"minutesUsed": minutes_used,
|
217
|
+
"minutesUsedNextResetAt": minutes_used_next_reset_at,
|
201
218
|
"minutesOverageCost": minutes_overage_cost,
|
202
219
|
"providersIncluded": providers_included,
|
203
220
|
"outboundCallsDailyLimit": outbound_calls_daily_limit,
|
@@ -225,6 +242,8 @@ module Vapi
|
|
225
242
|
credits = parsed_json["credits"]
|
226
243
|
concurrency_counter = parsed_json["concurrencyCounter"]
|
227
244
|
concurrency_limit_included = parsed_json["concurrencyLimitIncluded"]
|
245
|
+
phone_numbers_counter = parsed_json["phoneNumbersCounter"]
|
246
|
+
phone_numbers_included = parsed_json["phoneNumbersIncluded"]
|
228
247
|
concurrency_limit_purchased = parsed_json["concurrencyLimitPurchased"]
|
229
248
|
monthly_charge_schedule_id = parsed_json["monthlyChargeScheduleId"]
|
230
249
|
monthly_credit_check_schedule_id = parsed_json["monthlyCreditCheckScheduleId"]
|
@@ -245,6 +264,9 @@ module Vapi
|
|
245
264
|
end
|
246
265
|
minutes_included = parsed_json["minutesIncluded"]
|
247
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
|
248
270
|
minutes_overage_cost = parsed_json["minutesOverageCost"]
|
249
271
|
providers_included = parsed_json["providersIncluded"]
|
250
272
|
outbound_calls_daily_limit = parsed_json["outboundCallsDailyLimit"]
|
@@ -263,6 +285,8 @@ module Vapi
|
|
263
285
|
credits: credits,
|
264
286
|
concurrency_counter: concurrency_counter,
|
265
287
|
concurrency_limit_included: concurrency_limit_included,
|
288
|
+
phone_numbers_counter: phone_numbers_counter,
|
289
|
+
phone_numbers_included: phone_numbers_included,
|
266
290
|
concurrency_limit_purchased: concurrency_limit_purchased,
|
267
291
|
monthly_charge_schedule_id: monthly_charge_schedule_id,
|
268
292
|
monthly_credit_check_schedule_id: monthly_credit_check_schedule_id,
|
@@ -278,6 +302,7 @@ module Vapi
|
|
278
302
|
auto_reload_plan: auto_reload_plan,
|
279
303
|
minutes_included: minutes_included,
|
280
304
|
minutes_used: minutes_used,
|
305
|
+
minutes_used_next_reset_at: minutes_used_next_reset_at,
|
281
306
|
minutes_overage_cost: minutes_overage_cost,
|
282
307
|
providers_included: providers_included,
|
283
308
|
outbound_calls_daily_limit: outbound_calls_daily_limit,
|
@@ -311,6 +336,8 @@ module Vapi
|
|
311
336
|
obj.credits.is_a?(String) != false || raise("Passed value for field obj.credits is not the expected type, validation failed.")
|
312
337
|
obj.concurrency_counter.is_a?(Float) != false || raise("Passed value for field obj.concurrency_counter is not the expected type, validation failed.")
|
313
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.")
|
314
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.")
|
315
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.")
|
316
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.")
|
@@ -326,6 +353,7 @@ module Vapi
|
|
326
353
|
obj.auto_reload_plan.nil? || Vapi::AutoReloadPlan.validate_raw(obj: obj.auto_reload_plan)
|
327
354
|
obj.minutes_included&.is_a?(Float) != false || raise("Passed value for field obj.minutes_included is not the expected type, validation failed.")
|
328
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.")
|
329
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.")
|
330
358
|
obj.providers_included&.is_a?(Array) != false || raise("Passed value for field obj.providers_included is not the expected type, validation failed.")
|
331
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.")
|
@@ -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
|
@@ -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,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
|