vapi_server_sdk 0.2.0 → 0.3.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 +129 -62
- data/lib/vapi_server_sdk/assistants/client.rb +15 -2
- data/lib/vapi_server_sdk/assistants/types/update_assistant_dto_credentials_item.rb +512 -0
- data/lib/vapi_server_sdk/assistants/types/update_assistant_dto_model.rb +13 -0
- data/lib/vapi_server_sdk/assistants/types/update_assistant_dto_transcriber.rb +13 -0
- data/lib/vapi_server_sdk/assistants/types/update_assistant_dto_voice.rb +13 -0
- data/lib/vapi_server_sdk/blocks/client.rb +7 -166
- data/lib/vapi_server_sdk/blocks/types/blocks_update_request.rb +109 -0
- data/lib/vapi_server_sdk/calls/client.rb +16 -4
- data/lib/vapi_server_sdk/knowledge_bases/client.rb +7 -8
- data/lib/vapi_server_sdk/knowledge_bases/types/knowledge_bases_update_request.rb +96 -0
- data/lib/vapi_server_sdk/logs/client.rb +84 -0
- data/lib/vapi_server_sdk/phone_numbers/client.rb +7 -69
- data/lib/vapi_server_sdk/phone_numbers/types/phone_numbers_update_request.rb +122 -0
- data/lib/vapi_server_sdk/squads/client.rb +8 -0
- data/lib/vapi_server_sdk/tools/client.rb +7 -91
- data/lib/vapi_server_sdk/tools/types/tools_update_request.rb +200 -0
- data/lib/vapi_server_sdk/types/assistant.rb +19 -1
- data/lib/vapi_server_sdk/types/assistant_credentials_item.rb +510 -0
- data/lib/vapi_server_sdk/types/assistant_model.rb +13 -0
- data/lib/vapi_server_sdk/types/assistant_overrides.rb +19 -1
- data/lib/vapi_server_sdk/types/assistant_overrides_credentials_item.rb +510 -0
- data/lib/vapi_server_sdk/types/assistant_overrides_model.rb +13 -0
- data/lib/vapi_server_sdk/types/assistant_overrides_transcriber.rb +13 -0
- data/lib/vapi_server_sdk/types/assistant_overrides_voice.rb +13 -0
- data/lib/vapi_server_sdk/types/assistant_transcriber.rb +13 -0
- data/lib/vapi_server_sdk/types/assistant_voice.rb +13 -0
- data/lib/vapi_server_sdk/types/azure_blob_storage_bucket_plan.rb +88 -0
- data/lib/vapi_server_sdk/types/azure_credential.rb +22 -5
- data/lib/vapi_server_sdk/types/azure_credential_region.rb +1 -1
- data/lib/vapi_server_sdk/types/azure_credential_service.rb +9 -0
- data/lib/vapi_server_sdk/types/azure_open_ai_credential.rb +9 -1
- data/lib/vapi_server_sdk/types/azure_open_ai_credential_region.rb +1 -1
- data/lib/vapi_server_sdk/types/azure_speech_transcriber.rb +62 -0
- data/lib/vapi_server_sdk/types/azure_speech_transcriber_language.rb +152 -0
- data/lib/vapi_server_sdk/types/buy_phone_number_dto.rb +25 -29
- data/lib/vapi_server_sdk/types/byo_phone_number.rb +25 -29
- data/lib/vapi_server_sdk/types/call_ended_reason.rb +44 -29
- data/lib/vapi_server_sdk/types/cartesia_voice_model.rb +2 -0
- data/lib/vapi_server_sdk/types/cerebras_credential.rb +111 -0
- data/lib/vapi_server_sdk/types/chat_dto.rb +103 -0
- data/lib/vapi_server_sdk/types/{credits_buy_dto.rb → chat_service_response.rb} +9 -17
- data/lib/vapi_server_sdk/types/cloudflare_credential.rb +142 -0
- data/lib/vapi_server_sdk/types/cloudflare_r_2_bucket_plan.rb +105 -0
- data/lib/vapi_server_sdk/types/create_anthropic_credential_dto.rb +2 -9
- data/lib/vapi_server_sdk/types/create_anyscale_credential_dto.rb +2 -9
- data/lib/vapi_server_sdk/types/create_assembly_ai_credential_dto.rb +2 -9
- data/lib/vapi_server_sdk/types/create_assistant_dto.rb +19 -1
- data/lib/vapi_server_sdk/types/create_assistant_dto_credentials_item.rb +510 -0
- data/lib/vapi_server_sdk/types/create_assistant_dto_model.rb +13 -0
- data/lib/vapi_server_sdk/types/create_assistant_dto_transcriber.rb +13 -0
- data/lib/vapi_server_sdk/types/create_assistant_dto_voice.rb +13 -0
- data/lib/vapi_server_sdk/types/create_azure_credential_dto.rb +21 -12
- data/lib/vapi_server_sdk/types/create_azure_credential_dto_region.rb +1 -1
- data/lib/vapi_server_sdk/types/create_azure_credential_dto_service.rb +9 -0
- data/lib/vapi_server_sdk/types/create_azure_open_ai_credential_dto.rb +10 -9
- data/lib/vapi_server_sdk/types/create_azure_open_ai_credential_dto_region.rb +1 -1
- data/lib/vapi_server_sdk/types/create_byo_phone_number_dto.rb +25 -29
- data/lib/vapi_server_sdk/types/create_byo_sip_trunk_credential_dto.rb +1 -9
- data/lib/vapi_server_sdk/types/create_cartesia_credential_dto.rb +2 -9
- data/lib/vapi_server_sdk/types/create_cerebras_credential_dto.rb +74 -0
- data/lib/vapi_server_sdk/types/create_cloudflare_credential_dto.rb +101 -0
- data/lib/vapi_server_sdk/types/create_custom_llm_credential_dto.rb +2 -14
- data/lib/vapi_server_sdk/types/create_deep_infra_credential_dto.rb +2 -9
- data/lib/vapi_server_sdk/types/create_deep_seek_credential_dto.rb +67 -0
- data/lib/vapi_server_sdk/types/create_deepgram_credential_dto.rb +2 -9
- data/lib/vapi_server_sdk/types/create_eleven_labs_credential_dto.rb +2 -9
- data/lib/vapi_server_sdk/types/create_gcp_credential_dto.rb +2 -14
- data/lib/vapi_server_sdk/types/create_gladia_credential_dto.rb +2 -9
- data/lib/vapi_server_sdk/types/create_go_high_level_credential_dto.rb +2 -9
- data/lib/vapi_server_sdk/types/create_groq_credential_dto.rb +2 -9
- data/lib/vapi_server_sdk/types/create_langfuse_credential_dto.rb +2 -15
- data/lib/vapi_server_sdk/types/create_lmnt_credential_dto.rb +2 -9
- data/lib/vapi_server_sdk/types/create_make_credential_dto.rb +2 -15
- data/lib/vapi_server_sdk/types/create_open_ai_credential_dto.rb +2 -9
- data/lib/vapi_server_sdk/types/create_open_router_credential_dto.rb +2 -9
- data/lib/vapi_server_sdk/types/create_org_dto.rb +25 -25
- data/lib/vapi_server_sdk/types/create_perplexity_ai_credential_dto.rb +2 -9
- data/lib/vapi_server_sdk/types/create_play_ht_credential_dto.rb +2 -9
- data/lib/vapi_server_sdk/types/create_rime_ai_credential_dto.rb +2 -9
- data/lib/vapi_server_sdk/types/create_runpod_credential_dto.rb +2 -9
- data/lib/vapi_server_sdk/types/create_s_3_credential_dto.rb +2 -10
- data/lib/vapi_server_sdk/types/create_smallest_ai_credential_dto.rb +67 -0
- data/lib/vapi_server_sdk/types/create_tavus_credential_dto.rb +2 -9
- data/lib/vapi_server_sdk/types/create_together_ai_credential_dto.rb +2 -9
- data/lib/vapi_server_sdk/types/create_twilio_credential_dto.rb +2 -14
- data/lib/vapi_server_sdk/types/create_twilio_phone_number_dto.rb +25 -29
- data/lib/vapi_server_sdk/types/create_vapi_phone_number_dto.rb +25 -29
- data/lib/vapi_server_sdk/types/create_vonage_credential_dto.rb +2 -14
- data/lib/vapi_server_sdk/types/create_vonage_phone_number_dto.rb +25 -29
- data/lib/vapi_server_sdk/types/create_webhook_credential_dto.rb +2 -13
- data/lib/vapi_server_sdk/types/create_x_ai_credential_dto.rb +2 -11
- data/lib/vapi_server_sdk/types/deep_seek_credential.rb +111 -0
- data/lib/vapi_server_sdk/types/deep_seek_model.rb +177 -0
- data/lib/vapi_server_sdk/types/deep_seek_model_tools_item.rb +159 -0
- data/lib/vapi_server_sdk/types/eleven_labs_voice_model.rb +2 -0
- data/lib/vapi_server_sdk/types/fallback_cartesia_voice_model.rb +2 -0
- data/lib/vapi_server_sdk/types/fallback_eleven_labs_voice_model.rb +2 -0
- data/lib/vapi_server_sdk/types/fallback_open_ai_voice.rb +4 -4
- data/lib/vapi_server_sdk/types/fallback_open_ai_voice_id.rb +2 -2
- data/lib/vapi_server_sdk/types/fallback_plan_voices_item.rb +13 -0
- data/lib/vapi_server_sdk/types/fallback_smallest_ai_voice.rb +95 -0
- data/lib/vapi_server_sdk/types/fallback_smallest_ai_voice_id.rb +53 -0
- data/lib/vapi_server_sdk/types/fallback_smallest_ai_voice_id_enum.rb +31 -0
- data/lib/vapi_server_sdk/types/gemini_multimodal_live_prebuilt_voice_config.rb +58 -0
- data/lib/vapi_server_sdk/types/gemini_multimodal_live_prebuilt_voice_config_voice_name.rb +11 -0
- data/lib/vapi_server_sdk/types/gemini_multimodal_live_speech_config.rb +61 -0
- data/lib/vapi_server_sdk/types/gemini_multimodal_live_voice_config.rb +61 -0
- data/lib/vapi_server_sdk/types/google_model.rb +17 -1
- data/lib/vapi_server_sdk/types/google_model_model.rb +2 -0
- data/lib/vapi_server_sdk/types/google_realtime_config.rb +121 -0
- data/lib/vapi_server_sdk/types/groq_model_model.rb +1 -3
- data/lib/vapi_server_sdk/types/import_twilio_phone_number_dto.rb +25 -29
- data/lib/vapi_server_sdk/types/import_vonage_phone_number_dto.rb +25 -29
- data/lib/vapi_server_sdk/types/open_ai_model_fallback_models_item.rb +6 -0
- data/lib/vapi_server_sdk/types/open_ai_model_model.rb +6 -0
- data/lib/vapi_server_sdk/types/open_ai_voice.rb +4 -4
- data/lib/vapi_server_sdk/types/open_ai_voice_id.rb +2 -2
- data/lib/vapi_server_sdk/types/org.rb +25 -25
- data/lib/vapi_server_sdk/types/org_with_org_user.rb +25 -25
- data/lib/vapi_server_sdk/types/server_message_end_of_call_report_ended_reason.rb +44 -29
- data/lib/vapi_server_sdk/types/server_message_status_update.rb +11 -1
- data/lib/vapi_server_sdk/types/server_message_status_update_ended_reason.rb +44 -29
- data/lib/vapi_server_sdk/types/smallest_ai_credential.rb +111 -0
- data/lib/vapi_server_sdk/types/smallest_ai_voice.rb +117 -0
- data/lib/vapi_server_sdk/types/smallest_ai_voice_id.rb +53 -0
- data/lib/vapi_server_sdk/types/smallest_ai_voice_id_enum.rb +31 -0
- data/lib/vapi_server_sdk/types/subscription.rb +2 -2
- data/lib/vapi_server_sdk/types/sync_voice_library_dto_providers_item.rb +1 -0
- data/lib/vapi_server_sdk/types/transfer_plan.rb +26 -6
- data/lib/vapi_server_sdk/types/transfer_plan_message.rb +2 -1
- data/lib/vapi_server_sdk/types/twilio_phone_number.rb +25 -29
- data/lib/vapi_server_sdk/types/update_anthropic_credential_dto.rb +4 -11
- data/lib/vapi_server_sdk/types/update_anyscale_credential_dto.rb +4 -11
- data/lib/vapi_server_sdk/types/update_assembly_ai_credential_dto.rb +4 -11
- data/lib/vapi_server_sdk/types/update_azure_credential_dto.rb +24 -14
- data/lib/vapi_server_sdk/types/update_azure_credential_dto_region.rb +1 -1
- data/lib/vapi_server_sdk/types/update_azure_credential_dto_service.rb +9 -0
- data/lib/vapi_server_sdk/types/update_azure_open_ai_credential_dto.rb +25 -24
- data/lib/vapi_server_sdk/types/update_azure_open_ai_credential_dto_region.rb +1 -1
- data/lib/vapi_server_sdk/types/update_bash_tool_dto.rb +161 -0
- data/lib/vapi_server_sdk/types/update_bash_tool_dto_messages_item.rb +120 -0
- data/lib/vapi_server_sdk/types/update_byo_phone_number_dto.rb +187 -0
- data/lib/vapi_server_sdk/types/update_byo_phone_number_dto_fallback_destination.rb +101 -0
- data/lib/vapi_server_sdk/types/update_byo_sip_trunk_credential_dto.rb +13 -21
- data/lib/vapi_server_sdk/types/update_cartesia_credential_dto.rb +4 -11
- data/lib/vapi_server_sdk/types/update_cerebras_credential_dto.rb +67 -0
- data/lib/vapi_server_sdk/types/update_cloudflare_credential_dto.rb +101 -0
- data/lib/vapi_server_sdk/types/update_computer_tool_dto.rb +185 -0
- data/lib/vapi_server_sdk/types/update_computer_tool_dto_messages_item.rb +120 -0
- data/lib/vapi_server_sdk/types/update_conversation_block_dto.rb +206 -0
- data/lib/vapi_server_sdk/types/update_conversation_block_dto_messages_item.rb +95 -0
- data/lib/vapi_server_sdk/types/update_custom_knowledge_base_dto.rb +139 -0
- data/lib/vapi_server_sdk/types/update_custom_llm_credential_dto.rb +4 -16
- data/lib/vapi_server_sdk/types/update_deep_infra_credential_dto.rb +4 -11
- data/lib/vapi_server_sdk/types/update_deep_seek_credential_dto.rb +67 -0
- data/lib/vapi_server_sdk/types/update_deepgram_credential_dto.rb +11 -18
- data/lib/vapi_server_sdk/types/update_dtmf_tool_dto.rb +139 -0
- data/lib/vapi_server_sdk/types/update_dtmf_tool_dto_messages_item.rb +120 -0
- data/lib/vapi_server_sdk/types/update_eleven_labs_credential_dto.rb +11 -11
- data/lib/vapi_server_sdk/types/update_end_call_tool_dto.rb +139 -0
- data/lib/vapi_server_sdk/types/update_end_call_tool_dto_messages_item.rb +120 -0
- data/lib/vapi_server_sdk/types/update_function_tool_dto.rb +139 -0
- data/lib/vapi_server_sdk/types/update_function_tool_dto_messages_item.rb +120 -0
- data/lib/vapi_server_sdk/types/update_gcp_credential_dto.rb +11 -23
- data/lib/vapi_server_sdk/types/update_ghl_tool_dto.rb +159 -0
- data/lib/vapi_server_sdk/types/update_ghl_tool_dto_messages_item.rb +120 -0
- data/lib/vapi_server_sdk/types/update_gladia_credential_dto.rb +4 -11
- data/lib/vapi_server_sdk/types/update_go_high_level_credential_dto.rb +4 -11
- data/lib/vapi_server_sdk/types/update_google_credential_dto.rb +4 -13
- data/lib/vapi_server_sdk/types/update_groq_credential_dto.rb +4 -11
- data/lib/vapi_server_sdk/types/update_inflection_ai_credential_dto.rb +4 -13
- data/lib/vapi_server_sdk/types/update_langfuse_credential_dto.rb +8 -21
- data/lib/vapi_server_sdk/types/update_lmnt_credential_dto.rb +4 -11
- data/lib/vapi_server_sdk/types/update_make_credential_dto.rb +8 -21
- data/lib/vapi_server_sdk/types/update_make_tool_dto.rb +159 -0
- data/lib/vapi_server_sdk/types/update_make_tool_dto_messages_item.rb +120 -0
- data/lib/vapi_server_sdk/types/update_open_ai_credential_dto.rb +4 -11
- data/lib/vapi_server_sdk/types/update_open_router_credential_dto.rb +4 -11
- data/lib/vapi_server_sdk/types/update_org_dto.rb +25 -25
- data/lib/vapi_server_sdk/types/update_output_tool_dto.rb +139 -0
- data/lib/vapi_server_sdk/types/update_output_tool_dto_messages_item.rb +120 -0
- data/lib/vapi_server_sdk/types/update_perplexity_ai_credential_dto.rb +4 -11
- data/lib/vapi_server_sdk/types/update_play_ht_credential_dto.rb +11 -18
- data/lib/vapi_server_sdk/types/update_rime_ai_credential_dto.rb +4 -11
- data/lib/vapi_server_sdk/types/update_runpod_credential_dto.rb +4 -11
- data/lib/vapi_server_sdk/types/update_s_3_credential_dto.rb +12 -20
- data/lib/vapi_server_sdk/types/update_smallest_ai_credential_dto.rb +67 -0
- data/lib/vapi_server_sdk/types/update_tavus_credential_dto.rb +4 -11
- data/lib/vapi_server_sdk/types/update_text_editor_tool_dto.rb +161 -0
- data/lib/vapi_server_sdk/types/update_text_editor_tool_dto_messages_item.rb +120 -0
- data/lib/vapi_server_sdk/types/update_together_ai_credential_dto.rb +4 -11
- data/lib/vapi_server_sdk/types/update_token_dto.rb +81 -0
- data/lib/vapi_server_sdk/types/update_token_dto_tag.rb +9 -0
- data/lib/vapi_server_sdk/types/update_tool_call_block_dto.rb +168 -0
- data/lib/vapi_server_sdk/types/update_tool_call_block_dto_messages_item.rb +94 -0
- data/lib/vapi_server_sdk/types/update_tool_call_block_dto_tool.rb +161 -0
- data/lib/vapi_server_sdk/types/update_transfer_call_tool_dto.rb +161 -0
- data/lib/vapi_server_sdk/types/update_transfer_call_tool_dto_destinations_item.rb +121 -0
- data/lib/vapi_server_sdk/types/update_transfer_call_tool_dto_messages_item.rb +121 -0
- data/lib/vapi_server_sdk/types/update_trieve_knowledge_base_dto.rb +109 -0
- data/lib/vapi_server_sdk/types/update_twilio_credential_dto.rb +11 -23
- data/lib/vapi_server_sdk/types/update_twilio_phone_number_dto.rb +163 -0
- data/lib/vapi_server_sdk/types/update_twilio_phone_number_dto_fallback_destination.rb +101 -0
- data/lib/vapi_server_sdk/types/update_vapi_phone_number_dto.rb +169 -0
- data/lib/vapi_server_sdk/types/update_vapi_phone_number_dto_fallback_destination.rb +101 -0
- data/lib/vapi_server_sdk/types/update_vonage_credential_dto.rb +11 -23
- data/lib/vapi_server_sdk/types/update_vonage_phone_number_dto.rb +157 -0
- data/lib/vapi_server_sdk/types/update_vonage_phone_number_dto_fallback_destination.rb +101 -0
- data/lib/vapi_server_sdk/types/update_workflow_block_dto.rb +154 -0
- data/lib/vapi_server_sdk/types/update_workflow_block_dto_messages_item.rb +94 -0
- data/lib/vapi_server_sdk/types/update_workflow_block_dto_steps_item.rb +94 -0
- data/lib/vapi_server_sdk/types/update_x_ai_credential_dto.rb +4 -13
- data/lib/vapi_server_sdk/types/vapi_phone_number.rb +25 -29
- data/lib/vapi_server_sdk/types/vonage_phone_number.rb +25 -29
- metadata +88 -21
- data/lib/vapi_server_sdk/blocks/types/update_block_dto_messages_item.rb +0 -96
- data/lib/vapi_server_sdk/blocks/types/update_block_dto_steps_item.rb +0 -96
- data/lib/vapi_server_sdk/blocks/types/update_block_dto_tool.rb +0 -163
- data/lib/vapi_server_sdk/phone_numbers/types/update_phone_number_dto_fallback_destination.rb +0 -103
- data/lib/vapi_server_sdk/tools/types/update_tool_dto_messages_item.rb +0 -122
- data/lib/vapi_server_sdk/types/auto_reload_plan_dto.rb +0 -65
- data/lib/vapi_server_sdk/types/hipaa_buy_dto.rb +0 -65
- data/lib/vapi_server_sdk/types/payment.rb +0 -167
- data/lib/vapi_server_sdk/types/payment_retry_dto.rb +0 -55
- data/lib/vapi_server_sdk/types/payment_status.rb +0 -11
- data/lib/vapi_server_sdk/types/payments_paginated_response.rb +0 -75
- data/lib/vapi_server_sdk/types/subscription_concurrency_line_buy_dto.rb +0 -55
- data/lib/vapi_server_sdk/types/subscription_concurrency_line_remove_dto.rb +0 -55
- data/lib/vapi_server_sdk/types/subscription_coupon_add_dto.rb +0 -67
- data/lib/vapi_server_sdk/types/subscription_monthly_charge.rb +0 -65
@@ -0,0 +1,109 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "trieve_knowledge_base_vector_store_search_plan"
|
4
|
+
require_relative "trieve_knowledge_base_vector_store_create_plan"
|
5
|
+
require "ostruct"
|
6
|
+
require "json"
|
7
|
+
|
8
|
+
module Vapi
|
9
|
+
class UpdateTrieveKnowledgeBaseDto
|
10
|
+
# @return [String] This is the name of the knowledge base.
|
11
|
+
attr_reader :name
|
12
|
+
# @return [Vapi::TrieveKnowledgeBaseVectorStoreSearchPlan] This is the plan on how to search the vector store while a call is going on.
|
13
|
+
attr_reader :vector_store_search_plan
|
14
|
+
# @return [Vapi::TrieveKnowledgeBaseVectorStoreCreatePlan] This is the plan if you want us to create a new vector store on your behalf. To
|
15
|
+
# use an existing vector store from your account, use `vectoreStoreProviderId`
|
16
|
+
attr_reader :vector_store_create_plan
|
17
|
+
# @return [String] This is an vector store that you already have on your account with the provider.
|
18
|
+
# To create a new vector store, use vectorStoreCreatePlan.
|
19
|
+
# Usage:
|
20
|
+
# - To bring your own vector store from Trieve, go to https://trieve.ai
|
21
|
+
# - Create a dataset, and use the datasetId here.
|
22
|
+
attr_reader :vector_store_provider_id
|
23
|
+
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
24
|
+
attr_reader :additional_properties
|
25
|
+
# @return [Object]
|
26
|
+
attr_reader :_field_set
|
27
|
+
protected :_field_set
|
28
|
+
|
29
|
+
OMIT = Object.new
|
30
|
+
|
31
|
+
# @param name [String] This is the name of the knowledge base.
|
32
|
+
# @param vector_store_search_plan [Vapi::TrieveKnowledgeBaseVectorStoreSearchPlan] This is the plan on how to search the vector store while a call is going on.
|
33
|
+
# @param vector_store_create_plan [Vapi::TrieveKnowledgeBaseVectorStoreCreatePlan] This is the plan if you want us to create a new vector store on your behalf. To
|
34
|
+
# use an existing vector store from your account, use `vectoreStoreProviderId`
|
35
|
+
# @param vector_store_provider_id [String] This is an vector store that you already have on your account with the provider.
|
36
|
+
# To create a new vector store, use vectorStoreCreatePlan.
|
37
|
+
# Usage:
|
38
|
+
# - To bring your own vector store from Trieve, go to https://trieve.ai
|
39
|
+
# - Create a dataset, and use the datasetId here.
|
40
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
41
|
+
# @return [Vapi::UpdateTrieveKnowledgeBaseDto]
|
42
|
+
def initialize(name: OMIT, vector_store_search_plan: OMIT, vector_store_create_plan: OMIT,
|
43
|
+
vector_store_provider_id: OMIT, additional_properties: nil)
|
44
|
+
@name = name if name != OMIT
|
45
|
+
@vector_store_search_plan = vector_store_search_plan if vector_store_search_plan != OMIT
|
46
|
+
@vector_store_create_plan = vector_store_create_plan if vector_store_create_plan != OMIT
|
47
|
+
@vector_store_provider_id = vector_store_provider_id if vector_store_provider_id != OMIT
|
48
|
+
@additional_properties = additional_properties
|
49
|
+
@_field_set = {
|
50
|
+
"name": name,
|
51
|
+
"vectorStoreSearchPlan": vector_store_search_plan,
|
52
|
+
"vectorStoreCreatePlan": vector_store_create_plan,
|
53
|
+
"vectorStoreProviderId": vector_store_provider_id
|
54
|
+
}.reject do |_k, v|
|
55
|
+
v == OMIT
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
# Deserialize a JSON object to an instance of UpdateTrieveKnowledgeBaseDto
|
60
|
+
#
|
61
|
+
# @param json_object [String]
|
62
|
+
# @return [Vapi::UpdateTrieveKnowledgeBaseDto]
|
63
|
+
def self.from_json(json_object:)
|
64
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
65
|
+
parsed_json = JSON.parse(json_object)
|
66
|
+
name = parsed_json["name"]
|
67
|
+
if parsed_json["vectorStoreSearchPlan"].nil?
|
68
|
+
vector_store_search_plan = nil
|
69
|
+
else
|
70
|
+
vector_store_search_plan = parsed_json["vectorStoreSearchPlan"].to_json
|
71
|
+
vector_store_search_plan = Vapi::TrieveKnowledgeBaseVectorStoreSearchPlan.from_json(json_object: vector_store_search_plan)
|
72
|
+
end
|
73
|
+
if parsed_json["vectorStoreCreatePlan"].nil?
|
74
|
+
vector_store_create_plan = nil
|
75
|
+
else
|
76
|
+
vector_store_create_plan = parsed_json["vectorStoreCreatePlan"].to_json
|
77
|
+
vector_store_create_plan = Vapi::TrieveKnowledgeBaseVectorStoreCreatePlan.from_json(json_object: vector_store_create_plan)
|
78
|
+
end
|
79
|
+
vector_store_provider_id = parsed_json["vectorStoreProviderId"]
|
80
|
+
new(
|
81
|
+
name: name,
|
82
|
+
vector_store_search_plan: vector_store_search_plan,
|
83
|
+
vector_store_create_plan: vector_store_create_plan,
|
84
|
+
vector_store_provider_id: vector_store_provider_id,
|
85
|
+
additional_properties: struct
|
86
|
+
)
|
87
|
+
end
|
88
|
+
|
89
|
+
# Serialize an instance of UpdateTrieveKnowledgeBaseDto to a JSON object
|
90
|
+
#
|
91
|
+
# @return [String]
|
92
|
+
def to_json(*_args)
|
93
|
+
@_field_set&.to_json
|
94
|
+
end
|
95
|
+
|
96
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
97
|
+
# hash and check each fields type against the current object's property
|
98
|
+
# definitions.
|
99
|
+
#
|
100
|
+
# @param obj [Object]
|
101
|
+
# @return [Void]
|
102
|
+
def self.validate_raw(obj:)
|
103
|
+
obj.name&.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
|
104
|
+
obj.vector_store_search_plan.nil? || Vapi::TrieveKnowledgeBaseVectorStoreSearchPlan.validate_raw(obj: obj.vector_store_search_plan)
|
105
|
+
obj.vector_store_create_plan.nil? || Vapi::TrieveKnowledgeBaseVectorStoreCreatePlan.validate_raw(obj: obj.vector_store_create_plan)
|
106
|
+
obj.vector_store_provider_id&.is_a?(String) != false || raise("Passed value for field obj.vector_store_provider_id is not the expected type, validation failed.")
|
107
|
+
end
|
108
|
+
end
|
109
|
+
end
|
@@ -5,14 +5,12 @@ require "json"
|
|
5
5
|
|
6
6
|
module Vapi
|
7
7
|
class UpdateTwilioCredentialDto
|
8
|
-
# @return [String]
|
9
|
-
attr_reader :provider
|
10
8
|
# @return [String] This is not returned in the API.
|
11
9
|
attr_reader :auth_token
|
12
|
-
# @return [String]
|
13
|
-
attr_reader :account_sid
|
14
10
|
# @return [String] This is the name of credential. This is just for your reference.
|
15
11
|
attr_reader :name
|
12
|
+
# @return [String]
|
13
|
+
attr_reader :account_sid
|
16
14
|
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
17
15
|
attr_reader :additional_properties
|
18
16
|
# @return [Object]
|
@@ -21,24 +19,17 @@ module Vapi
|
|
21
19
|
|
22
20
|
OMIT = Object.new
|
23
21
|
|
24
|
-
# @param provider [String]
|
25
22
|
# @param auth_token [String] This is not returned in the API.
|
26
|
-
# @param account_sid [String]
|
27
23
|
# @param name [String] This is the name of credential. This is just for your reference.
|
24
|
+
# @param account_sid [String]
|
28
25
|
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
29
26
|
# @return [Vapi::UpdateTwilioCredentialDto]
|
30
|
-
def initialize(
|
31
|
-
@
|
32
|
-
@auth_token = auth_token
|
33
|
-
@account_sid = account_sid
|
27
|
+
def initialize(auth_token: OMIT, name: OMIT, account_sid: OMIT, additional_properties: nil)
|
28
|
+
@auth_token = auth_token if auth_token != OMIT
|
34
29
|
@name = name if name != OMIT
|
30
|
+
@account_sid = account_sid if account_sid != OMIT
|
35
31
|
@additional_properties = additional_properties
|
36
|
-
@_field_set = {
|
37
|
-
"provider": provider,
|
38
|
-
"authToken": auth_token,
|
39
|
-
"accountSid": account_sid,
|
40
|
-
"name": name
|
41
|
-
}.reject do |_k, v|
|
32
|
+
@_field_set = { "authToken": auth_token, "name": name, "accountSid": account_sid }.reject do |_k, v|
|
42
33
|
v == OMIT
|
43
34
|
end
|
44
35
|
end
|
@@ -50,15 +41,13 @@ module Vapi
|
|
50
41
|
def self.from_json(json_object:)
|
51
42
|
struct = JSON.parse(json_object, object_class: OpenStruct)
|
52
43
|
parsed_json = JSON.parse(json_object)
|
53
|
-
provider = parsed_json["provider"]
|
54
44
|
auth_token = parsed_json["authToken"]
|
55
|
-
account_sid = parsed_json["accountSid"]
|
56
45
|
name = parsed_json["name"]
|
46
|
+
account_sid = parsed_json["accountSid"]
|
57
47
|
new(
|
58
|
-
provider: provider,
|
59
48
|
auth_token: auth_token,
|
60
|
-
account_sid: account_sid,
|
61
49
|
name: name,
|
50
|
+
account_sid: account_sid,
|
62
51
|
additional_properties: struct
|
63
52
|
)
|
64
53
|
end
|
@@ -77,10 +66,9 @@ module Vapi
|
|
77
66
|
# @param obj [Object]
|
78
67
|
# @return [Void]
|
79
68
|
def self.validate_raw(obj:)
|
80
|
-
obj.
|
81
|
-
obj.auth_token.is_a?(String) != false || raise("Passed value for field obj.auth_token is not the expected type, validation failed.")
|
82
|
-
obj.account_sid.is_a?(String) != false || raise("Passed value for field obj.account_sid is not the expected type, validation failed.")
|
69
|
+
obj.auth_token&.is_a?(String) != false || raise("Passed value for field obj.auth_token is not the expected type, validation failed.")
|
83
70
|
obj.name&.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
|
71
|
+
obj.account_sid&.is_a?(String) != false || raise("Passed value for field obj.account_sid is not the expected type, validation failed.")
|
84
72
|
end
|
85
73
|
end
|
86
74
|
end
|
@@ -0,0 +1,163 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "update_twilio_phone_number_dto_fallback_destination"
|
4
|
+
require_relative "server"
|
5
|
+
require "ostruct"
|
6
|
+
require "json"
|
7
|
+
|
8
|
+
module Vapi
|
9
|
+
class UpdateTwilioPhoneNumberDto
|
10
|
+
# @return [Vapi::UpdateTwilioPhoneNumberDtoFallbackDestination] This is the fallback destination an inbound call will be transferred to if:
|
11
|
+
# 1. `assistantId` is not set
|
12
|
+
# 2. `squadId` is not set
|
13
|
+
# 3. and, `assistant-request` message to the `serverUrl` fails
|
14
|
+
# If this is not set and above conditions are met, the inbound call is hung up
|
15
|
+
# with an error message.
|
16
|
+
attr_reader :fallback_destination
|
17
|
+
# @return [String] This is the name of the phone number. This is just for your own reference.
|
18
|
+
attr_reader :name
|
19
|
+
# @return [String] This is the assistant that will be used for incoming calls to this phone number.
|
20
|
+
# If neither `assistantId` nor `squadId` is set, `assistant-request` will be sent
|
21
|
+
# to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the
|
22
|
+
# shape of the message and response that is expected.
|
23
|
+
attr_reader :assistant_id
|
24
|
+
# @return [String] This is the squad that will be used for incoming calls to this phone number.
|
25
|
+
# If neither `assistantId` nor `squadId` is set, `assistant-request` will be sent
|
26
|
+
# to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the
|
27
|
+
# shape of the message and response that is expected.
|
28
|
+
attr_reader :squad_id
|
29
|
+
# @return [Vapi::Server] This is where Vapi will send webhooks. You can find all webhooks available along
|
30
|
+
# with their shape in ServerMessage schema.
|
31
|
+
# The order of precedence is:
|
32
|
+
# 1. assistant.server
|
33
|
+
# 2. phoneNumber.server
|
34
|
+
# 3. org.server
|
35
|
+
attr_reader :server
|
36
|
+
# @return [String] These are the digits of the phone number you own on your Twilio.
|
37
|
+
attr_reader :number
|
38
|
+
# @return [String] This is the Twilio Account SID for the phone number.
|
39
|
+
attr_reader :twilio_account_sid
|
40
|
+
# @return [String] This is the Twilio Auth Token for the phone number.
|
41
|
+
attr_reader :twilio_auth_token
|
42
|
+
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
43
|
+
attr_reader :additional_properties
|
44
|
+
# @return [Object]
|
45
|
+
attr_reader :_field_set
|
46
|
+
protected :_field_set
|
47
|
+
|
48
|
+
OMIT = Object.new
|
49
|
+
|
50
|
+
# @param fallback_destination [Vapi::UpdateTwilioPhoneNumberDtoFallbackDestination] This is the fallback destination an inbound call will be transferred to if:
|
51
|
+
# 1. `assistantId` is not set
|
52
|
+
# 2. `squadId` is not set
|
53
|
+
# 3. and, `assistant-request` message to the `serverUrl` fails
|
54
|
+
# If this is not set and above conditions are met, the inbound call is hung up
|
55
|
+
# with an error message.
|
56
|
+
# @param name [String] This is the name of the phone number. This is just for your own reference.
|
57
|
+
# @param assistant_id [String] This is the assistant that will be used for incoming calls to this phone number.
|
58
|
+
# If neither `assistantId` nor `squadId` is set, `assistant-request` will be sent
|
59
|
+
# to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the
|
60
|
+
# shape of the message and response that is expected.
|
61
|
+
# @param squad_id [String] This is the squad that will be used for incoming calls to this phone number.
|
62
|
+
# If neither `assistantId` nor `squadId` is set, `assistant-request` will be sent
|
63
|
+
# to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the
|
64
|
+
# shape of the message and response that is expected.
|
65
|
+
# @param server [Vapi::Server] This is where Vapi will send webhooks. You can find all webhooks available along
|
66
|
+
# with their shape in ServerMessage schema.
|
67
|
+
# The order of precedence is:
|
68
|
+
# 1. assistant.server
|
69
|
+
# 2. phoneNumber.server
|
70
|
+
# 3. org.server
|
71
|
+
# @param number [String] These are the digits of the phone number you own on your Twilio.
|
72
|
+
# @param twilio_account_sid [String] This is the Twilio Account SID for the phone number.
|
73
|
+
# @param twilio_auth_token [String] This is the Twilio Auth Token for the phone number.
|
74
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
75
|
+
# @return [Vapi::UpdateTwilioPhoneNumberDto]
|
76
|
+
def initialize(fallback_destination: OMIT, name: OMIT, assistant_id: OMIT, squad_id: OMIT, server: OMIT,
|
77
|
+
number: OMIT, twilio_account_sid: OMIT, twilio_auth_token: OMIT, additional_properties: nil)
|
78
|
+
@fallback_destination = fallback_destination if fallback_destination != OMIT
|
79
|
+
@name = name if name != OMIT
|
80
|
+
@assistant_id = assistant_id if assistant_id != OMIT
|
81
|
+
@squad_id = squad_id if squad_id != OMIT
|
82
|
+
@server = server if server != OMIT
|
83
|
+
@number = number if number != OMIT
|
84
|
+
@twilio_account_sid = twilio_account_sid if twilio_account_sid != OMIT
|
85
|
+
@twilio_auth_token = twilio_auth_token if twilio_auth_token != OMIT
|
86
|
+
@additional_properties = additional_properties
|
87
|
+
@_field_set = {
|
88
|
+
"fallbackDestination": fallback_destination,
|
89
|
+
"name": name,
|
90
|
+
"assistantId": assistant_id,
|
91
|
+
"squadId": squad_id,
|
92
|
+
"server": server,
|
93
|
+
"number": number,
|
94
|
+
"twilioAccountSid": twilio_account_sid,
|
95
|
+
"twilioAuthToken": twilio_auth_token
|
96
|
+
}.reject do |_k, v|
|
97
|
+
v == OMIT
|
98
|
+
end
|
99
|
+
end
|
100
|
+
|
101
|
+
# Deserialize a JSON object to an instance of UpdateTwilioPhoneNumberDto
|
102
|
+
#
|
103
|
+
# @param json_object [String]
|
104
|
+
# @return [Vapi::UpdateTwilioPhoneNumberDto]
|
105
|
+
def self.from_json(json_object:)
|
106
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
107
|
+
parsed_json = JSON.parse(json_object)
|
108
|
+
if parsed_json["fallbackDestination"].nil?
|
109
|
+
fallback_destination = nil
|
110
|
+
else
|
111
|
+
fallback_destination = parsed_json["fallbackDestination"].to_json
|
112
|
+
fallback_destination = Vapi::UpdateTwilioPhoneNumberDtoFallbackDestination.from_json(json_object: fallback_destination)
|
113
|
+
end
|
114
|
+
name = parsed_json["name"]
|
115
|
+
assistant_id = parsed_json["assistantId"]
|
116
|
+
squad_id = parsed_json["squadId"]
|
117
|
+
if parsed_json["server"].nil?
|
118
|
+
server = nil
|
119
|
+
else
|
120
|
+
server = parsed_json["server"].to_json
|
121
|
+
server = Vapi::Server.from_json(json_object: server)
|
122
|
+
end
|
123
|
+
number = parsed_json["number"]
|
124
|
+
twilio_account_sid = parsed_json["twilioAccountSid"]
|
125
|
+
twilio_auth_token = parsed_json["twilioAuthToken"]
|
126
|
+
new(
|
127
|
+
fallback_destination: fallback_destination,
|
128
|
+
name: name,
|
129
|
+
assistant_id: assistant_id,
|
130
|
+
squad_id: squad_id,
|
131
|
+
server: server,
|
132
|
+
number: number,
|
133
|
+
twilio_account_sid: twilio_account_sid,
|
134
|
+
twilio_auth_token: twilio_auth_token,
|
135
|
+
additional_properties: struct
|
136
|
+
)
|
137
|
+
end
|
138
|
+
|
139
|
+
# Serialize an instance of UpdateTwilioPhoneNumberDto to a JSON object
|
140
|
+
#
|
141
|
+
# @return [String]
|
142
|
+
def to_json(*_args)
|
143
|
+
@_field_set&.to_json
|
144
|
+
end
|
145
|
+
|
146
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
147
|
+
# hash and check each fields type against the current object's property
|
148
|
+
# definitions.
|
149
|
+
#
|
150
|
+
# @param obj [Object]
|
151
|
+
# @return [Void]
|
152
|
+
def self.validate_raw(obj:)
|
153
|
+
obj.fallback_destination.nil? || Vapi::UpdateTwilioPhoneNumberDtoFallbackDestination.validate_raw(obj: obj.fallback_destination)
|
154
|
+
obj.name&.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
|
155
|
+
obj.assistant_id&.is_a?(String) != false || raise("Passed value for field obj.assistant_id is not the expected type, validation failed.")
|
156
|
+
obj.squad_id&.is_a?(String) != false || raise("Passed value for field obj.squad_id is not the expected type, validation failed.")
|
157
|
+
obj.server.nil? || Vapi::Server.validate_raw(obj: obj.server)
|
158
|
+
obj.number&.is_a?(String) != false || raise("Passed value for field obj.number is not the expected type, validation failed.")
|
159
|
+
obj.twilio_account_sid&.is_a?(String) != false || raise("Passed value for field obj.twilio_account_sid is not the expected type, validation failed.")
|
160
|
+
obj.twilio_auth_token&.is_a?(String) != false || raise("Passed value for field obj.twilio_auth_token is not the expected type, validation failed.")
|
161
|
+
end
|
162
|
+
end
|
163
|
+
end
|
@@ -0,0 +1,101 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "json"
|
4
|
+
require_relative "transfer_destination_number"
|
5
|
+
require_relative "transfer_destination_sip"
|
6
|
+
|
7
|
+
module Vapi
|
8
|
+
# This is the fallback destination an inbound call will be transferred to if:
|
9
|
+
# 1. `assistantId` is not set
|
10
|
+
# 2. `squadId` is not set
|
11
|
+
# 3. and, `assistant-request` message to the `serverUrl` fails
|
12
|
+
# If this is not set and above conditions are met, the inbound call is hung up
|
13
|
+
# with an error message.
|
14
|
+
class UpdateTwilioPhoneNumberDtoFallbackDestination
|
15
|
+
# @return [Object]
|
16
|
+
attr_reader :member
|
17
|
+
# @return [String]
|
18
|
+
attr_reader :discriminant
|
19
|
+
|
20
|
+
private_class_method :new
|
21
|
+
alias kind_of? is_a?
|
22
|
+
|
23
|
+
# @param member [Object]
|
24
|
+
# @param discriminant [String]
|
25
|
+
# @return [Vapi::UpdateTwilioPhoneNumberDtoFallbackDestination]
|
26
|
+
def initialize(member:, discriminant:)
|
27
|
+
@member = member
|
28
|
+
@discriminant = discriminant
|
29
|
+
end
|
30
|
+
|
31
|
+
# Deserialize a JSON object to an instance of
|
32
|
+
# UpdateTwilioPhoneNumberDtoFallbackDestination
|
33
|
+
#
|
34
|
+
# @param json_object [String]
|
35
|
+
# @return [Vapi::UpdateTwilioPhoneNumberDtoFallbackDestination]
|
36
|
+
def self.from_json(json_object:)
|
37
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
38
|
+
member = case struct.type
|
39
|
+
when "number"
|
40
|
+
Vapi::TransferDestinationNumber.from_json(json_object: json_object)
|
41
|
+
when "sip"
|
42
|
+
Vapi::TransferDestinationSip.from_json(json_object: json_object)
|
43
|
+
else
|
44
|
+
Vapi::TransferDestinationNumber.from_json(json_object: json_object)
|
45
|
+
end
|
46
|
+
new(member: member, discriminant: struct.type)
|
47
|
+
end
|
48
|
+
|
49
|
+
# For Union Types, to_json functionality is delegated to the wrapped member.
|
50
|
+
#
|
51
|
+
# @return [String]
|
52
|
+
def to_json(*_args)
|
53
|
+
case @discriminant
|
54
|
+
when "number"
|
55
|
+
{ **@member.to_json, type: @discriminant }.to_json
|
56
|
+
when "sip"
|
57
|
+
{ **@member.to_json, type: @discriminant }.to_json
|
58
|
+
else
|
59
|
+
{ "type": @discriminant, value: @member }.to_json
|
60
|
+
end
|
61
|
+
@member.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
|
+
case obj.type
|
72
|
+
when "number"
|
73
|
+
Vapi::TransferDestinationNumber.validate_raw(obj: obj)
|
74
|
+
when "sip"
|
75
|
+
Vapi::TransferDestinationSip.validate_raw(obj: obj)
|
76
|
+
else
|
77
|
+
raise("Passed value matched no type within the union, validation failed.")
|
78
|
+
end
|
79
|
+
end
|
80
|
+
|
81
|
+
# For Union Types, is_a? functionality is delegated to the wrapped member.
|
82
|
+
#
|
83
|
+
# @param obj [Object]
|
84
|
+
# @return [Boolean]
|
85
|
+
def is_a?(obj)
|
86
|
+
@member.is_a?(obj)
|
87
|
+
end
|
88
|
+
|
89
|
+
# @param member [Vapi::TransferDestinationNumber]
|
90
|
+
# @return [Vapi::UpdateTwilioPhoneNumberDtoFallbackDestination]
|
91
|
+
def self.number(member:)
|
92
|
+
new(member: member, discriminant: "number")
|
93
|
+
end
|
94
|
+
|
95
|
+
# @param member [Vapi::TransferDestinationSip]
|
96
|
+
# @return [Vapi::UpdateTwilioPhoneNumberDtoFallbackDestination]
|
97
|
+
def self.sip(member:)
|
98
|
+
new(member: member, discriminant: "sip")
|
99
|
+
end
|
100
|
+
end
|
101
|
+
end
|
@@ -0,0 +1,169 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "update_vapi_phone_number_dto_fallback_destination"
|
4
|
+
require_relative "server"
|
5
|
+
require_relative "sip_authentication"
|
6
|
+
require "ostruct"
|
7
|
+
require "json"
|
8
|
+
|
9
|
+
module Vapi
|
10
|
+
class UpdateVapiPhoneNumberDto
|
11
|
+
# @return [Vapi::UpdateVapiPhoneNumberDtoFallbackDestination] This is the fallback destination an inbound call will be transferred to if:
|
12
|
+
# 1. `assistantId` is not set
|
13
|
+
# 2. `squadId` is not set
|
14
|
+
# 3. and, `assistant-request` message to the `serverUrl` fails
|
15
|
+
# If this is not set and above conditions are met, the inbound call is hung up
|
16
|
+
# with an error message.
|
17
|
+
attr_reader :fallback_destination
|
18
|
+
# @return [String] This is the name of the phone number. This is just for your own reference.
|
19
|
+
attr_reader :name
|
20
|
+
# @return [String] This is the assistant that will be used for incoming calls to this phone number.
|
21
|
+
# If neither `assistantId` nor `squadId` is set, `assistant-request` will be sent
|
22
|
+
# to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the
|
23
|
+
# shape of the message and response that is expected.
|
24
|
+
attr_reader :assistant_id
|
25
|
+
# @return [String] This is the squad that will be used for incoming calls to this phone number.
|
26
|
+
# If neither `assistantId` nor `squadId` is set, `assistant-request` will be sent
|
27
|
+
# to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the
|
28
|
+
# shape of the message and response that is expected.
|
29
|
+
attr_reader :squad_id
|
30
|
+
# @return [Vapi::Server] This is where Vapi will send webhooks. You can find all webhooks available along
|
31
|
+
# with their shape in ServerMessage schema.
|
32
|
+
# The order of precedence is:
|
33
|
+
# 1. assistant.server
|
34
|
+
# 2. phoneNumber.server
|
35
|
+
# 3. org.server
|
36
|
+
attr_reader :server
|
37
|
+
# @return [String] This is the SIP URI of the phone number. You can SIP INVITE this. The assistant
|
38
|
+
# attached to this number will answer.
|
39
|
+
# This is case-insensitive.
|
40
|
+
attr_reader :sip_uri
|
41
|
+
# @return [Vapi::SipAuthentication] This enables authentication for incoming SIP INVITE requests to the `sipUri`.
|
42
|
+
# If not set, any username/password to the 401 challenge of the SIP INVITE will be
|
43
|
+
# accepted.
|
44
|
+
attr_reader :authentication
|
45
|
+
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
46
|
+
attr_reader :additional_properties
|
47
|
+
# @return [Object]
|
48
|
+
attr_reader :_field_set
|
49
|
+
protected :_field_set
|
50
|
+
|
51
|
+
OMIT = Object.new
|
52
|
+
|
53
|
+
# @param fallback_destination [Vapi::UpdateVapiPhoneNumberDtoFallbackDestination] This is the fallback destination an inbound call will be transferred to if:
|
54
|
+
# 1. `assistantId` is not set
|
55
|
+
# 2. `squadId` is not set
|
56
|
+
# 3. and, `assistant-request` message to the `serverUrl` fails
|
57
|
+
# If this is not set and above conditions are met, the inbound call is hung up
|
58
|
+
# with an error message.
|
59
|
+
# @param name [String] This is the name of the phone number. This is just for your own reference.
|
60
|
+
# @param assistant_id [String] This is the assistant that will be used for incoming calls to this phone number.
|
61
|
+
# If neither `assistantId` nor `squadId` is set, `assistant-request` will be sent
|
62
|
+
# to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the
|
63
|
+
# shape of the message and response that is expected.
|
64
|
+
# @param squad_id [String] This is the squad that will be used for incoming calls to this phone number.
|
65
|
+
# If neither `assistantId` nor `squadId` is set, `assistant-request` will be sent
|
66
|
+
# to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the
|
67
|
+
# shape of the message and response that is expected.
|
68
|
+
# @param server [Vapi::Server] This is where Vapi will send webhooks. You can find all webhooks available along
|
69
|
+
# with their shape in ServerMessage schema.
|
70
|
+
# The order of precedence is:
|
71
|
+
# 1. assistant.server
|
72
|
+
# 2. phoneNumber.server
|
73
|
+
# 3. org.server
|
74
|
+
# @param sip_uri [String] This is the SIP URI of the phone number. You can SIP INVITE this. The assistant
|
75
|
+
# attached to this number will answer.
|
76
|
+
# This is case-insensitive.
|
77
|
+
# @param authentication [Vapi::SipAuthentication] This enables authentication for incoming SIP INVITE requests to the `sipUri`.
|
78
|
+
# If not set, any username/password to the 401 challenge of the SIP INVITE will be
|
79
|
+
# accepted.
|
80
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
81
|
+
# @return [Vapi::UpdateVapiPhoneNumberDto]
|
82
|
+
def initialize(fallback_destination: OMIT, name: OMIT, assistant_id: OMIT, squad_id: OMIT, server: OMIT,
|
83
|
+
sip_uri: OMIT, authentication: OMIT, additional_properties: nil)
|
84
|
+
@fallback_destination = fallback_destination if fallback_destination != OMIT
|
85
|
+
@name = name if name != OMIT
|
86
|
+
@assistant_id = assistant_id if assistant_id != OMIT
|
87
|
+
@squad_id = squad_id if squad_id != OMIT
|
88
|
+
@server = server if server != OMIT
|
89
|
+
@sip_uri = sip_uri if sip_uri != OMIT
|
90
|
+
@authentication = authentication if authentication != OMIT
|
91
|
+
@additional_properties = additional_properties
|
92
|
+
@_field_set = {
|
93
|
+
"fallbackDestination": fallback_destination,
|
94
|
+
"name": name,
|
95
|
+
"assistantId": assistant_id,
|
96
|
+
"squadId": squad_id,
|
97
|
+
"server": server,
|
98
|
+
"sipUri": sip_uri,
|
99
|
+
"authentication": authentication
|
100
|
+
}.reject do |_k, v|
|
101
|
+
v == OMIT
|
102
|
+
end
|
103
|
+
end
|
104
|
+
|
105
|
+
# Deserialize a JSON object to an instance of UpdateVapiPhoneNumberDto
|
106
|
+
#
|
107
|
+
# @param json_object [String]
|
108
|
+
# @return [Vapi::UpdateVapiPhoneNumberDto]
|
109
|
+
def self.from_json(json_object:)
|
110
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
111
|
+
parsed_json = JSON.parse(json_object)
|
112
|
+
if parsed_json["fallbackDestination"].nil?
|
113
|
+
fallback_destination = nil
|
114
|
+
else
|
115
|
+
fallback_destination = parsed_json["fallbackDestination"].to_json
|
116
|
+
fallback_destination = Vapi::UpdateVapiPhoneNumberDtoFallbackDestination.from_json(json_object: fallback_destination)
|
117
|
+
end
|
118
|
+
name = parsed_json["name"]
|
119
|
+
assistant_id = parsed_json["assistantId"]
|
120
|
+
squad_id = parsed_json["squadId"]
|
121
|
+
if parsed_json["server"].nil?
|
122
|
+
server = nil
|
123
|
+
else
|
124
|
+
server = parsed_json["server"].to_json
|
125
|
+
server = Vapi::Server.from_json(json_object: server)
|
126
|
+
end
|
127
|
+
sip_uri = parsed_json["sipUri"]
|
128
|
+
if parsed_json["authentication"].nil?
|
129
|
+
authentication = nil
|
130
|
+
else
|
131
|
+
authentication = parsed_json["authentication"].to_json
|
132
|
+
authentication = Vapi::SipAuthentication.from_json(json_object: authentication)
|
133
|
+
end
|
134
|
+
new(
|
135
|
+
fallback_destination: fallback_destination,
|
136
|
+
name: name,
|
137
|
+
assistant_id: assistant_id,
|
138
|
+
squad_id: squad_id,
|
139
|
+
server: server,
|
140
|
+
sip_uri: sip_uri,
|
141
|
+
authentication: authentication,
|
142
|
+
additional_properties: struct
|
143
|
+
)
|
144
|
+
end
|
145
|
+
|
146
|
+
# Serialize an instance of UpdateVapiPhoneNumberDto to a JSON object
|
147
|
+
#
|
148
|
+
# @return [String]
|
149
|
+
def to_json(*_args)
|
150
|
+
@_field_set&.to_json
|
151
|
+
end
|
152
|
+
|
153
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
154
|
+
# hash and check each fields type against the current object's property
|
155
|
+
# definitions.
|
156
|
+
#
|
157
|
+
# @param obj [Object]
|
158
|
+
# @return [Void]
|
159
|
+
def self.validate_raw(obj:)
|
160
|
+
obj.fallback_destination.nil? || Vapi::UpdateVapiPhoneNumberDtoFallbackDestination.validate_raw(obj: obj.fallback_destination)
|
161
|
+
obj.name&.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
|
162
|
+
obj.assistant_id&.is_a?(String) != false || raise("Passed value for field obj.assistant_id is not the expected type, validation failed.")
|
163
|
+
obj.squad_id&.is_a?(String) != false || raise("Passed value for field obj.squad_id is not the expected type, validation failed.")
|
164
|
+
obj.server.nil? || Vapi::Server.validate_raw(obj: obj.server)
|
165
|
+
obj.sip_uri&.is_a?(String) != false || raise("Passed value for field obj.sip_uri is not the expected type, validation failed.")
|
166
|
+
obj.authentication.nil? || Vapi::SipAuthentication.validate_raw(obj: obj.authentication)
|
167
|
+
end
|
168
|
+
end
|
169
|
+
end
|