From 460d054d62140095230f721175d0dce7f920001f Mon Sep 17 00:00:00 2001 From: fern-api <115122769+fern-api[bot]@users.noreply.github.com> Date: Mon, 3 Mar 2025 14:53:42 +0000 Subject: [PATCH 1/5] Release 0.5.0 --- src/Vapi.Net.Test/Core/EnumSerializerTests.cs | 83 +++-- .../Core/OneOfSerializerTests.cs | 311 ++++++++++++++++++ .../Core/Pagination/GuidCursorTest.cs | 7 +- .../Core/Pagination/HasNextPageOffsetTest.cs | 7 +- .../Core/Pagination/IntOffsetTest.cs | 7 +- .../Core/Pagination/LongOffsetTest.cs | 7 +- .../Core/Pagination/NoRequestCursorTest.cs | 7 +- .../Core/Pagination/NoRequestOffsetTest.cs | 7 +- .../Core/Pagination/StepOffsetTest.cs | 7 +- .../Core/Pagination/StringCursorTest.cs | 7 +- src/Vapi.Net.Test/Core/RawClientTests.cs | 194 ++++++----- src/Vapi.Net.Test/TestClient.cs | 4 +- src/Vapi.Net.Test/Vapi.Net.Test.csproj | 7 +- src/Vapi.Net.sln | 20 +- src/Vapi.Net/Analytics/AnalyticsClient.cs | 43 ++- .../Requests}/AnalyticsQueryDto.cs | 2 - src/Vapi.Net/Assistants/AssistantsClient.cs | 124 +++---- .../Requests/AssistantsListRequest.cs | 2 - .../Assistants/Requests/UpdateAssistantDto.cs | 17 +- .../UpdateAssistantDtoBackgroundSound.cs | 2 - .../UpdateAssistantDtoClientMessagesItem.cs | 2 - .../UpdateAssistantDtoFirstMessageMode.cs | 2 - .../UpdateAssistantDtoServerMessagesItem.cs | 5 +- src/Vapi.Net/Blocks/BlocksClient.cs | 124 +++---- .../Blocks/Requests/BlocksListRequest.cs | 2 - src/Vapi.Net/Calls/CallsClient.cs | 124 +++---- .../Calls/Requests/CallsListRequest.cs | 2 - src/Vapi.Net/Calls/Requests/CreateCallDto.cs | 2 - src/Vapi.Net/Calls/Requests/UpdateCallDto.cs | 2 - src/Vapi.Net/Core/CollectionItemSerializer.cs | 4 +- src/Vapi.Net/Core/DateTimeSerializer.cs | 2 +- src/Vapi.Net/Core/EnumSerializer.cs | 6 +- src/Vapi.Net/Core/IRequestOptions.cs | 2 - src/Vapi.Net/Core/JsonConfiguration.cs | 6 + src/Vapi.Net/Core/OneOfSerializer.cs | 36 +- src/Vapi.Net/Core/Page.cs | 8 +- src/Vapi.Net/Core/Public/ClientOptions.cs | 2 - src/Vapi.Net/Core/Public/RequestOptions.cs | 2 - .../Core/Public/VapiClientEnvironment.cs | 2 +- .../Core/Public/VapiClientException.cs | 4 +- src/Vapi.Net/Core/Public/Version.cs | 2 +- src/Vapi.Net/Core/RawClient.cs | 25 +- src/Vapi.Net/Files/FilesClient.cs | 116 ++++--- src/Vapi.Net/Files/Requests/CreateFileDto.cs | 2 - src/Vapi.Net/Files/Requests/UpdateFileDto.cs | 2 - .../KnowledgeBases/KnowledgeBasesClient.cs | 124 +++---- .../Requests/KnowledgeBasesListRequest.cs | 2 - src/Vapi.Net/Logs/LogsClient.cs | 60 ++-- ...LoggingControllerLogsDeleteQueryRequest.cs | 2 - src/Vapi.Net/Logs/Requests/LogsGetRequest.cs | 4 +- ...ingControllerLogsDeleteQueryRequestType.cs | 2 - .../Logs/Types/LogsGetRequestSortOrder.cs | 2 - src/Vapi.Net/Logs/Types/LogsGetRequestType.cs | 2 - .../PhoneNumbers/PhoneNumbersClient.cs | 124 +++---- .../Requests/PhoneNumbersListRequest.cs | 2 - .../Squads/Requests/SquadsListRequest.cs | 2 - .../Squads/Requests/UpdateSquadDto.cs | 2 - src/Vapi.Net/Squads/SquadsClient.cs | 124 +++---- .../Requests/CreateTestSuiteRunDto.cs | 18 + ...iteRunControllerFindAllPaginatedRequest.cs | 66 ++++ .../Requests/UpdateTestSuiteRunDto.cs | 18 + .../TestSuiteRuns/TestSuiteRunsClient.cs | 265 +++++++++++++++ ...trollerFindAllPaginatedRequestSortOrder.cs | 15 + ...teTestControllerFindAllPaginatedRequest.cs | 66 ++++ .../TestSuiteTests/TestSuiteTestsClient.cs | 265 +++++++++++++++ ...trollerFindAllPaginatedRequestSortOrder.cs | 15 + .../TestSuites/Requests/CreateTestSuiteDto.cs | 24 ++ ...tSuiteControllerFindAllPaginatedRequest.cs | 66 ++++ .../TestSuites/Requests/UpdateTestSuiteDto.cs | 24 ++ src/Vapi.Net/TestSuites/TestSuitesClient.cs | 257 +++++++++++++++ ...trollerFindAllPaginatedRequestSortOrder.cs | 15 + .../Tools/Requests/ToolsListRequest.cs | 2 - src/Vapi.Net/Tools/ToolsClient.cs | 124 +++---- src/Vapi.Net/Types/AddVoiceToProviderDto.cs | 2 - ...ticEdgeCondition.cs => AiEdgeCondition.cs} | 6 +- src/Vapi.Net/Types/Analysis.cs | 2 - src/Vapi.Net/Types/AnalysisCost.cs | 2 - .../Types/AnalysisCostAnalysisType.cs | 2 - src/Vapi.Net/Types/AnalysisCostBreakdown.cs | 2 - src/Vapi.Net/Types/AnalysisPlan.cs | 2 - src/Vapi.Net/Types/AnalyticsOperation.cs | 2 - .../Types/AnalyticsOperationColumn.cs | 5 +- .../Types/AnalyticsOperationOperation.cs | 5 +- src/Vapi.Net/Types/AnalyticsQuery.cs | 4 +- .../Types/AnalyticsQueryGroupByItem.cs | 2 - src/Vapi.Net/Types/AnalyticsQueryResult.cs | 2 - src/Vapi.Net/Types/AnalyticsQueryTable.cs | 15 + src/Vapi.Net/Types/AnthropicCredential.cs | 4 +- src/Vapi.Net/Types/AnthropicModel.cs | 2 - src/Vapi.Net/Types/AnthropicModelModel.cs | 2 - src/Vapi.Net/Types/AnyscaleCredential.cs | 4 +- src/Vapi.Net/Types/AnyscaleModel.cs | 2 - src/Vapi.Net/Types/ApiRequest.cs | 67 ++++ src/Vapi.Net/Types/ApiRequestMethod.cs | 15 + src/Vapi.Net/Types/ApiRequestMode.cs | 15 + src/Vapi.Net/Types/Artifact.cs | 8 +- src/Vapi.Net/Types/ArtifactPlan.cs | 28 +- src/Vapi.Net/Types/AssemblyAiCredential.cs | 4 +- src/Vapi.Net/Types/AssemblyAiTranscriber.cs | 2 - src/Vapi.Net/Types/AssignmentMutation.cs | 4 +- src/Vapi.Net/Types/Assistant.cs | 17 +- .../Types/AssistantBackgroundSound.cs | 2 - .../Types/AssistantClientMessagesItem.cs | 2 - .../Types/AssistantCustomEndpointingRule.cs | 2 - .../Types/AssistantFirstMessageMode.cs | 2 - src/Vapi.Net/Types/AssistantHookActionBase.cs | 11 + src/Vapi.Net/Types/AssistantHookFilter.cs | 30 ++ src/Vapi.Net/Types/AssistantHooks.cs | 31 ++ src/Vapi.Net/Types/AssistantOverrides.cs | 17 +- .../AssistantOverridesBackgroundSound.cs | 2 - .../AssistantOverridesClientMessagesItem.cs | 2 - .../AssistantOverridesFirstMessageMode.cs | 2 - .../AssistantOverridesServerMessagesItem.cs | 5 +- .../Types/AssistantServerMessagesItem.cs | 5 +- src/Vapi.Net/Types/AutoReloadPlan.cs | 2 - .../Types/AzureBlobStorageBucketPlan.cs | 2 - src/Vapi.Net/Types/AzureCredential.cs | 4 +- src/Vapi.Net/Types/AzureCredentialRegion.cs | 2 - src/Vapi.Net/Types/AzureCredentialService.cs | 2 - src/Vapi.Net/Types/AzureOpenAiCredential.cs | 4 +- .../Types/AzureOpenAiCredentialModelsItem.cs | 5 +- .../Types/AzureOpenAiCredentialRegion.cs | 2 - src/Vapi.Net/Types/AzureSpeechTranscriber.cs | 2 - .../Types/AzureSpeechTranscriberLanguage.cs | 2 - src/Vapi.Net/Types/AzureVoice.cs | 2 - src/Vapi.Net/Types/AzureVoiceIdEnum.cs | 2 - src/Vapi.Net/Types/BackoffPlan.cs | 34 ++ src/Vapi.Net/Types/BashTool.cs | 6 +- src/Vapi.Net/Types/BashToolWithToolCall.cs | 6 +- src/Vapi.Net/Types/BlockCompleteMessage.cs | 2 - src/Vapi.Net/Types/BlockStartMessage.cs | 2 - src/Vapi.Net/Types/BotMessage.cs | 2 - .../Types/BothCustomEndpointingRule.cs | 2 - src/Vapi.Net/Types/BucketPlan.cs | 2 - src/Vapi.Net/Types/BuyPhoneNumberDto.cs | 65 ---- src/Vapi.Net/Types/ByoPhoneNumber.cs | 8 +- src/Vapi.Net/Types/ByoPhoneNumberStatus.cs | 18 + src/Vapi.Net/Types/ByoSipTrunkCredential.cs | 2 - src/Vapi.Net/Types/Call.cs | 2 - src/Vapi.Net/Types/CallEndedReason.cs | 33 +- src/Vapi.Net/Types/CallLogPrivileged.cs | 2 - src/Vapi.Net/Types/CallLogPrivilegedLevel.cs | 2 - .../Types/CallLogsPaginatedResponse.cs | 2 - src/Vapi.Net/Types/CallPaginatedResponse.cs | 2 - src/Vapi.Net/Types/CallPhoneCallProvider.cs | 2 - src/Vapi.Net/Types/CallPhoneCallTransport.cs | 2 - src/Vapi.Net/Types/CallStatus.cs | 2 - src/Vapi.Net/Types/CallType.cs | 2 - src/Vapi.Net/Types/CallbackStep.cs | 2 - src/Vapi.Net/Types/CartesiaCredential.cs | 4 +- .../Types/CartesiaExperimentalControls.cs | 18 + .../CartesiaExperimentalControlsEmotion.cs | 69 ++++ .../CartesiaExperimentalControlsSpeed.cs | 24 ++ src/Vapi.Net/Types/CartesiaVoice.cs | 20 +- src/Vapi.Net/Types/CartesiaVoiceLanguage.cs | 2 - src/Vapi.Net/Types/CartesiaVoiceModel.cs | 2 - src/Vapi.Net/Types/CerebrasCredential.cs | 4 +- src/Vapi.Net/Types/ChatCompletionMessage.cs | 21 ++ .../Types/ChatCompletionMessageMetadata.cs | 27 ++ src/Vapi.Net/Types/ChatCompletionsDto.cs | 22 ++ src/Vapi.Net/Types/ChatDto.cs | 2 - src/Vapi.Net/Types/ChatServiceResponse.cs | 2 - src/Vapi.Net/Types/ChunkPlan.cs | 2 - src/Vapi.Net/Types/ClientInboundMessage.cs | 2 - .../Types/ClientInboundMessageAddMessage.cs | 2 - .../Types/ClientInboundMessageControl.cs | 2 - .../ClientInboundMessageControlControl.cs | 2 - .../Types/ClientInboundMessageEndCall.cs | 2 - src/Vapi.Net/Types/ClientInboundMessageSay.cs | 2 - .../Types/ClientInboundMessageTransfer.cs | 8 +- src/Vapi.Net/Types/ClientMessage.cs | 19 +- .../Types/ClientMessageConversationUpdate.cs | 8 +- src/Vapi.Net/Types/ClientMessageHang.cs | 13 +- .../ClientMessageLanguageChangeDetected.cs | 8 +- src/Vapi.Net/Types/ClientMessageMetadata.cs | 8 +- .../Types/ClientMessageModelOutput.cs | 8 +- .../Types/ClientMessageSpeechUpdate.cs | 8 +- .../Types/ClientMessageSpeechUpdateRole.cs | 2 - .../Types/ClientMessageSpeechUpdateStatus.cs | 2 - src/Vapi.Net/Types/ClientMessageToolCalls.cs | 8 +- .../Types/ClientMessageToolCallsResult.cs | 8 +- src/Vapi.Net/Types/ClientMessageTranscript.cs | 8 +- .../Types/ClientMessageTranscriptRole.cs | 2 - .../ClientMessageTranscriptTranscriptType.cs | 2 - .../Types/ClientMessageTranscriptType.cs | 15 + .../Types/ClientMessageTransferUpdate.cs | 8 +- .../Types/ClientMessageUserInterrupted.cs | 9 +- src/Vapi.Net/Types/ClientMessageVoiceInput.cs | 8 +- .../Types/ClientMessageWorkflowNodeStarted.cs | 24 ++ src/Vapi.Net/Types/CloneVoiceDto.cs | 2 - src/Vapi.Net/Types/CloudflareCredential.cs | 4 +- src/Vapi.Net/Types/CloudflareR2BucketPlan.cs | 2 - src/Vapi.Net/Types/CompliancePlan.cs | 24 ++ src/Vapi.Net/Types/ComputerTool.cs | 6 +- .../Types/ComputerToolWithToolCall.cs | 6 +- src/Vapi.Net/Types/Condition.cs | 2 - src/Vapi.Net/Types/ConditionOperator.cs | 2 - src/Vapi.Net/Types/ConversationBlock.cs | 2 - src/Vapi.Net/Types/CostBreakdown.cs | 2 - .../Types/CreateAnthropicCredentialDto.cs | 2 - .../Types/CreateAnyscaleCredentialDto.cs | 2 - .../Types/CreateAssemblyAiCredentialDto.cs | 2 - src/Vapi.Net/Types/CreateAssistantDto.cs | 17 +- .../CreateAssistantDtoBackgroundSound.cs | 2 - .../CreateAssistantDtoClientMessagesItem.cs | 2 - .../CreateAssistantDtoFirstMessageMode.cs | 2 - .../CreateAssistantDtoServerMessagesItem.cs | 5 +- .../Types/CreateAzureCredentialDto.cs | 2 - .../Types/CreateAzureCredentialDtoRegion.cs | 2 - .../Types/CreateAzureCredentialDtoService.cs | 2 - .../Types/CreateAzureOpenAiCredentialDto.cs | 2 - ...reateAzureOpenAiCredentialDtoModelsItem.cs | 5 +- .../CreateAzureOpenAiCredentialDtoRegion.cs | 2 - src/Vapi.Net/Types/CreateBashToolDto.cs | 6 +- src/Vapi.Net/Types/CreateByoPhoneNumberDto.cs | 2 - .../Types/CreateByoSipTrunkCredentialDto.cs | 2 - .../Types/CreateCartesiaCredentialDto.cs | 2 - .../Types/CreateCerebrasCredentialDto.cs | 4 +- .../Types/CreateCloudflareCredentialDto.cs | 2 - src/Vapi.Net/Types/CreateComputerToolDto.cs | 6 +- .../Types/CreateConversationBlockDto.cs | 2 - .../Types/CreateCustomKnowledgeBaseDto.cs | 2 - .../Types/CreateCustomLlmCredentialDto.cs | 2 - src/Vapi.Net/Types/CreateCustomerDto.cs | 2 - .../Types/CreateDeepInfraCredentialDto.cs | 2 - .../Types/CreateDeepSeekCredentialDto.cs | 2 - .../Types/CreateDeepgramCredentialDto.cs | 2 - src/Vapi.Net/Types/CreateDtmfToolDto.cs | 2 - .../Types/CreateElevenLabsCredentialDto.cs | 2 - src/Vapi.Net/Types/CreateEndCallToolDto.cs | 2 - src/Vapi.Net/Types/CreateFunctionToolDto.cs | 2 - src/Vapi.Net/Types/CreateGcpCredentialDto.cs | 2 - src/Vapi.Net/Types/CreateGhlToolDto.cs | 2 - .../Types/CreateGladiaCredentialDto.cs | 2 - .../Types/CreateGoHighLevelCredentialDto.cs | 2 - .../Types/CreateGoogleCredentialDto.cs | 4 +- src/Vapi.Net/Types/CreateGroqCredentialDto.cs | 2 - .../Types/CreateInflectionAiCredentialDto.cs | 4 +- .../Types/CreateLangfuseCredentialDto.cs | 2 - src/Vapi.Net/Types/CreateLmntCredentialDto.cs | 2 - src/Vapi.Net/Types/CreateMakeCredentialDto.cs | 2 - src/Vapi.Net/Types/CreateMakeToolDto.cs | 2 - .../Types/CreateOpenAiCredentialDto.cs | 2 - .../Types/CreateOpenRouterCredentialDto.cs | 2 - src/Vapi.Net/Types/CreateOrgDto.cs | 2 - src/Vapi.Net/Types/CreateOrgDtoChannel.cs | 2 - src/Vapi.Net/Types/CreateOutboundCallDto.cs | 2 - src/Vapi.Net/Types/CreateOutputToolDto.cs | 2 - .../Types/CreatePerplexityAiCredentialDto.cs | 2 - .../Types/CreatePlayHtCredentialDto.cs | 2 - .../Types/CreateRimeAiCredentialDto.cs | 2 - .../Types/CreateRunpodCredentialDto.cs | 2 - src/Vapi.Net/Types/CreateS3CredentialDto.cs | 2 - .../Types/CreateSmallestAiCredentialDto.cs | 2 - src/Vapi.Net/Types/CreateSquadDto.cs | 2 - .../Types/CreateTavusCredentialDto.cs | 2 - .../Types/CreateTestSuiteTestVoiceDto.cs | 37 +++ src/Vapi.Net/Types/CreateTextEditorToolDto.cs | 6 +- .../Types/CreateTogetherAiCredentialDto.cs | 2 - src/Vapi.Net/Types/CreateTokenDto.cs | 2 - src/Vapi.Net/Types/CreateTokenDtoTag.cs | 2 - src/Vapi.Net/Types/CreateToolCallBlockDto.cs | 2 - src/Vapi.Net/Types/CreateToolTemplateDto.cs | 4 +- .../Types/CreateToolTemplateDtoProvider.cs | 2 - .../Types/CreateToolTemplateDtoVisibility.cs | 2 - .../Types/CreateTransferCallToolDto.cs | 2 - .../Types/CreateTrieveKnowledgeBaseDto.cs | 2 - .../Types/CreateTwilioCredentialDto.cs | 2 - .../Types/CreateTwilioPhoneNumberDto.cs | 2 - .../Types/CreateVapiPhoneNumberDto.cs | 10 +- src/Vapi.Net/Types/CreateVoicemailToolDto.cs | 2 - .../Types/CreateVonageCredentialDto.cs | 2 - .../Types/CreateVonagePhoneNumberDto.cs | 2 - src/Vapi.Net/Types/CreateWebCallDto.cs | 2 - .../Types/CreateWebhookCredentialDto.cs | 2 - src/Vapi.Net/Types/CreateWorkflowBlockDto.cs | 2 - src/Vapi.Net/Types/CreateWorkflowDto.cs | 9 +- src/Vapi.Net/Types/CreateXAiCredentialDto.cs | 2 - src/Vapi.Net/Types/CustomKnowledgeBase.cs | 2 - src/Vapi.Net/Types/CustomLlmCredential.cs | 4 +- src/Vapi.Net/Types/CustomLlmModel.cs | 2 - .../Types/CustomLlmModelMetadataSendMode.cs | 2 - src/Vapi.Net/Types/CustomMessage.cs | 4 +- src/Vapi.Net/Types/CustomTranscriber.cs | 2 - src/Vapi.Net/Types/CustomVoice.cs | 2 - .../Types/CustomerCustomEndpointingRule.cs | 2 - src/Vapi.Net/Types/DeepInfraCredential.cs | 4 +- src/Vapi.Net/Types/DeepInfraModel.cs | 2 - src/Vapi.Net/Types/DeepSeekCredential.cs | 4 +- src/Vapi.Net/Types/DeepSeekModel.cs | 4 +- src/Vapi.Net/Types/DeepSeekModelModel.cs | 15 + src/Vapi.Net/Types/DeepgramCredential.cs | 4 +- src/Vapi.Net/Types/DeepgramTranscriber.cs | 18 +- .../Types/DeepgramTranscriberLanguage.cs | 2 - .../Types/DeepgramTranscriberModel.cs | 2 - src/Vapi.Net/Types/DeepgramVoice.cs | 12 +- src/Vapi.Net/Types/DeepgramVoiceIdEnum.cs | 2 - src/Vapi.Net/Types/DtmfTool.cs | 2 - src/Vapi.Net/Types/Edge.cs | 8 +- src/Vapi.Net/Types/ElevenLabsCredential.cs | 4 +- src/Vapi.Net/Types/ElevenLabsVoice.cs | 2 - src/Vapi.Net/Types/ElevenLabsVoiceIdEnum.cs | 2 - src/Vapi.Net/Types/ElevenLabsVoiceModel.cs | 2 - src/Vapi.Net/Types/EndCallTool.cs | 2 - src/Vapi.Net/Types/Error.cs | 2 - src/Vapi.Net/Types/ExactReplacement.cs | 2 - src/Vapi.Net/Types/FailedEdgeCondition.cs | 11 + src/Vapi.Net/Types/FallbackAzureVoice.cs | 2 - .../Types/FallbackAzureVoiceVoiceId.cs | 2 - src/Vapi.Net/Types/FallbackCartesiaVoice.cs | 14 +- .../Types/FallbackCartesiaVoiceLanguage.cs | 2 - .../Types/FallbackCartesiaVoiceModel.cs | 2 - src/Vapi.Net/Types/FallbackCustomVoice.cs | 2 - src/Vapi.Net/Types/FallbackDeepgramVoice.cs | 12 +- .../Types/FallbackDeepgramVoiceIdEnum.cs | 2 - src/Vapi.Net/Types/FallbackElevenLabsVoice.cs | 2 - .../Types/FallbackElevenLabsVoiceIdEnum.cs | 2 - .../Types/FallbackElevenLabsVoiceModel.cs | 2 - src/Vapi.Net/Types/FallbackLmntVoice.cs | 2 - src/Vapi.Net/Types/FallbackLmntVoiceIdEnum.cs | 2 - src/Vapi.Net/Types/FallbackNeetsVoice.cs | 2 - .../Types/FallbackNeetsVoiceIdEnum.cs | 2 - src/Vapi.Net/Types/FallbackOpenAiVoice.cs | 2 - src/Vapi.Net/Types/FallbackOpenAiVoiceId.cs | 2 - src/Vapi.Net/Types/FallbackPlan.cs | 2 - src/Vapi.Net/Types/FallbackPlayHtVoice.cs | 2 - .../Types/FallbackPlayHtVoiceEmotion.cs | 2 - .../Types/FallbackPlayHtVoiceIdEnum.cs | 2 - .../Types/FallbackPlayHtVoiceLanguage.cs | 2 - .../Types/FallbackPlayHtVoiceModel.cs | 5 +- src/Vapi.Net/Types/FallbackRimeAiVoice.cs | 2 - .../Types/FallbackRimeAiVoiceIdEnum.cs | 128 +++---- .../Types/FallbackRimeAiVoiceModel.cs | 5 +- src/Vapi.Net/Types/FallbackSmallestAiVoice.cs | 2 - .../Types/FallbackSmallestAiVoiceIdEnum.cs | 2 - src/Vapi.Net/Types/FallbackTavusVoice.cs | 2 - src/Vapi.Net/Types/File.cs | 2 - src/Vapi.Net/Types/FileStatus.cs | 2 - src/Vapi.Net/Types/FormatPlan.cs | 11 +- .../Types/FormatPlanFormattersEnabledItem.cs | 57 ++++ src/Vapi.Net/Types/FunctionTool.cs | 2 - .../Types/FunctionToolProviderDetails.cs | 2 - .../Types/FunctionToolWithToolCall.cs | 2 - src/Vapi.Net/Types/Gather.cs | 40 ++- src/Vapi.Net/Types/GcpCredential.cs | 4 +- src/Vapi.Net/Types/GcpKey.cs | 2 - ...GeminiMultimodalLivePrebuiltVoiceConfig.cs | 2 - ...timodalLivePrebuiltVoiceConfigVoiceName.cs | 2 - .../Types/GeminiMultimodalLiveSpeechConfig.cs | 2 - .../Types/GeminiMultimodalLiveVoiceConfig.cs | 2 - src/Vapi.Net/Types/GhlTool.cs | 2 - src/Vapi.Net/Types/GhlToolMetadata.cs | 2 - src/Vapi.Net/Types/GhlToolProviderDetails.cs | 2 - src/Vapi.Net/Types/GhlToolWithToolCall.cs | 2 - src/Vapi.Net/Types/GladiaCredential.cs | 4 +- src/Vapi.Net/Types/GladiaTranscriber.cs | 2 - .../Types/GladiaTranscriberLanguage.cs | 2 - .../GladiaTranscriberLanguageBehaviour.cs | 2 - src/Vapi.Net/Types/GladiaTranscriberModel.cs | 2 - src/Vapi.Net/Types/GoHighLevelCredential.cs | 4 +- src/Vapi.Net/Types/GoogleCredential.cs | 4 +- src/Vapi.Net/Types/GoogleModel.cs | 2 - src/Vapi.Net/Types/GoogleModelModel.cs | 14 +- src/Vapi.Net/Types/GoogleRealtimeConfig.cs | 2 - src/Vapi.Net/Types/GroqCredential.cs | 4 +- src/Vapi.Net/Types/GroqModel.cs | 2 - src/Vapi.Net/Types/GroqModelModel.cs | 5 +- src/Vapi.Net/Types/HandoffStep.cs | 2 - src/Vapi.Net/Types/Hangup.cs | 21 ++ src/Vapi.Net/Types/Hook.cs | 18 + src/Vapi.Net/Types/HookOn.cs | 18 + .../Types/ImportTwilioPhoneNumberDto.cs | 2 - .../Types/ImportVonagePhoneNumberDto.cs | 2 - src/Vapi.Net/Types/InflectionAiCredential.cs | 4 +- src/Vapi.Net/Types/InflectionAiModel.cs | 4 +- src/Vapi.Net/Types/InviteUserDto.cs | 5 +- src/Vapi.Net/Types/InviteUserDtoRole.cs | 2 - src/Vapi.Net/Types/JsonSchema.cs | 20 +- src/Vapi.Net/Types/JsonSchemaType.cs | 2 - .../Types/KnowledgeBaseResponseDocument.cs | 2 - src/Vapi.Net/Types/LangfuseCredential.cs | 4 +- src/Vapi.Net/Types/LmntCredential.cs | 4 +- src/Vapi.Net/Types/LmntVoice.cs | 2 - src/Vapi.Net/Types/LmntVoiceIdEnum.cs | 2 - src/Vapi.Net/Types/Log.cs | 2 - src/Vapi.Net/Types/LogRequestHttpMethod.cs | 2 - src/Vapi.Net/Types/LogResource.cs | 2 - src/Vapi.Net/Types/LogType.cs | 2 - ...EdgeCondition.cs => LogicEdgeCondition.cs} | 8 +- src/Vapi.Net/Types/LogsPaginatedResponse.cs | 2 - src/Vapi.Net/Types/MakeCredential.cs | 4 +- src/Vapi.Net/Types/MakeTool.cs | 2 - src/Vapi.Net/Types/MakeToolMetadata.cs | 2 - src/Vapi.Net/Types/MakeToolProviderDetails.cs | 2 - src/Vapi.Net/Types/MakeToolWithToolCall.cs | 2 - src/Vapi.Net/Types/MessagePlan.cs | 10 +- src/Vapi.Net/Types/Metrics.cs | 2 - src/Vapi.Net/Types/ModelBasedCondition.cs | 2 - src/Vapi.Net/Types/ModelCost.cs | 2 - src/Vapi.Net/Types/Monitor.cs | 2 - src/Vapi.Net/Types/MonitorPlan.cs | 2 - src/Vapi.Net/Types/NeetsVoice.cs | 2 - src/Vapi.Net/Types/NeetsVoiceIdEnum.cs | 2 - .../Types/OAuth2AuthenticationPlan.cs | 4 +- .../Types/Oauth2AuthenticationSession.cs | 2 - src/Vapi.Net/Types/OpenAiCredential.cs | 4 +- src/Vapi.Net/Types/OpenAiFunction.cs | 2 - .../Types/OpenAiFunctionParameters.cs | 4 +- src/Vapi.Net/Types/OpenAiMessage.cs | 2 - src/Vapi.Net/Types/OpenAiMessageRole.cs | 2 - src/Vapi.Net/Types/OpenAiModel.cs | 5 - .../Types/OpenAiModelFallbackModelsItem.cs | 8 +- src/Vapi.Net/Types/OpenAiModelModel.cs | 8 +- src/Vapi.Net/Types/OpenAiVoice.cs | 2 - src/Vapi.Net/Types/OpenAiVoiceId.cs | 2 - src/Vapi.Net/Types/OpenRouterCredential.cs | 4 +- src/Vapi.Net/Types/OpenRouterModel.cs | 2 - src/Vapi.Net/Types/Org.cs | 2 - src/Vapi.Net/Types/OrgChannel.cs | 2 - src/Vapi.Net/Types/OrgPlan.cs | 2 - src/Vapi.Net/Types/OrgWithOrgUser.cs | 127 ------- src/Vapi.Net/Types/OrgWithOrgUserChannel.cs | 17 - src/Vapi.Net/Types/OrgWithOrgUserRole.cs | 20 -- src/Vapi.Net/Types/OutputTool.cs | 2 - src/Vapi.Net/Types/PaginationMeta.cs | 2 - src/Vapi.Net/Types/PerplexityAiCredential.cs | 4 +- src/Vapi.Net/Types/PerplexityAiModel.cs | 2 - .../Types/PhoneNumberPaginatedResponse.cs | 2 - src/Vapi.Net/Types/PlayHtCredential.cs | 4 +- src/Vapi.Net/Types/PlayHtVoice.cs | 2 - src/Vapi.Net/Types/PlayHtVoiceEmotion.cs | 2 - src/Vapi.Net/Types/PlayHtVoiceIdEnum.cs | 2 - src/Vapi.Net/Types/PlayHtVoiceLanguage.cs | 2 - src/Vapi.Net/Types/PlayHtVoiceModel.cs | 5 +- src/Vapi.Net/Types/PunctuationBoundary.cs | 2 - src/Vapi.Net/Types/RegexOption.cs | 2 - src/Vapi.Net/Types/RegexOptionType.cs | 2 - src/Vapi.Net/Types/RegexReplacement.cs | 2 - src/Vapi.Net/Types/RimeAiCredential.cs | 4 +- src/Vapi.Net/Types/RimeAiVoice.cs | 2 - src/Vapi.Net/Types/RimeAiVoiceIdEnum.cs | 128 +++---- src/Vapi.Net/Types/RimeAiVoiceModel.cs | 5 +- src/Vapi.Net/Types/RuleBasedCondition.cs | 2 - .../Types/RuleBasedConditionOperator.cs | 2 - src/Vapi.Net/Types/RunpodCredential.cs | 4 +- src/Vapi.Net/Types/S3Credential.cs | 4 +- src/Vapi.Net/Types/Say.cs | 16 +- src/Vapi.Net/Types/SayHook.cs | 27 ++ src/Vapi.Net/Types/SbcConfiguration.cs | 2 - src/Vapi.Net/Types/Server.cs | 8 +- src/Vapi.Net/Types/ServerMessage.cs | 23 +- .../Types/ServerMessageAssistantRequest.cs | 8 +- .../Types/ServerMessageConversationUpdate.cs | 8 +- .../Types/ServerMessageEndOfCallReport.cs | 8 +- ...ServerMessageEndOfCallReportEndedReason.cs | 33 +- src/Vapi.Net/Types/ServerMessageHang.cs | 12 +- .../ServerMessageKnowledgeBaseRequest.cs | 8 +- .../ServerMessageLanguageChangeDetected.cs | 8 +- .../Types/ServerMessageModelOutput.cs | 8 +- .../Types/ServerMessagePhoneCallControl.cs | 10 +- .../ServerMessagePhoneCallControlRequest.cs | 2 - src/Vapi.Net/Types/ServerMessageResponse.cs | 2 - .../ServerMessageResponseAssistantRequest.cs | 2 - ...rverMessageResponseKnowledgeBaseRequest.cs | 2 - .../Types/ServerMessageResponseToolCalls.cs | 2 - ...ssageResponseTransferDestinationRequest.cs | 2 - .../ServerMessageResponseVoiceRequest.cs | 2 - .../Types/ServerMessageSpeechUpdate.cs | 8 +- .../Types/ServerMessageSpeechUpdateRole.cs | 2 - .../Types/ServerMessageSpeechUpdateStatus.cs | 2 - .../Types/ServerMessageStatusUpdate.cs | 8 +- .../ServerMessageStatusUpdateEndedReason.cs | 33 +- .../Types/ServerMessageStatusUpdateStatus.cs | 2 - src/Vapi.Net/Types/ServerMessageToolCalls.cs | 8 +- src/Vapi.Net/Types/ServerMessageTranscript.cs | 8 +- .../Types/ServerMessageTranscriptRole.cs | 2 - .../ServerMessageTranscriptTranscriptType.cs | 2 - .../Types/ServerMessageTranscriptType.cs | 15 + ...ServerMessageTransferDestinationRequest.cs | 8 +- .../Types/ServerMessageTransferUpdate.cs | 8 +- .../Types/ServerMessageUserInterrupted.cs | 8 +- src/Vapi.Net/Types/ServerMessageVoiceInput.cs | 8 +- .../Types/ServerMessageVoiceRequest.cs | 29 +- src/Vapi.Net/Types/SipAuthentication.cs | 2 - src/Vapi.Net/Types/SipTrunkGateway.cs | 2 - .../Types/SipTrunkGatewayOutboundProtocol.cs | 2 - .../SipTrunkOutboundAuthenticationPlan.cs | 2 - .../Types/SipTrunkOutboundSipRegisterPlan.cs | 2 - src/Vapi.Net/Types/SmallestAiCredential.cs | 4 +- src/Vapi.Net/Types/SmallestAiVoice.cs | 2 - src/Vapi.Net/Types/SmallestAiVoiceIdEnum.cs | 2 - src/Vapi.Net/Types/Squad.cs | 2 - src/Vapi.Net/Types/SquadMemberDto.cs | 2 - src/Vapi.Net/Types/StartSpeakingPlan.cs | 2 - src/Vapi.Net/Types/StepDestination.cs | 4 +- src/Vapi.Net/Types/StopSpeakingPlan.cs | 16 +- src/Vapi.Net/Types/StructuredDataPlan.cs | 2 - src/Vapi.Net/Types/Subscription.cs | 24 +- src/Vapi.Net/Types/SubscriptionStatus.cs | 2 - src/Vapi.Net/Types/SubscriptionType.cs | 2 - src/Vapi.Net/Types/SuccessEvaluationPlan.cs | 2 - .../Types/SuccessEvaluationPlanRubric.cs | 2 - src/Vapi.Net/Types/SummaryPlan.cs | 2 - src/Vapi.Net/Types/SyncVoiceLibraryDto.cs | 2 - .../Types/SyncVoiceLibraryDtoProvidersItem.cs | 5 +- src/Vapi.Net/Types/SystemMessage.cs | 2 - src/Vapi.Net/Types/TalkscriberTranscriber.cs | 2 - .../Types/TalkscriberTranscriberLanguage.cs | 2 - .../Types/TavusConversationProperties.cs | 2 - src/Vapi.Net/Types/TavusCredential.cs | 4 +- src/Vapi.Net/Types/TavusVoice.cs | 2 - src/Vapi.Net/Types/Template.cs | 4 +- src/Vapi.Net/Types/TemplateProvider.cs | 2 - src/Vapi.Net/Types/TemplateVisibility.cs | 2 - src/Vapi.Net/Types/TestSuite.cs | 48 +++ src/Vapi.Net/Types/TestSuiteRun.cs | 61 ++++ src/Vapi.Net/Types/TestSuiteRunScorerAi.cs | 36 ++ .../Types/TestSuiteRunScorerAiResult.cs | 15 + src/Vapi.Net/Types/TestSuiteRunStatus.cs | 18 + src/Vapi.Net/Types/TestSuiteRunTestAttempt.cs | 25 ++ .../Types/TestSuiteRunTestAttemptCall.cs | 18 + src/Vapi.Net/Types/TestSuiteRunTestResult.cs | 25 ++ .../Types/TestSuiteRunsPaginatedResponse.cs | 18 + src/Vapi.Net/Types/TestSuiteTestScorerAi.cs | 24 ++ src/Vapi.Net/Types/TestSuiteTestVoice.cs | 67 ++++ .../Types/TestSuiteTestsPaginatedResponse.cs | 24 ++ .../Types/TestSuitesPaginatedResponse.cs | 18 + src/Vapi.Net/Types/TextContent.cs | 4 +- src/Vapi.Net/Types/TextContentLanguage.cs | 2 - src/Vapi.Net/Types/TextEditorTool.cs | 6 +- .../Types/TextEditorToolWithToolCall.cs | 6 +- src/Vapi.Net/Types/TimeRange.cs | 2 - src/Vapi.Net/Types/TimeRangeStep.cs | 5 +- src/Vapi.Net/Types/TogetherAiCredential.cs | 4 +- src/Vapi.Net/Types/TogetherAiModel.cs | 2 - src/Vapi.Net/Types/Token.cs | 2 - src/Vapi.Net/Types/TokenRestrictions.cs | 2 - src/Vapi.Net/Types/TokenTag.cs | 2 - src/Vapi.Net/Types/ToolCall.cs | 4 +- src/Vapi.Net/Types/ToolCallBlock.cs | 2 - src/Vapi.Net/Types/ToolCallFunction.cs | 2 - src/Vapi.Net/Types/ToolCallMessage.cs | 2 - src/Vapi.Net/Types/ToolCallResult.cs | 2 - src/Vapi.Net/Types/ToolCallResultMessage.cs | 2 - src/Vapi.Net/Types/ToolMessageComplete.cs | 2 - src/Vapi.Net/Types/ToolMessageCompleteRole.cs | 2 - src/Vapi.Net/Types/ToolMessageDelayed.cs | 2 - src/Vapi.Net/Types/ToolMessageFailed.cs | 2 - src/Vapi.Net/Types/ToolMessageStart.cs | 10 +- src/Vapi.Net/Types/ToolTemplateMetadata.cs | 2 - src/Vapi.Net/Types/ToolTemplateSetup.cs | 2 - src/Vapi.Net/Types/TranscriberCost.cs | 2 - src/Vapi.Net/Types/TranscriptPlan.cs | 2 - .../Types/TranscriptionEndpointingPlan.cs | 2 - src/Vapi.Net/Types/Transfer.cs | 24 ++ .../Types/TransferAssistantHookAction.cs | 24 ++ src/Vapi.Net/Types/TransferCallTool.cs | 2 - .../Types/TransferDestinationAssistant.cs | 25 +- .../Types/TransferDestinationNumber.cs | 2 - src/Vapi.Net/Types/TransferDestinationSip.cs | 2 - src/Vapi.Net/Types/TransferDestinationStep.cs | 2 - src/Vapi.Net/Types/TransferMode.cs | 2 - src/Vapi.Net/Types/TransferPlan.cs | 21 +- src/Vapi.Net/Types/TransferPlanMode.cs | 5 +- src/Vapi.Net/Types/Transport.cs | 2 - .../Types/TransportConfigurationTwilio.cs | 4 +- ...ortConfigurationTwilioRecordingChannels.cs | 2 - src/Vapi.Net/Types/TransportCost.cs | 2 - src/Vapi.Net/Types/TransportCostProvider.cs | 2 - src/Vapi.Net/Types/TransportProvider.cs | 2 - src/Vapi.Net/Types/TrieveKnowledgeBase.cs | 2 - .../Types/TrieveKnowledgeBaseChunkPlan.cs | 2 - .../Types/TrieveKnowledgeBaseCreate.cs | 2 - .../Types/TrieveKnowledgeBaseImport.cs | 2 - .../Types/TrieveKnowledgeBaseSearchPlan.cs | 8 +- ...TrieveKnowledgeBaseSearchPlanSearchType.cs | 2 - src/Vapi.Net/Types/TwilioCredential.cs | 4 +- src/Vapi.Net/Types/TwilioPhoneNumber.cs | 8 +- src/Vapi.Net/Types/TwilioPhoneNumberStatus.cs | 18 + .../Types/TwilioVoicemailDetection.cs | 4 +- ...ailDetectionVoicemailDetectionTypesItem.cs | 2 - .../Types/UpdateAnthropicCredentialDto.cs | 2 - .../Types/UpdateAnyscaleCredentialDto.cs | 2 - .../Types/UpdateAssemblyAiCredentialDto.cs | 2 - .../Types/UpdateAzureCredentialDto.cs | 2 - .../Types/UpdateAzureCredentialDtoRegion.cs | 2 - .../Types/UpdateAzureCredentialDtoService.cs | 2 - .../Types/UpdateAzureOpenAiCredentialDto.cs | 2 - ...pdateAzureOpenAiCredentialDtoModelsItem.cs | 5 +- .../UpdateAzureOpenAiCredentialDtoRegion.cs | 2 - src/Vapi.Net/Types/UpdateBashToolDto.cs | 2 - src/Vapi.Net/Types/UpdateByoPhoneNumberDto.cs | 2 - .../Types/UpdateByoSipTrunkCredentialDto.cs | 2 - .../Types/UpdateCartesiaCredentialDto.cs | 2 - .../Types/UpdateCerebrasCredentialDto.cs | 2 - .../Types/UpdateCloudflareCredentialDto.cs | 2 - src/Vapi.Net/Types/UpdateComputerToolDto.cs | 2 - .../Types/UpdateConversationBlockDto.cs | 2 - .../Types/UpdateCustomKnowledgeBaseDto.cs | 2 - .../Types/UpdateCustomLlmCredentialDto.cs | 2 - .../Types/UpdateDeepInfraCredentialDto.cs | 2 - .../Types/UpdateDeepSeekCredentialDto.cs | 2 - .../Types/UpdateDeepgramCredentialDto.cs | 2 - src/Vapi.Net/Types/UpdateDtmfToolDto.cs | 2 - .../Types/UpdateElevenLabsCredentialDto.cs | 2 - src/Vapi.Net/Types/UpdateEndCallToolDto.cs | 2 - src/Vapi.Net/Types/UpdateFunctionToolDto.cs | 2 - src/Vapi.Net/Types/UpdateGcpCredentialDto.cs | 2 - src/Vapi.Net/Types/UpdateGhlToolDto.cs | 2 - .../Types/UpdateGladiaCredentialDto.cs | 2 - .../Types/UpdateGoHighLevelCredentialDto.cs | 2 - .../Types/UpdateGoogleCredentialDto.cs | 2 - src/Vapi.Net/Types/UpdateGroqCredentialDto.cs | 2 - .../Types/UpdateInflectionAiCredentialDto.cs | 2 - .../Types/UpdateLangfuseCredentialDto.cs | 2 - src/Vapi.Net/Types/UpdateLmntCredentialDto.cs | 2 - src/Vapi.Net/Types/UpdateMakeCredentialDto.cs | 2 - src/Vapi.Net/Types/UpdateMakeToolDto.cs | 2 - .../Types/UpdateOpenAiCredentialDto.cs | 2 - .../Types/UpdateOpenRouterCredentialDto.cs | 2 - src/Vapi.Net/Types/UpdateOrgDto.cs | 2 - src/Vapi.Net/Types/UpdateOrgDtoChannel.cs | 2 - src/Vapi.Net/Types/UpdateOutputToolDto.cs | 2 - .../Types/UpdatePerplexityAiCredentialDto.cs | 2 - .../Types/UpdatePlayHtCredentialDto.cs | 2 - .../Types/UpdateRimeAiCredentialDto.cs | 2 - .../Types/UpdateRunpodCredentialDto.cs | 2 - src/Vapi.Net/Types/UpdateS3CredentialDto.cs | 2 - .../Types/UpdateSmallestAiCredentialDto.cs | 2 - .../Types/UpdateTavusCredentialDto.cs | 2 - .../Types/UpdateTestSuiteTestVoiceDto.cs | 36 ++ src/Vapi.Net/Types/UpdateTextEditorToolDto.cs | 2 - .../Types/UpdateTogetherAiCredentialDto.cs | 2 - src/Vapi.Net/Types/UpdateTokenDto.cs | 2 - src/Vapi.Net/Types/UpdateTokenDtoTag.cs | 2 - src/Vapi.Net/Types/UpdateToolCallBlockDto.cs | 2 - src/Vapi.Net/Types/UpdateToolTemplateDto.cs | 4 +- .../Types/UpdateToolTemplateDtoProvider.cs | 2 - .../Types/UpdateToolTemplateDtoVisibility.cs | 2 - .../Types/UpdateTransferCallToolDto.cs | 2 - .../Types/UpdateTrieveKnowledgeBaseDto.cs | 2 - .../Types/UpdateTwilioCredentialDto.cs | 2 - .../Types/UpdateTwilioPhoneNumberDto.cs | 2 - src/Vapi.Net/Types/UpdateUserRoleDto.cs | 2 - src/Vapi.Net/Types/UpdateUserRoleDtoRole.cs | 2 - .../Types/UpdateVapiPhoneNumberDto.cs | 2 - .../Types/UpdateVonageCredentialDto.cs | 2 - .../Types/UpdateVonagePhoneNumberDto.cs | 2 - src/Vapi.Net/Types/UpdateWorkflowBlockDto.cs | 2 - src/Vapi.Net/Types/UpdateWorkflowDto.cs | 24 -- src/Vapi.Net/Types/UpdateXAiCredentialDto.cs | 2 - src/Vapi.Net/Types/User.cs | 2 - src/Vapi.Net/Types/UserMessage.cs | 2 - src/Vapi.Net/Types/VapiCost.cs | 2 - src/Vapi.Net/Types/VapiCostSubType.cs | 2 - src/Vapi.Net/Types/VapiModel.cs | 2 - src/Vapi.Net/Types/VapiPhoneNumber.cs | 22 +- src/Vapi.Net/Types/VapiPhoneNumberStatus.cs | 18 + src/Vapi.Net/Types/VoiceCost.cs | 2 - src/Vapi.Net/Types/VoiceLibrary.cs | 2 - src/Vapi.Net/Types/VoiceLibraryGender.cs | 2 - .../Types/VoiceLibraryVoiceResponse.cs | 2 - src/Vapi.Net/Types/VonageCredential.cs | 4 +- src/Vapi.Net/Types/VonagePhoneNumber.cs | 8 +- src/Vapi.Net/Types/VonagePhoneNumberStatus.cs | 18 + src/Vapi.Net/Types/WebhookCredential.cs | 4 +- src/Vapi.Net/Types/Workflow.cs | 9 +- src/Vapi.Net/Types/WorkflowBlock.cs | 2 - src/Vapi.Net/Types/XAiCredential.cs | 4 +- src/Vapi.Net/Types/XaiModel.cs | 4 +- src/Vapi.Net/Types/XaiModelModel.cs | 18 + src/Vapi.Net/Vapi.Net.csproj | 2 +- src/Vapi.Net/VapiClient.cs | 18 +- 673 files changed, 4499 insertions(+), 2385 deletions(-) create mode 100644 src/Vapi.Net.Test/Core/OneOfSerializerTests.cs rename src/Vapi.Net/{Types => Analytics/Requests}/AnalyticsQueryDto.cs (96%) create mode 100644 src/Vapi.Net/TestSuiteRuns/Requests/CreateTestSuiteRunDto.cs create mode 100644 src/Vapi.Net/TestSuiteRuns/Requests/TestSuiteRunControllerFindAllPaginatedRequest.cs create mode 100644 src/Vapi.Net/TestSuiteRuns/Requests/UpdateTestSuiteRunDto.cs create mode 100644 src/Vapi.Net/TestSuiteRuns/TestSuiteRunsClient.cs create mode 100644 src/Vapi.Net/TestSuiteRuns/Types/TestSuiteRunControllerFindAllPaginatedRequestSortOrder.cs create mode 100644 src/Vapi.Net/TestSuiteTests/Requests/TestSuiteTestControllerFindAllPaginatedRequest.cs create mode 100644 src/Vapi.Net/TestSuiteTests/TestSuiteTestsClient.cs create mode 100644 src/Vapi.Net/TestSuiteTests/Types/TestSuiteTestControllerFindAllPaginatedRequestSortOrder.cs create mode 100644 src/Vapi.Net/TestSuites/Requests/CreateTestSuiteDto.cs create mode 100644 src/Vapi.Net/TestSuites/Requests/TestSuiteControllerFindAllPaginatedRequest.cs create mode 100644 src/Vapi.Net/TestSuites/Requests/UpdateTestSuiteDto.cs create mode 100644 src/Vapi.Net/TestSuites/TestSuitesClient.cs create mode 100644 src/Vapi.Net/TestSuites/Types/TestSuiteControllerFindAllPaginatedRequestSortOrder.cs rename src/Vapi.Net/Types/{SemanticEdgeCondition.cs => AiEdgeCondition.cs} (66%) create mode 100644 src/Vapi.Net/Types/AnalyticsQueryTable.cs create mode 100644 src/Vapi.Net/Types/ApiRequest.cs create mode 100644 src/Vapi.Net/Types/ApiRequestMethod.cs create mode 100644 src/Vapi.Net/Types/ApiRequestMode.cs create mode 100644 src/Vapi.Net/Types/AssistantHookActionBase.cs create mode 100644 src/Vapi.Net/Types/AssistantHookFilter.cs create mode 100644 src/Vapi.Net/Types/AssistantHooks.cs create mode 100644 src/Vapi.Net/Types/BackoffPlan.cs delete mode 100644 src/Vapi.Net/Types/BuyPhoneNumberDto.cs create mode 100644 src/Vapi.Net/Types/ByoPhoneNumberStatus.cs create mode 100644 src/Vapi.Net/Types/CartesiaExperimentalControls.cs create mode 100644 src/Vapi.Net/Types/CartesiaExperimentalControlsEmotion.cs create mode 100644 src/Vapi.Net/Types/CartesiaExperimentalControlsSpeed.cs create mode 100644 src/Vapi.Net/Types/ChatCompletionMessage.cs create mode 100644 src/Vapi.Net/Types/ChatCompletionMessageMetadata.cs create mode 100644 src/Vapi.Net/Types/ChatCompletionsDto.cs create mode 100644 src/Vapi.Net/Types/ClientMessageTranscriptType.cs create mode 100644 src/Vapi.Net/Types/ClientMessageWorkflowNodeStarted.cs create mode 100644 src/Vapi.Net/Types/CompliancePlan.cs create mode 100644 src/Vapi.Net/Types/CreateTestSuiteTestVoiceDto.cs create mode 100644 src/Vapi.Net/Types/DeepSeekModelModel.cs create mode 100644 src/Vapi.Net/Types/FailedEdgeCondition.cs create mode 100644 src/Vapi.Net/Types/FormatPlanFormattersEnabledItem.cs create mode 100644 src/Vapi.Net/Types/Hangup.cs create mode 100644 src/Vapi.Net/Types/Hook.cs create mode 100644 src/Vapi.Net/Types/HookOn.cs rename src/Vapi.Net/Types/{ProgrammaticEdgeCondition.cs => LogicEdgeCondition.cs} (53%) delete mode 100644 src/Vapi.Net/Types/OrgWithOrgUser.cs delete mode 100644 src/Vapi.Net/Types/OrgWithOrgUserChannel.cs delete mode 100644 src/Vapi.Net/Types/OrgWithOrgUserRole.cs create mode 100644 src/Vapi.Net/Types/SayHook.cs create mode 100644 src/Vapi.Net/Types/ServerMessageTranscriptType.cs create mode 100644 src/Vapi.Net/Types/TestSuite.cs create mode 100644 src/Vapi.Net/Types/TestSuiteRun.cs create mode 100644 src/Vapi.Net/Types/TestSuiteRunScorerAi.cs create mode 100644 src/Vapi.Net/Types/TestSuiteRunScorerAiResult.cs create mode 100644 src/Vapi.Net/Types/TestSuiteRunStatus.cs create mode 100644 src/Vapi.Net/Types/TestSuiteRunTestAttempt.cs create mode 100644 src/Vapi.Net/Types/TestSuiteRunTestAttemptCall.cs create mode 100644 src/Vapi.Net/Types/TestSuiteRunTestResult.cs create mode 100644 src/Vapi.Net/Types/TestSuiteRunsPaginatedResponse.cs create mode 100644 src/Vapi.Net/Types/TestSuiteTestScorerAi.cs create mode 100644 src/Vapi.Net/Types/TestSuiteTestVoice.cs create mode 100644 src/Vapi.Net/Types/TestSuiteTestsPaginatedResponse.cs create mode 100644 src/Vapi.Net/Types/TestSuitesPaginatedResponse.cs create mode 100644 src/Vapi.Net/Types/Transfer.cs create mode 100644 src/Vapi.Net/Types/TransferAssistantHookAction.cs create mode 100644 src/Vapi.Net/Types/TwilioPhoneNumberStatus.cs create mode 100644 src/Vapi.Net/Types/UpdateTestSuiteTestVoiceDto.cs delete mode 100644 src/Vapi.Net/Types/UpdateWorkflowDto.cs create mode 100644 src/Vapi.Net/Types/VapiPhoneNumberStatus.cs create mode 100644 src/Vapi.Net/Types/VonagePhoneNumberStatus.cs create mode 100644 src/Vapi.Net/Types/XaiModelModel.cs diff --git a/src/Vapi.Net.Test/Core/EnumSerializerTests.cs b/src/Vapi.Net.Test/Core/EnumSerializerTests.cs index 2ccc2b6..3a54617 100644 --- a/src/Vapi.Net.Test/Core/EnumSerializerTests.cs +++ b/src/Vapi.Net.Test/Core/EnumSerializerTests.cs @@ -1,61 +1,60 @@ -using System; using System.Runtime.Serialization; using System.Text.Json; using System.Text.Json.Serialization; using NUnit.Framework; using Vapi.Net.Core; -namespace Vapi.Net.Test.Core -{ - [TestFixture] - public class StringEnumSerializerTests - { - private static readonly JsonSerializerOptions JsonOptions = new() { WriteIndented = true }; +namespace Vapi.Net.Test.Core; - private const DummyEnum KnownEnumValue2 = DummyEnum.KnownValue2; - private const string KnownEnumValue2String = "known_value2"; +[TestFixture] +[Parallelizable(ParallelScope.All)] +public class StringEnumSerializerTests +{ + private static readonly JsonSerializerOptions JsonOptions = new() { WriteIndented = true }; - private static readonly string JsonWithKnownEnum2 = $$""" - { - "enum_property": "{{KnownEnumValue2String}}" - } - """; + private const DummyEnum KnownEnumValue2 = DummyEnum.KnownValue2; + private const string KnownEnumValue2String = "known_value2"; - [Test] - public void ShouldParseKnownEnumValue2() + private const string JsonWithKnownEnum2 = $$""" { - var obj = JsonSerializer.Deserialize(JsonWithKnownEnum2, JsonOptions); - Assert.That(obj, Is.Not.Null); - Assert.That(obj.EnumProperty, Is.EqualTo(KnownEnumValue2)); + "enum_property": "{{KnownEnumValue2String}}" } + """; - [Test] - public void ShouldSerializeKnownEnumValue2() - { - var json = JsonSerializer.SerializeToElement( - new DummyObject { EnumProperty = KnownEnumValue2 }, - JsonOptions - ); - TestContext.Out.WriteLine("Serialized JSON: \n" + json); - var enumString = json.GetProperty("enum_property").GetString(); - Assert.That(enumString, Is.Not.Null); - Assert.That(enumString, Is.EqualTo(KnownEnumValue2String)); - } + [Test] + public void ShouldParseKnownEnumValue2() + { + var obj = JsonSerializer.Deserialize(JsonWithKnownEnum2, JsonOptions); + Assert.That(obj, Is.Not.Null); + Assert.That(obj.EnumProperty, Is.EqualTo(KnownEnumValue2)); } - public class DummyObject + [Test] + public void ShouldSerializeKnownEnumValue2() { - [JsonPropertyName("enum_property")] - public DummyEnum EnumProperty { get; set; } + var json = JsonSerializer.SerializeToElement( + new DummyObject { EnumProperty = KnownEnumValue2 }, + JsonOptions + ); + TestContext.Out.WriteLine("Serialized JSON: \n" + json); + var enumString = json.GetProperty("enum_property").GetString(); + Assert.That(enumString, Is.Not.Null); + Assert.That(enumString, Is.EqualTo(KnownEnumValue2String)); } +} - [JsonConverter(typeof(EnumSerializer))] - public enum DummyEnum - { - [EnumMember(Value = "known_value1")] - KnownValue1, +public class DummyObject +{ + [JsonPropertyName("enum_property")] + public DummyEnum EnumProperty { get; set; } +} - [EnumMember(Value = "known_value2")] - KnownValue2, - } +[JsonConverter(typeof(EnumSerializer))] +public enum DummyEnum +{ + [EnumMember(Value = "known_value1")] + KnownValue1, + + [EnumMember(Value = "known_value2")] + KnownValue2, } diff --git a/src/Vapi.Net.Test/Core/OneOfSerializerTests.cs b/src/Vapi.Net.Test/Core/OneOfSerializerTests.cs new file mode 100644 index 0000000..6c3fc20 --- /dev/null +++ b/src/Vapi.Net.Test/Core/OneOfSerializerTests.cs @@ -0,0 +1,311 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using NUnit.Framework; +using OneOf; +using Vapi.Net.Core; + +namespace Vapi.Net.Test.Core; + +[TestFixture] +[Parallelizable(ParallelScope.All)] +public class OneOfSerializerTests +{ + private class Foo + { + [JsonPropertyName("string_prop")] + public required string StringProp { get; set; } + } + + private class Bar + { + [JsonPropertyName("int_prop")] + public required int IntProp { get; set; } + } + + private static readonly OneOf OneOf1 = OneOf< + string, + int, + object, + Foo, + Bar + >.FromT2(new { }); + private const string OneOf1String = "{}"; + + private static readonly OneOf OneOf2 = OneOf< + string, + int, + object, + Foo, + Bar + >.FromT0("test"); + private const string OneOf2String = "\"test\""; + + private static readonly OneOf OneOf3 = OneOf< + string, + int, + object, + Foo, + Bar + >.FromT1(123); + private const string OneOf3String = "123"; + + private static readonly OneOf OneOf4 = OneOf< + string, + int, + object, + Foo, + Bar + >.FromT3(new Foo { StringProp = "test" }); + private const string OneOf4String = "{\n \"string_prop\": \"test\"\n}"; + + private static readonly OneOf OneOf5 = OneOf< + string, + int, + object, + Foo, + Bar + >.FromT4(new Bar { IntProp = 5 }); + private const string OneOf5String = "{\n \"int_prop\": 5\n}"; + + [Test] + public void Serialize_OneOfs_Should_Return_Expected_String() + { + (OneOf, string)[] testData = + [ + (OneOf1, OneOf1String), + (OneOf2, OneOf2String), + (OneOf3, OneOf3String), + (OneOf4, OneOf4String), + (OneOf5, OneOf5String), + ]; + Assert.Multiple(() => + { + foreach (var (oneOf, expected) in testData) + { + var result = JsonUtils.Serialize(oneOf); + Assert.That(result, Is.EqualTo(expected)); + } + }); + } + + [Test] + public void OneOfs_Should_Deserialize_From_String() + { + (OneOf, string)[] testData = + [ + (OneOf1, OneOf1String), + (OneOf2, OneOf2String), + (OneOf3, OneOf3String), + (OneOf4, OneOf4String), + (OneOf5, OneOf5String), + ]; + Assert.Multiple(() => + { + foreach (var (oneOf, json) in testData) + { + var result = JsonUtils.Deserialize>(json); + Assert.That(result.Index, Is.EqualTo(oneOf.Index)); + Assert.That(json, Is.EqualTo(JsonUtils.Serialize(result.Value))); + } + }); + } + + private static readonly OneOf? NullableOneOf1 = null; + private const string NullableOneOf1String = "null"; + + private static readonly OneOf? NullableOneOf2 = OneOf< + string, + int, + object, + Foo, + Bar + >.FromT4(new Bar { IntProp = 5 }); + private const string NullableOneOf2String = "{\n \"int_prop\": 5\n}"; + + [Test] + public void Serialize_NullableOneOfs_Should_Return_Expected_String() + { + (OneOf?, string)[] testData = + [ + (NullableOneOf1, NullableOneOf1String), + (NullableOneOf2, NullableOneOf2String), + ]; + Assert.Multiple(() => + { + foreach (var (oneOf, expected) in testData) + { + var result = JsonUtils.Serialize(oneOf); + Assert.That(result, Is.EqualTo(expected)); + } + }); + } + + [Test] + public void NullableOneOfs_Should_Deserialize_From_String() + { + (OneOf?, string)[] testData = + [ + (NullableOneOf1, NullableOneOf1String), + (NullableOneOf2, NullableOneOf2String), + ]; + Assert.Multiple(() => + { + foreach (var (oneOf, json) in testData) + { + var result = JsonUtils.Deserialize?>(json); + Assert.That(result?.Index, Is.EqualTo(oneOf?.Index)); + Assert.That(json, Is.EqualTo(JsonUtils.Serialize(result?.Value))); + } + }); + } + + private static readonly OneOf OneOfWithNullable1 = OneOf< + string, + int, + Foo? + >.FromT2(null); + private const string OneOfWithNullable1String = "null"; + + private static readonly OneOf OneOfWithNullable2 = OneOf< + string, + int, + Foo? + >.FromT2(new Foo { StringProp = "test" }); + private const string OneOfWithNullable2String = "{\n \"string_prop\": \"test\"\n}"; + + private static readonly OneOf OneOfWithNullable3 = OneOf< + string, + int, + Foo? + >.FromT0("test"); + private const string OneOfWithNullable3String = "\"test\""; + + [Test] + public void Serialize_OneOfWithNullables_Should_Return_Expected_String() + { + (OneOf, string)[] testData = + [ + (OneOfWithNullable1, OneOfWithNullable1String), + (OneOfWithNullable2, OneOfWithNullable2String), + (OneOfWithNullable3, OneOfWithNullable3String), + ]; + Assert.Multiple(() => + { + foreach (var (oneOf, expected) in testData) + { + var result = JsonUtils.Serialize(oneOf); + Assert.That(result, Is.EqualTo(expected)); + } + }); + } + + [Test] + public void OneOfWithNullables_Should_Deserialize_From_String() + { + (OneOf, string)[] testData = + [ + // (OneOfWithNullable1, OneOfWithNullable1String), // not possible with .NET's JSON serializer + (OneOfWithNullable2, OneOfWithNullable2String), + (OneOfWithNullable3, OneOfWithNullable3String), + ]; + Assert.Multiple(() => + { + foreach (var (oneOf, json) in testData) + { + var result = JsonUtils.Deserialize>(json); + Assert.That(result.Index, Is.EqualTo(oneOf.Index)); + Assert.That(json, Is.EqualTo(JsonUtils.Serialize(result.Value))); + } + }); + } + + [Test] + public void Serialize_OneOfWithObjectLast_Should_Return_Expected_String() + { + var oneOfWithObjectLast = OneOf.FromT4( + new { random = "data" } + ); + const string oneOfWithObjectLastString = "{\n \"random\": \"data\"\n}"; + + var result = JsonUtils.Serialize(oneOfWithObjectLast); + Assert.That(result, Is.EqualTo(oneOfWithObjectLastString)); + } + + [Test] + public void OneOfWithObjectLast_Should_Deserialize_From_String() + { + const string oneOfWithObjectLastString = "{\n \"random\": \"data\"\n}"; + var result = JsonUtils.Deserialize>( + oneOfWithObjectLastString + ); + Assert.Multiple(() => + { + Assert.That(result.Index, Is.EqualTo(4)); + Assert.That(result.Value, Is.InstanceOf()); + Assert.That(JsonUtils.Serialize(result.Value), Is.EqualTo(oneOfWithObjectLastString)); + }); + } + + [Test] + public void Serialize_OneOfWithObjectNotLast_Should_Return_Expected_String() + { + var oneOfWithObjectNotLast = OneOf.FromT1( + new { random = "data" } + ); + const string oneOfWithObjectNotLastString = "{\n \"random\": \"data\"\n}"; + + var result = JsonUtils.Serialize(oneOfWithObjectNotLast); + Assert.That(result, Is.EqualTo(oneOfWithObjectNotLastString)); + } + + [Test] + public void OneOfWithObjectNotLast_Should_Deserialize_From_String() + { + const string oneOfWithObjectNotLastString = "{\n \"random\": \"data\"\n}"; + var result = JsonUtils.Deserialize>( + oneOfWithObjectNotLastString + ); + Assert.Multiple(() => + { + Assert.That(result.Index, Is.EqualTo(1)); + Assert.That(result.Value, Is.InstanceOf()); + Assert.That( + JsonUtils.Serialize(result.Value), + Is.EqualTo(oneOfWithObjectNotLastString) + ); + }); + } + + [Test] + public void Serialize_OneOfSingleType_Should_Return_Expected_String() + { + var oneOfSingle = OneOf.FromT0("single"); + const string oneOfSingleString = "\"single\""; + + var result = JsonUtils.Serialize(oneOfSingle); + Assert.That(result, Is.EqualTo(oneOfSingleString)); + } + + [Test] + public void OneOfSingleType_Should_Deserialize_From_String() + { + const string oneOfSingleString = "\"single\""; + var result = JsonUtils.Deserialize>(oneOfSingleString); + Assert.Multiple(() => + { + Assert.That(result.Index, Is.EqualTo(0)); + Assert.That(result.Value, Is.EqualTo("single")); + }); + } + + [Test] + public void Deserialize_InvalidData_Should_Throw_Exception() + { + const string invalidJson = "{\"invalid\": \"data\"}"; + + Assert.Throws(() => + { + JsonUtils.Deserialize>(invalidJson); + }); + } +} diff --git a/src/Vapi.Net.Test/Core/Pagination/GuidCursorTest.cs b/src/Vapi.Net.Test/Core/Pagination/GuidCursorTest.cs index 547ecd5..60f5e2b 100644 --- a/src/Vapi.Net.Test/Core/Pagination/GuidCursorTest.cs +++ b/src/Vapi.Net.Test/Core/Pagination/GuidCursorTest.cs @@ -1,5 +1,6 @@ using NUnit.Framework; using Vapi.Net.Core; +using SystemTask = System.Threading.Tasks.Task; namespace Vapi.Net.Test.Core.Pagination; @@ -7,7 +8,7 @@ namespace Vapi.Net.Test.Core.Pagination; public class GuidCursorTest { [Test] - public async Task CursorPagerShouldWorkWithGuidCursors() + public async SystemTask CursorPagerShouldWorkWithGuidCursors() { var pager = CreatePager(); await AssertPager(pager); @@ -45,7 +46,7 @@ private Pager CreatePager() (_, _, _) => { responses.MoveNext(); - return Task.FromResult(responses.Current); + return SystemTask.FromResult(responses.Current); }, (request, cursor) => { @@ -58,7 +59,7 @@ private Pager CreatePager() return pager; } - private async Task AssertPager(Pager pager) + private async SystemTask AssertPager(Pager pager) { var pageEnumerator = pager.AsPagesAsync().GetAsyncEnumerator(); diff --git a/src/Vapi.Net.Test/Core/Pagination/HasNextPageOffsetTest.cs b/src/Vapi.Net.Test/Core/Pagination/HasNextPageOffsetTest.cs index 1098db4..fef18e2 100644 --- a/src/Vapi.Net.Test/Core/Pagination/HasNextPageOffsetTest.cs +++ b/src/Vapi.Net.Test/Core/Pagination/HasNextPageOffsetTest.cs @@ -1,5 +1,6 @@ using NUnit.Framework; using Vapi.Net.Core; +using SystemTask = System.Threading.Tasks.Task; namespace Vapi.Net.Test.Core.Pagination; @@ -7,7 +8,7 @@ namespace Vapi.Net.Test.Core.Pagination; public class HasNextPageOffsetTest { [Test] - public async Task OffsetPagerShouldWorkWithHasNextPage() + public async SystemTask OffsetPagerShouldWorkWithHasNextPage() { var pager = CreatePager(); await AssertPager(pager); @@ -39,7 +40,7 @@ private static Pager CreatePager() (_, _, _) => { responses.MoveNext(); - return Task.FromResult(responses.Current); + return SystemTask.FromResult(responses.Current); }, request => request?.Pagination?.Page ?? 0, (request, offset) => @@ -54,7 +55,7 @@ private static Pager CreatePager() return pager; } - private static async Task AssertPager(Pager pager) + private static async SystemTask AssertPager(Pager pager) { var pageCounter = 0; var itemCounter = 0; diff --git a/src/Vapi.Net.Test/Core/Pagination/IntOffsetTest.cs b/src/Vapi.Net.Test/Core/Pagination/IntOffsetTest.cs index 50556c3..a9ff29a 100644 --- a/src/Vapi.Net.Test/Core/Pagination/IntOffsetTest.cs +++ b/src/Vapi.Net.Test/Core/Pagination/IntOffsetTest.cs @@ -1,5 +1,6 @@ using NUnit.Framework; using Vapi.Net.Core; +using SystemTask = System.Threading.Tasks.Task; namespace Vapi.Net.Test.Core.Pagination; @@ -7,7 +8,7 @@ namespace Vapi.Net.Test.Core.Pagination; public class IntOffsetTest { [Test] - public async Task OffsetPagerShouldWorkWithIntPage() + public async SystemTask OffsetPagerShouldWorkWithIntPage() { var pager = CreatePager(); await AssertPager(pager); @@ -27,7 +28,7 @@ public Pager CreatePager() (_, _, _) => { responses.MoveNext(); - return Task.FromResult(responses.Current); + return SystemTask.FromResult(responses.Current); }, request => request.Pagination.Page, (request, offset) => @@ -42,7 +43,7 @@ public Pager CreatePager() return pager; } - public async Task AssertPager(Pager pager) + public async SystemTask AssertPager(Pager pager) { var pageCounter = 0; var itemCounter = 0; diff --git a/src/Vapi.Net.Test/Core/Pagination/LongOffsetTest.cs b/src/Vapi.Net.Test/Core/Pagination/LongOffsetTest.cs index 7d57ef9..1daeb20 100644 --- a/src/Vapi.Net.Test/Core/Pagination/LongOffsetTest.cs +++ b/src/Vapi.Net.Test/Core/Pagination/LongOffsetTest.cs @@ -1,5 +1,6 @@ using NUnit.Framework; using Vapi.Net.Core; +using SystemTask = System.Threading.Tasks.Task; namespace Vapi.Net.Test.Core.Pagination; @@ -7,7 +8,7 @@ namespace Vapi.Net.Test.Core.Pagination; public class LongOffsetTest { [Test] - public async Task OffsetPagerShouldWorkWithLongPage() + public async SystemTask OffsetPagerShouldWorkWithLongPage() { var pager = CreatePager(); await AssertPager(pager); @@ -27,7 +28,7 @@ private static Pager CreatePager() (_, _, _) => { responses.MoveNext(); - return Task.FromResult(responses.Current); + return SystemTask.FromResult(responses.Current); }, request => request?.Pagination?.Page ?? 0, (request, offset) => @@ -42,7 +43,7 @@ private static Pager CreatePager() return pager; } - private static async Task AssertPager(Pager pager) + private static async SystemTask AssertPager(Pager pager) { var pageCounter = 0; var itemCounter = 0; diff --git a/src/Vapi.Net.Test/Core/Pagination/NoRequestCursorTest.cs b/src/Vapi.Net.Test/Core/Pagination/NoRequestCursorTest.cs index 4375158..42a8270 100644 --- a/src/Vapi.Net.Test/Core/Pagination/NoRequestCursorTest.cs +++ b/src/Vapi.Net.Test/Core/Pagination/NoRequestCursorTest.cs @@ -1,5 +1,6 @@ using NUnit.Framework; using Vapi.Net.Core; +using SystemTask = System.Threading.Tasks.Task; namespace Vapi.Net.Test.Core.Pagination; @@ -7,7 +8,7 @@ namespace Vapi.Net.Test.Core.Pagination; public class NoRequestCursorTest { [Test] - public async Task CursorPagerShouldWorkWithStringCursor() + public async SystemTask CursorPagerShouldWorkWithStringCursor() { var pager = CreatePager(); await AssertPager(pager); @@ -45,7 +46,7 @@ private Pager CreatePager() (_, _, _) => { responses.MoveNext(); - return Task.FromResult(responses.Current); + return SystemTask.FromResult(responses.Current); }, (request, cursor) => { @@ -58,7 +59,7 @@ private Pager CreatePager() return pager; } - private async Task AssertPager(Pager pager) + private async SystemTask AssertPager(Pager pager) { var pageEnumerator = pager.AsPagesAsync().GetAsyncEnumerator(); diff --git a/src/Vapi.Net.Test/Core/Pagination/NoRequestOffsetTest.cs b/src/Vapi.Net.Test/Core/Pagination/NoRequestOffsetTest.cs index cdbe82d..445a0d7 100644 --- a/src/Vapi.Net.Test/Core/Pagination/NoRequestOffsetTest.cs +++ b/src/Vapi.Net.Test/Core/Pagination/NoRequestOffsetTest.cs @@ -1,5 +1,6 @@ using NUnit.Framework; using Vapi.Net.Core; +using SystemTask = System.Threading.Tasks.Task; namespace Vapi.Net.Test.Core.Pagination; @@ -7,7 +8,7 @@ namespace Vapi.Net.Test.Core.Pagination; public class NoRequestOffsetTest { [Test] - public async Task OffsetPagerShouldWorkWithoutRequest() + public async SystemTask OffsetPagerShouldWorkWithoutRequest() { var pager = CreatePager(); await AssertPager(pager); @@ -27,7 +28,7 @@ public Pager CreatePager() (_, _, _) => { responses.MoveNext(); - return Task.FromResult(responses.Current); + return SystemTask.FromResult(responses.Current); }, request => request?.Pagination?.Page ?? 0, (request, offset) => @@ -42,7 +43,7 @@ public Pager CreatePager() return pager; } - public async Task AssertPager(Pager pager) + public async SystemTask AssertPager(Pager pager) { var pageCounter = 0; var itemCounter = 0; diff --git a/src/Vapi.Net.Test/Core/Pagination/StepOffsetTest.cs b/src/Vapi.Net.Test/Core/Pagination/StepOffsetTest.cs index 06ea954..97dc707 100644 --- a/src/Vapi.Net.Test/Core/Pagination/StepOffsetTest.cs +++ b/src/Vapi.Net.Test/Core/Pagination/StepOffsetTest.cs @@ -1,5 +1,6 @@ using NUnit.Framework; using Vapi.Net.Core; +using SystemTask = System.Threading.Tasks.Task; namespace Vapi.Net.Test.Core.Pagination; @@ -7,7 +8,7 @@ namespace Vapi.Net.Test.Core.Pagination; public class StepPageOffsetPaginationTest { [Test] - public async Task OffsetPagerShouldWorkWithStep() + public async SystemTask OffsetPagerShouldWorkWithStep() { var pager = CreatePager(); await AssertPager(pager); @@ -30,7 +31,7 @@ private Pager CreatePager() (_, _, _) => { responses.MoveNext(); - return Task.FromResult(responses.Current); + return SystemTask.FromResult(responses.Current); }, request => request?.Pagination?.ItemOffset ?? 0, (request, offset) => @@ -46,7 +47,7 @@ private Pager CreatePager() return pager; } - private async Task AssertPager(Pager pager) + private async SystemTask AssertPager(Pager pager) { var pageEnumerator = pager.AsPagesAsync().GetAsyncEnumerator(); diff --git a/src/Vapi.Net.Test/Core/Pagination/StringCursorTest.cs b/src/Vapi.Net.Test/Core/Pagination/StringCursorTest.cs index 34f3665..6f45b90 100644 --- a/src/Vapi.Net.Test/Core/Pagination/StringCursorTest.cs +++ b/src/Vapi.Net.Test/Core/Pagination/StringCursorTest.cs @@ -1,5 +1,6 @@ using NUnit.Framework; using Vapi.Net.Core; +using SystemTask = System.Threading.Tasks.Task; namespace Vapi.Net.Test.Core.Pagination; @@ -7,7 +8,7 @@ namespace Vapi.Net.Test.Core.Pagination; public class StringCursorTest { [Test] - public async Task CursorPagerShouldWorkWithStringCursor() + public async SystemTask CursorPagerShouldWorkWithStringCursor() { var pager = CreatePager(); await AssertPager(pager); @@ -45,7 +46,7 @@ private Pager CreatePager() (_, _, _) => { responses.MoveNext(); - return Task.FromResult(responses.Current); + return SystemTask.FromResult(responses.Current); }, (request, cursor) => { @@ -58,7 +59,7 @@ private Pager CreatePager() return pager; } - private async Task AssertPager(Pager pager) + private async SystemTask AssertPager(Pager pager) { var pageEnumerator = pager.AsPagesAsync().GetAsyncEnumerator(); diff --git a/src/Vapi.Net.Test/Core/RawClientTests.cs b/src/Vapi.Net.Test/Core/RawClientTests.cs index 75ec4eb..c48e0be 100644 --- a/src/Vapi.Net.Test/Core/RawClientTests.cs +++ b/src/Vapi.Net.Test/Core/RawClientTests.cs @@ -1,6 +1,3 @@ -using System; -using System.Net.Http; -using FluentAssertions; using NUnit.Framework; using Vapi.Net.Core; using WireMock.Server; @@ -8,106 +5,105 @@ using WireMockRequest = WireMock.RequestBuilders.Request; using WireMockResponse = WireMock.ResponseBuilders.Response; -namespace Vapi.Net.Test.Core +namespace Vapi.Net.Test.Core; + +[TestFixture] +[Parallelizable(ParallelScope.Self)] +public class RawClientTests { - [TestFixture] - public class RawClientTests + private const int MaxRetries = 3; + private WireMockServer _server; + private HttpClient _httpClient; + private RawClient _rawClient; + private string _baseUrl; + + [SetUp] + public void SetUp() { - private WireMockServer _server; - private HttpClient _httpClient; - private RawClient _rawClient; - private string _baseUrl; - private const int _maxRetries = 3; - - [SetUp] - public void SetUp() - { - _server = WireMockServer.Start(); - _baseUrl = _server.Url ?? ""; - _httpClient = new HttpClient { BaseAddress = new Uri(_baseUrl) }; - _rawClient = new RawClient( - new ClientOptions() { HttpClient = _httpClient, MaxRetries = _maxRetries } - ); - } - - [Test] - [TestCase(408)] - [TestCase(429)] - [TestCase(500)] - [TestCase(504)] - public async SystemTask MakeRequestAsync_ShouldRetry_OnRetryableStatusCodes(int statusCode) - { - _server - .Given(WireMockRequest.Create().WithPath("/test").UsingGet()) - .InScenario("Retry") - .WillSetStateTo("Server Error") - .RespondWith(WireMockResponse.Create().WithStatusCode(statusCode)); - - _server - .Given(WireMockRequest.Create().WithPath("/test").UsingGet()) - .InScenario("Retry") - .WhenStateIs("Server Error") - .WillSetStateTo("Success") - .RespondWith(WireMockResponse.Create().WithStatusCode(statusCode)); - - _server - .Given(WireMockRequest.Create().WithPath("/test").UsingGet()) - .InScenario("Retry") - .WhenStateIs("Success") - .RespondWith(WireMockResponse.Create().WithStatusCode(200).WithBody("Success")); - - var request = new RawClient.BaseApiRequest - { - BaseUrl = _baseUrl, - Method = HttpMethod.Get, - Path = "/test", - }; - - var response = await _rawClient.MakeRequestAsync(request); - Assert.That(response.StatusCode, Is.EqualTo(200)); - - var content = await response.Raw.Content.ReadAsStringAsync(); - Assert.That(content, Is.EqualTo("Success")); - - Assert.That(_server.LogEntries.Count, Is.EqualTo(_maxRetries)); - } - - [Test] - [TestCase(400)] - [TestCase(409)] - public async SystemTask MakeRequestAsync_ShouldRetry_OnNonRetryableStatusCodes( - int statusCode + _server = WireMockServer.Start(); + _baseUrl = _server.Url ?? ""; + _httpClient = new HttpClient { BaseAddress = new Uri(_baseUrl) }; + _rawClient = new RawClient( + new ClientOptions { HttpClient = _httpClient, MaxRetries = MaxRetries } ) { - _server - .Given(WireMockRequest.Create().WithPath("/test").UsingGet()) - .InScenario("Retry") - .WillSetStateTo("Server Error") - .RespondWith( - WireMockResponse.Create().WithStatusCode(statusCode).WithBody("Failure") - ); - - var request = new RawClient.BaseApiRequest - { - BaseUrl = _baseUrl, - Method = HttpMethod.Get, - Path = "/test", - }; - - var response = await _rawClient.MakeRequestAsync(request); - Assert.That(response.StatusCode, Is.EqualTo(statusCode)); - - var content = await response.Raw.Content.ReadAsStringAsync(); - Assert.That(content, Is.EqualTo("Failure")); - - Assert.That(_server.LogEntries.Count, Is.EqualTo(1)); - } - - [TearDown] - public void TearDown() + BaseRetryDelay = 0, + }; + } + + [Test] + [TestCase(408)] + [TestCase(429)] + [TestCase(500)] + [TestCase(504)] + public async SystemTask MakeRequestAsync_ShouldRetry_OnRetryableStatusCodes(int statusCode) + { + _server + .Given(WireMockRequest.Create().WithPath("/test").UsingGet()) + .InScenario("Retry") + .WillSetStateTo("Server Error") + .RespondWith(WireMockResponse.Create().WithStatusCode(statusCode)); + + _server + .Given(WireMockRequest.Create().WithPath("/test").UsingGet()) + .InScenario("Retry") + .WhenStateIs("Server Error") + .WillSetStateTo("Success") + .RespondWith(WireMockResponse.Create().WithStatusCode(statusCode)); + + _server + .Given(WireMockRequest.Create().WithPath("/test").UsingGet()) + .InScenario("Retry") + .WhenStateIs("Success") + .RespondWith(WireMockResponse.Create().WithStatusCode(200).WithBody("Success")); + + var request = new RawClient.BaseApiRequest + { + BaseUrl = _baseUrl, + Method = HttpMethod.Get, + Path = "/test", + }; + + var response = await _rawClient.MakeRequestAsync(request); + Assert.That(response.StatusCode, Is.EqualTo(200)); + + var content = await response.Raw.Content.ReadAsStringAsync(); + Assert.That(content, Is.EqualTo("Success")); + + Assert.That(_server.LogEntries.Count, Is.EqualTo(MaxRetries)); + } + + [Test] + [TestCase(400)] + [TestCase(409)] + public async SystemTask MakeRequestAsync_ShouldRetry_OnNonRetryableStatusCodes(int statusCode) + { + _server + .Given(WireMockRequest.Create().WithPath("/test").UsingGet()) + .InScenario("Retry") + .WillSetStateTo("Server Error") + .RespondWith(WireMockResponse.Create().WithStatusCode(statusCode).WithBody("Failure")); + + var request = new RawClient.BaseApiRequest { - _server.Dispose(); - _httpClient.Dispose(); - } + BaseUrl = _baseUrl, + Method = HttpMethod.Get, + Path = "/test", + }; + + var response = await _rawClient.MakeRequestAsync(request); + Assert.That(response.StatusCode, Is.EqualTo(statusCode)); + + var content = await response.Raw.Content.ReadAsStringAsync(); + Assert.That(content, Is.EqualTo("Failure")); + + Assert.That(_server.LogEntries.Count, Is.EqualTo(1)); + } + + [TearDown] + public void TearDown() + { + _server.Dispose(); + _httpClient.Dispose(); } } diff --git a/src/Vapi.Net.Test/TestClient.cs b/src/Vapi.Net.Test/TestClient.cs index d650ff1..5d5d4b8 100644 --- a/src/Vapi.Net.Test/TestClient.cs +++ b/src/Vapi.Net.Test/TestClient.cs @@ -1,8 +1,6 @@ using NUnit.Framework; -#nullable enable - namespace Vapi.Net.Test; [TestFixture] -public class TestClient { } +public class TestClient; diff --git a/src/Vapi.Net.Test/Vapi.Net.Test.csproj b/src/Vapi.Net.Test/Vapi.Net.Test.csproj index edd3777..3cdf534 100644 --- a/src/Vapi.Net.Test/Vapi.Net.Test.csproj +++ b/src/Vapi.Net.Test/Vapi.Net.Test.csproj @@ -2,14 +2,19 @@ net8.0 + 12 enable enable - false true + true + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + diff --git a/src/Vapi.Net.sln b/src/Vapi.Net.sln index a1eccc8..e495681 100644 --- a/src/Vapi.Net.sln +++ b/src/Vapi.Net.sln @@ -3,9 +3,9 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 VisualStudioVersion = 17.0.31903.59 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Vapi.Net", "Vapi.Net\Vapi.Net.csproj", "{B99D6C0F-4A08-4F6E-8F39-ADE7F821FF67}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Vapi.Net", "Vapi.Net\Vapi.Net.csproj", "{6586B53D-B956-4662-8F9B-474993193E39}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Vapi.Net.Test", "Vapi.Net.Test\Vapi.Net.Test.csproj", "{E05772B8-D757-4469-AC47-9AAB88404340}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Vapi.Net.Test", "Vapi.Net.Test\Vapi.Net.Test.csproj", "{CAF72DE5-5EE2-4EA3-A10E-A767F0F975E7}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -16,13 +16,13 @@ Global HideSolutionNode = FALSE EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {B99D6C0F-4A08-4F6E-8F39-ADE7F821FF67}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {B99D6C0F-4A08-4F6E-8F39-ADE7F821FF67}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B99D6C0F-4A08-4F6E-8F39-ADE7F821FF67}.Release|Any CPU.ActiveCfg = Release|Any CPU - {B99D6C0F-4A08-4F6E-8F39-ADE7F821FF67}.Release|Any CPU.Build.0 = Release|Any CPU - {E05772B8-D757-4469-AC47-9AAB88404340}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E05772B8-D757-4469-AC47-9AAB88404340}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E05772B8-D757-4469-AC47-9AAB88404340}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E05772B8-D757-4469-AC47-9AAB88404340}.Release|Any CPU.Build.0 = Release|Any CPU + {6586B53D-B956-4662-8F9B-474993193E39}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6586B53D-B956-4662-8F9B-474993193E39}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6586B53D-B956-4662-8F9B-474993193E39}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6586B53D-B956-4662-8F9B-474993193E39}.Release|Any CPU.Build.0 = Release|Any CPU + {CAF72DE5-5EE2-4EA3-A10E-A767F0F975E7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {CAF72DE5-5EE2-4EA3-A10E-A767F0F975E7}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CAF72DE5-5EE2-4EA3-A10E-A767F0F975E7}.Release|Any CPU.ActiveCfg = Release|Any CPU + {CAF72DE5-5EE2-4EA3-A10E-A767F0F975E7}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection EndGlobal diff --git a/src/Vapi.Net/Analytics/AnalyticsClient.cs b/src/Vapi.Net/Analytics/AnalyticsClient.cs index e7509bd..e1da96d 100644 --- a/src/Vapi.Net/Analytics/AnalyticsClient.cs +++ b/src/Vapi.Net/Analytics/AnalyticsClient.cs @@ -1,10 +1,8 @@ using System.Net.Http; +using System.Text.Json; using System.Threading; -using System.Threading.Tasks; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public partial class AnalyticsClient @@ -16,26 +14,39 @@ internal AnalyticsClient(RawClient client) _client = client; } - public async Task GetAsync( + public async Task> GetAsync( + AnalyticsQueryDto request, RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Post, - Path = "analytics", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Post, + Path = "analytics", + Body = request, + ContentType = "application/json", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); + var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { - return; + try + { + return JsonUtils.Deserialize>(responseBody)!; + } + catch (JsonException e) + { + throw new VapiClientException("Failed to deserialize response", e); + } } - var responseBody = await response.Raw.Content.ReadAsStringAsync(); + throw new VapiClientApiException( $"Error with status code {response.StatusCode}", response.StatusCode, diff --git a/src/Vapi.Net/Types/AnalyticsQueryDto.cs b/src/Vapi.Net/Analytics/Requests/AnalyticsQueryDto.cs similarity index 96% rename from src/Vapi.Net/Types/AnalyticsQueryDto.cs rename to src/Vapi.Net/Analytics/Requests/AnalyticsQueryDto.cs index 3ffca2c..e598505 100644 --- a/src/Vapi.Net/Types/AnalyticsQueryDto.cs +++ b/src/Vapi.Net/Analytics/Requests/AnalyticsQueryDto.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record AnalyticsQueryDto diff --git a/src/Vapi.Net/Assistants/AssistantsClient.cs b/src/Vapi.Net/Assistants/AssistantsClient.cs index 256606c..e975700 100644 --- a/src/Vapi.Net/Assistants/AssistantsClient.cs +++ b/src/Vapi.Net/Assistants/AssistantsClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public partial class AssistantsClient @@ -25,7 +23,7 @@ public async Task> ListAsync( var _query = new Dictionary(); if (request.Limit != null) { - _query["limit"] = request.Limit.ToString(); + _query["limit"] = request.Limit.Value.ToString(); } if (request.CreatedAtGt != null) { @@ -59,17 +57,19 @@ public async Task> ListAsync( { _query["updatedAtLe"] = request.UpdatedAtLe.Value.ToString(Constants.DateTimeFormat); } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "assistant", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "assistant", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -96,18 +96,20 @@ public async Task CreateAsync( CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Post, - Path = "assistant", - Body = request, - ContentType = "application/json", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Post, + Path = "assistant", + Body = request, + ContentType = "application/json", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -134,16 +136,18 @@ public async Task GetAsync( CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = $"assistant/{id}", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = $"assistant/{JsonUtils.SerializeAsString(id)}", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -170,16 +174,18 @@ public async Task DeleteAsync( CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Delete, - Path = $"assistant/{id}", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Delete, + Path = $"assistant/{JsonUtils.SerializeAsString(id)}", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -207,18 +213,20 @@ public async Task UpdateAsync( CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethodExtensions.Patch, - Path = $"assistant/{id}", - Body = request, - ContentType = "application/json", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethodExtensions.Patch, + Path = $"assistant/{JsonUtils.SerializeAsString(id)}", + Body = request, + ContentType = "application/json", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Vapi.Net/Assistants/Requests/AssistantsListRequest.cs b/src/Vapi.Net/Assistants/Requests/AssistantsListRequest.cs index 1f11eeb..8e461d6 100644 --- a/src/Vapi.Net/Assistants/Requests/AssistantsListRequest.cs +++ b/src/Vapi.Net/Assistants/Requests/AssistantsListRequest.cs @@ -1,7 +1,5 @@ using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record AssistantsListRequest diff --git a/src/Vapi.Net/Assistants/Requests/UpdateAssistantDto.cs b/src/Vapi.Net/Assistants/Requests/UpdateAssistantDto.cs index e8b1f0d..5856caa 100644 --- a/src/Vapi.Net/Assistants/Requests/UpdateAssistantDto.cs +++ b/src/Vapi.Net/Assistants/Requests/UpdateAssistantDto.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record UpdateAssistantDto @@ -46,12 +44,6 @@ public record UpdateAssistantDto [JsonPropertyName("firstMessageMode")] public UpdateAssistantDtoFirstMessageMode? FirstMessageMode { get; set; } - /// - /// When this is enabled, no logs, recordings, or transcriptions will be stored. At the end of the call, you will still receive an end-of-call-report message to store on your server. Defaults to false. - /// - [JsonPropertyName("hipaaEnabled")] - public bool? HipaaEnabled { get; set; } - /// /// These are the messages that will be sent to your Client SDKs. Default is conversation-update,function-call,hang,model-output,speech-update,status-update,transfer-update,transcript,tool-calls,user-interrupted,voice-input. You can check the shape of the messages in ClientMessage schema. /// @@ -156,6 +148,9 @@ public record UpdateAssistantDto [JsonPropertyName("endCallPhrases")] public IEnumerable? EndCallPhrases { get; set; } + [JsonPropertyName("compliancePlan")] + public CompliancePlan? CompliancePlan { get; set; } + /// /// This is for metadata you want to store on the assistant. /// @@ -238,6 +233,12 @@ public record UpdateAssistantDto [JsonPropertyName("server")] public Server? Server { get; set; } + /// + /// This is a set of actions that will be performed on certain events. + /// + [JsonPropertyName("hooks")] + public IEnumerable? Hooks { get; set; } + public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Assistants/Types/UpdateAssistantDtoBackgroundSound.cs b/src/Vapi.Net/Assistants/Types/UpdateAssistantDtoBackgroundSound.cs index 1d1dd56..2bc68c0 100644 --- a/src/Vapi.Net/Assistants/Types/UpdateAssistantDtoBackgroundSound.cs +++ b/src/Vapi.Net/Assistants/Types/UpdateAssistantDtoBackgroundSound.cs @@ -2,8 +2,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] diff --git a/src/Vapi.Net/Assistants/Types/UpdateAssistantDtoClientMessagesItem.cs b/src/Vapi.Net/Assistants/Types/UpdateAssistantDtoClientMessagesItem.cs index 1fcb531..f60d0a7 100644 --- a/src/Vapi.Net/Assistants/Types/UpdateAssistantDtoClientMessagesItem.cs +++ b/src/Vapi.Net/Assistants/Types/UpdateAssistantDtoClientMessagesItem.cs @@ -2,8 +2,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] diff --git a/src/Vapi.Net/Assistants/Types/UpdateAssistantDtoFirstMessageMode.cs b/src/Vapi.Net/Assistants/Types/UpdateAssistantDtoFirstMessageMode.cs index 8487391..45df7c7 100644 --- a/src/Vapi.Net/Assistants/Types/UpdateAssistantDtoFirstMessageMode.cs +++ b/src/Vapi.Net/Assistants/Types/UpdateAssistantDtoFirstMessageMode.cs @@ -2,8 +2,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] diff --git a/src/Vapi.Net/Assistants/Types/UpdateAssistantDtoServerMessagesItem.cs b/src/Vapi.Net/Assistants/Types/UpdateAssistantDtoServerMessagesItem.cs index 42b21e9..0cb99da 100644 --- a/src/Vapi.Net/Assistants/Types/UpdateAssistantDtoServerMessagesItem.cs +++ b/src/Vapi.Net/Assistants/Types/UpdateAssistantDtoServerMessagesItem.cs @@ -2,8 +2,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] @@ -42,6 +40,9 @@ public enum UpdateAssistantDtoServerMessagesItem [EnumMember(Value = "transcript")] Transcript, + [EnumMember(Value = "transcript[transcriptType='final']")] + TranscriptTranscriptTypeFinal, + [EnumMember(Value = "tool-calls")] ToolCalls, diff --git a/src/Vapi.Net/Blocks/BlocksClient.cs b/src/Vapi.Net/Blocks/BlocksClient.cs index d24f959..c9b4c8b 100644 --- a/src/Vapi.Net/Blocks/BlocksClient.cs +++ b/src/Vapi.Net/Blocks/BlocksClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public partial class BlocksClient @@ -25,7 +23,7 @@ public async Task> ListAsync( var _query = new Dictionary(); if (request.Limit != null) { - _query["limit"] = request.Limit.ToString(); + _query["limit"] = request.Limit.Value.ToString(); } if (request.CreatedAtGt != null) { @@ -59,17 +57,19 @@ public async Task> ListAsync( { _query["updatedAtLe"] = request.UpdatedAtLe.Value.ToString(Constants.DateTimeFormat); } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "block", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "block", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -96,18 +96,20 @@ public async Task CreateAsync( CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Post, - Path = "block", - Body = request, - ContentType = "application/json", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Post, + Path = "block", + Body = request, + ContentType = "application/json", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -134,16 +136,18 @@ public async Task GetAsync( CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = $"block/{id}", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = $"block/{JsonUtils.SerializeAsString(id)}", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -170,16 +174,18 @@ public async Task DeleteAsync( CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Delete, - Path = $"block/{id}", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Delete, + Path = $"block/{JsonUtils.SerializeAsString(id)}", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -207,18 +213,20 @@ public async Task UpdateAsync( CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethodExtensions.Patch, - Path = $"block/{id}", - Body = request, - ContentType = "application/json", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethodExtensions.Patch, + Path = $"block/{JsonUtils.SerializeAsString(id)}", + Body = request, + ContentType = "application/json", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Vapi.Net/Blocks/Requests/BlocksListRequest.cs b/src/Vapi.Net/Blocks/Requests/BlocksListRequest.cs index a8d2f5e..3018a00 100644 --- a/src/Vapi.Net/Blocks/Requests/BlocksListRequest.cs +++ b/src/Vapi.Net/Blocks/Requests/BlocksListRequest.cs @@ -1,7 +1,5 @@ using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record BlocksListRequest diff --git a/src/Vapi.Net/Calls/CallsClient.cs b/src/Vapi.Net/Calls/CallsClient.cs index f179fc0..0ef2ed9 100644 --- a/src/Vapi.Net/Calls/CallsClient.cs +++ b/src/Vapi.Net/Calls/CallsClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public partial class CallsClient @@ -37,7 +35,7 @@ public async Task> ListAsync( } if (request.Limit != null) { - _query["limit"] = request.Limit.ToString(); + _query["limit"] = request.Limit.Value.ToString(); } if (request.CreatedAtGt != null) { @@ -71,17 +69,19 @@ public async Task> ListAsync( { _query["updatedAtLe"] = request.UpdatedAtLe.Value.ToString(Constants.DateTimeFormat); } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "call", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "call", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -108,18 +108,20 @@ public async Task CreateAsync( CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Post, - Path = "call", - Body = request, - ContentType = "application/json", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Post, + Path = "call", + Body = request, + ContentType = "application/json", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -146,16 +148,18 @@ public async Task GetAsync( CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = $"call/{id}", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = $"call/{JsonUtils.SerializeAsString(id)}", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -182,16 +186,18 @@ public async Task DeleteAsync( CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Delete, - Path = $"call/{id}", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Delete, + Path = $"call/{JsonUtils.SerializeAsString(id)}", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -219,18 +225,20 @@ public async Task UpdateAsync( CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethodExtensions.Patch, - Path = $"call/{id}", - Body = request, - ContentType = "application/json", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethodExtensions.Patch, + Path = $"call/{JsonUtils.SerializeAsString(id)}", + Body = request, + ContentType = "application/json", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Vapi.Net/Calls/Requests/CallsListRequest.cs b/src/Vapi.Net/Calls/Requests/CallsListRequest.cs index 5dc56fb..d55b3e1 100644 --- a/src/Vapi.Net/Calls/Requests/CallsListRequest.cs +++ b/src/Vapi.Net/Calls/Requests/CallsListRequest.cs @@ -1,7 +1,5 @@ using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record CallsListRequest diff --git a/src/Vapi.Net/Calls/Requests/CreateCallDto.cs b/src/Vapi.Net/Calls/Requests/CreateCallDto.cs index bd3197f..62cafe6 100644 --- a/src/Vapi.Net/Calls/Requests/CreateCallDto.cs +++ b/src/Vapi.Net/Calls/Requests/CreateCallDto.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record CreateCallDto diff --git a/src/Vapi.Net/Calls/Requests/UpdateCallDto.cs b/src/Vapi.Net/Calls/Requests/UpdateCallDto.cs index ac185ce..8cf34b4 100644 --- a/src/Vapi.Net/Calls/Requests/UpdateCallDto.cs +++ b/src/Vapi.Net/Calls/Requests/UpdateCallDto.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record UpdateCallDto diff --git a/src/Vapi.Net/Core/CollectionItemSerializer.cs b/src/Vapi.Net/Core/CollectionItemSerializer.cs index 948bc75..fde0844 100644 --- a/src/Vapi.Net/Core/CollectionItemSerializer.cs +++ b/src/Vapi.Net/Core/CollectionItemSerializer.cs @@ -23,7 +23,7 @@ internal class CollectionItemSerializer /// Created object. public override IEnumerable? Read( ref Utf8JsonReader reader, - System.Type typeToConvert, + global::System.Type typeToConvert, JsonSerializerOptions options ) { @@ -75,7 +75,7 @@ JsonSerializerOptions options return; } - JsonSerializerOptions jsonSerializerOptions = new JsonSerializerOptions(options); + var jsonSerializerOptions = new JsonSerializerOptions(options); jsonSerializerOptions.Converters.Clear(); jsonSerializerOptions.Converters.Add(Activator.CreateInstance()); diff --git a/src/Vapi.Net/Core/DateTimeSerializer.cs b/src/Vapi.Net/Core/DateTimeSerializer.cs index ca02db5..253e358 100644 --- a/src/Vapi.Net/Core/DateTimeSerializer.cs +++ b/src/Vapi.Net/Core/DateTimeSerializer.cs @@ -8,7 +8,7 @@ internal class DateTimeSerializer : JsonConverter { public override DateTime Read( ref Utf8JsonReader reader, - System.Type typeToConvert, + global::System.Type typeToConvert, JsonSerializerOptions options ) { diff --git a/src/Vapi.Net/Core/EnumSerializer.cs b/src/Vapi.Net/Core/EnumSerializer.cs index 8999941..143b99d 100644 --- a/src/Vapi.Net/Core/EnumSerializer.cs +++ b/src/Vapi.Net/Core/EnumSerializer.cs @@ -5,7 +5,7 @@ namespace Vapi.Net.Core; internal class EnumSerializer : JsonConverter - where TEnum : struct, System.Enum + where TEnum : struct, Enum { private readonly Dictionary _enumToString = new(); private readonly Dictionary _stringToEnum = new(); @@ -18,7 +18,7 @@ public EnumSerializer() foreach (var value in values) { var enumValue = (TEnum)value; - var enumMember = type.GetMember(enumValue.ToString())[0]; + var enumMember = type.GetField(enumValue.ToString())!; var attr = enumMember .GetCustomAttributes(typeof(EnumMemberAttribute), false) .Cast() @@ -36,7 +36,7 @@ public EnumSerializer() public override TEnum Read( ref Utf8JsonReader reader, - System.Type typeToConvert, + global::System.Type typeToConvert, JsonSerializerOptions options ) { diff --git a/src/Vapi.Net/Core/IRequestOptions.cs b/src/Vapi.Net/Core/IRequestOptions.cs index b2533ea..1a46b86 100644 --- a/src/Vapi.Net/Core/IRequestOptions.cs +++ b/src/Vapi.Net/Core/IRequestOptions.cs @@ -1,8 +1,6 @@ using System; using System.Net.Http; -#nullable enable - namespace Vapi.Net.Core; internal interface IRequestOptions diff --git a/src/Vapi.Net/Core/JsonConfiguration.cs b/src/Vapi.Net/Core/JsonConfiguration.cs index 1a9742e..eb563b6 100644 --- a/src/Vapi.Net/Core/JsonConfiguration.cs +++ b/src/Vapi.Net/Core/JsonConfiguration.cs @@ -29,6 +29,12 @@ public static string Serialize(T obj) return JsonSerializer.Serialize(obj, JsonOptions.JsonSerializerOptions); } + public static string SerializeAsString(T obj) + { + var json = JsonSerializer.Serialize(obj, JsonOptions.JsonSerializerOptions); + return json.Trim('"'); + } + public static T Deserialize(string json) { return JsonSerializer.Deserialize(json, JsonOptions.JsonSerializerOptions)!; diff --git a/src/Vapi.Net/Core/OneOfSerializer.cs b/src/Vapi.Net/Core/OneOfSerializer.cs index a0a67d9..f2452dd 100644 --- a/src/Vapi.Net/Core/OneOfSerializer.cs +++ b/src/Vapi.Net/Core/OneOfSerializer.cs @@ -9,7 +9,7 @@ internal class OneOfSerializer : JsonConverter { public override IOneOf? Read( ref Utf8JsonReader reader, - System.Type typeToConvert, + global::System.Type typeToConvert, JsonSerializerOptions options ) { @@ -38,13 +38,19 @@ public override void Write(Utf8JsonWriter writer, IOneOf value, JsonSerializerOp JsonSerializer.Serialize(writer, value.Value, options); } - private static (System.Type type, MethodInfo cast)[] GetOneOfTypes(System.Type typeToConvert) + private static (global::System.Type type, MethodInfo cast)[] GetOneOfTypes( + global::System.Type typeToConvert + ) { - var casts = typeToConvert - .GetRuntimeMethods() + var type = typeToConvert; + if (Nullable.GetUnderlyingType(type) is { } underlyingType) + { + type = underlyingType; + } + + var casts = type.GetRuntimeMethods() .Where(m => m.IsSpecialName && m.Name == "op_Implicit") .ToArray(); - var type = typeToConvert; while (type != null) { if ( @@ -52,17 +58,33 @@ private static (System.Type type, MethodInfo cast)[] GetOneOfTypes(System.Type t && (type.Name.StartsWith("OneOf`") || type.Name.StartsWith("OneOfBase`")) ) { - return type.GetGenericArguments() + var genericArguments = type.GetGenericArguments(); + if (genericArguments.Length == 1) + { + return [(genericArguments[0], casts[0])]; + } + + // if object type is present, make sure it is last + var indexOfObjectType = Array.IndexOf(genericArguments, typeof(object)); + if (indexOfObjectType != -1 && genericArguments.Length - 1 != indexOfObjectType) + { + genericArguments = genericArguments + .OrderBy(t => t == typeof(object) ? 1 : 0) + .ToArray(); + } + + return genericArguments .Select(t => (t, casts.First(c => c.GetParameters()[0].ParameterType == t))) .ToArray(); } type = type.BaseType; } + throw new InvalidOperationException($"{type} isn't OneOf or OneOfBase"); } - public override bool CanConvert(System.Type typeToConvert) + public override bool CanConvert(global::System.Type typeToConvert) { return typeof(IOneOf).IsAssignableFrom(typeToConvert); } diff --git a/src/Vapi.Net/Core/Page.cs b/src/Vapi.Net/Core/Page.cs index 173b43a..4b129e5 100644 --- a/src/Vapi.Net/Core/Page.cs +++ b/src/Vapi.Net/Core/Page.cs @@ -1,3 +1,5 @@ +using System.Collections; + namespace Vapi.Net.Core; /// @@ -5,7 +7,7 @@ namespace Vapi.Net.Core; /// zero or more s of items. /// /// The type of items. -public class Page +public class Page : IEnumerable { public Page(IReadOnlyList items) { @@ -16,4 +18,8 @@ public Page(IReadOnlyList items) /// Gets the items in this . /// public IReadOnlyList Items { get; } + + public IEnumerator GetEnumerator() => Items.GetEnumerator(); + + IEnumerator IEnumerable.GetEnumerator() => Items.GetEnumerator(); } diff --git a/src/Vapi.Net/Core/Public/ClientOptions.cs b/src/Vapi.Net/Core/Public/ClientOptions.cs index 5128a50..5b88816 100644 --- a/src/Vapi.Net/Core/Public/ClientOptions.cs +++ b/src/Vapi.Net/Core/Public/ClientOptions.cs @@ -2,8 +2,6 @@ using System.Net.Http; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public partial class ClientOptions diff --git a/src/Vapi.Net/Core/Public/RequestOptions.cs b/src/Vapi.Net/Core/Public/RequestOptions.cs index 0c5c8b9..a499345 100644 --- a/src/Vapi.Net/Core/Public/RequestOptions.cs +++ b/src/Vapi.Net/Core/Public/RequestOptions.cs @@ -2,8 +2,6 @@ using System.Net.Http; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public partial class RequestOptions : IRequestOptions diff --git a/src/Vapi.Net/Core/Public/VapiClientEnvironment.cs b/src/Vapi.Net/Core/Public/VapiClientEnvironment.cs index ef6dbf3..a86e9ec 100644 --- a/src/Vapi.Net/Core/Public/VapiClientEnvironment.cs +++ b/src/Vapi.Net/Core/Public/VapiClientEnvironment.cs @@ -2,5 +2,5 @@ namespace Vapi.Net; public class VapiClientEnvironment { - public static string Default = "https://api.vapi.ai"; + public const string Default = "https://api.vapi.ai"; } diff --git a/src/Vapi.Net/Core/Public/VapiClientException.cs b/src/Vapi.Net/Core/Public/VapiClientException.cs index a3caeb8..fab0345 100644 --- a/src/Vapi.Net/Core/Public/VapiClientException.cs +++ b/src/Vapi.Net/Core/Public/VapiClientException.cs @@ -1,11 +1,9 @@ using System; -#nullable enable - namespace Vapi.Net; /// /// Base exception class for all exceptions thrown by the SDK. /// public class VapiClientException(string message, Exception? innerException = null) - : Exception(message, innerException) { } + : Exception(message, innerException); diff --git a/src/Vapi.Net/Core/Public/Version.cs b/src/Vapi.Net/Core/Public/Version.cs index 5f23075..ad76d19 100644 --- a/src/Vapi.Net/Core/Public/Version.cs +++ b/src/Vapi.Net/Core/Public/Version.cs @@ -2,5 +2,5 @@ namespace Vapi.Net; internal class Version { - public const string Current = "0.4.1"; + public const string Current = "0.5.0"; } diff --git a/src/Vapi.Net/Core/RawClient.cs b/src/Vapi.Net/Core/RawClient.cs index 8bfa0c0..ba67dff 100644 --- a/src/Vapi.Net/Core/RawClient.cs +++ b/src/Vapi.Net/Core/RawClient.cs @@ -2,18 +2,17 @@ using System.Net.Http.Headers; using System.Text; using System.Threading; +using SystemTask = System.Threading.Tasks.Task; namespace Vapi.Net.Core; -#nullable enable - /// /// Utility class for making raw HTTP requests to the API. /// internal class RawClient(ClientOptions clientOptions) { - private const int InitialRetryDelayMs = 1000; private const int MaxRetryDelayMs = 60000; + internal int BaseRetryDelay { get; set; } = 1000; /// /// The client options applied on every request. @@ -31,7 +30,7 @@ public async Task MakeRequestAsync( cts.CancelAfter(timeout); // Send the request. - return await SendWithRetriesAsync(request, cts.Token); + return await SendWithRetriesAsync(request, cts.Token).ConfigureAwait(false); } public record BaseApiRequest @@ -84,16 +83,20 @@ CancellationToken cancellationToken { var httpClient = request.Options?.HttpClient ?? Options.HttpClient; var maxRetries = request.Options?.MaxRetries ?? Options.MaxRetries; - var response = await httpClient.SendAsync(BuildHttpRequest(request), cancellationToken); + var response = await httpClient + .SendAsync(BuildHttpRequest(request), cancellationToken) + .ConfigureAwait(false); for (var i = 0; i < maxRetries; i++) { if (!ShouldRetry(response)) { break; } - var delayMs = Math.Min(InitialRetryDelayMs * (int)Math.Pow(2, i), MaxRetryDelayMs); - await System.Threading.Tasks.Task.Delay(delayMs, cancellationToken); - response = await httpClient.SendAsync(BuildHttpRequest(request), cancellationToken); + var delayMs = Math.Min(BaseRetryDelay * (int)Math.Pow(2, i), MaxRetryDelayMs); + await SystemTask.Delay(delayMs, cancellationToken).ConfigureAwait(false); + response = await httpClient + .SendAsync(BuildHttpRequest(request), cancellationToken) + .ConfigureAwait(false); } return new ApiResponse { StatusCode = (int)response.StatusCode, Raw = response }; } @@ -153,7 +156,11 @@ private static string BuildUrl(BaseApiRequest request) url, (current, queryItem) => { - if (queryItem.Value is System.Collections.IEnumerable collection and not string) + if ( + queryItem.Value + is global::System.Collections.IEnumerable collection + and not string + ) { var items = collection .Cast() diff --git a/src/Vapi.Net/Files/FilesClient.cs b/src/Vapi.Net/Files/FilesClient.cs index 12e7a85..f550709 100644 --- a/src/Vapi.Net/Files/FilesClient.cs +++ b/src/Vapi.Net/Files/FilesClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public partial class FilesClient @@ -21,16 +19,18 @@ public async Task> ListAsync( CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "file", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "file", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -57,16 +57,18 @@ public async Task CreateAsync( CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Post, - Path = "file", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Post, + Path = "file", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -105,16 +107,18 @@ public async Task GetAsync( CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = $"file/{id}", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = $"file/{JsonUtils.SerializeAsString(id)}", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -141,16 +145,18 @@ public async Task DeleteAsync( CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Delete, - Path = $"file/{id}", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Delete, + Path = $"file/{JsonUtils.SerializeAsString(id)}", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -178,18 +184,20 @@ public async Task UpdateAsync( CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethodExtensions.Patch, - Path = $"file/{id}", - Body = request, - ContentType = "application/json", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethodExtensions.Patch, + Path = $"file/{JsonUtils.SerializeAsString(id)}", + Body = request, + ContentType = "application/json", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Vapi.Net/Files/Requests/CreateFileDto.cs b/src/Vapi.Net/Files/Requests/CreateFileDto.cs index cba835f..e37f688 100644 --- a/src/Vapi.Net/Files/Requests/CreateFileDto.cs +++ b/src/Vapi.Net/Files/Requests/CreateFileDto.cs @@ -1,7 +1,5 @@ using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record CreateFileDto diff --git a/src/Vapi.Net/Files/Requests/UpdateFileDto.cs b/src/Vapi.Net/Files/Requests/UpdateFileDto.cs index 8b20b36..6059e72 100644 --- a/src/Vapi.Net/Files/Requests/UpdateFileDto.cs +++ b/src/Vapi.Net/Files/Requests/UpdateFileDto.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record UpdateFileDto diff --git a/src/Vapi.Net/KnowledgeBases/KnowledgeBasesClient.cs b/src/Vapi.Net/KnowledgeBases/KnowledgeBasesClient.cs index 93b7f4c..cbd3915 100644 --- a/src/Vapi.Net/KnowledgeBases/KnowledgeBasesClient.cs +++ b/src/Vapi.Net/KnowledgeBases/KnowledgeBasesClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public partial class KnowledgeBasesClient @@ -25,7 +23,7 @@ public async Task> ListAsync( var _query = new Dictionary(); if (request.Limit != null) { - _query["limit"] = request.Limit.ToString(); + _query["limit"] = request.Limit.Value.ToString(); } if (request.CreatedAtGt != null) { @@ -59,17 +57,19 @@ public async Task> ListAsync( { _query["updatedAtLe"] = request.UpdatedAtLe.Value.ToString(Constants.DateTimeFormat); } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "knowledge-base", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "knowledge-base", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -96,18 +96,20 @@ public async Task CreateAsync( CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Post, - Path = "knowledge-base", - Body = request, - ContentType = "application/json", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Post, + Path = "knowledge-base", + Body = request, + ContentType = "application/json", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -134,16 +136,18 @@ public async Task GetAsync( CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = $"knowledge-base/{id}", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = $"knowledge-base/{JsonUtils.SerializeAsString(id)}", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -170,16 +174,18 @@ public async Task DeleteAsync( CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Delete, - Path = $"knowledge-base/{id}", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Delete, + Path = $"knowledge-base/{JsonUtils.SerializeAsString(id)}", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -207,18 +213,20 @@ public async Task UpdateAsync( CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethodExtensions.Patch, - Path = $"knowledge-base/{id}", - Body = request, - ContentType = "application/json", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethodExtensions.Patch, + Path = $"knowledge-base/{JsonUtils.SerializeAsString(id)}", + Body = request, + ContentType = "application/json", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Vapi.Net/KnowledgeBases/Requests/KnowledgeBasesListRequest.cs b/src/Vapi.Net/KnowledgeBases/Requests/KnowledgeBasesListRequest.cs index f41e669..b5d4fc4 100644 --- a/src/Vapi.Net/KnowledgeBases/Requests/KnowledgeBasesListRequest.cs +++ b/src/Vapi.Net/KnowledgeBases/Requests/KnowledgeBasesListRequest.cs @@ -1,7 +1,5 @@ using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record KnowledgeBasesListRequest diff --git a/src/Vapi.Net/Logs/LogsClient.cs b/src/Vapi.Net/Logs/LogsClient.cs index e929736..191ae41 100644 --- a/src/Vapi.Net/Logs/LogsClient.cs +++ b/src/Vapi.Net/Logs/LogsClient.cs @@ -1,11 +1,9 @@ using System.Net.Http; using System.Text.Json; using System.Threading; -using System.Threading.Tasks; +using global::System.Threading.Tasks; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public partial class LogsClient @@ -46,7 +44,7 @@ public Pager GetAsync(LogsGetRequest request, RequestOptions? options = nul return pager; } - public async Task LoggingControllerLogsDeleteQueryAsync( + public async global::System.Threading.Tasks.Task LoggingControllerLogsDeleteQueryAsync( LoggingControllerLogsDeleteQueryRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -77,17 +75,19 @@ public async Task LoggingControllerLogsDeleteQueryAsync( { _query["callId"] = request.CallId; } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Delete, - Path = "logs", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Delete, + Path = "logs", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); if (response.StatusCode is >= 200 and < 400) { return; @@ -100,7 +100,7 @@ public async Task LoggingControllerLogsDeleteQueryAsync( ); } - internal async Task GetAsync( + private async Task GetAsync( LogsGetRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -137,7 +137,7 @@ internal async Task GetAsync( } if (request.Page != null) { - _query["page"] = request.Page.ToString(); + _query["page"] = request.Page.Value.ToString(); } if (request.SortOrder != null) { @@ -145,7 +145,7 @@ internal async Task GetAsync( } if (request.Limit != null) { - _query["limit"] = request.Limit.ToString(); + _query["limit"] = request.Limit.Value.ToString(); } if (request.CreatedAtGt != null) { @@ -179,17 +179,19 @@ internal async Task GetAsync( { _query["updatedAtLe"] = request.UpdatedAtLe.Value.ToString(Constants.DateTimeFormat); } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "logs", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "logs", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Vapi.Net/Logs/Requests/LoggingControllerLogsDeleteQueryRequest.cs b/src/Vapi.Net/Logs/Requests/LoggingControllerLogsDeleteQueryRequest.cs index 904dba0..d56e08c 100644 --- a/src/Vapi.Net/Logs/Requests/LoggingControllerLogsDeleteQueryRequest.cs +++ b/src/Vapi.Net/Logs/Requests/LoggingControllerLogsDeleteQueryRequest.cs @@ -1,7 +1,5 @@ using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record LoggingControllerLogsDeleteQueryRequest diff --git a/src/Vapi.Net/Logs/Requests/LogsGetRequest.cs b/src/Vapi.Net/Logs/Requests/LogsGetRequest.cs index f4e2294..7682f75 100644 --- a/src/Vapi.Net/Logs/Requests/LogsGetRequest.cs +++ b/src/Vapi.Net/Logs/Requests/LogsGetRequest.cs @@ -1,7 +1,5 @@ using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record LogsGetRequest @@ -47,7 +45,7 @@ public record LogsGetRequest public double? Page { get; set; } /// - /// This is the sort order for pagination. Defaults to 'ASC'. + /// This is the sort order for pagination. Defaults to 'DESC'. /// public LogsGetRequestSortOrder? SortOrder { get; set; } diff --git a/src/Vapi.Net/Logs/Types/LoggingControllerLogsDeleteQueryRequestType.cs b/src/Vapi.Net/Logs/Types/LoggingControllerLogsDeleteQueryRequestType.cs index bad941e..1fbdd79 100644 --- a/src/Vapi.Net/Logs/Types/LoggingControllerLogsDeleteQueryRequestType.cs +++ b/src/Vapi.Net/Logs/Types/LoggingControllerLogsDeleteQueryRequestType.cs @@ -2,8 +2,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] diff --git a/src/Vapi.Net/Logs/Types/LogsGetRequestSortOrder.cs b/src/Vapi.Net/Logs/Types/LogsGetRequestSortOrder.cs index dfe101d..73053b0 100644 --- a/src/Vapi.Net/Logs/Types/LogsGetRequestSortOrder.cs +++ b/src/Vapi.Net/Logs/Types/LogsGetRequestSortOrder.cs @@ -2,8 +2,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] diff --git a/src/Vapi.Net/Logs/Types/LogsGetRequestType.cs b/src/Vapi.Net/Logs/Types/LogsGetRequestType.cs index 9fe7dbe..e05a915 100644 --- a/src/Vapi.Net/Logs/Types/LogsGetRequestType.cs +++ b/src/Vapi.Net/Logs/Types/LogsGetRequestType.cs @@ -2,8 +2,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] diff --git a/src/Vapi.Net/PhoneNumbers/PhoneNumbersClient.cs b/src/Vapi.Net/PhoneNumbers/PhoneNumbersClient.cs index 5da4bb5..5e3d4e7 100644 --- a/src/Vapi.Net/PhoneNumbers/PhoneNumbersClient.cs +++ b/src/Vapi.Net/PhoneNumbers/PhoneNumbersClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public partial class PhoneNumbersClient @@ -25,7 +23,7 @@ public async Task> ListAsync( var _query = new Dictionary(); if (request.Limit != null) { - _query["limit"] = request.Limit.ToString(); + _query["limit"] = request.Limit.Value.ToString(); } if (request.CreatedAtGt != null) { @@ -59,17 +57,19 @@ public async Task> ListAsync( { _query["updatedAtLe"] = request.UpdatedAtLe.Value.ToString(Constants.DateTimeFormat); } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "phone-number", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "phone-number", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -96,18 +96,20 @@ public async Task CreateAsync( CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Post, - Path = "phone-number", - Body = request, - ContentType = "application/json", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Post, + Path = "phone-number", + Body = request, + ContentType = "application/json", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -134,16 +136,18 @@ public async Task GetAsync( CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = $"phone-number/{id}", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = $"phone-number/{JsonUtils.SerializeAsString(id)}", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -170,16 +174,18 @@ public async Task DeleteAsync( CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Delete, - Path = $"phone-number/{id}", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Delete, + Path = $"phone-number/{JsonUtils.SerializeAsString(id)}", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -207,18 +213,20 @@ public async Task UpdateAsync( CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethodExtensions.Patch, - Path = $"phone-number/{id}", - Body = request, - ContentType = "application/json", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethodExtensions.Patch, + Path = $"phone-number/{JsonUtils.SerializeAsString(id)}", + Body = request, + ContentType = "application/json", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Vapi.Net/PhoneNumbers/Requests/PhoneNumbersListRequest.cs b/src/Vapi.Net/PhoneNumbers/Requests/PhoneNumbersListRequest.cs index 8ad7262..6d3cc6f 100644 --- a/src/Vapi.Net/PhoneNumbers/Requests/PhoneNumbersListRequest.cs +++ b/src/Vapi.Net/PhoneNumbers/Requests/PhoneNumbersListRequest.cs @@ -1,7 +1,5 @@ using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record PhoneNumbersListRequest diff --git a/src/Vapi.Net/Squads/Requests/SquadsListRequest.cs b/src/Vapi.Net/Squads/Requests/SquadsListRequest.cs index 3600ace..0a5c233 100644 --- a/src/Vapi.Net/Squads/Requests/SquadsListRequest.cs +++ b/src/Vapi.Net/Squads/Requests/SquadsListRequest.cs @@ -1,7 +1,5 @@ using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record SquadsListRequest diff --git a/src/Vapi.Net/Squads/Requests/UpdateSquadDto.cs b/src/Vapi.Net/Squads/Requests/UpdateSquadDto.cs index 7bc5036..dad0248 100644 --- a/src/Vapi.Net/Squads/Requests/UpdateSquadDto.cs +++ b/src/Vapi.Net/Squads/Requests/UpdateSquadDto.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record UpdateSquadDto diff --git a/src/Vapi.Net/Squads/SquadsClient.cs b/src/Vapi.Net/Squads/SquadsClient.cs index 847b38c..b66a664 100644 --- a/src/Vapi.Net/Squads/SquadsClient.cs +++ b/src/Vapi.Net/Squads/SquadsClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public partial class SquadsClient @@ -25,7 +23,7 @@ public async Task> ListAsync( var _query = new Dictionary(); if (request.Limit != null) { - _query["limit"] = request.Limit.ToString(); + _query["limit"] = request.Limit.Value.ToString(); } if (request.CreatedAtGt != null) { @@ -59,17 +57,19 @@ public async Task> ListAsync( { _query["updatedAtLe"] = request.UpdatedAtLe.Value.ToString(Constants.DateTimeFormat); } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "squad", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "squad", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -96,18 +96,20 @@ public async Task CreateAsync( CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Post, - Path = "squad", - Body = request, - ContentType = "application/json", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Post, + Path = "squad", + Body = request, + ContentType = "application/json", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -134,16 +136,18 @@ public async Task GetAsync( CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = $"squad/{id}", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = $"squad/{JsonUtils.SerializeAsString(id)}", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -170,16 +174,18 @@ public async Task DeleteAsync( CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Delete, - Path = $"squad/{id}", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Delete, + Path = $"squad/{JsonUtils.SerializeAsString(id)}", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -207,18 +213,20 @@ public async Task UpdateAsync( CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethodExtensions.Patch, - Path = $"squad/{id}", - Body = request, - ContentType = "application/json", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethodExtensions.Patch, + Path = $"squad/{JsonUtils.SerializeAsString(id)}", + Body = request, + ContentType = "application/json", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Vapi.Net/TestSuiteRuns/Requests/CreateTestSuiteRunDto.cs b/src/Vapi.Net/TestSuiteRuns/Requests/CreateTestSuiteRunDto.cs new file mode 100644 index 0000000..7d99d58 --- /dev/null +++ b/src/Vapi.Net/TestSuiteRuns/Requests/CreateTestSuiteRunDto.cs @@ -0,0 +1,18 @@ +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record CreateTestSuiteRunDto +{ + /// + /// This is the name of the test suite run. + /// + [JsonPropertyName("name")] + public string? Name { get; set; } + + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/TestSuiteRuns/Requests/TestSuiteRunControllerFindAllPaginatedRequest.cs b/src/Vapi.Net/TestSuiteRuns/Requests/TestSuiteRunControllerFindAllPaginatedRequest.cs new file mode 100644 index 0000000..1cbe3f4 --- /dev/null +++ b/src/Vapi.Net/TestSuiteRuns/Requests/TestSuiteRunControllerFindAllPaginatedRequest.cs @@ -0,0 +1,66 @@ +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record TestSuiteRunControllerFindAllPaginatedRequest +{ + /// + /// This is the page number to return. Defaults to 1. + /// + public double? Page { get; set; } + + /// + /// This is the sort order for pagination. Defaults to 'DESC'. + /// + public TestSuiteRunControllerFindAllPaginatedRequestSortOrder? SortOrder { get; set; } + + /// + /// This is the maximum number of items to return. Defaults to 100. + /// + public double? Limit { get; set; } + + /// + /// This will return items where the createdAt is greater than the specified value. + /// + public DateTime? CreatedAtGt { get; set; } + + /// + /// This will return items where the createdAt is less than the specified value. + /// + public DateTime? CreatedAtLt { get; set; } + + /// + /// This will return items where the createdAt is greater than or equal to the specified value. + /// + public DateTime? CreatedAtGe { get; set; } + + /// + /// This will return items where the createdAt is less than or equal to the specified value. + /// + public DateTime? CreatedAtLe { get; set; } + + /// + /// This will return items where the updatedAt is greater than the specified value. + /// + public DateTime? UpdatedAtGt { get; set; } + + /// + /// This will return items where the updatedAt is less than the specified value. + /// + public DateTime? UpdatedAtLt { get; set; } + + /// + /// This will return items where the updatedAt is greater than or equal to the specified value. + /// + public DateTime? UpdatedAtGe { get; set; } + + /// + /// This will return items where the updatedAt is less than or equal to the specified value. + /// + public DateTime? UpdatedAtLe { get; set; } + + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/TestSuiteRuns/Requests/UpdateTestSuiteRunDto.cs b/src/Vapi.Net/TestSuiteRuns/Requests/UpdateTestSuiteRunDto.cs new file mode 100644 index 0000000..86b0197 --- /dev/null +++ b/src/Vapi.Net/TestSuiteRuns/Requests/UpdateTestSuiteRunDto.cs @@ -0,0 +1,18 @@ +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record UpdateTestSuiteRunDto +{ + /// + /// This is the name of the test suite run. + /// + [JsonPropertyName("name")] + public string? Name { get; set; } + + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/TestSuiteRuns/TestSuiteRunsClient.cs b/src/Vapi.Net/TestSuiteRuns/TestSuiteRunsClient.cs new file mode 100644 index 0000000..ca7d5da --- /dev/null +++ b/src/Vapi.Net/TestSuiteRuns/TestSuiteRunsClient.cs @@ -0,0 +1,265 @@ +using System.Net.Http; +using System.Text.Json; +using System.Threading; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public partial class TestSuiteRunsClient +{ + private RawClient _client; + + internal TestSuiteRunsClient(RawClient client) + { + _client = client; + } + + public async Task TestSuiteRunControllerFindAllPaginatedAsync( + string testSuiteId, + TestSuiteRunControllerFindAllPaginatedRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + var _query = new Dictionary(); + if (request.Page != null) + { + _query["page"] = request.Page.Value.ToString(); + } + if (request.SortOrder != null) + { + _query["sortOrder"] = request.SortOrder.Value.Stringify(); + } + if (request.Limit != null) + { + _query["limit"] = request.Limit.Value.ToString(); + } + if (request.CreatedAtGt != null) + { + _query["createdAtGt"] = request.CreatedAtGt.Value.ToString(Constants.DateTimeFormat); + } + if (request.CreatedAtLt != null) + { + _query["createdAtLt"] = request.CreatedAtLt.Value.ToString(Constants.DateTimeFormat); + } + if (request.CreatedAtGe != null) + { + _query["createdAtGe"] = request.CreatedAtGe.Value.ToString(Constants.DateTimeFormat); + } + if (request.CreatedAtLe != null) + { + _query["createdAtLe"] = request.CreatedAtLe.Value.ToString(Constants.DateTimeFormat); + } + if (request.UpdatedAtGt != null) + { + _query["updatedAtGt"] = request.UpdatedAtGt.Value.ToString(Constants.DateTimeFormat); + } + if (request.UpdatedAtLt != null) + { + _query["updatedAtLt"] = request.UpdatedAtLt.Value.ToString(Constants.DateTimeFormat); + } + if (request.UpdatedAtGe != null) + { + _query["updatedAtGe"] = request.UpdatedAtGe.Value.ToString(Constants.DateTimeFormat); + } + if (request.UpdatedAtLe != null) + { + _query["updatedAtLe"] = request.UpdatedAtLe.Value.ToString(Constants.DateTimeFormat); + } + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = $"test-suite/{JsonUtils.SerializeAsString(testSuiteId)}/run", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); + var responseBody = await response.Raw.Content.ReadAsStringAsync(); + if (response.StatusCode is >= 200 and < 400) + { + try + { + return JsonUtils.Deserialize(responseBody)!; + } + catch (JsonException e) + { + throw new VapiClientException("Failed to deserialize response", e); + } + } + + throw new VapiClientApiException( + $"Error with status code {response.StatusCode}", + response.StatusCode, + responseBody + ); + } + + public async Task TestSuiteRunControllerCreateAsync( + string testSuiteId, + CreateTestSuiteRunDto request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Post, + Path = $"test-suite/{JsonUtils.SerializeAsString(testSuiteId)}/run", + Body = request, + ContentType = "application/json", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); + var responseBody = await response.Raw.Content.ReadAsStringAsync(); + if (response.StatusCode is >= 200 and < 400) + { + try + { + return JsonUtils.Deserialize(responseBody)!; + } + catch (JsonException e) + { + throw new VapiClientException("Failed to deserialize response", e); + } + } + + throw new VapiClientApiException( + $"Error with status code {response.StatusCode}", + response.StatusCode, + responseBody + ); + } + + public async Task TestSuiteRunControllerFindOneAsync( + string testSuiteId, + string id, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = + $"test-suite/{JsonUtils.SerializeAsString(testSuiteId)}/run/{JsonUtils.SerializeAsString(id)}", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); + var responseBody = await response.Raw.Content.ReadAsStringAsync(); + if (response.StatusCode is >= 200 and < 400) + { + try + { + return JsonUtils.Deserialize(responseBody)!; + } + catch (JsonException e) + { + throw new VapiClientException("Failed to deserialize response", e); + } + } + + throw new VapiClientApiException( + $"Error with status code {response.StatusCode}", + response.StatusCode, + responseBody + ); + } + + public async Task TestSuiteRunControllerRemoveAsync( + string testSuiteId, + string id, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Delete, + Path = + $"test-suite/{JsonUtils.SerializeAsString(testSuiteId)}/run/{JsonUtils.SerializeAsString(id)}", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); + var responseBody = await response.Raw.Content.ReadAsStringAsync(); + if (response.StatusCode is >= 200 and < 400) + { + try + { + return JsonUtils.Deserialize(responseBody)!; + } + catch (JsonException e) + { + throw new VapiClientException("Failed to deserialize response", e); + } + } + + throw new VapiClientApiException( + $"Error with status code {response.StatusCode}", + response.StatusCode, + responseBody + ); + } + + public async Task TestSuiteRunControllerUpdateAsync( + string testSuiteId, + string id, + UpdateTestSuiteRunDto request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethodExtensions.Patch, + Path = + $"test-suite/{JsonUtils.SerializeAsString(testSuiteId)}/run/{JsonUtils.SerializeAsString(id)}", + Body = request, + ContentType = "application/json", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); + var responseBody = await response.Raw.Content.ReadAsStringAsync(); + if (response.StatusCode is >= 200 and < 400) + { + try + { + return JsonUtils.Deserialize(responseBody)!; + } + catch (JsonException e) + { + throw new VapiClientException("Failed to deserialize response", e); + } + } + + throw new VapiClientApiException( + $"Error with status code {response.StatusCode}", + response.StatusCode, + responseBody + ); + } +} diff --git a/src/Vapi.Net/TestSuiteRuns/Types/TestSuiteRunControllerFindAllPaginatedRequestSortOrder.cs b/src/Vapi.Net/TestSuiteRuns/Types/TestSuiteRunControllerFindAllPaginatedRequestSortOrder.cs new file mode 100644 index 0000000..e805b91 --- /dev/null +++ b/src/Vapi.Net/TestSuiteRuns/Types/TestSuiteRunControllerFindAllPaginatedRequestSortOrder.cs @@ -0,0 +1,15 @@ +using System.Runtime.Serialization; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[JsonConverter(typeof(EnumSerializer))] +public enum TestSuiteRunControllerFindAllPaginatedRequestSortOrder +{ + [EnumMember(Value = "ASC")] + Asc, + + [EnumMember(Value = "DESC")] + Desc, +} diff --git a/src/Vapi.Net/TestSuiteTests/Requests/TestSuiteTestControllerFindAllPaginatedRequest.cs b/src/Vapi.Net/TestSuiteTests/Requests/TestSuiteTestControllerFindAllPaginatedRequest.cs new file mode 100644 index 0000000..1d3ea7f --- /dev/null +++ b/src/Vapi.Net/TestSuiteTests/Requests/TestSuiteTestControllerFindAllPaginatedRequest.cs @@ -0,0 +1,66 @@ +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record TestSuiteTestControllerFindAllPaginatedRequest +{ + /// + /// This is the page number to return. Defaults to 1. + /// + public double? Page { get; set; } + + /// + /// This is the sort order for pagination. Defaults to 'DESC'. + /// + public TestSuiteTestControllerFindAllPaginatedRequestSortOrder? SortOrder { get; set; } + + /// + /// This is the maximum number of items to return. Defaults to 100. + /// + public double? Limit { get; set; } + + /// + /// This will return items where the createdAt is greater than the specified value. + /// + public DateTime? CreatedAtGt { get; set; } + + /// + /// This will return items where the createdAt is less than the specified value. + /// + public DateTime? CreatedAtLt { get; set; } + + /// + /// This will return items where the createdAt is greater than or equal to the specified value. + /// + public DateTime? CreatedAtGe { get; set; } + + /// + /// This will return items where the createdAt is less than or equal to the specified value. + /// + public DateTime? CreatedAtLe { get; set; } + + /// + /// This will return items where the updatedAt is greater than the specified value. + /// + public DateTime? UpdatedAtGt { get; set; } + + /// + /// This will return items where the updatedAt is less than the specified value. + /// + public DateTime? UpdatedAtLt { get; set; } + + /// + /// This will return items where the updatedAt is greater than or equal to the specified value. + /// + public DateTime? UpdatedAtGe { get; set; } + + /// + /// This will return items where the updatedAt is less than or equal to the specified value. + /// + public DateTime? UpdatedAtLe { get; set; } + + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/TestSuiteTests/TestSuiteTestsClient.cs b/src/Vapi.Net/TestSuiteTests/TestSuiteTestsClient.cs new file mode 100644 index 0000000..ee32715 --- /dev/null +++ b/src/Vapi.Net/TestSuiteTests/TestSuiteTestsClient.cs @@ -0,0 +1,265 @@ +using System.Net.Http; +using System.Text.Json; +using System.Threading; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public partial class TestSuiteTestsClient +{ + private RawClient _client; + + internal TestSuiteTestsClient(RawClient client) + { + _client = client; + } + + public async Task TestSuiteTestControllerFindAllPaginatedAsync( + string testSuiteId, + TestSuiteTestControllerFindAllPaginatedRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + var _query = new Dictionary(); + if (request.Page != null) + { + _query["page"] = request.Page.Value.ToString(); + } + if (request.SortOrder != null) + { + _query["sortOrder"] = request.SortOrder.Value.Stringify(); + } + if (request.Limit != null) + { + _query["limit"] = request.Limit.Value.ToString(); + } + if (request.CreatedAtGt != null) + { + _query["createdAtGt"] = request.CreatedAtGt.Value.ToString(Constants.DateTimeFormat); + } + if (request.CreatedAtLt != null) + { + _query["createdAtLt"] = request.CreatedAtLt.Value.ToString(Constants.DateTimeFormat); + } + if (request.CreatedAtGe != null) + { + _query["createdAtGe"] = request.CreatedAtGe.Value.ToString(Constants.DateTimeFormat); + } + if (request.CreatedAtLe != null) + { + _query["createdAtLe"] = request.CreatedAtLe.Value.ToString(Constants.DateTimeFormat); + } + if (request.UpdatedAtGt != null) + { + _query["updatedAtGt"] = request.UpdatedAtGt.Value.ToString(Constants.DateTimeFormat); + } + if (request.UpdatedAtLt != null) + { + _query["updatedAtLt"] = request.UpdatedAtLt.Value.ToString(Constants.DateTimeFormat); + } + if (request.UpdatedAtGe != null) + { + _query["updatedAtGe"] = request.UpdatedAtGe.Value.ToString(Constants.DateTimeFormat); + } + if (request.UpdatedAtLe != null) + { + _query["updatedAtLe"] = request.UpdatedAtLe.Value.ToString(Constants.DateTimeFormat); + } + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = $"test-suite/{JsonUtils.SerializeAsString(testSuiteId)}/test", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); + var responseBody = await response.Raw.Content.ReadAsStringAsync(); + if (response.StatusCode is >= 200 and < 400) + { + try + { + return JsonUtils.Deserialize(responseBody)!; + } + catch (JsonException e) + { + throw new VapiClientException("Failed to deserialize response", e); + } + } + + throw new VapiClientApiException( + $"Error with status code {response.StatusCode}", + response.StatusCode, + responseBody + ); + } + + public async Task TestSuiteTestControllerCreateAsync( + string testSuiteId, + object request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Post, + Path = $"test-suite/{JsonUtils.SerializeAsString(testSuiteId)}/test", + Body = request, + ContentType = "application/json", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); + var responseBody = await response.Raw.Content.ReadAsStringAsync(); + if (response.StatusCode is >= 200 and < 400) + { + try + { + return JsonUtils.Deserialize(responseBody)!; + } + catch (JsonException e) + { + throw new VapiClientException("Failed to deserialize response", e); + } + } + + throw new VapiClientApiException( + $"Error with status code {response.StatusCode}", + response.StatusCode, + responseBody + ); + } + + public async Task TestSuiteTestControllerFindOneAsync( + string testSuiteId, + string id, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = + $"test-suite/{JsonUtils.SerializeAsString(testSuiteId)}/test/{JsonUtils.SerializeAsString(id)}", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); + var responseBody = await response.Raw.Content.ReadAsStringAsync(); + if (response.StatusCode is >= 200 and < 400) + { + try + { + return JsonUtils.Deserialize(responseBody)!; + } + catch (JsonException e) + { + throw new VapiClientException("Failed to deserialize response", e); + } + } + + throw new VapiClientApiException( + $"Error with status code {response.StatusCode}", + response.StatusCode, + responseBody + ); + } + + public async Task TestSuiteTestControllerRemoveAsync( + string testSuiteId, + string id, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Delete, + Path = + $"test-suite/{JsonUtils.SerializeAsString(testSuiteId)}/test/{JsonUtils.SerializeAsString(id)}", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); + var responseBody = await response.Raw.Content.ReadAsStringAsync(); + if (response.StatusCode is >= 200 and < 400) + { + try + { + return JsonUtils.Deserialize(responseBody)!; + } + catch (JsonException e) + { + throw new VapiClientException("Failed to deserialize response", e); + } + } + + throw new VapiClientApiException( + $"Error with status code {response.StatusCode}", + response.StatusCode, + responseBody + ); + } + + public async Task TestSuiteTestControllerUpdateAsync( + string testSuiteId, + string id, + object request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethodExtensions.Patch, + Path = + $"test-suite/{JsonUtils.SerializeAsString(testSuiteId)}/test/{JsonUtils.SerializeAsString(id)}", + Body = request, + ContentType = "application/json", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); + var responseBody = await response.Raw.Content.ReadAsStringAsync(); + if (response.StatusCode is >= 200 and < 400) + { + try + { + return JsonUtils.Deserialize(responseBody)!; + } + catch (JsonException e) + { + throw new VapiClientException("Failed to deserialize response", e); + } + } + + throw new VapiClientApiException( + $"Error with status code {response.StatusCode}", + response.StatusCode, + responseBody + ); + } +} diff --git a/src/Vapi.Net/TestSuiteTests/Types/TestSuiteTestControllerFindAllPaginatedRequestSortOrder.cs b/src/Vapi.Net/TestSuiteTests/Types/TestSuiteTestControllerFindAllPaginatedRequestSortOrder.cs new file mode 100644 index 0000000..46c42d2 --- /dev/null +++ b/src/Vapi.Net/TestSuiteTests/Types/TestSuiteTestControllerFindAllPaginatedRequestSortOrder.cs @@ -0,0 +1,15 @@ +using System.Runtime.Serialization; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[JsonConverter(typeof(EnumSerializer))] +public enum TestSuiteTestControllerFindAllPaginatedRequestSortOrder +{ + [EnumMember(Value = "ASC")] + Asc, + + [EnumMember(Value = "DESC")] + Desc, +} diff --git a/src/Vapi.Net/TestSuites/Requests/CreateTestSuiteDto.cs b/src/Vapi.Net/TestSuites/Requests/CreateTestSuiteDto.cs new file mode 100644 index 0000000..652fa80 --- /dev/null +++ b/src/Vapi.Net/TestSuites/Requests/CreateTestSuiteDto.cs @@ -0,0 +1,24 @@ +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record CreateTestSuiteDto +{ + /// + /// This is the name of the test suite. + /// + [JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// This is the phone number ID associated with this test suite. + /// + [JsonPropertyName("phoneNumberId")] + public string? PhoneNumberId { get; set; } + + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/TestSuites/Requests/TestSuiteControllerFindAllPaginatedRequest.cs b/src/Vapi.Net/TestSuites/Requests/TestSuiteControllerFindAllPaginatedRequest.cs new file mode 100644 index 0000000..e20c4e1 --- /dev/null +++ b/src/Vapi.Net/TestSuites/Requests/TestSuiteControllerFindAllPaginatedRequest.cs @@ -0,0 +1,66 @@ +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record TestSuiteControllerFindAllPaginatedRequest +{ + /// + /// This is the page number to return. Defaults to 1. + /// + public double? Page { get; set; } + + /// + /// This is the sort order for pagination. Defaults to 'DESC'. + /// + public TestSuiteControllerFindAllPaginatedRequestSortOrder? SortOrder { get; set; } + + /// + /// This is the maximum number of items to return. Defaults to 100. + /// + public double? Limit { get; set; } + + /// + /// This will return items where the createdAt is greater than the specified value. + /// + public DateTime? CreatedAtGt { get; set; } + + /// + /// This will return items where the createdAt is less than the specified value. + /// + public DateTime? CreatedAtLt { get; set; } + + /// + /// This will return items where the createdAt is greater than or equal to the specified value. + /// + public DateTime? CreatedAtGe { get; set; } + + /// + /// This will return items where the createdAt is less than or equal to the specified value. + /// + public DateTime? CreatedAtLe { get; set; } + + /// + /// This will return items where the updatedAt is greater than the specified value. + /// + public DateTime? UpdatedAtGt { get; set; } + + /// + /// This will return items where the updatedAt is less than the specified value. + /// + public DateTime? UpdatedAtLt { get; set; } + + /// + /// This will return items where the updatedAt is greater than or equal to the specified value. + /// + public DateTime? UpdatedAtGe { get; set; } + + /// + /// This will return items where the updatedAt is less than or equal to the specified value. + /// + public DateTime? UpdatedAtLe { get; set; } + + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/TestSuites/Requests/UpdateTestSuiteDto.cs b/src/Vapi.Net/TestSuites/Requests/UpdateTestSuiteDto.cs new file mode 100644 index 0000000..ff0c844 --- /dev/null +++ b/src/Vapi.Net/TestSuites/Requests/UpdateTestSuiteDto.cs @@ -0,0 +1,24 @@ +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record UpdateTestSuiteDto +{ + /// + /// This is the name of the test suite. + /// + [JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// This is the phone number ID associated with this test suite. + /// + [JsonPropertyName("phoneNumberId")] + public string? PhoneNumberId { get; set; } + + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/TestSuites/TestSuitesClient.cs b/src/Vapi.Net/TestSuites/TestSuitesClient.cs new file mode 100644 index 0000000..ed56823 --- /dev/null +++ b/src/Vapi.Net/TestSuites/TestSuitesClient.cs @@ -0,0 +1,257 @@ +using System.Net.Http; +using System.Text.Json; +using System.Threading; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public partial class TestSuitesClient +{ + private RawClient _client; + + internal TestSuitesClient(RawClient client) + { + _client = client; + } + + public async Task TestSuiteControllerFindAllPaginatedAsync( + TestSuiteControllerFindAllPaginatedRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + var _query = new Dictionary(); + if (request.Page != null) + { + _query["page"] = request.Page.Value.ToString(); + } + if (request.SortOrder != null) + { + _query["sortOrder"] = request.SortOrder.Value.Stringify(); + } + if (request.Limit != null) + { + _query["limit"] = request.Limit.Value.ToString(); + } + if (request.CreatedAtGt != null) + { + _query["createdAtGt"] = request.CreatedAtGt.Value.ToString(Constants.DateTimeFormat); + } + if (request.CreatedAtLt != null) + { + _query["createdAtLt"] = request.CreatedAtLt.Value.ToString(Constants.DateTimeFormat); + } + if (request.CreatedAtGe != null) + { + _query["createdAtGe"] = request.CreatedAtGe.Value.ToString(Constants.DateTimeFormat); + } + if (request.CreatedAtLe != null) + { + _query["createdAtLe"] = request.CreatedAtLe.Value.ToString(Constants.DateTimeFormat); + } + if (request.UpdatedAtGt != null) + { + _query["updatedAtGt"] = request.UpdatedAtGt.Value.ToString(Constants.DateTimeFormat); + } + if (request.UpdatedAtLt != null) + { + _query["updatedAtLt"] = request.UpdatedAtLt.Value.ToString(Constants.DateTimeFormat); + } + if (request.UpdatedAtGe != null) + { + _query["updatedAtGe"] = request.UpdatedAtGe.Value.ToString(Constants.DateTimeFormat); + } + if (request.UpdatedAtLe != null) + { + _query["updatedAtLe"] = request.UpdatedAtLe.Value.ToString(Constants.DateTimeFormat); + } + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "test-suite", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); + var responseBody = await response.Raw.Content.ReadAsStringAsync(); + if (response.StatusCode is >= 200 and < 400) + { + try + { + return JsonUtils.Deserialize(responseBody)!; + } + catch (JsonException e) + { + throw new VapiClientException("Failed to deserialize response", e); + } + } + + throw new VapiClientApiException( + $"Error with status code {response.StatusCode}", + response.StatusCode, + responseBody + ); + } + + public async Task TestSuiteControllerCreateAsync( + CreateTestSuiteDto request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Post, + Path = "test-suite", + Body = request, + ContentType = "application/json", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); + var responseBody = await response.Raw.Content.ReadAsStringAsync(); + if (response.StatusCode is >= 200 and < 400) + { + try + { + return JsonUtils.Deserialize(responseBody)!; + } + catch (JsonException e) + { + throw new VapiClientException("Failed to deserialize response", e); + } + } + + throw new VapiClientApiException( + $"Error with status code {response.StatusCode}", + response.StatusCode, + responseBody + ); + } + + public async Task TestSuiteControllerFindOneAsync( + string id, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = $"test-suite/{JsonUtils.SerializeAsString(id)}", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); + var responseBody = await response.Raw.Content.ReadAsStringAsync(); + if (response.StatusCode is >= 200 and < 400) + { + try + { + return JsonUtils.Deserialize(responseBody)!; + } + catch (JsonException e) + { + throw new VapiClientException("Failed to deserialize response", e); + } + } + + throw new VapiClientApiException( + $"Error with status code {response.StatusCode}", + response.StatusCode, + responseBody + ); + } + + public async Task TestSuiteControllerRemoveAsync( + string id, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Delete, + Path = $"test-suite/{JsonUtils.SerializeAsString(id)}", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); + var responseBody = await response.Raw.Content.ReadAsStringAsync(); + if (response.StatusCode is >= 200 and < 400) + { + try + { + return JsonUtils.Deserialize(responseBody)!; + } + catch (JsonException e) + { + throw new VapiClientException("Failed to deserialize response", e); + } + } + + throw new VapiClientApiException( + $"Error with status code {response.StatusCode}", + response.StatusCode, + responseBody + ); + } + + public async Task TestSuiteControllerUpdateAsync( + string id, + UpdateTestSuiteDto request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethodExtensions.Patch, + Path = $"test-suite/{JsonUtils.SerializeAsString(id)}", + Body = request, + ContentType = "application/json", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); + var responseBody = await response.Raw.Content.ReadAsStringAsync(); + if (response.StatusCode is >= 200 and < 400) + { + try + { + return JsonUtils.Deserialize(responseBody)!; + } + catch (JsonException e) + { + throw new VapiClientException("Failed to deserialize response", e); + } + } + + throw new VapiClientApiException( + $"Error with status code {response.StatusCode}", + response.StatusCode, + responseBody + ); + } +} diff --git a/src/Vapi.Net/TestSuites/Types/TestSuiteControllerFindAllPaginatedRequestSortOrder.cs b/src/Vapi.Net/TestSuites/Types/TestSuiteControllerFindAllPaginatedRequestSortOrder.cs new file mode 100644 index 0000000..a40cfe3 --- /dev/null +++ b/src/Vapi.Net/TestSuites/Types/TestSuiteControllerFindAllPaginatedRequestSortOrder.cs @@ -0,0 +1,15 @@ +using System.Runtime.Serialization; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[JsonConverter(typeof(EnumSerializer))] +public enum TestSuiteControllerFindAllPaginatedRequestSortOrder +{ + [EnumMember(Value = "ASC")] + Asc, + + [EnumMember(Value = "DESC")] + Desc, +} diff --git a/src/Vapi.Net/Tools/Requests/ToolsListRequest.cs b/src/Vapi.Net/Tools/Requests/ToolsListRequest.cs index cd57da9..9457c90 100644 --- a/src/Vapi.Net/Tools/Requests/ToolsListRequest.cs +++ b/src/Vapi.Net/Tools/Requests/ToolsListRequest.cs @@ -1,7 +1,5 @@ using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record ToolsListRequest diff --git a/src/Vapi.Net/Tools/ToolsClient.cs b/src/Vapi.Net/Tools/ToolsClient.cs index 96cc92c..bd8d812 100644 --- a/src/Vapi.Net/Tools/ToolsClient.cs +++ b/src/Vapi.Net/Tools/ToolsClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public partial class ToolsClient @@ -25,7 +23,7 @@ public async Task> ListAsync( var _query = new Dictionary(); if (request.Limit != null) { - _query["limit"] = request.Limit.ToString(); + _query["limit"] = request.Limit.Value.ToString(); } if (request.CreatedAtGt != null) { @@ -59,17 +57,19 @@ public async Task> ListAsync( { _query["updatedAtLe"] = request.UpdatedAtLe.Value.ToString(Constants.DateTimeFormat); } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "tool", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "tool", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -96,18 +96,20 @@ public async Task CreateAsync( CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Post, - Path = "tool", - Body = request, - ContentType = "application/json", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Post, + Path = "tool", + Body = request, + ContentType = "application/json", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -134,16 +136,18 @@ public async Task GetAsync( CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = $"tool/{id}", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = $"tool/{JsonUtils.SerializeAsString(id)}", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -170,16 +174,18 @@ public async Task DeleteAsync( CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Delete, - Path = $"tool/{id}", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Delete, + Path = $"tool/{JsonUtils.SerializeAsString(id)}", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -207,18 +213,20 @@ public async Task UpdateAsync( CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethodExtensions.Patch, - Path = $"tool/{id}", - Body = request, - ContentType = "application/json", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethodExtensions.Patch, + Path = $"tool/{JsonUtils.SerializeAsString(id)}", + Body = request, + ContentType = "application/json", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Vapi.Net/Types/AddVoiceToProviderDto.cs b/src/Vapi.Net/Types/AddVoiceToProviderDto.cs index d7599ff..e301b4c 100644 --- a/src/Vapi.Net/Types/AddVoiceToProviderDto.cs +++ b/src/Vapi.Net/Types/AddVoiceToProviderDto.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record AddVoiceToProviderDto diff --git a/src/Vapi.Net/Types/SemanticEdgeCondition.cs b/src/Vapi.Net/Types/AiEdgeCondition.cs similarity index 66% rename from src/Vapi.Net/Types/SemanticEdgeCondition.cs rename to src/Vapi.Net/Types/AiEdgeCondition.cs index 386a73b..109e435 100644 --- a/src/Vapi.Net/Types/SemanticEdgeCondition.cs +++ b/src/Vapi.Net/Types/AiEdgeCondition.cs @@ -1,14 +1,12 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; -public record SemanticEdgeCondition +public record AiEdgeCondition { [JsonPropertyName("matches")] - public IEnumerable? Matches { get; set; } + public IEnumerable Matches { get; set; } = new List(); public override string ToString() { diff --git a/src/Vapi.Net/Types/Analysis.cs b/src/Vapi.Net/Types/Analysis.cs index ea43fb0..0b3afb3 100644 --- a/src/Vapi.Net/Types/Analysis.cs +++ b/src/Vapi.Net/Types/Analysis.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record Analysis diff --git a/src/Vapi.Net/Types/AnalysisCost.cs b/src/Vapi.Net/Types/AnalysisCost.cs index aeec182..a1c49be 100644 --- a/src/Vapi.Net/Types/AnalysisCost.cs +++ b/src/Vapi.Net/Types/AnalysisCost.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record AnalysisCost diff --git a/src/Vapi.Net/Types/AnalysisCostAnalysisType.cs b/src/Vapi.Net/Types/AnalysisCostAnalysisType.cs index ba749b6..449281c 100644 --- a/src/Vapi.Net/Types/AnalysisCostAnalysisType.cs +++ b/src/Vapi.Net/Types/AnalysisCostAnalysisType.cs @@ -2,8 +2,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] diff --git a/src/Vapi.Net/Types/AnalysisCostBreakdown.cs b/src/Vapi.Net/Types/AnalysisCostBreakdown.cs index dcd1dea..109aa49 100644 --- a/src/Vapi.Net/Types/AnalysisCostBreakdown.cs +++ b/src/Vapi.Net/Types/AnalysisCostBreakdown.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record AnalysisCostBreakdown diff --git a/src/Vapi.Net/Types/AnalysisPlan.cs b/src/Vapi.Net/Types/AnalysisPlan.cs index 623d328..9c2fe93 100644 --- a/src/Vapi.Net/Types/AnalysisPlan.cs +++ b/src/Vapi.Net/Types/AnalysisPlan.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record AnalysisPlan diff --git a/src/Vapi.Net/Types/AnalyticsOperation.cs b/src/Vapi.Net/Types/AnalyticsOperation.cs index 43493db..56416e0 100644 --- a/src/Vapi.Net/Types/AnalyticsOperation.cs +++ b/src/Vapi.Net/Types/AnalyticsOperation.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record AnalyticsOperation diff --git a/src/Vapi.Net/Types/AnalyticsOperationColumn.cs b/src/Vapi.Net/Types/AnalyticsOperationColumn.cs index a6db02c..d29cf7d 100644 --- a/src/Vapi.Net/Types/AnalyticsOperationColumn.cs +++ b/src/Vapi.Net/Types/AnalyticsOperationColumn.cs @@ -2,8 +2,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] @@ -38,4 +36,7 @@ public enum AnalyticsOperationColumn [EnumMember(Value = "duration")] Duration, + + [EnumMember(Value = "concurrency")] + Concurrency, } diff --git a/src/Vapi.Net/Types/AnalyticsOperationOperation.cs b/src/Vapi.Net/Types/AnalyticsOperationOperation.cs index cd8b3bc..7031998 100644 --- a/src/Vapi.Net/Types/AnalyticsOperationOperation.cs +++ b/src/Vapi.Net/Types/AnalyticsOperationOperation.cs @@ -2,8 +2,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] @@ -23,4 +21,7 @@ public enum AnalyticsOperationOperation [EnumMember(Value = "max")] Max, + + [EnumMember(Value = "history")] + History, } diff --git a/src/Vapi.Net/Types/AnalyticsQuery.cs b/src/Vapi.Net/Types/AnalyticsQuery.cs index ae656cf..97c1f13 100644 --- a/src/Vapi.Net/Types/AnalyticsQuery.cs +++ b/src/Vapi.Net/Types/AnalyticsQuery.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record AnalyticsQuery @@ -11,7 +9,7 @@ public record AnalyticsQuery /// This is the table you want to query. /// [JsonPropertyName("table")] - public required string Table { get; set; } + public required AnalyticsQueryTable Table { get; set; } /// /// This is the list of columns you want to group by. diff --git a/src/Vapi.Net/Types/AnalyticsQueryGroupByItem.cs b/src/Vapi.Net/Types/AnalyticsQueryGroupByItem.cs index 2537f45..840c5c1 100644 --- a/src/Vapi.Net/Types/AnalyticsQueryGroupByItem.cs +++ b/src/Vapi.Net/Types/AnalyticsQueryGroupByItem.cs @@ -2,8 +2,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] diff --git a/src/Vapi.Net/Types/AnalyticsQueryResult.cs b/src/Vapi.Net/Types/AnalyticsQueryResult.cs index ef9fa09..00e9d88 100644 --- a/src/Vapi.Net/Types/AnalyticsQueryResult.cs +++ b/src/Vapi.Net/Types/AnalyticsQueryResult.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record AnalyticsQueryResult diff --git a/src/Vapi.Net/Types/AnalyticsQueryTable.cs b/src/Vapi.Net/Types/AnalyticsQueryTable.cs new file mode 100644 index 0000000..1e1a7bf --- /dev/null +++ b/src/Vapi.Net/Types/AnalyticsQueryTable.cs @@ -0,0 +1,15 @@ +using System.Runtime.Serialization; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[JsonConverter(typeof(EnumSerializer))] +public enum AnalyticsQueryTable +{ + [EnumMember(Value = "call")] + Call, + + [EnumMember(Value = "subscription")] + Subscription, +} diff --git a/src/Vapi.Net/Types/AnthropicCredential.cs b/src/Vapi.Net/Types/AnthropicCredential.cs index 1896e01..988f62e 100644 --- a/src/Vapi.Net/Types/AnthropicCredential.cs +++ b/src/Vapi.Net/Types/AnthropicCredential.cs @@ -1,14 +1,12 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record AnthropicCredential { [JsonPropertyName("provider")] - public required string Provider { get; set; } + public string Provider { get; set; } = "anthropic"; /// /// This is not returned in the API. diff --git a/src/Vapi.Net/Types/AnthropicModel.cs b/src/Vapi.Net/Types/AnthropicModel.cs index 9da8e62..adf8fc0 100644 --- a/src/Vapi.Net/Types/AnthropicModel.cs +++ b/src/Vapi.Net/Types/AnthropicModel.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record AnthropicModel diff --git a/src/Vapi.Net/Types/AnthropicModelModel.cs b/src/Vapi.Net/Types/AnthropicModelModel.cs index 2780d95..1750a8e 100644 --- a/src/Vapi.Net/Types/AnthropicModelModel.cs +++ b/src/Vapi.Net/Types/AnthropicModelModel.cs @@ -2,8 +2,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] diff --git a/src/Vapi.Net/Types/AnyscaleCredential.cs b/src/Vapi.Net/Types/AnyscaleCredential.cs index 367b870..a2b6326 100644 --- a/src/Vapi.Net/Types/AnyscaleCredential.cs +++ b/src/Vapi.Net/Types/AnyscaleCredential.cs @@ -1,14 +1,12 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record AnyscaleCredential { [JsonPropertyName("provider")] - public required string Provider { get; set; } + public string Provider { get; set; } = "anyscale"; /// /// This is not returned in the API. diff --git a/src/Vapi.Net/Types/AnyscaleModel.cs b/src/Vapi.Net/Types/AnyscaleModel.cs index 52ee5d8..b28becf 100644 --- a/src/Vapi.Net/Types/AnyscaleModel.cs +++ b/src/Vapi.Net/Types/AnyscaleModel.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record AnyscaleModel diff --git a/src/Vapi.Net/Types/ApiRequest.cs b/src/Vapi.Net/Types/ApiRequest.cs new file mode 100644 index 0000000..5c96887 --- /dev/null +++ b/src/Vapi.Net/Types/ApiRequest.cs @@ -0,0 +1,67 @@ +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record ApiRequest +{ + [JsonPropertyName("method")] + public required ApiRequestMethod Method { get; set; } + + /// + /// Api endpoint to send requests to. + /// + [JsonPropertyName("url")] + public required string Url { get; set; } + + /// + /// These are the custom headers to include in the Api Request sent. + /// + /// Each key-value pair represents a header name and its value. + /// + [JsonPropertyName("headers")] + public JsonSchema? Headers { get; set; } + + /// + /// This defined the JSON body of your Api Request. For example, if `body_schema` + /// included "my_field": "my_gather_statement.user_age", then the json body sent to the server would have that particular value assign to it. + /// Right now, only data from gather statements are supported. + /// + [JsonPropertyName("body")] + public JsonSchema? Body { get; set; } + + /// + /// This is the mode of the Api Request. + /// We only support BLOCKING and BACKGROUND for now. + /// + [JsonPropertyName("mode")] + public required ApiRequestMode Mode { get; set; } + + /// + /// This is a list of hooks for a task. + /// Each hook is a list of tasks to run on a trigger (such as on start, on failure, etc). + /// Only Say is supported for now. + /// + [JsonPropertyName("hooks")] + public IEnumerable? Hooks { get; set; } + + /// + /// This is the schema for the outputs of the Api Request. + /// + [JsonPropertyName("output")] + public JsonSchema? Output { get; set; } + + [JsonPropertyName("name")] + public required string Name { get; set; } + + /// + /// This is for metadata you want to store on the task. + /// + [JsonPropertyName("metadata")] + public object? Metadata { get; set; } + + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/ApiRequestMethod.cs b/src/Vapi.Net/Types/ApiRequestMethod.cs new file mode 100644 index 0000000..e9e5995 --- /dev/null +++ b/src/Vapi.Net/Types/ApiRequestMethod.cs @@ -0,0 +1,15 @@ +using System.Runtime.Serialization; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[JsonConverter(typeof(EnumSerializer))] +public enum ApiRequestMethod +{ + [EnumMember(Value = "POST")] + Post, + + [EnumMember(Value = "GET")] + Get, +} diff --git a/src/Vapi.Net/Types/ApiRequestMode.cs b/src/Vapi.Net/Types/ApiRequestMode.cs new file mode 100644 index 0000000..95e4417 --- /dev/null +++ b/src/Vapi.Net/Types/ApiRequestMode.cs @@ -0,0 +1,15 @@ +using System.Runtime.Serialization; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[JsonConverter(typeof(EnumSerializer))] +public enum ApiRequestMode +{ + [EnumMember(Value = "blocking")] + Blocking, + + [EnumMember(Value = "background")] + Background, +} diff --git a/src/Vapi.Net/Types/Artifact.cs b/src/Vapi.Net/Types/Artifact.cs index e24b216..9287797 100644 --- a/src/Vapi.Net/Types/Artifact.cs +++ b/src/Vapi.Net/Types/Artifact.cs @@ -2,8 +2,6 @@ using OneOf; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record Artifact @@ -52,6 +50,12 @@ public IEnumerable< [JsonPropertyName("transcript")] public string? Transcript { get; set; } + /// + /// This is the packet capture url for the call. This is only available for `phone` type calls where phone number's provider is `vapi` or `byo-phone-number`. + /// + [JsonPropertyName("pcapUrl")] + public string? PcapUrl { get; set; } + public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/ArtifactPlan.cs b/src/Vapi.Net/Types/ArtifactPlan.cs index 0370ea6..5f3406b 100644 --- a/src/Vapi.Net/Types/ArtifactPlan.cs +++ b/src/Vapi.Net/Types/ArtifactPlan.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record ArtifactPlan @@ -12,7 +10,7 @@ public record ArtifactPlan /// /// Usage: /// - If you don't want to record the calls, set this to false. - /// - If you want to record the calls when `assistant.hipaaEnabled`, explicity set this to true and make sure to provide S3 or GCP credentials on the Provider Credentials page in the Dashboard. + /// - If you want to record the calls when `assistant.hipaaEnabled` (deprecated) or `assistant.compliancePlan.hipaaEnabled` explicity set this to true and make sure to provide S3 or GCP credentials on the Provider Credentials page in the Dashboard. /// /// You can find the recording at `call.artifact.recordingUrl` and `call.artifact.stereoRecordingUrl` after the call is ended. /// @@ -31,6 +29,30 @@ public record ArtifactPlan [JsonPropertyName("videoRecordingEnabled")] public bool? VideoRecordingEnabled { get; set; } + /// + /// This determines whether the SIP packet capture is enabled. Defaults to true. Only relevant for `phone` type calls where phone number's provider is `vapi` or `byo-phone-number`. + /// + /// You can find the packet capture at `call.artifact.pcapUrl` after the call is ended. + /// + /// @default true + /// + [JsonPropertyName("pcapEnabled")] + public bool? PcapEnabled { get; set; } + + /// + /// This is the path where the SIP packet capture will be uploaded. This is only used if you have provided S3 or GCP credentials on the Provider Credentials page in the Dashboard. + /// + /// If credential.s3PathPrefix or credential.bucketPlan.path is set, this will append to it. + /// + /// Usage: + /// - If you want to upload the packet capture to a specific path, set this to the path. Example: `/my-assistant-captures`. + /// - If you want to upload the packet capture to the root of the bucket, set this to `/`. + /// + /// @default '/' + /// + [JsonPropertyName("pcapS3PathPrefix")] + public string? PcapS3PathPrefix { get; set; } + /// /// This is the plan for `call.artifact.transcript`. To disable, set `transcriptPlan.enabled` to false. /// diff --git a/src/Vapi.Net/Types/AssemblyAiCredential.cs b/src/Vapi.Net/Types/AssemblyAiCredential.cs index 9e623eb..aeeba1d 100644 --- a/src/Vapi.Net/Types/AssemblyAiCredential.cs +++ b/src/Vapi.Net/Types/AssemblyAiCredential.cs @@ -1,14 +1,12 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record AssemblyAiCredential { [JsonPropertyName("provider")] - public required string Provider { get; set; } + public string Provider { get; set; } = "assembly-ai"; /// /// This is not returned in the API. diff --git a/src/Vapi.Net/Types/AssemblyAiTranscriber.cs b/src/Vapi.Net/Types/AssemblyAiTranscriber.cs index 0499f42..0b39336 100644 --- a/src/Vapi.Net/Types/AssemblyAiTranscriber.cs +++ b/src/Vapi.Net/Types/AssemblyAiTranscriber.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record AssemblyAiTranscriber diff --git a/src/Vapi.Net/Types/AssignmentMutation.cs b/src/Vapi.Net/Types/AssignmentMutation.cs index 289ca28..58bd1fb 100644 --- a/src/Vapi.Net/Types/AssignmentMutation.cs +++ b/src/Vapi.Net/Types/AssignmentMutation.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record AssignmentMutation @@ -17,7 +15,7 @@ public record AssignmentMutation /// This mutation assigns a new value to an existing or new variable. /// [JsonPropertyName("type")] - public required string Type { get; set; } + public string Type { get; set; } = "assignment"; /// /// This is the variable to assign a new value to. diff --git a/src/Vapi.Net/Types/Assistant.cs b/src/Vapi.Net/Types/Assistant.cs index ad3707b..3418494 100644 --- a/src/Vapi.Net/Types/Assistant.cs +++ b/src/Vapi.Net/Types/Assistant.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record Assistant @@ -46,12 +44,6 @@ public record Assistant [JsonPropertyName("firstMessageMode")] public AssistantFirstMessageMode? FirstMessageMode { get; set; } - /// - /// When this is enabled, no logs, recordings, or transcriptions will be stored. At the end of the call, you will still receive an end-of-call-report message to store on your server. Defaults to false. - /// - [JsonPropertyName("hipaaEnabled")] - public bool? HipaaEnabled { get; set; } - /// /// These are the messages that will be sent to your Client SDKs. Default is conversation-update,function-call,hang,model-output,speech-update,status-update,transfer-update,transcript,tool-calls,user-interrupted,voice-input. You can check the shape of the messages in ClientMessage schema. /// @@ -156,6 +148,9 @@ public record Assistant [JsonPropertyName("endCallPhrases")] public IEnumerable? EndCallPhrases { get; set; } + [JsonPropertyName("compliancePlan")] + public CompliancePlan? CompliancePlan { get; set; } + /// /// This is for metadata you want to store on the assistant. /// @@ -238,6 +233,12 @@ public record Assistant [JsonPropertyName("server")] public Server? Server { get; set; } + /// + /// This is a set of actions that will be performed on certain events. + /// + [JsonPropertyName("hooks")] + public IEnumerable? Hooks { get; set; } + /// /// This is the unique identifier for the assistant. /// diff --git a/src/Vapi.Net/Types/AssistantBackgroundSound.cs b/src/Vapi.Net/Types/AssistantBackgroundSound.cs index 01e42a6..4770c21 100644 --- a/src/Vapi.Net/Types/AssistantBackgroundSound.cs +++ b/src/Vapi.Net/Types/AssistantBackgroundSound.cs @@ -2,8 +2,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] diff --git a/src/Vapi.Net/Types/AssistantClientMessagesItem.cs b/src/Vapi.Net/Types/AssistantClientMessagesItem.cs index 72d525c..2defd0c 100644 --- a/src/Vapi.Net/Types/AssistantClientMessagesItem.cs +++ b/src/Vapi.Net/Types/AssistantClientMessagesItem.cs @@ -2,8 +2,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] diff --git a/src/Vapi.Net/Types/AssistantCustomEndpointingRule.cs b/src/Vapi.Net/Types/AssistantCustomEndpointingRule.cs index d3b7dde..28afe6e 100644 --- a/src/Vapi.Net/Types/AssistantCustomEndpointingRule.cs +++ b/src/Vapi.Net/Types/AssistantCustomEndpointingRule.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record AssistantCustomEndpointingRule diff --git a/src/Vapi.Net/Types/AssistantFirstMessageMode.cs b/src/Vapi.Net/Types/AssistantFirstMessageMode.cs index d0b4dc0..b639fcb 100644 --- a/src/Vapi.Net/Types/AssistantFirstMessageMode.cs +++ b/src/Vapi.Net/Types/AssistantFirstMessageMode.cs @@ -2,8 +2,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] diff --git a/src/Vapi.Net/Types/AssistantHookActionBase.cs b/src/Vapi.Net/Types/AssistantHookActionBase.cs new file mode 100644 index 0000000..d735791 --- /dev/null +++ b/src/Vapi.Net/Types/AssistantHookActionBase.cs @@ -0,0 +1,11 @@ +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record AssistantHookActionBase +{ + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/AssistantHookFilter.cs b/src/Vapi.Net/Types/AssistantHookFilter.cs new file mode 100644 index 0000000..a9b3d75 --- /dev/null +++ b/src/Vapi.Net/Types/AssistantHookFilter.cs @@ -0,0 +1,30 @@ +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record AssistantHookFilter +{ + /// + /// This is the type of filter - currently only "oneOf" is supported + /// + [JsonPropertyName("type")] + public string Type { get; set; } = "oneOf"; + + /// + /// This is the key to filter on (e.g. "call.endedReason") + /// + [JsonPropertyName("key")] + public required string Key { get; set; } + + /// + /// This is the array of possible values to match against + /// + [JsonPropertyName("oneOf")] + public IEnumerable OneOf { get; set; } = new List(); + + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/AssistantHooks.cs b/src/Vapi.Net/Types/AssistantHooks.cs new file mode 100644 index 0000000..dcca939 --- /dev/null +++ b/src/Vapi.Net/Types/AssistantHooks.cs @@ -0,0 +1,31 @@ +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record AssistantHooks +{ + /// + /// This is the event that triggers this hook + /// + [JsonPropertyName("on")] + public string On { get; set; } = "call.ending"; + + /// + /// This is the set of filters that must match for the hook to trigger + /// + [JsonPropertyName("filters")] + public IEnumerable? Filters { get; set; } + + /// + /// This is the set of actions to perform when the hook triggers + /// + [JsonPropertyName("do")] + public IEnumerable Do { get; set; } = + new List(); + + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/AssistantOverrides.cs b/src/Vapi.Net/Types/AssistantOverrides.cs index 426d57d..0fc0234 100644 --- a/src/Vapi.Net/Types/AssistantOverrides.cs +++ b/src/Vapi.Net/Types/AssistantOverrides.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record AssistantOverrides @@ -46,12 +44,6 @@ public record AssistantOverrides [JsonPropertyName("firstMessageMode")] public AssistantOverridesFirstMessageMode? FirstMessageMode { get; set; } - /// - /// When this is enabled, no logs, recordings, or transcriptions will be stored. At the end of the call, you will still receive an end-of-call-report message to store on your server. Defaults to false. - /// - [JsonPropertyName("hipaaEnabled")] - public bool? HipaaEnabled { get; set; } - /// /// These are the messages that will be sent to your Client SDKs. Default is conversation-update,function-call,hang,model-output,speech-update,status-update,transfer-update,transcript,tool-calls,user-interrupted,voice-input. You can check the shape of the messages in ClientMessage schema. /// @@ -168,6 +160,9 @@ public record AssistantOverrides [JsonPropertyName("endCallPhrases")] public IEnumerable? EndCallPhrases { get; set; } + [JsonPropertyName("compliancePlan")] + public CompliancePlan? CompliancePlan { get; set; } + /// /// This is for metadata you want to store on the assistant. /// @@ -250,6 +245,12 @@ public record AssistantOverrides [JsonPropertyName("server")] public Server? Server { get; set; } + /// + /// This is a set of actions that will be performed on certain events. + /// + [JsonPropertyName("hooks")] + public IEnumerable? Hooks { get; set; } + public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/AssistantOverridesBackgroundSound.cs b/src/Vapi.Net/Types/AssistantOverridesBackgroundSound.cs index ac91665..63b54e2 100644 --- a/src/Vapi.Net/Types/AssistantOverridesBackgroundSound.cs +++ b/src/Vapi.Net/Types/AssistantOverridesBackgroundSound.cs @@ -2,8 +2,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] diff --git a/src/Vapi.Net/Types/AssistantOverridesClientMessagesItem.cs b/src/Vapi.Net/Types/AssistantOverridesClientMessagesItem.cs index 527c078..88ac777 100644 --- a/src/Vapi.Net/Types/AssistantOverridesClientMessagesItem.cs +++ b/src/Vapi.Net/Types/AssistantOverridesClientMessagesItem.cs @@ -2,8 +2,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] diff --git a/src/Vapi.Net/Types/AssistantOverridesFirstMessageMode.cs b/src/Vapi.Net/Types/AssistantOverridesFirstMessageMode.cs index fff7789..446540b 100644 --- a/src/Vapi.Net/Types/AssistantOverridesFirstMessageMode.cs +++ b/src/Vapi.Net/Types/AssistantOverridesFirstMessageMode.cs @@ -2,8 +2,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] diff --git a/src/Vapi.Net/Types/AssistantOverridesServerMessagesItem.cs b/src/Vapi.Net/Types/AssistantOverridesServerMessagesItem.cs index c1e0d55..7828460 100644 --- a/src/Vapi.Net/Types/AssistantOverridesServerMessagesItem.cs +++ b/src/Vapi.Net/Types/AssistantOverridesServerMessagesItem.cs @@ -2,8 +2,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] @@ -42,6 +40,9 @@ public enum AssistantOverridesServerMessagesItem [EnumMember(Value = "transcript")] Transcript, + [EnumMember(Value = "transcript[transcriptType='final']")] + TranscriptTranscriptTypeFinal, + [EnumMember(Value = "tool-calls")] ToolCalls, diff --git a/src/Vapi.Net/Types/AssistantServerMessagesItem.cs b/src/Vapi.Net/Types/AssistantServerMessagesItem.cs index addc34c..37e825f 100644 --- a/src/Vapi.Net/Types/AssistantServerMessagesItem.cs +++ b/src/Vapi.Net/Types/AssistantServerMessagesItem.cs @@ -2,8 +2,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] @@ -42,6 +40,9 @@ public enum AssistantServerMessagesItem [EnumMember(Value = "transcript")] Transcript, + [EnumMember(Value = "transcript[transcriptType='final']")] + TranscriptTranscriptTypeFinal, + [EnumMember(Value = "tool-calls")] ToolCalls, diff --git a/src/Vapi.Net/Types/AutoReloadPlan.cs b/src/Vapi.Net/Types/AutoReloadPlan.cs index d33235f..7808778 100644 --- a/src/Vapi.Net/Types/AutoReloadPlan.cs +++ b/src/Vapi.Net/Types/AutoReloadPlan.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record AutoReloadPlan diff --git a/src/Vapi.Net/Types/AzureBlobStorageBucketPlan.cs b/src/Vapi.Net/Types/AzureBlobStorageBucketPlan.cs index acf68ec..8b2071d 100644 --- a/src/Vapi.Net/Types/AzureBlobStorageBucketPlan.cs +++ b/src/Vapi.Net/Types/AzureBlobStorageBucketPlan.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record AzureBlobStorageBucketPlan diff --git a/src/Vapi.Net/Types/AzureCredential.cs b/src/Vapi.Net/Types/AzureCredential.cs index 42702f3..ca3509b 100644 --- a/src/Vapi.Net/Types/AzureCredential.cs +++ b/src/Vapi.Net/Types/AzureCredential.cs @@ -1,14 +1,12 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record AzureCredential { [JsonPropertyName("provider")] - public required string Provider { get; set; } + public string Provider { get; set; } = "azure"; /// /// This is the service being used in Azure. diff --git a/src/Vapi.Net/Types/AzureCredentialRegion.cs b/src/Vapi.Net/Types/AzureCredentialRegion.cs index d248e63..03da321 100644 --- a/src/Vapi.Net/Types/AzureCredentialRegion.cs +++ b/src/Vapi.Net/Types/AzureCredentialRegion.cs @@ -2,8 +2,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] diff --git a/src/Vapi.Net/Types/AzureCredentialService.cs b/src/Vapi.Net/Types/AzureCredentialService.cs index 87b31d8..46e429f 100644 --- a/src/Vapi.Net/Types/AzureCredentialService.cs +++ b/src/Vapi.Net/Types/AzureCredentialService.cs @@ -2,8 +2,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] diff --git a/src/Vapi.Net/Types/AzureOpenAiCredential.cs b/src/Vapi.Net/Types/AzureOpenAiCredential.cs index 461e49d..6483152 100644 --- a/src/Vapi.Net/Types/AzureOpenAiCredential.cs +++ b/src/Vapi.Net/Types/AzureOpenAiCredential.cs @@ -1,14 +1,12 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record AzureOpenAiCredential { [JsonPropertyName("provider")] - public required string Provider { get; set; } + public string Provider { get; set; } = "azure-openai"; [JsonPropertyName("region")] public required AzureOpenAiCredentialRegion Region { get; set; } diff --git a/src/Vapi.Net/Types/AzureOpenAiCredentialModelsItem.cs b/src/Vapi.Net/Types/AzureOpenAiCredentialModelsItem.cs index 7227f3f..4f8e136 100644 --- a/src/Vapi.Net/Types/AzureOpenAiCredentialModelsItem.cs +++ b/src/Vapi.Net/Types/AzureOpenAiCredentialModelsItem.cs @@ -2,13 +2,14 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] public enum AzureOpenAiCredentialModelsItem { + [EnumMember(Value = "gpt-4o-2024-08-06-ptu")] + Gpt4O20240806Ptu, + [EnumMember(Value = "gpt-4o-2024-08-06")] Gpt4O20240806, diff --git a/src/Vapi.Net/Types/AzureOpenAiCredentialRegion.cs b/src/Vapi.Net/Types/AzureOpenAiCredentialRegion.cs index e58b7dc..db3763d 100644 --- a/src/Vapi.Net/Types/AzureOpenAiCredentialRegion.cs +++ b/src/Vapi.Net/Types/AzureOpenAiCredentialRegion.cs @@ -2,8 +2,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] diff --git a/src/Vapi.Net/Types/AzureSpeechTranscriber.cs b/src/Vapi.Net/Types/AzureSpeechTranscriber.cs index 2d4f8f6..d5a3489 100644 --- a/src/Vapi.Net/Types/AzureSpeechTranscriber.cs +++ b/src/Vapi.Net/Types/AzureSpeechTranscriber.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record AzureSpeechTranscriber diff --git a/src/Vapi.Net/Types/AzureSpeechTranscriberLanguage.cs b/src/Vapi.Net/Types/AzureSpeechTranscriberLanguage.cs index 34a668a..984bdec 100644 --- a/src/Vapi.Net/Types/AzureSpeechTranscriberLanguage.cs +++ b/src/Vapi.Net/Types/AzureSpeechTranscriberLanguage.cs @@ -2,8 +2,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] diff --git a/src/Vapi.Net/Types/AzureVoice.cs b/src/Vapi.Net/Types/AzureVoice.cs index e41169a..68fe35d 100644 --- a/src/Vapi.Net/Types/AzureVoice.cs +++ b/src/Vapi.Net/Types/AzureVoice.cs @@ -2,8 +2,6 @@ using OneOf; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record AzureVoice diff --git a/src/Vapi.Net/Types/AzureVoiceIdEnum.cs b/src/Vapi.Net/Types/AzureVoiceIdEnum.cs index a5bbfda..56bc7b3 100644 --- a/src/Vapi.Net/Types/AzureVoiceIdEnum.cs +++ b/src/Vapi.Net/Types/AzureVoiceIdEnum.cs @@ -2,8 +2,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] diff --git a/src/Vapi.Net/Types/BackoffPlan.cs b/src/Vapi.Net/Types/BackoffPlan.cs new file mode 100644 index 0000000..c0f3e7f --- /dev/null +++ b/src/Vapi.Net/Types/BackoffPlan.cs @@ -0,0 +1,34 @@ +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record BackoffPlan +{ + /// + /// This is the maximum number of retries to attempt if the request fails. Defaults to 0 (no retries). + /// + /// @default 0 + /// + [JsonPropertyName("maxRetries")] + public required double MaxRetries { get; set; } + + /// + /// This is the type of backoff plan to use. Defaults to fixed. + /// + /// @default fixed + /// + [JsonPropertyName("type")] + public object Type { get; set; } = new Dictionary(); + + /// + /// This is the base delay in seconds. For linear backoff, this is the delay between each retry. For exponential backoff, this is the initial delay. + /// + [JsonPropertyName("baseDelaySeconds")] + public required double BaseDelaySeconds { get; set; } + + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/BashTool.cs b/src/Vapi.Net/Types/BashTool.cs index a0df113..788e182 100644 --- a/src/Vapi.Net/Types/BashTool.cs +++ b/src/Vapi.Net/Types/BashTool.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record BashTool @@ -31,7 +29,7 @@ public record BashTool /// The sub type of tool. /// [JsonPropertyName("subType")] - public required string SubType { get; set; } + public string SubType { get; set; } = "bash_20241022"; /// /// This is the unique identifier for the tool. @@ -81,7 +79,7 @@ public record BashTool /// The name of the tool, fixed to 'bash' /// [JsonPropertyName("name")] - public required string Name { get; set; } + public string Name { get; set; } = "bash"; public override string ToString() { diff --git a/src/Vapi.Net/Types/BashToolWithToolCall.cs b/src/Vapi.Net/Types/BashToolWithToolCall.cs index 35b30e7..c01013b 100644 --- a/src/Vapi.Net/Types/BashToolWithToolCall.cs +++ b/src/Vapi.Net/Types/BashToolWithToolCall.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record BashToolWithToolCall @@ -31,7 +29,7 @@ public record BashToolWithToolCall /// The sub type of tool. /// [JsonPropertyName("subType")] - public required string SubType { get; set; } + public string SubType { get; set; } = "bash_20241022"; [JsonPropertyName("toolCall")] public required ToolCall ToolCall { get; set; } @@ -40,7 +38,7 @@ public record BashToolWithToolCall /// The name of the tool, fixed to 'bash' /// [JsonPropertyName("name")] - public required string Name { get; set; } + public string Name { get; set; } = "bash"; /// /// This is the function definition of the tool. diff --git a/src/Vapi.Net/Types/BlockCompleteMessage.cs b/src/Vapi.Net/Types/BlockCompleteMessage.cs index 38facd8..18e0c43 100644 --- a/src/Vapi.Net/Types/BlockCompleteMessage.cs +++ b/src/Vapi.Net/Types/BlockCompleteMessage.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record BlockCompleteMessage diff --git a/src/Vapi.Net/Types/BlockStartMessage.cs b/src/Vapi.Net/Types/BlockStartMessage.cs index f76ad94..8770077 100644 --- a/src/Vapi.Net/Types/BlockStartMessage.cs +++ b/src/Vapi.Net/Types/BlockStartMessage.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record BlockStartMessage diff --git a/src/Vapi.Net/Types/BotMessage.cs b/src/Vapi.Net/Types/BotMessage.cs index e19ce1e..3b58ae9 100644 --- a/src/Vapi.Net/Types/BotMessage.cs +++ b/src/Vapi.Net/Types/BotMessage.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record BotMessage diff --git a/src/Vapi.Net/Types/BothCustomEndpointingRule.cs b/src/Vapi.Net/Types/BothCustomEndpointingRule.cs index 6843c7d..436f30b 100644 --- a/src/Vapi.Net/Types/BothCustomEndpointingRule.cs +++ b/src/Vapi.Net/Types/BothCustomEndpointingRule.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record BothCustomEndpointingRule diff --git a/src/Vapi.Net/Types/BucketPlan.cs b/src/Vapi.Net/Types/BucketPlan.cs index dda5821..e275130 100644 --- a/src/Vapi.Net/Types/BucketPlan.cs +++ b/src/Vapi.Net/Types/BucketPlan.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record BucketPlan diff --git a/src/Vapi.Net/Types/BuyPhoneNumberDto.cs b/src/Vapi.Net/Types/BuyPhoneNumberDto.cs deleted file mode 100644 index f1234b3..0000000 --- a/src/Vapi.Net/Types/BuyPhoneNumberDto.cs +++ /dev/null @@ -1,65 +0,0 @@ -using System.Text.Json.Serialization; -using Vapi.Net.Core; - -#nullable enable - -namespace Vapi.Net; - -public record BuyPhoneNumberDto -{ - /// - /// This is the fallback destination an inbound call will be transferred to if: - /// 1. `assistantId` is not set - /// 2. `squadId` is not set - /// 3. and, `assistant-request` message to the `serverUrl` fails - /// - /// If this is not set and above conditions are met, the inbound call is hung up with an error message. - /// - [JsonPropertyName("fallbackDestination")] - public object? FallbackDestination { get; set; } - - /// - /// This is the area code of the phone number to purchase. - /// - [JsonPropertyName("areaCode")] - public required string AreaCode { get; set; } - - /// - /// This is the name of the phone number. This is just for your own reference. - /// - [JsonPropertyName("name")] - public string? Name { get; set; } - - /// - /// This is the assistant that will be used for incoming calls to this phone number. - /// - /// If neither `assistantId` nor `squadId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected. - /// - [JsonPropertyName("assistantId")] - public string? AssistantId { get; set; } - - /// - /// This is the squad that will be used for incoming calls to this phone number. - /// - /// If neither `assistantId` nor `squadId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected. - /// - [JsonPropertyName("squadId")] - public string? SquadId { get; set; } - - /// - /// This is where Vapi will send webhooks. You can find all webhooks available along with their shape in ServerMessage schema. - /// - /// The order of precedence is: - /// - /// 1. assistant.server - /// 2. phoneNumber.server - /// 3. org.server - /// - [JsonPropertyName("server")] - public Server? Server { get; set; } - - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Vapi.Net/Types/ByoPhoneNumber.cs b/src/Vapi.Net/Types/ByoPhoneNumber.cs index 1ae8f8f..095ff9a 100644 --- a/src/Vapi.Net/Types/ByoPhoneNumber.cs +++ b/src/Vapi.Net/Types/ByoPhoneNumber.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record ByoPhoneNumber @@ -56,6 +54,12 @@ public record ByoPhoneNumber [JsonPropertyName("updatedAt")] public required DateTime UpdatedAt { get; set; } + /// + /// This is the status of the phone number. + /// + [JsonPropertyName("status")] + public ByoPhoneNumberStatus? Status { get; set; } + /// /// This is the name of the phone number. This is just for your own reference. /// diff --git a/src/Vapi.Net/Types/ByoPhoneNumberStatus.cs b/src/Vapi.Net/Types/ByoPhoneNumberStatus.cs new file mode 100644 index 0000000..5c9eb76 --- /dev/null +++ b/src/Vapi.Net/Types/ByoPhoneNumberStatus.cs @@ -0,0 +1,18 @@ +using System.Runtime.Serialization; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[JsonConverter(typeof(EnumSerializer))] +public enum ByoPhoneNumberStatus +{ + [EnumMember(Value = "active")] + Active, + + [EnumMember(Value = "activating")] + Activating, + + [EnumMember(Value = "blocked")] + Blocked, +} diff --git a/src/Vapi.Net/Types/ByoSipTrunkCredential.cs b/src/Vapi.Net/Types/ByoSipTrunkCredential.cs index 21303c9..3c306a8 100644 --- a/src/Vapi.Net/Types/ByoSipTrunkCredential.cs +++ b/src/Vapi.Net/Types/ByoSipTrunkCredential.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record ByoSipTrunkCredential diff --git a/src/Vapi.Net/Types/Call.cs b/src/Vapi.Net/Types/Call.cs index 4276c14..e2faa61 100644 --- a/src/Vapi.Net/Types/Call.cs +++ b/src/Vapi.Net/Types/Call.cs @@ -2,8 +2,6 @@ using OneOf; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record Call diff --git a/src/Vapi.Net/Types/CallEndedReason.cs b/src/Vapi.Net/Types/CallEndedReason.cs index 6e63bc8..b1d8c51 100644 --- a/src/Vapi.Net/Types/CallEndedReason.cs +++ b/src/Vapi.Net/Types/CallEndedReason.cs @@ -2,15 +2,13 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] public enum CallEndedReason { - [EnumMember(Value = "assistant-not-invalid")] - AssistantNotInvalid, + [EnumMember(Value = "assistant-not-valid")] + AssistantNotValid, [EnumMember(Value = "assistant-not-provided")] AssistantNotProvided, @@ -42,6 +40,9 @@ public enum CallEndedReason [EnumMember(Value = "assistant-said-end-call-phrase")] AssistantSaidEndCallPhrase, + [EnumMember(Value = "assistant-ended-call-with-hangup-task")] + AssistantEndedCallWithHangupTask, + [EnumMember(Value = "assistant-forwarded-call")] AssistantForwardedCall, @@ -111,12 +112,18 @@ public enum CallEndedReason [EnumMember(Value = "pipeline-error-smallest-ai-voice-failed")] PipelineErrorSmallestAiVoiceFailed, + [EnumMember(Value = "pipeline-error-neuphonic-voice-failed")] + PipelineErrorNeuphonicVoiceFailed, + [EnumMember(Value = "pipeline-error-deepgram-transcriber-failed")] PipelineErrorDeepgramTranscriberFailed, [EnumMember(Value = "pipeline-error-gladia-transcriber-failed")] PipelineErrorGladiaTranscriberFailed, + [EnumMember(Value = "pipeline-error-speechmatics-transcriber-failed")] + PipelineErrorSpeechmaticsTranscriberFailed, + [EnumMember(Value = "pipeline-error-assembly-ai-transcriber-failed")] PipelineErrorAssemblyAiTranscriberFailed, @@ -198,6 +205,9 @@ public enum CallEndedReason [EnumMember(Value = "pipeline-error-xai-llm-failed")] PipelineErrorXaiLlmFailed, + [EnumMember(Value = "pipeline-error-mistral-llm-failed")] + PipelineErrorMistralLlmFailed, + [EnumMember(Value = "pipeline-error-inflection-ai-llm-failed")] PipelineErrorInflectionAiLlmFailed, @@ -252,6 +262,21 @@ public enum CallEndedReason [EnumMember(Value = "pipeline-error-xai-500-server-error")] PipelineErrorXai500ServerError, + [EnumMember(Value = "pipeline-error-mistral-400-bad-request-validation-failed")] + PipelineErrorMistral400BadRequestValidationFailed, + + [EnumMember(Value = "pipeline-error-mistral-401-unauthorized")] + PipelineErrorMistral401Unauthorized, + + [EnumMember(Value = "pipeline-error-mistral-403-model-access-denied")] + PipelineErrorMistral403ModelAccessDenied, + + [EnumMember(Value = "pipeline-error-mistral-429-exceeded-quota")] + PipelineErrorMistral429ExceededQuota, + + [EnumMember(Value = "pipeline-error-mistral-500-server-error")] + PipelineErrorMistral500ServerError, + [EnumMember(Value = "pipeline-error-inflection-ai-400-bad-request-validation-failed")] PipelineErrorInflectionAi400BadRequestValidationFailed, diff --git a/src/Vapi.Net/Types/CallLogPrivileged.cs b/src/Vapi.Net/Types/CallLogPrivileged.cs index 85c1cb8..05a1cfe 100644 --- a/src/Vapi.Net/Types/CallLogPrivileged.cs +++ b/src/Vapi.Net/Types/CallLogPrivileged.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record CallLogPrivileged diff --git a/src/Vapi.Net/Types/CallLogPrivilegedLevel.cs b/src/Vapi.Net/Types/CallLogPrivilegedLevel.cs index 094f1c6..6959387 100644 --- a/src/Vapi.Net/Types/CallLogPrivilegedLevel.cs +++ b/src/Vapi.Net/Types/CallLogPrivilegedLevel.cs @@ -2,8 +2,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] diff --git a/src/Vapi.Net/Types/CallLogsPaginatedResponse.cs b/src/Vapi.Net/Types/CallLogsPaginatedResponse.cs index a5357ed..326714d 100644 --- a/src/Vapi.Net/Types/CallLogsPaginatedResponse.cs +++ b/src/Vapi.Net/Types/CallLogsPaginatedResponse.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record CallLogsPaginatedResponse diff --git a/src/Vapi.Net/Types/CallPaginatedResponse.cs b/src/Vapi.Net/Types/CallPaginatedResponse.cs index 6a349a5..fee03f7 100644 --- a/src/Vapi.Net/Types/CallPaginatedResponse.cs +++ b/src/Vapi.Net/Types/CallPaginatedResponse.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record CallPaginatedResponse diff --git a/src/Vapi.Net/Types/CallPhoneCallProvider.cs b/src/Vapi.Net/Types/CallPhoneCallProvider.cs index b029efb..7d294a7 100644 --- a/src/Vapi.Net/Types/CallPhoneCallProvider.cs +++ b/src/Vapi.Net/Types/CallPhoneCallProvider.cs @@ -2,8 +2,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] diff --git a/src/Vapi.Net/Types/CallPhoneCallTransport.cs b/src/Vapi.Net/Types/CallPhoneCallTransport.cs index b2b1f9f..2f673ec 100644 --- a/src/Vapi.Net/Types/CallPhoneCallTransport.cs +++ b/src/Vapi.Net/Types/CallPhoneCallTransport.cs @@ -2,8 +2,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] diff --git a/src/Vapi.Net/Types/CallStatus.cs b/src/Vapi.Net/Types/CallStatus.cs index 834e964..fcac4a7 100644 --- a/src/Vapi.Net/Types/CallStatus.cs +++ b/src/Vapi.Net/Types/CallStatus.cs @@ -2,8 +2,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] diff --git a/src/Vapi.Net/Types/CallType.cs b/src/Vapi.Net/Types/CallType.cs index e0ab5aa..075f4f1 100644 --- a/src/Vapi.Net/Types/CallType.cs +++ b/src/Vapi.Net/Types/CallType.cs @@ -2,8 +2,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] diff --git a/src/Vapi.Net/Types/CallbackStep.cs b/src/Vapi.Net/Types/CallbackStep.cs index 15c19dc..f348169 100644 --- a/src/Vapi.Net/Types/CallbackStep.cs +++ b/src/Vapi.Net/Types/CallbackStep.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record CallbackStep diff --git a/src/Vapi.Net/Types/CartesiaCredential.cs b/src/Vapi.Net/Types/CartesiaCredential.cs index 813920c..3a5cecf 100644 --- a/src/Vapi.Net/Types/CartesiaCredential.cs +++ b/src/Vapi.Net/Types/CartesiaCredential.cs @@ -1,14 +1,12 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record CartesiaCredential { [JsonPropertyName("provider")] - public required string Provider { get; set; } + public string Provider { get; set; } = "cartesia"; /// /// This is not returned in the API. diff --git a/src/Vapi.Net/Types/CartesiaExperimentalControls.cs b/src/Vapi.Net/Types/CartesiaExperimentalControls.cs new file mode 100644 index 0000000..46af830 --- /dev/null +++ b/src/Vapi.Net/Types/CartesiaExperimentalControls.cs @@ -0,0 +1,18 @@ +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record CartesiaExperimentalControls +{ + [JsonPropertyName("speed")] + public CartesiaExperimentalControlsSpeed? Speed { get; set; } + + [JsonPropertyName("emotion")] + public CartesiaExperimentalControlsEmotion? Emotion { get; set; } + + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/CartesiaExperimentalControlsEmotion.cs b/src/Vapi.Net/Types/CartesiaExperimentalControlsEmotion.cs new file mode 100644 index 0000000..ba6b480 --- /dev/null +++ b/src/Vapi.Net/Types/CartesiaExperimentalControlsEmotion.cs @@ -0,0 +1,69 @@ +using System.Runtime.Serialization; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[JsonConverter(typeof(EnumSerializer))] +public enum CartesiaExperimentalControlsEmotion +{ + [EnumMember(Value = "anger:lowest")] + AngerLowest, + + [EnumMember(Value = "anger:low")] + AngerLow, + + [EnumMember(Value = "anger:high")] + AngerHigh, + + [EnumMember(Value = "anger:highest")] + AngerHighest, + + [EnumMember(Value = "positivity:lowest")] + PositivityLowest, + + [EnumMember(Value = "positivity:low")] + PositivityLow, + + [EnumMember(Value = "positivity:high")] + PositivityHigh, + + [EnumMember(Value = "positivity:highest")] + PositivityHighest, + + [EnumMember(Value = "surprise:lowest")] + SurpriseLowest, + + [EnumMember(Value = "surprise:low")] + SurpriseLow, + + [EnumMember(Value = "surprise:high")] + SurpriseHigh, + + [EnumMember(Value = "surprise:highest")] + SurpriseHighest, + + [EnumMember(Value = "sadness:lowest")] + SadnessLowest, + + [EnumMember(Value = "sadness:low")] + SadnessLow, + + [EnumMember(Value = "sadness:high")] + SadnessHigh, + + [EnumMember(Value = "sadness:highest")] + SadnessHighest, + + [EnumMember(Value = "curiosity:lowest")] + CuriosityLowest, + + [EnumMember(Value = "curiosity:low")] + CuriosityLow, + + [EnumMember(Value = "curiosity:high")] + CuriosityHigh, + + [EnumMember(Value = "curiosity:highest")] + CuriosityHighest, +} diff --git a/src/Vapi.Net/Types/CartesiaExperimentalControlsSpeed.cs b/src/Vapi.Net/Types/CartesiaExperimentalControlsSpeed.cs new file mode 100644 index 0000000..b114d50 --- /dev/null +++ b/src/Vapi.Net/Types/CartesiaExperimentalControlsSpeed.cs @@ -0,0 +1,24 @@ +using System.Runtime.Serialization; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[JsonConverter(typeof(EnumSerializer))] +public enum CartesiaExperimentalControlsSpeed +{ + [EnumMember(Value = "slowest")] + Slowest, + + [EnumMember(Value = "slow")] + Slow, + + [EnumMember(Value = "normal")] + Normal, + + [EnumMember(Value = "fast")] + Fast, + + [EnumMember(Value = "fastest")] + Fastest, +} diff --git a/src/Vapi.Net/Types/CartesiaVoice.cs b/src/Vapi.Net/Types/CartesiaVoice.cs index 6ea4d15..efeb27f 100644 --- a/src/Vapi.Net/Types/CartesiaVoice.cs +++ b/src/Vapi.Net/Types/CartesiaVoice.cs @@ -1,12 +1,16 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record CartesiaVoice { + /// + /// The ID of the particular voice you want to use. + /// + [JsonPropertyName("voiceId")] + public required string VoiceId { get; set; } + /// /// This is the model that will be used. This is optional and will default to the correct model for the voiceId. /// @@ -20,16 +24,16 @@ public record CartesiaVoice public CartesiaVoiceLanguage? Language { get; set; } /// - /// This is the plan for chunking the model output before it is sent to the voice provider. + /// Experimental controls for Cartesia voice generation /// - [JsonPropertyName("chunkPlan")] - public ChunkPlan? ChunkPlan { get; set; } + [JsonPropertyName("experimentalControls")] + public CartesiaExperimentalControls? ExperimentalControls { get; set; } /// - /// This is the provider-specific ID that will be used. + /// This is the plan for chunking the model output before it is sent to the voice provider. /// - [JsonPropertyName("voiceId")] - public required string VoiceId { get; set; } + [JsonPropertyName("chunkPlan")] + public ChunkPlan? ChunkPlan { get; set; } /// /// This is the plan for voice provider fallbacks in the event that the primary voice provider fails. diff --git a/src/Vapi.Net/Types/CartesiaVoiceLanguage.cs b/src/Vapi.Net/Types/CartesiaVoiceLanguage.cs index dd88801..af6b86f 100644 --- a/src/Vapi.Net/Types/CartesiaVoiceLanguage.cs +++ b/src/Vapi.Net/Types/CartesiaVoiceLanguage.cs @@ -2,8 +2,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] diff --git a/src/Vapi.Net/Types/CartesiaVoiceModel.cs b/src/Vapi.Net/Types/CartesiaVoiceModel.cs index 0660edf..413159c 100644 --- a/src/Vapi.Net/Types/CartesiaVoiceModel.cs +++ b/src/Vapi.Net/Types/CartesiaVoiceModel.cs @@ -2,8 +2,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] diff --git a/src/Vapi.Net/Types/CerebrasCredential.cs b/src/Vapi.Net/Types/CerebrasCredential.cs index 7a2a5ae..de1dcae 100644 --- a/src/Vapi.Net/Types/CerebrasCredential.cs +++ b/src/Vapi.Net/Types/CerebrasCredential.cs @@ -1,14 +1,12 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record CerebrasCredential { [JsonPropertyName("provider")] - public required string Provider { get; set; } + public string Provider { get; set; } = "cerebras"; /// /// This is not returned in the API. diff --git a/src/Vapi.Net/Types/ChatCompletionMessage.cs b/src/Vapi.Net/Types/ChatCompletionMessage.cs new file mode 100644 index 0000000..0686869 --- /dev/null +++ b/src/Vapi.Net/Types/ChatCompletionMessage.cs @@ -0,0 +1,21 @@ +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record ChatCompletionMessage +{ + [JsonPropertyName("role")] + public object Role { get; set; } = new Dictionary(); + + [JsonPropertyName("content")] + public string? Content { get; set; } + + [JsonPropertyName("metadata")] + public ChatCompletionMessageMetadata? Metadata { get; set; } + + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/ChatCompletionMessageMetadata.cs b/src/Vapi.Net/Types/ChatCompletionMessageMetadata.cs new file mode 100644 index 0000000..66f234e --- /dev/null +++ b/src/Vapi.Net/Types/ChatCompletionMessageMetadata.cs @@ -0,0 +1,27 @@ +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record ChatCompletionMessageMetadata +{ + [JsonPropertyName("taskName")] + public required string TaskName { get; set; } + + [JsonPropertyName("taskType")] + public required string TaskType { get; set; } + + [JsonPropertyName("taskOutput")] + public required string TaskOutput { get; set; } + + [JsonPropertyName("taskState")] + public object? TaskState { get; set; } + + [JsonPropertyName("nodeTrace")] + public IEnumerable? NodeTrace { get; set; } + + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/ChatCompletionsDto.cs b/src/Vapi.Net/Types/ChatCompletionsDto.cs new file mode 100644 index 0000000..4271034 --- /dev/null +++ b/src/Vapi.Net/Types/ChatCompletionsDto.cs @@ -0,0 +1,22 @@ +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record ChatCompletionsDto +{ + [JsonPropertyName("messages")] + public IEnumerable Messages { get; set; } = + new List(); + + [JsonPropertyName("workflowId")] + public string? WorkflowId { get; set; } + + [JsonPropertyName("workflow")] + public CreateWorkflowDto? Workflow { get; set; } + + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/ChatDto.cs b/src/Vapi.Net/Types/ChatDto.cs index eef00fc..3ea5c2c 100644 --- a/src/Vapi.Net/Types/ChatDto.cs +++ b/src/Vapi.Net/Types/ChatDto.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record ChatDto diff --git a/src/Vapi.Net/Types/ChatServiceResponse.cs b/src/Vapi.Net/Types/ChatServiceResponse.cs index 1424db2..740c59a 100644 --- a/src/Vapi.Net/Types/ChatServiceResponse.cs +++ b/src/Vapi.Net/Types/ChatServiceResponse.cs @@ -1,7 +1,5 @@ using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record ChatServiceResponse diff --git a/src/Vapi.Net/Types/ChunkPlan.cs b/src/Vapi.Net/Types/ChunkPlan.cs index 9ab589f..9bb53d4 100644 --- a/src/Vapi.Net/Types/ChunkPlan.cs +++ b/src/Vapi.Net/Types/ChunkPlan.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record ChunkPlan diff --git a/src/Vapi.Net/Types/ClientInboundMessage.cs b/src/Vapi.Net/Types/ClientInboundMessage.cs index 4bc4e72..5c0edca 100644 --- a/src/Vapi.Net/Types/ClientInboundMessage.cs +++ b/src/Vapi.Net/Types/ClientInboundMessage.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record ClientInboundMessage diff --git a/src/Vapi.Net/Types/ClientInboundMessageAddMessage.cs b/src/Vapi.Net/Types/ClientInboundMessageAddMessage.cs index 4befe4c..42e9bad 100644 --- a/src/Vapi.Net/Types/ClientInboundMessageAddMessage.cs +++ b/src/Vapi.Net/Types/ClientInboundMessageAddMessage.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record ClientInboundMessageAddMessage diff --git a/src/Vapi.Net/Types/ClientInboundMessageControl.cs b/src/Vapi.Net/Types/ClientInboundMessageControl.cs index 6206b5a..def89fe 100644 --- a/src/Vapi.Net/Types/ClientInboundMessageControl.cs +++ b/src/Vapi.Net/Types/ClientInboundMessageControl.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record ClientInboundMessageControl diff --git a/src/Vapi.Net/Types/ClientInboundMessageControlControl.cs b/src/Vapi.Net/Types/ClientInboundMessageControlControl.cs index e490f92..4c8906a 100644 --- a/src/Vapi.Net/Types/ClientInboundMessageControlControl.cs +++ b/src/Vapi.Net/Types/ClientInboundMessageControlControl.cs @@ -2,8 +2,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] diff --git a/src/Vapi.Net/Types/ClientInboundMessageEndCall.cs b/src/Vapi.Net/Types/ClientInboundMessageEndCall.cs index f49a7d4..d22f00e 100644 --- a/src/Vapi.Net/Types/ClientInboundMessageEndCall.cs +++ b/src/Vapi.Net/Types/ClientInboundMessageEndCall.cs @@ -1,7 +1,5 @@ using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record ClientInboundMessageEndCall diff --git a/src/Vapi.Net/Types/ClientInboundMessageSay.cs b/src/Vapi.Net/Types/ClientInboundMessageSay.cs index b7fa7ad..1f85a2d 100644 --- a/src/Vapi.Net/Types/ClientInboundMessageSay.cs +++ b/src/Vapi.Net/Types/ClientInboundMessageSay.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record ClientInboundMessageSay diff --git a/src/Vapi.Net/Types/ClientInboundMessageTransfer.cs b/src/Vapi.Net/Types/ClientInboundMessageTransfer.cs index f2dc24b..d3b6810 100644 --- a/src/Vapi.Net/Types/ClientInboundMessageTransfer.cs +++ b/src/Vapi.Net/Types/ClientInboundMessageTransfer.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record ClientInboundMessageTransfer @@ -13,6 +11,12 @@ public record ClientInboundMessageTransfer [JsonPropertyName("destination")] public object? Destination { get; set; } + /// + /// This is the content to say. + /// + [JsonPropertyName("content")] + public string? Content { get; set; } + public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/ClientMessage.cs b/src/Vapi.Net/Types/ClientMessage.cs index 46f9ff4..003d720 100644 --- a/src/Vapi.Net/Types/ClientMessage.cs +++ b/src/Vapi.Net/Types/ClientMessage.cs @@ -1,8 +1,7 @@ using System.Text.Json.Serialization; +using OneOf; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record ClientMessage @@ -11,7 +10,21 @@ public record ClientMessage /// These are all the messages that can be sent to the client-side SDKs during the call. Configure the messages you'd like to receive in `assistant.clientMessages`. /// [JsonPropertyName("message")] - public required object Message { get; set; } + public required OneOf< + ClientMessageWorkflowNodeStarted, + ClientMessageConversationUpdate, + ClientMessageHang, + ClientMessageMetadata, + ClientMessageModelOutput, + ClientMessageSpeechUpdate, + ClientMessageTranscript, + ClientMessageToolCalls, + ClientMessageToolCallsResult, + ClientMessageTransferUpdate, + ClientMessageUserInterrupted, + ClientMessageLanguageChangeDetected, + ClientMessageVoiceInput + > Message { get; set; } public override string ToString() { diff --git a/src/Vapi.Net/Types/ClientMessageConversationUpdate.cs b/src/Vapi.Net/Types/ClientMessageConversationUpdate.cs index 00e6e2b..14dd670 100644 --- a/src/Vapi.Net/Types/ClientMessageConversationUpdate.cs +++ b/src/Vapi.Net/Types/ClientMessageConversationUpdate.cs @@ -2,12 +2,16 @@ using OneOf; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record ClientMessageConversationUpdate { + /// + /// This is the type of the message. "conversation-update" is sent when an update is committed to the conversation history. + /// + [JsonPropertyName("type")] + public string Type { get; set; } = "conversation-update"; + /// /// This is the most up-to-date conversation history at the time the message is sent. /// diff --git a/src/Vapi.Net/Types/ClientMessageHang.cs b/src/Vapi.Net/Types/ClientMessageHang.cs index f3cf3f9..7381e6e 100644 --- a/src/Vapi.Net/Types/ClientMessageHang.cs +++ b/src/Vapi.Net/Types/ClientMessageHang.cs @@ -1,11 +1,20 @@ +using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record ClientMessageHang { + /// + /// This is the type of the message. "hang" is sent when the assistant is hanging due to a delay. The delay can be caused by many factors, such as: + /// - the model is too slow to respond + /// - the voice is too slow to respond + /// - the tool call is still waiting for a response from your server + /// - etc. + /// + [JsonPropertyName("type")] + public string Type { get; set; } = "hang"; + public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/ClientMessageLanguageChangeDetected.cs b/src/Vapi.Net/Types/ClientMessageLanguageChangeDetected.cs index 7d7e00b..f4b4d85 100644 --- a/src/Vapi.Net/Types/ClientMessageLanguageChangeDetected.cs +++ b/src/Vapi.Net/Types/ClientMessageLanguageChangeDetected.cs @@ -1,12 +1,16 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record ClientMessageLanguageChangeDetected { + /// + /// This is the type of the message. "language-change-detected" is sent when the transcriber is automatically switched based on the detected language. + /// + [JsonPropertyName("type")] + public string Type { get; set; } = "language-change-detected"; + /// /// This is the language the transcriber is switched to. /// diff --git a/src/Vapi.Net/Types/ClientMessageMetadata.cs b/src/Vapi.Net/Types/ClientMessageMetadata.cs index 2807da9..c784091 100644 --- a/src/Vapi.Net/Types/ClientMessageMetadata.cs +++ b/src/Vapi.Net/Types/ClientMessageMetadata.cs @@ -1,12 +1,16 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record ClientMessageMetadata { + /// + /// This is the type of the message. "metadata" is sent to forward metadata to the client. + /// + [JsonPropertyName("type")] + public string Type { get; set; } = "metadata"; + /// /// This is the metadata content /// diff --git a/src/Vapi.Net/Types/ClientMessageModelOutput.cs b/src/Vapi.Net/Types/ClientMessageModelOutput.cs index cd50968..bcbf24e 100644 --- a/src/Vapi.Net/Types/ClientMessageModelOutput.cs +++ b/src/Vapi.Net/Types/ClientMessageModelOutput.cs @@ -1,12 +1,16 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record ClientMessageModelOutput { + /// + /// This is the type of the message. "model-output" is sent as the model outputs tokens. + /// + [JsonPropertyName("type")] + public string Type { get; set; } = "model-output"; + /// /// This is the output of the model. It can be a token or tool call. /// diff --git a/src/Vapi.Net/Types/ClientMessageSpeechUpdate.cs b/src/Vapi.Net/Types/ClientMessageSpeechUpdate.cs index d3ab4bd..72ad5ee 100644 --- a/src/Vapi.Net/Types/ClientMessageSpeechUpdate.cs +++ b/src/Vapi.Net/Types/ClientMessageSpeechUpdate.cs @@ -1,12 +1,16 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record ClientMessageSpeechUpdate { + /// + /// This is the type of the message. "speech-update" is sent whenever assistant or user start or stop speaking. + /// + [JsonPropertyName("type")] + public string Type { get; set; } = "speech-update"; + /// /// This is the status of the speech update. /// diff --git a/src/Vapi.Net/Types/ClientMessageSpeechUpdateRole.cs b/src/Vapi.Net/Types/ClientMessageSpeechUpdateRole.cs index 481321f..c53c03b 100644 --- a/src/Vapi.Net/Types/ClientMessageSpeechUpdateRole.cs +++ b/src/Vapi.Net/Types/ClientMessageSpeechUpdateRole.cs @@ -2,8 +2,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] diff --git a/src/Vapi.Net/Types/ClientMessageSpeechUpdateStatus.cs b/src/Vapi.Net/Types/ClientMessageSpeechUpdateStatus.cs index ec7a94d..bc9df41 100644 --- a/src/Vapi.Net/Types/ClientMessageSpeechUpdateStatus.cs +++ b/src/Vapi.Net/Types/ClientMessageSpeechUpdateStatus.cs @@ -2,8 +2,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] diff --git a/src/Vapi.Net/Types/ClientMessageToolCalls.cs b/src/Vapi.Net/Types/ClientMessageToolCalls.cs index 7d00c8f..016ff10 100644 --- a/src/Vapi.Net/Types/ClientMessageToolCalls.cs +++ b/src/Vapi.Net/Types/ClientMessageToolCalls.cs @@ -1,12 +1,16 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record ClientMessageToolCalls { + /// + /// This is the type of the message. "tool-calls" is sent to call a tool. + /// + [JsonPropertyName("type")] + public string? Type { get; set; } + /// /// This is the list of tools calls that the model is requesting along with the original tool configuration. /// diff --git a/src/Vapi.Net/Types/ClientMessageToolCallsResult.cs b/src/Vapi.Net/Types/ClientMessageToolCallsResult.cs index f747d38..b43a44e 100644 --- a/src/Vapi.Net/Types/ClientMessageToolCallsResult.cs +++ b/src/Vapi.Net/Types/ClientMessageToolCallsResult.cs @@ -1,12 +1,16 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record ClientMessageToolCallsResult { + /// + /// This is the type of the message. "tool-calls-result" is sent to forward the result of a tool call to the client. + /// + [JsonPropertyName("type")] + public string Type { get; set; } = "tool-calls-result"; + /// /// This is the result of the tool call. /// diff --git a/src/Vapi.Net/Types/ClientMessageTranscript.cs b/src/Vapi.Net/Types/ClientMessageTranscript.cs index 44f5f5e..e915ca6 100644 --- a/src/Vapi.Net/Types/ClientMessageTranscript.cs +++ b/src/Vapi.Net/Types/ClientMessageTranscript.cs @@ -1,12 +1,16 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record ClientMessageTranscript { + /// + /// This is the type of the message. "transcript" is sent as transcriber outputs partial or final transcript. + /// + [JsonPropertyName("type")] + public required ClientMessageTranscriptType Type { get; set; } + /// /// This is the role for which the transcript is for. /// diff --git a/src/Vapi.Net/Types/ClientMessageTranscriptRole.cs b/src/Vapi.Net/Types/ClientMessageTranscriptRole.cs index e5495e1..1db0b38 100644 --- a/src/Vapi.Net/Types/ClientMessageTranscriptRole.cs +++ b/src/Vapi.Net/Types/ClientMessageTranscriptRole.cs @@ -2,8 +2,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] diff --git a/src/Vapi.Net/Types/ClientMessageTranscriptTranscriptType.cs b/src/Vapi.Net/Types/ClientMessageTranscriptTranscriptType.cs index 05629e9..d1c49b3 100644 --- a/src/Vapi.Net/Types/ClientMessageTranscriptTranscriptType.cs +++ b/src/Vapi.Net/Types/ClientMessageTranscriptTranscriptType.cs @@ -2,8 +2,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] diff --git a/src/Vapi.Net/Types/ClientMessageTranscriptType.cs b/src/Vapi.Net/Types/ClientMessageTranscriptType.cs new file mode 100644 index 0000000..00da4bc --- /dev/null +++ b/src/Vapi.Net/Types/ClientMessageTranscriptType.cs @@ -0,0 +1,15 @@ +using System.Runtime.Serialization; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[JsonConverter(typeof(EnumSerializer))] +public enum ClientMessageTranscriptType +{ + [EnumMember(Value = "transcript")] + Transcript, + + [EnumMember(Value = "transcript[transcriptType='final']")] + TranscriptTranscriptTypeFinal, +} diff --git a/src/Vapi.Net/Types/ClientMessageTransferUpdate.cs b/src/Vapi.Net/Types/ClientMessageTransferUpdate.cs index a3ccf09..79faa3d 100644 --- a/src/Vapi.Net/Types/ClientMessageTransferUpdate.cs +++ b/src/Vapi.Net/Types/ClientMessageTransferUpdate.cs @@ -1,12 +1,16 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record ClientMessageTransferUpdate { + /// + /// This is the type of the message. "transfer-update" is sent whenever a transfer happens. + /// + [JsonPropertyName("type")] + public string Type { get; set; } = "transfer-update"; + /// /// This is the destination of the transfer. /// diff --git a/src/Vapi.Net/Types/ClientMessageUserInterrupted.cs b/src/Vapi.Net/Types/ClientMessageUserInterrupted.cs index 61c49ec..64dbf5d 100644 --- a/src/Vapi.Net/Types/ClientMessageUserInterrupted.cs +++ b/src/Vapi.Net/Types/ClientMessageUserInterrupted.cs @@ -1,11 +1,16 @@ +using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record ClientMessageUserInterrupted { + /// + /// This is the type of the message. "user-interrupted" is sent when the user interrupts the assistant. + /// + [JsonPropertyName("type")] + public string Type { get; set; } = "user-interrupted"; + public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/ClientMessageVoiceInput.cs b/src/Vapi.Net/Types/ClientMessageVoiceInput.cs index 82fa0c6..d63e8b1 100644 --- a/src/Vapi.Net/Types/ClientMessageVoiceInput.cs +++ b/src/Vapi.Net/Types/ClientMessageVoiceInput.cs @@ -1,12 +1,16 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record ClientMessageVoiceInput { + /// + /// This is the type of the message. "voice-input" is sent when a generation is requested from voice provider. + /// + [JsonPropertyName("type")] + public string Type { get; set; } = "voice-input"; + /// /// This is the voice input content /// diff --git a/src/Vapi.Net/Types/ClientMessageWorkflowNodeStarted.cs b/src/Vapi.Net/Types/ClientMessageWorkflowNodeStarted.cs new file mode 100644 index 0000000..319452f --- /dev/null +++ b/src/Vapi.Net/Types/ClientMessageWorkflowNodeStarted.cs @@ -0,0 +1,24 @@ +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record ClientMessageWorkflowNodeStarted +{ + /// + /// This is the type of the message. "workflow.node.started" is sent when the active node changes. + /// + [JsonPropertyName("type")] + public string Type { get; set; } = "workflow.node.started"; + + /// + /// This is the active node. + /// + [JsonPropertyName("node")] + public object Node { get; set; } = new Dictionary(); + + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/CloneVoiceDto.cs b/src/Vapi.Net/Types/CloneVoiceDto.cs index 69a560f..cd40066 100644 --- a/src/Vapi.Net/Types/CloneVoiceDto.cs +++ b/src/Vapi.Net/Types/CloneVoiceDto.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record CloneVoiceDto diff --git a/src/Vapi.Net/Types/CloudflareCredential.cs b/src/Vapi.Net/Types/CloudflareCredential.cs index 77c3405..6374a69 100644 --- a/src/Vapi.Net/Types/CloudflareCredential.cs +++ b/src/Vapi.Net/Types/CloudflareCredential.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record CloudflareCredential @@ -11,7 +9,7 @@ public record CloudflareCredential /// Credential provider. Only allowed value is cloudflare /// [JsonPropertyName("provider")] - public required string Provider { get; set; } + public string Provider { get; set; } = "cloudflare"; /// /// Cloudflare Account Id. diff --git a/src/Vapi.Net/Types/CloudflareR2BucketPlan.cs b/src/Vapi.Net/Types/CloudflareR2BucketPlan.cs index c27b5b5..a1ea76d 100644 --- a/src/Vapi.Net/Types/CloudflareR2BucketPlan.cs +++ b/src/Vapi.Net/Types/CloudflareR2BucketPlan.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record CloudflareR2BucketPlan diff --git a/src/Vapi.Net/Types/CompliancePlan.cs b/src/Vapi.Net/Types/CompliancePlan.cs new file mode 100644 index 0000000..64e379c --- /dev/null +++ b/src/Vapi.Net/Types/CompliancePlan.cs @@ -0,0 +1,24 @@ +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record CompliancePlan +{ + /// + /// When this is enabled, no logs, recordings, or transcriptions will be stored. At the end of the call, you will still receive an end-of-call-report message to store on your server. Defaults to false. + /// + [JsonPropertyName("hipaaEnabled")] + public bool? HipaaEnabled { get; set; } + + /// + /// When this is enabled, the user will be restricted to use PCI-compliant providers, and no logs or transcripts are stored. At the end of the call, you will receive an end-of-call-report message to store on your server. Defaults to false. + /// + [JsonPropertyName("pciEnabled")] + public bool? PciEnabled { get; set; } + + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/ComputerTool.cs b/src/Vapi.Net/Types/ComputerTool.cs index 595cab1..864b8c7 100644 --- a/src/Vapi.Net/Types/ComputerTool.cs +++ b/src/Vapi.Net/Types/ComputerTool.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record ComputerTool @@ -31,7 +29,7 @@ public record ComputerTool /// The sub type of tool. /// [JsonPropertyName("subType")] - public required string SubType { get; set; } + public string SubType { get; set; } = "computer_20241022"; /// /// This is the unique identifier for the tool. @@ -81,7 +79,7 @@ public record ComputerTool /// The name of the tool, fixed to 'computer' /// [JsonPropertyName("name")] - public required string Name { get; set; } + public string Name { get; set; } = "computer"; /// /// The display width in pixels diff --git a/src/Vapi.Net/Types/ComputerToolWithToolCall.cs b/src/Vapi.Net/Types/ComputerToolWithToolCall.cs index 401d979..7e1d186 100644 --- a/src/Vapi.Net/Types/ComputerToolWithToolCall.cs +++ b/src/Vapi.Net/Types/ComputerToolWithToolCall.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record ComputerToolWithToolCall @@ -31,7 +29,7 @@ public record ComputerToolWithToolCall /// The sub type of tool. /// [JsonPropertyName("subType")] - public required string SubType { get; set; } + public string SubType { get; set; } = "computer_20241022"; [JsonPropertyName("toolCall")] public required ToolCall ToolCall { get; set; } @@ -40,7 +38,7 @@ public record ComputerToolWithToolCall /// The name of the tool, fixed to 'computer' /// [JsonPropertyName("name")] - public required string Name { get; set; } + public string Name { get; set; } = "computer"; /// /// The display width in pixels diff --git a/src/Vapi.Net/Types/Condition.cs b/src/Vapi.Net/Types/Condition.cs index f79df8f..6b9c990 100644 --- a/src/Vapi.Net/Types/Condition.cs +++ b/src/Vapi.Net/Types/Condition.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record Condition diff --git a/src/Vapi.Net/Types/ConditionOperator.cs b/src/Vapi.Net/Types/ConditionOperator.cs index e9ff0b4..cdebfc4 100644 --- a/src/Vapi.Net/Types/ConditionOperator.cs +++ b/src/Vapi.Net/Types/ConditionOperator.cs @@ -2,8 +2,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] diff --git a/src/Vapi.Net/Types/ConversationBlock.cs b/src/Vapi.Net/Types/ConversationBlock.cs index e5b735f..779e2a0 100644 --- a/src/Vapi.Net/Types/ConversationBlock.cs +++ b/src/Vapi.Net/Types/ConversationBlock.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record ConversationBlock diff --git a/src/Vapi.Net/Types/CostBreakdown.cs b/src/Vapi.Net/Types/CostBreakdown.cs index 90e08f4..400d99c 100644 --- a/src/Vapi.Net/Types/CostBreakdown.cs +++ b/src/Vapi.Net/Types/CostBreakdown.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record CostBreakdown diff --git a/src/Vapi.Net/Types/CreateAnthropicCredentialDto.cs b/src/Vapi.Net/Types/CreateAnthropicCredentialDto.cs index 09a110f..a4ce31a 100644 --- a/src/Vapi.Net/Types/CreateAnthropicCredentialDto.cs +++ b/src/Vapi.Net/Types/CreateAnthropicCredentialDto.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record CreateAnthropicCredentialDto diff --git a/src/Vapi.Net/Types/CreateAnyscaleCredentialDto.cs b/src/Vapi.Net/Types/CreateAnyscaleCredentialDto.cs index 1b98e5c..4531088 100644 --- a/src/Vapi.Net/Types/CreateAnyscaleCredentialDto.cs +++ b/src/Vapi.Net/Types/CreateAnyscaleCredentialDto.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record CreateAnyscaleCredentialDto diff --git a/src/Vapi.Net/Types/CreateAssemblyAiCredentialDto.cs b/src/Vapi.Net/Types/CreateAssemblyAiCredentialDto.cs index f87eabb..cf31936 100644 --- a/src/Vapi.Net/Types/CreateAssemblyAiCredentialDto.cs +++ b/src/Vapi.Net/Types/CreateAssemblyAiCredentialDto.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record CreateAssemblyAiCredentialDto diff --git a/src/Vapi.Net/Types/CreateAssistantDto.cs b/src/Vapi.Net/Types/CreateAssistantDto.cs index edfda9a..7a07399 100644 --- a/src/Vapi.Net/Types/CreateAssistantDto.cs +++ b/src/Vapi.Net/Types/CreateAssistantDto.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record CreateAssistantDto @@ -46,12 +44,6 @@ public record CreateAssistantDto [JsonPropertyName("firstMessageMode")] public CreateAssistantDtoFirstMessageMode? FirstMessageMode { get; set; } - /// - /// When this is enabled, no logs, recordings, or transcriptions will be stored. At the end of the call, you will still receive an end-of-call-report message to store on your server. Defaults to false. - /// - [JsonPropertyName("hipaaEnabled")] - public bool? HipaaEnabled { get; set; } - /// /// These are the messages that will be sent to your Client SDKs. Default is conversation-update,function-call,hang,model-output,speech-update,status-update,transfer-update,transcript,tool-calls,user-interrupted,voice-input. You can check the shape of the messages in ClientMessage schema. /// @@ -156,6 +148,9 @@ public record CreateAssistantDto [JsonPropertyName("endCallPhrases")] public IEnumerable? EndCallPhrases { get; set; } + [JsonPropertyName("compliancePlan")] + public CompliancePlan? CompliancePlan { get; set; } + /// /// This is for metadata you want to store on the assistant. /// @@ -238,6 +233,12 @@ public record CreateAssistantDto [JsonPropertyName("server")] public Server? Server { get; set; } + /// + /// This is a set of actions that will be performed on certain events. + /// + [JsonPropertyName("hooks")] + public IEnumerable? Hooks { get; set; } + public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/CreateAssistantDtoBackgroundSound.cs b/src/Vapi.Net/Types/CreateAssistantDtoBackgroundSound.cs index 43d2f1b..41b7c2c 100644 --- a/src/Vapi.Net/Types/CreateAssistantDtoBackgroundSound.cs +++ b/src/Vapi.Net/Types/CreateAssistantDtoBackgroundSound.cs @@ -2,8 +2,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] diff --git a/src/Vapi.Net/Types/CreateAssistantDtoClientMessagesItem.cs b/src/Vapi.Net/Types/CreateAssistantDtoClientMessagesItem.cs index dc64bfa..2675dcc 100644 --- a/src/Vapi.Net/Types/CreateAssistantDtoClientMessagesItem.cs +++ b/src/Vapi.Net/Types/CreateAssistantDtoClientMessagesItem.cs @@ -2,8 +2,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] diff --git a/src/Vapi.Net/Types/CreateAssistantDtoFirstMessageMode.cs b/src/Vapi.Net/Types/CreateAssistantDtoFirstMessageMode.cs index 90c7ea2..7b2b2c3 100644 --- a/src/Vapi.Net/Types/CreateAssistantDtoFirstMessageMode.cs +++ b/src/Vapi.Net/Types/CreateAssistantDtoFirstMessageMode.cs @@ -2,8 +2,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] diff --git a/src/Vapi.Net/Types/CreateAssistantDtoServerMessagesItem.cs b/src/Vapi.Net/Types/CreateAssistantDtoServerMessagesItem.cs index 9723cdb..7973efe 100644 --- a/src/Vapi.Net/Types/CreateAssistantDtoServerMessagesItem.cs +++ b/src/Vapi.Net/Types/CreateAssistantDtoServerMessagesItem.cs @@ -2,8 +2,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] @@ -42,6 +40,9 @@ public enum CreateAssistantDtoServerMessagesItem [EnumMember(Value = "transcript")] Transcript, + [EnumMember(Value = "transcript[transcriptType='final']")] + TranscriptTranscriptTypeFinal, + [EnumMember(Value = "tool-calls")] ToolCalls, diff --git a/src/Vapi.Net/Types/CreateAzureCredentialDto.cs b/src/Vapi.Net/Types/CreateAzureCredentialDto.cs index a7a688f..db35325 100644 --- a/src/Vapi.Net/Types/CreateAzureCredentialDto.cs +++ b/src/Vapi.Net/Types/CreateAzureCredentialDto.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record CreateAzureCredentialDto diff --git a/src/Vapi.Net/Types/CreateAzureCredentialDtoRegion.cs b/src/Vapi.Net/Types/CreateAzureCredentialDtoRegion.cs index 4da616b..87ab3cb 100644 --- a/src/Vapi.Net/Types/CreateAzureCredentialDtoRegion.cs +++ b/src/Vapi.Net/Types/CreateAzureCredentialDtoRegion.cs @@ -2,8 +2,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] diff --git a/src/Vapi.Net/Types/CreateAzureCredentialDtoService.cs b/src/Vapi.Net/Types/CreateAzureCredentialDtoService.cs index d82c9fc..2cd9b65 100644 --- a/src/Vapi.Net/Types/CreateAzureCredentialDtoService.cs +++ b/src/Vapi.Net/Types/CreateAzureCredentialDtoService.cs @@ -2,8 +2,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] diff --git a/src/Vapi.Net/Types/CreateAzureOpenAiCredentialDto.cs b/src/Vapi.Net/Types/CreateAzureOpenAiCredentialDto.cs index bc61aec..f337b99 100644 --- a/src/Vapi.Net/Types/CreateAzureOpenAiCredentialDto.cs +++ b/src/Vapi.Net/Types/CreateAzureOpenAiCredentialDto.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record CreateAzureOpenAiCredentialDto diff --git a/src/Vapi.Net/Types/CreateAzureOpenAiCredentialDtoModelsItem.cs b/src/Vapi.Net/Types/CreateAzureOpenAiCredentialDtoModelsItem.cs index 434b670..f75df62 100644 --- a/src/Vapi.Net/Types/CreateAzureOpenAiCredentialDtoModelsItem.cs +++ b/src/Vapi.Net/Types/CreateAzureOpenAiCredentialDtoModelsItem.cs @@ -2,13 +2,14 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] public enum CreateAzureOpenAiCredentialDtoModelsItem { + [EnumMember(Value = "gpt-4o-2024-08-06-ptu")] + Gpt4O20240806Ptu, + [EnumMember(Value = "gpt-4o-2024-08-06")] Gpt4O20240806, diff --git a/src/Vapi.Net/Types/CreateAzureOpenAiCredentialDtoRegion.cs b/src/Vapi.Net/Types/CreateAzureOpenAiCredentialDtoRegion.cs index a4586dd..aab2fbd 100644 --- a/src/Vapi.Net/Types/CreateAzureOpenAiCredentialDtoRegion.cs +++ b/src/Vapi.Net/Types/CreateAzureOpenAiCredentialDtoRegion.cs @@ -2,8 +2,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] diff --git a/src/Vapi.Net/Types/CreateBashToolDto.cs b/src/Vapi.Net/Types/CreateBashToolDto.cs index 838d291..fdafb64 100644 --- a/src/Vapi.Net/Types/CreateBashToolDto.cs +++ b/src/Vapi.Net/Types/CreateBashToolDto.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record CreateBashToolDto @@ -31,13 +29,13 @@ public record CreateBashToolDto /// The sub type of tool. /// [JsonPropertyName("subType")] - public required string SubType { get; set; } + public string SubType { get; set; } = "bash_20241022"; /// /// The name of the tool, fixed to 'bash' /// [JsonPropertyName("name")] - public required string Name { get; set; } + public string Name { get; set; } = "bash"; /// /// This is the function definition of the tool. diff --git a/src/Vapi.Net/Types/CreateByoPhoneNumberDto.cs b/src/Vapi.Net/Types/CreateByoPhoneNumberDto.cs index 1781ff8..4106cdd 100644 --- a/src/Vapi.Net/Types/CreateByoPhoneNumberDto.cs +++ b/src/Vapi.Net/Types/CreateByoPhoneNumberDto.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record CreateByoPhoneNumberDto diff --git a/src/Vapi.Net/Types/CreateByoSipTrunkCredentialDto.cs b/src/Vapi.Net/Types/CreateByoSipTrunkCredentialDto.cs index 8c5aba0..db6c225 100644 --- a/src/Vapi.Net/Types/CreateByoSipTrunkCredentialDto.cs +++ b/src/Vapi.Net/Types/CreateByoSipTrunkCredentialDto.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record CreateByoSipTrunkCredentialDto diff --git a/src/Vapi.Net/Types/CreateCartesiaCredentialDto.cs b/src/Vapi.Net/Types/CreateCartesiaCredentialDto.cs index a070bd7..509f2af 100644 --- a/src/Vapi.Net/Types/CreateCartesiaCredentialDto.cs +++ b/src/Vapi.Net/Types/CreateCartesiaCredentialDto.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record CreateCartesiaCredentialDto diff --git a/src/Vapi.Net/Types/CreateCerebrasCredentialDto.cs b/src/Vapi.Net/Types/CreateCerebrasCredentialDto.cs index 9edc95f..2622bd2 100644 --- a/src/Vapi.Net/Types/CreateCerebrasCredentialDto.cs +++ b/src/Vapi.Net/Types/CreateCerebrasCredentialDto.cs @@ -1,14 +1,12 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record CreateCerebrasCredentialDto { [JsonPropertyName("provider")] - public required string Provider { get; set; } + public string Provider { get; set; } = "cerebras"; /// /// This is not returned in the API. diff --git a/src/Vapi.Net/Types/CreateCloudflareCredentialDto.cs b/src/Vapi.Net/Types/CreateCloudflareCredentialDto.cs index 032bbd8..96d96ef 100644 --- a/src/Vapi.Net/Types/CreateCloudflareCredentialDto.cs +++ b/src/Vapi.Net/Types/CreateCloudflareCredentialDto.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record CreateCloudflareCredentialDto diff --git a/src/Vapi.Net/Types/CreateComputerToolDto.cs b/src/Vapi.Net/Types/CreateComputerToolDto.cs index c639cd6..ff55557 100644 --- a/src/Vapi.Net/Types/CreateComputerToolDto.cs +++ b/src/Vapi.Net/Types/CreateComputerToolDto.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record CreateComputerToolDto @@ -31,13 +29,13 @@ public record CreateComputerToolDto /// The sub type of tool. /// [JsonPropertyName("subType")] - public required string SubType { get; set; } + public string SubType { get; set; } = "computer_20241022"; /// /// The name of the tool, fixed to 'computer' /// [JsonPropertyName("name")] - public required string Name { get; set; } + public string Name { get; set; } = "computer"; /// /// The display width in pixels diff --git a/src/Vapi.Net/Types/CreateConversationBlockDto.cs b/src/Vapi.Net/Types/CreateConversationBlockDto.cs index 8b642b4..a761c0b 100644 --- a/src/Vapi.Net/Types/CreateConversationBlockDto.cs +++ b/src/Vapi.Net/Types/CreateConversationBlockDto.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record CreateConversationBlockDto diff --git a/src/Vapi.Net/Types/CreateCustomKnowledgeBaseDto.cs b/src/Vapi.Net/Types/CreateCustomKnowledgeBaseDto.cs index b656871..f867b32 100644 --- a/src/Vapi.Net/Types/CreateCustomKnowledgeBaseDto.cs +++ b/src/Vapi.Net/Types/CreateCustomKnowledgeBaseDto.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record CreateCustomKnowledgeBaseDto diff --git a/src/Vapi.Net/Types/CreateCustomLlmCredentialDto.cs b/src/Vapi.Net/Types/CreateCustomLlmCredentialDto.cs index 6c65389..ae8125e 100644 --- a/src/Vapi.Net/Types/CreateCustomLlmCredentialDto.cs +++ b/src/Vapi.Net/Types/CreateCustomLlmCredentialDto.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record CreateCustomLlmCredentialDto diff --git a/src/Vapi.Net/Types/CreateCustomerDto.cs b/src/Vapi.Net/Types/CreateCustomerDto.cs index 17d6a48..de63652 100644 --- a/src/Vapi.Net/Types/CreateCustomerDto.cs +++ b/src/Vapi.Net/Types/CreateCustomerDto.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record CreateCustomerDto diff --git a/src/Vapi.Net/Types/CreateDeepInfraCredentialDto.cs b/src/Vapi.Net/Types/CreateDeepInfraCredentialDto.cs index 1f39cde..9eb33fb 100644 --- a/src/Vapi.Net/Types/CreateDeepInfraCredentialDto.cs +++ b/src/Vapi.Net/Types/CreateDeepInfraCredentialDto.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record CreateDeepInfraCredentialDto diff --git a/src/Vapi.Net/Types/CreateDeepSeekCredentialDto.cs b/src/Vapi.Net/Types/CreateDeepSeekCredentialDto.cs index be6e281..7267d62 100644 --- a/src/Vapi.Net/Types/CreateDeepSeekCredentialDto.cs +++ b/src/Vapi.Net/Types/CreateDeepSeekCredentialDto.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record CreateDeepSeekCredentialDto diff --git a/src/Vapi.Net/Types/CreateDeepgramCredentialDto.cs b/src/Vapi.Net/Types/CreateDeepgramCredentialDto.cs index edb1af1..953cc79 100644 --- a/src/Vapi.Net/Types/CreateDeepgramCredentialDto.cs +++ b/src/Vapi.Net/Types/CreateDeepgramCredentialDto.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record CreateDeepgramCredentialDto diff --git a/src/Vapi.Net/Types/CreateDtmfToolDto.cs b/src/Vapi.Net/Types/CreateDtmfToolDto.cs index ad3e50e..5862675 100644 --- a/src/Vapi.Net/Types/CreateDtmfToolDto.cs +++ b/src/Vapi.Net/Types/CreateDtmfToolDto.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record CreateDtmfToolDto diff --git a/src/Vapi.Net/Types/CreateElevenLabsCredentialDto.cs b/src/Vapi.Net/Types/CreateElevenLabsCredentialDto.cs index d126884..9441324 100644 --- a/src/Vapi.Net/Types/CreateElevenLabsCredentialDto.cs +++ b/src/Vapi.Net/Types/CreateElevenLabsCredentialDto.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record CreateElevenLabsCredentialDto diff --git a/src/Vapi.Net/Types/CreateEndCallToolDto.cs b/src/Vapi.Net/Types/CreateEndCallToolDto.cs index 670247c..7de1e5d 100644 --- a/src/Vapi.Net/Types/CreateEndCallToolDto.cs +++ b/src/Vapi.Net/Types/CreateEndCallToolDto.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record CreateEndCallToolDto diff --git a/src/Vapi.Net/Types/CreateFunctionToolDto.cs b/src/Vapi.Net/Types/CreateFunctionToolDto.cs index bc8a59a..fbe5c7f 100644 --- a/src/Vapi.Net/Types/CreateFunctionToolDto.cs +++ b/src/Vapi.Net/Types/CreateFunctionToolDto.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record CreateFunctionToolDto diff --git a/src/Vapi.Net/Types/CreateGcpCredentialDto.cs b/src/Vapi.Net/Types/CreateGcpCredentialDto.cs index 53ddaa9..db4effe 100644 --- a/src/Vapi.Net/Types/CreateGcpCredentialDto.cs +++ b/src/Vapi.Net/Types/CreateGcpCredentialDto.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record CreateGcpCredentialDto diff --git a/src/Vapi.Net/Types/CreateGhlToolDto.cs b/src/Vapi.Net/Types/CreateGhlToolDto.cs index c921764..94cc3f5 100644 --- a/src/Vapi.Net/Types/CreateGhlToolDto.cs +++ b/src/Vapi.Net/Types/CreateGhlToolDto.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record CreateGhlToolDto diff --git a/src/Vapi.Net/Types/CreateGladiaCredentialDto.cs b/src/Vapi.Net/Types/CreateGladiaCredentialDto.cs index 854f686..637e1bc 100644 --- a/src/Vapi.Net/Types/CreateGladiaCredentialDto.cs +++ b/src/Vapi.Net/Types/CreateGladiaCredentialDto.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record CreateGladiaCredentialDto diff --git a/src/Vapi.Net/Types/CreateGoHighLevelCredentialDto.cs b/src/Vapi.Net/Types/CreateGoHighLevelCredentialDto.cs index 390c852..c35d295 100644 --- a/src/Vapi.Net/Types/CreateGoHighLevelCredentialDto.cs +++ b/src/Vapi.Net/Types/CreateGoHighLevelCredentialDto.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record CreateGoHighLevelCredentialDto diff --git a/src/Vapi.Net/Types/CreateGoogleCredentialDto.cs b/src/Vapi.Net/Types/CreateGoogleCredentialDto.cs index b8c70ad..e8c514b 100644 --- a/src/Vapi.Net/Types/CreateGoogleCredentialDto.cs +++ b/src/Vapi.Net/Types/CreateGoogleCredentialDto.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record CreateGoogleCredentialDto @@ -11,7 +9,7 @@ public record CreateGoogleCredentialDto /// This is the key for Gemini in Google AI Studio. Get it from here: https://aistudio.google.com/app/apikey /// [JsonPropertyName("provider")] - public required string Provider { get; set; } + public string Provider { get; set; } = "google"; /// /// This is not returned in the API. diff --git a/src/Vapi.Net/Types/CreateGroqCredentialDto.cs b/src/Vapi.Net/Types/CreateGroqCredentialDto.cs index f08cc38..75ea8be 100644 --- a/src/Vapi.Net/Types/CreateGroqCredentialDto.cs +++ b/src/Vapi.Net/Types/CreateGroqCredentialDto.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record CreateGroqCredentialDto diff --git a/src/Vapi.Net/Types/CreateInflectionAiCredentialDto.cs b/src/Vapi.Net/Types/CreateInflectionAiCredentialDto.cs index 54cb15e..3324cf3 100644 --- a/src/Vapi.Net/Types/CreateInflectionAiCredentialDto.cs +++ b/src/Vapi.Net/Types/CreateInflectionAiCredentialDto.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record CreateInflectionAiCredentialDto @@ -11,7 +9,7 @@ public record CreateInflectionAiCredentialDto /// This is the api key for Pi in InflectionAI's console. Get it from here: https://developers.inflection.ai/keys, billing will need to be setup /// [JsonPropertyName("provider")] - public required string Provider { get; set; } + public string Provider { get; set; } = "inflection-ai"; /// /// This is not returned in the API. diff --git a/src/Vapi.Net/Types/CreateLangfuseCredentialDto.cs b/src/Vapi.Net/Types/CreateLangfuseCredentialDto.cs index 7ce5dcd..d73b4dc 100644 --- a/src/Vapi.Net/Types/CreateLangfuseCredentialDto.cs +++ b/src/Vapi.Net/Types/CreateLangfuseCredentialDto.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record CreateLangfuseCredentialDto diff --git a/src/Vapi.Net/Types/CreateLmntCredentialDto.cs b/src/Vapi.Net/Types/CreateLmntCredentialDto.cs index 7d89e3b..47dc050 100644 --- a/src/Vapi.Net/Types/CreateLmntCredentialDto.cs +++ b/src/Vapi.Net/Types/CreateLmntCredentialDto.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record CreateLmntCredentialDto diff --git a/src/Vapi.Net/Types/CreateMakeCredentialDto.cs b/src/Vapi.Net/Types/CreateMakeCredentialDto.cs index fc3b03b..fe57ce6 100644 --- a/src/Vapi.Net/Types/CreateMakeCredentialDto.cs +++ b/src/Vapi.Net/Types/CreateMakeCredentialDto.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record CreateMakeCredentialDto diff --git a/src/Vapi.Net/Types/CreateMakeToolDto.cs b/src/Vapi.Net/Types/CreateMakeToolDto.cs index 0bb0058..f8eb6fc 100644 --- a/src/Vapi.Net/Types/CreateMakeToolDto.cs +++ b/src/Vapi.Net/Types/CreateMakeToolDto.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record CreateMakeToolDto diff --git a/src/Vapi.Net/Types/CreateOpenAiCredentialDto.cs b/src/Vapi.Net/Types/CreateOpenAiCredentialDto.cs index 0903515..e00710c 100644 --- a/src/Vapi.Net/Types/CreateOpenAiCredentialDto.cs +++ b/src/Vapi.Net/Types/CreateOpenAiCredentialDto.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record CreateOpenAiCredentialDto diff --git a/src/Vapi.Net/Types/CreateOpenRouterCredentialDto.cs b/src/Vapi.Net/Types/CreateOpenRouterCredentialDto.cs index 91d1e17..64f6513 100644 --- a/src/Vapi.Net/Types/CreateOpenRouterCredentialDto.cs +++ b/src/Vapi.Net/Types/CreateOpenRouterCredentialDto.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record CreateOpenRouterCredentialDto diff --git a/src/Vapi.Net/Types/CreateOrgDto.cs b/src/Vapi.Net/Types/CreateOrgDto.cs index 8c6ae17..10d6cc9 100644 --- a/src/Vapi.Net/Types/CreateOrgDto.cs +++ b/src/Vapi.Net/Types/CreateOrgDto.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record CreateOrgDto diff --git a/src/Vapi.Net/Types/CreateOrgDtoChannel.cs b/src/Vapi.Net/Types/CreateOrgDtoChannel.cs index 7bbdc60..2a979a4 100644 --- a/src/Vapi.Net/Types/CreateOrgDtoChannel.cs +++ b/src/Vapi.Net/Types/CreateOrgDtoChannel.cs @@ -2,8 +2,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] diff --git a/src/Vapi.Net/Types/CreateOutboundCallDto.cs b/src/Vapi.Net/Types/CreateOutboundCallDto.cs index 45e0f70..3e04d08 100644 --- a/src/Vapi.Net/Types/CreateOutboundCallDto.cs +++ b/src/Vapi.Net/Types/CreateOutboundCallDto.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record CreateOutboundCallDto diff --git a/src/Vapi.Net/Types/CreateOutputToolDto.cs b/src/Vapi.Net/Types/CreateOutputToolDto.cs index 11f98b1..e6fdf47 100644 --- a/src/Vapi.Net/Types/CreateOutputToolDto.cs +++ b/src/Vapi.Net/Types/CreateOutputToolDto.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record CreateOutputToolDto diff --git a/src/Vapi.Net/Types/CreatePerplexityAiCredentialDto.cs b/src/Vapi.Net/Types/CreatePerplexityAiCredentialDto.cs index 20452ff..d4e9233 100644 --- a/src/Vapi.Net/Types/CreatePerplexityAiCredentialDto.cs +++ b/src/Vapi.Net/Types/CreatePerplexityAiCredentialDto.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record CreatePerplexityAiCredentialDto diff --git a/src/Vapi.Net/Types/CreatePlayHtCredentialDto.cs b/src/Vapi.Net/Types/CreatePlayHtCredentialDto.cs index bb50e6b..539ea51 100644 --- a/src/Vapi.Net/Types/CreatePlayHtCredentialDto.cs +++ b/src/Vapi.Net/Types/CreatePlayHtCredentialDto.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record CreatePlayHtCredentialDto diff --git a/src/Vapi.Net/Types/CreateRimeAiCredentialDto.cs b/src/Vapi.Net/Types/CreateRimeAiCredentialDto.cs index 97ecd5e..9efc006 100644 --- a/src/Vapi.Net/Types/CreateRimeAiCredentialDto.cs +++ b/src/Vapi.Net/Types/CreateRimeAiCredentialDto.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record CreateRimeAiCredentialDto diff --git a/src/Vapi.Net/Types/CreateRunpodCredentialDto.cs b/src/Vapi.Net/Types/CreateRunpodCredentialDto.cs index 5b43beb..392857a 100644 --- a/src/Vapi.Net/Types/CreateRunpodCredentialDto.cs +++ b/src/Vapi.Net/Types/CreateRunpodCredentialDto.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record CreateRunpodCredentialDto diff --git a/src/Vapi.Net/Types/CreateS3CredentialDto.cs b/src/Vapi.Net/Types/CreateS3CredentialDto.cs index 275c511..d0797b1 100644 --- a/src/Vapi.Net/Types/CreateS3CredentialDto.cs +++ b/src/Vapi.Net/Types/CreateS3CredentialDto.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record CreateS3CredentialDto diff --git a/src/Vapi.Net/Types/CreateSmallestAiCredentialDto.cs b/src/Vapi.Net/Types/CreateSmallestAiCredentialDto.cs index 31d4f32..944901f 100644 --- a/src/Vapi.Net/Types/CreateSmallestAiCredentialDto.cs +++ b/src/Vapi.Net/Types/CreateSmallestAiCredentialDto.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record CreateSmallestAiCredentialDto diff --git a/src/Vapi.Net/Types/CreateSquadDto.cs b/src/Vapi.Net/Types/CreateSquadDto.cs index 6fc999e..9779694 100644 --- a/src/Vapi.Net/Types/CreateSquadDto.cs +++ b/src/Vapi.Net/Types/CreateSquadDto.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record CreateSquadDto diff --git a/src/Vapi.Net/Types/CreateTavusCredentialDto.cs b/src/Vapi.Net/Types/CreateTavusCredentialDto.cs index 80b5b54..2195e48 100644 --- a/src/Vapi.Net/Types/CreateTavusCredentialDto.cs +++ b/src/Vapi.Net/Types/CreateTavusCredentialDto.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record CreateTavusCredentialDto diff --git a/src/Vapi.Net/Types/CreateTestSuiteTestVoiceDto.cs b/src/Vapi.Net/Types/CreateTestSuiteTestVoiceDto.cs new file mode 100644 index 0000000..be41ddc --- /dev/null +++ b/src/Vapi.Net/Types/CreateTestSuiteTestVoiceDto.cs @@ -0,0 +1,37 @@ +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record CreateTestSuiteTestVoiceDto +{ + /// + /// These are the scorers used to evaluate the test. + /// + [JsonPropertyName("scorers")] + public IEnumerable Scorers { get; set; } = + new List(); + + /// + /// This is the script to be used for the voice test. + /// + [JsonPropertyName("script")] + public required string Script { get; set; } + + /// + /// This is the number of attempts allowed for the test. + /// + [JsonPropertyName("numAttempts")] + public double? NumAttempts { get; set; } + + /// + /// This is the name of the test. + /// + [JsonPropertyName("name")] + public string? Name { get; set; } + + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/CreateTextEditorToolDto.cs b/src/Vapi.Net/Types/CreateTextEditorToolDto.cs index 871833e..c2dfc88 100644 --- a/src/Vapi.Net/Types/CreateTextEditorToolDto.cs +++ b/src/Vapi.Net/Types/CreateTextEditorToolDto.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record CreateTextEditorToolDto @@ -31,13 +29,13 @@ public record CreateTextEditorToolDto /// The sub type of tool. /// [JsonPropertyName("subType")] - public required string SubType { get; set; } + public string SubType { get; set; } = "text_editor_20241022"; /// /// The name of the tool, fixed to 'str_replace_editor' /// [JsonPropertyName("name")] - public required string Name { get; set; } + public string Name { get; set; } = "str_replace_editor"; /// /// This is the function definition of the tool. diff --git a/src/Vapi.Net/Types/CreateTogetherAiCredentialDto.cs b/src/Vapi.Net/Types/CreateTogetherAiCredentialDto.cs index a2930ae..057d47e 100644 --- a/src/Vapi.Net/Types/CreateTogetherAiCredentialDto.cs +++ b/src/Vapi.Net/Types/CreateTogetherAiCredentialDto.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record CreateTogetherAiCredentialDto diff --git a/src/Vapi.Net/Types/CreateTokenDto.cs b/src/Vapi.Net/Types/CreateTokenDto.cs index 0997ce2..64280b8 100644 --- a/src/Vapi.Net/Types/CreateTokenDto.cs +++ b/src/Vapi.Net/Types/CreateTokenDto.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record CreateTokenDto diff --git a/src/Vapi.Net/Types/CreateTokenDtoTag.cs b/src/Vapi.Net/Types/CreateTokenDtoTag.cs index e38c52b..c031157 100644 --- a/src/Vapi.Net/Types/CreateTokenDtoTag.cs +++ b/src/Vapi.Net/Types/CreateTokenDtoTag.cs @@ -2,8 +2,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] diff --git a/src/Vapi.Net/Types/CreateToolCallBlockDto.cs b/src/Vapi.Net/Types/CreateToolCallBlockDto.cs index 4edae24..127e34a 100644 --- a/src/Vapi.Net/Types/CreateToolCallBlockDto.cs +++ b/src/Vapi.Net/Types/CreateToolCallBlockDto.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record CreateToolCallBlockDto diff --git a/src/Vapi.Net/Types/CreateToolTemplateDto.cs b/src/Vapi.Net/Types/CreateToolTemplateDto.cs index 458b534..0fd5283 100644 --- a/src/Vapi.Net/Types/CreateToolTemplateDto.cs +++ b/src/Vapi.Net/Types/CreateToolTemplateDto.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record CreateToolTemplateDto @@ -20,7 +18,7 @@ public record CreateToolTemplateDto public CreateToolTemplateDtoVisibility? Visibility { get; set; } [JsonPropertyName("type")] - public required string Type { get; set; } + public string Type { get; set; } = "tool"; /// /// The name of the template. This is just for your own reference. diff --git a/src/Vapi.Net/Types/CreateToolTemplateDtoProvider.cs b/src/Vapi.Net/Types/CreateToolTemplateDtoProvider.cs index 5dc9d65..7ec7739 100644 --- a/src/Vapi.Net/Types/CreateToolTemplateDtoProvider.cs +++ b/src/Vapi.Net/Types/CreateToolTemplateDtoProvider.cs @@ -2,8 +2,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] diff --git a/src/Vapi.Net/Types/CreateToolTemplateDtoVisibility.cs b/src/Vapi.Net/Types/CreateToolTemplateDtoVisibility.cs index ecfcce2..781bb44 100644 --- a/src/Vapi.Net/Types/CreateToolTemplateDtoVisibility.cs +++ b/src/Vapi.Net/Types/CreateToolTemplateDtoVisibility.cs @@ -2,8 +2,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] diff --git a/src/Vapi.Net/Types/CreateTransferCallToolDto.cs b/src/Vapi.Net/Types/CreateTransferCallToolDto.cs index cf54299..c240357 100644 --- a/src/Vapi.Net/Types/CreateTransferCallToolDto.cs +++ b/src/Vapi.Net/Types/CreateTransferCallToolDto.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record CreateTransferCallToolDto diff --git a/src/Vapi.Net/Types/CreateTrieveKnowledgeBaseDto.cs b/src/Vapi.Net/Types/CreateTrieveKnowledgeBaseDto.cs index f634ff7..cac5501 100644 --- a/src/Vapi.Net/Types/CreateTrieveKnowledgeBaseDto.cs +++ b/src/Vapi.Net/Types/CreateTrieveKnowledgeBaseDto.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record CreateTrieveKnowledgeBaseDto diff --git a/src/Vapi.Net/Types/CreateTwilioCredentialDto.cs b/src/Vapi.Net/Types/CreateTwilioCredentialDto.cs index 7c6dfe8..11c3c62 100644 --- a/src/Vapi.Net/Types/CreateTwilioCredentialDto.cs +++ b/src/Vapi.Net/Types/CreateTwilioCredentialDto.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record CreateTwilioCredentialDto diff --git a/src/Vapi.Net/Types/CreateTwilioPhoneNumberDto.cs b/src/Vapi.Net/Types/CreateTwilioPhoneNumberDto.cs index 49e3f38..b644792 100644 --- a/src/Vapi.Net/Types/CreateTwilioPhoneNumberDto.cs +++ b/src/Vapi.Net/Types/CreateTwilioPhoneNumberDto.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record CreateTwilioPhoneNumberDto diff --git a/src/Vapi.Net/Types/CreateVapiPhoneNumberDto.cs b/src/Vapi.Net/Types/CreateVapiPhoneNumberDto.cs index 49c9135..8604542 100644 --- a/src/Vapi.Net/Types/CreateVapiPhoneNumberDto.cs +++ b/src/Vapi.Net/Types/CreateVapiPhoneNumberDto.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record CreateVapiPhoneNumberDto @@ -18,13 +16,19 @@ public record CreateVapiPhoneNumberDto [JsonPropertyName("fallbackDestination")] public object? FallbackDestination { get; set; } + /// + /// This is the area code of the phone number to purchase. + /// + [JsonPropertyName("numberDesiredAreaCode")] + public string? NumberDesiredAreaCode { get; set; } + /// /// This is the SIP URI of the phone number. You can SIP INVITE this. The assistant attached to this number will answer. /// /// This is case-insensitive. /// [JsonPropertyName("sipUri")] - public required string SipUri { get; set; } + public string? SipUri { get; set; } /// /// This enables authentication for incoming SIP INVITE requests to the `sipUri`. diff --git a/src/Vapi.Net/Types/CreateVoicemailToolDto.cs b/src/Vapi.Net/Types/CreateVoicemailToolDto.cs index 4f9c4ab..97fcf65 100644 --- a/src/Vapi.Net/Types/CreateVoicemailToolDto.cs +++ b/src/Vapi.Net/Types/CreateVoicemailToolDto.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record CreateVoicemailToolDto diff --git a/src/Vapi.Net/Types/CreateVonageCredentialDto.cs b/src/Vapi.Net/Types/CreateVonageCredentialDto.cs index 9a00981..9b97238 100644 --- a/src/Vapi.Net/Types/CreateVonageCredentialDto.cs +++ b/src/Vapi.Net/Types/CreateVonageCredentialDto.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record CreateVonageCredentialDto diff --git a/src/Vapi.Net/Types/CreateVonagePhoneNumberDto.cs b/src/Vapi.Net/Types/CreateVonagePhoneNumberDto.cs index cd2b62e..fc91f00 100644 --- a/src/Vapi.Net/Types/CreateVonagePhoneNumberDto.cs +++ b/src/Vapi.Net/Types/CreateVonagePhoneNumberDto.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record CreateVonagePhoneNumberDto diff --git a/src/Vapi.Net/Types/CreateWebCallDto.cs b/src/Vapi.Net/Types/CreateWebCallDto.cs index 3d30744..c6290da 100644 --- a/src/Vapi.Net/Types/CreateWebCallDto.cs +++ b/src/Vapi.Net/Types/CreateWebCallDto.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record CreateWebCallDto diff --git a/src/Vapi.Net/Types/CreateWebhookCredentialDto.cs b/src/Vapi.Net/Types/CreateWebhookCredentialDto.cs index f3f9aed..cec7122 100644 --- a/src/Vapi.Net/Types/CreateWebhookCredentialDto.cs +++ b/src/Vapi.Net/Types/CreateWebhookCredentialDto.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record CreateWebhookCredentialDto diff --git a/src/Vapi.Net/Types/CreateWorkflowBlockDto.cs b/src/Vapi.Net/Types/CreateWorkflowBlockDto.cs index f4c7071..f4317f3 100644 --- a/src/Vapi.Net/Types/CreateWorkflowBlockDto.cs +++ b/src/Vapi.Net/Types/CreateWorkflowBlockDto.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record CreateWorkflowBlockDto diff --git a/src/Vapi.Net/Types/CreateWorkflowDto.cs b/src/Vapi.Net/Types/CreateWorkflowDto.cs index e1818be..68106b9 100644 --- a/src/Vapi.Net/Types/CreateWorkflowDto.cs +++ b/src/Vapi.Net/Types/CreateWorkflowDto.cs @@ -1,19 +1,12 @@ using System.Text.Json.Serialization; -using OneOf; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record CreateWorkflowDto { - [JsonPropertyName("type")] - public required string Type { get; set; } - [JsonPropertyName("nodes")] - public IEnumerable> Nodes { get; set; } = - new List>(); + public IEnumerable Nodes { get; set; } = new List(); [JsonPropertyName("name")] public required string Name { get; set; } diff --git a/src/Vapi.Net/Types/CreateXAiCredentialDto.cs b/src/Vapi.Net/Types/CreateXAiCredentialDto.cs index 5049983..da4de98 100644 --- a/src/Vapi.Net/Types/CreateXAiCredentialDto.cs +++ b/src/Vapi.Net/Types/CreateXAiCredentialDto.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record CreateXAiCredentialDto diff --git a/src/Vapi.Net/Types/CustomKnowledgeBase.cs b/src/Vapi.Net/Types/CustomKnowledgeBase.cs index ad9b6ad..dc48540 100644 --- a/src/Vapi.Net/Types/CustomKnowledgeBase.cs +++ b/src/Vapi.Net/Types/CustomKnowledgeBase.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record CustomKnowledgeBase diff --git a/src/Vapi.Net/Types/CustomLlmCredential.cs b/src/Vapi.Net/Types/CustomLlmCredential.cs index cb8ee84..66c099b 100644 --- a/src/Vapi.Net/Types/CustomLlmCredential.cs +++ b/src/Vapi.Net/Types/CustomLlmCredential.cs @@ -1,14 +1,12 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record CustomLlmCredential { [JsonPropertyName("provider")] - public required string Provider { get; set; } + public string Provider { get; set; } = "custom-llm"; /// /// This is not returned in the API. diff --git a/src/Vapi.Net/Types/CustomLlmModel.cs b/src/Vapi.Net/Types/CustomLlmModel.cs index 031cc84..54e7a6e 100644 --- a/src/Vapi.Net/Types/CustomLlmModel.cs +++ b/src/Vapi.Net/Types/CustomLlmModel.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record CustomLlmModel diff --git a/src/Vapi.Net/Types/CustomLlmModelMetadataSendMode.cs b/src/Vapi.Net/Types/CustomLlmModelMetadataSendMode.cs index 1c92e77..e7637cc 100644 --- a/src/Vapi.Net/Types/CustomLlmModelMetadataSendMode.cs +++ b/src/Vapi.Net/Types/CustomLlmModelMetadataSendMode.cs @@ -2,8 +2,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] diff --git a/src/Vapi.Net/Types/CustomMessage.cs b/src/Vapi.Net/Types/CustomMessage.cs index d4bb4df..f809ccc 100644 --- a/src/Vapi.Net/Types/CustomMessage.cs +++ b/src/Vapi.Net/Types/CustomMessage.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record CustomMessage @@ -23,7 +21,7 @@ public record CustomMessage /// This is a custom message. /// [JsonPropertyName("type")] - public required string Type { get; set; } + public string Type { get; set; } = "custom-message"; /// /// This is the content that the assistant will say when this message is triggered. diff --git a/src/Vapi.Net/Types/CustomTranscriber.cs b/src/Vapi.Net/Types/CustomTranscriber.cs index 7954677..f3a9485 100644 --- a/src/Vapi.Net/Types/CustomTranscriber.cs +++ b/src/Vapi.Net/Types/CustomTranscriber.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record CustomTranscriber diff --git a/src/Vapi.Net/Types/CustomVoice.cs b/src/Vapi.Net/Types/CustomVoice.cs index cba4e11..fa45956 100644 --- a/src/Vapi.Net/Types/CustomVoice.cs +++ b/src/Vapi.Net/Types/CustomVoice.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record CustomVoice diff --git a/src/Vapi.Net/Types/CustomerCustomEndpointingRule.cs b/src/Vapi.Net/Types/CustomerCustomEndpointingRule.cs index 4a66399..5c15ba6 100644 --- a/src/Vapi.Net/Types/CustomerCustomEndpointingRule.cs +++ b/src/Vapi.Net/Types/CustomerCustomEndpointingRule.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record CustomerCustomEndpointingRule diff --git a/src/Vapi.Net/Types/DeepInfraCredential.cs b/src/Vapi.Net/Types/DeepInfraCredential.cs index 94645e8..115211f 100644 --- a/src/Vapi.Net/Types/DeepInfraCredential.cs +++ b/src/Vapi.Net/Types/DeepInfraCredential.cs @@ -1,14 +1,12 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record DeepInfraCredential { [JsonPropertyName("provider")] - public required string Provider { get; set; } + public string Provider { get; set; } = "deepinfra"; /// /// This is not returned in the API. diff --git a/src/Vapi.Net/Types/DeepInfraModel.cs b/src/Vapi.Net/Types/DeepInfraModel.cs index 979d368..a4ad58a 100644 --- a/src/Vapi.Net/Types/DeepInfraModel.cs +++ b/src/Vapi.Net/Types/DeepInfraModel.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record DeepInfraModel diff --git a/src/Vapi.Net/Types/DeepSeekCredential.cs b/src/Vapi.Net/Types/DeepSeekCredential.cs index b737865..cfd0909 100644 --- a/src/Vapi.Net/Types/DeepSeekCredential.cs +++ b/src/Vapi.Net/Types/DeepSeekCredential.cs @@ -1,14 +1,12 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record DeepSeekCredential { [JsonPropertyName("provider")] - public required string Provider { get; set; } + public string Provider { get; set; } = "deep-seek"; /// /// This is not returned in the API. diff --git a/src/Vapi.Net/Types/DeepSeekModel.cs b/src/Vapi.Net/Types/DeepSeekModel.cs index bc6a964..dc64b0d 100644 --- a/src/Vapi.Net/Types/DeepSeekModel.cs +++ b/src/Vapi.Net/Types/DeepSeekModel.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record DeepSeekModel @@ -45,7 +43,7 @@ public record DeepSeekModel /// This is the name of the model. Ex. cognitivecomputations/dolphin-mixtral-8x7b /// [JsonPropertyName("model")] - public required string Model { get; set; } + public required DeepSeekModelModel Model { get; set; } /// /// This is the temperature that will be used for calls. Default is 0 to leverage caching for lower latency. diff --git a/src/Vapi.Net/Types/DeepSeekModelModel.cs b/src/Vapi.Net/Types/DeepSeekModelModel.cs new file mode 100644 index 0000000..d8c4f5f --- /dev/null +++ b/src/Vapi.Net/Types/DeepSeekModelModel.cs @@ -0,0 +1,15 @@ +using System.Runtime.Serialization; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[JsonConverter(typeof(EnumSerializer))] +public enum DeepSeekModelModel +{ + [EnumMember(Value = "deepseek-chat")] + DeepseekChat, + + [EnumMember(Value = "deepseek-reasoner")] + DeepseekReasoner, +} diff --git a/src/Vapi.Net/Types/DeepgramCredential.cs b/src/Vapi.Net/Types/DeepgramCredential.cs index acccc73..4d1f463 100644 --- a/src/Vapi.Net/Types/DeepgramCredential.cs +++ b/src/Vapi.Net/Types/DeepgramCredential.cs @@ -1,14 +1,12 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record DeepgramCredential { [JsonPropertyName("provider")] - public required string Provider { get; set; } + public string Provider { get; set; } = "deepgram"; /// /// This is not returned in the API. diff --git a/src/Vapi.Net/Types/DeepgramTranscriber.cs b/src/Vapi.Net/Types/DeepgramTranscriber.cs index 7f7ca71..80a15d4 100644 --- a/src/Vapi.Net/Types/DeepgramTranscriber.cs +++ b/src/Vapi.Net/Types/DeepgramTranscriber.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record DeepgramTranscriber @@ -61,12 +59,28 @@ public record DeepgramTranscriber [JsonPropertyName("codeSwitchingEnabled")] public bool? CodeSwitchingEnabled { get; set; } + /// + /// If set to true, this will add mip_opt_out=true as a query parameter of all API requests. See https://developers.deepgram.com/docs/the-deepgram-model-improvement-partnership-program#want-to-opt-out + /// + /// This will only be used if you are using your own Deepgram API key. + /// + /// @default false + /// + [JsonPropertyName("mipOptOut")] + public bool? MipOptOut { get; set; } + /// /// These keywords are passed to the transcription model to help it pick up use-case specific words. Anything that may not be a common word, like your company name, should be added here. /// [JsonPropertyName("keywords")] public IEnumerable? Keywords { get; set; } + /// + /// Keyterm Prompting allows you improve Keyword Recall Rate (KRR) for important keyterms or phrases up to 90%. + /// + [JsonPropertyName("keyterm")] + public IEnumerable? Keyterm { get; set; } + /// /// This is the timeout after which Deepgram will send transcription on user silence. You can read in-depth documentation here: https://developers.deepgram.com/docs/endpointing. /// diff --git a/src/Vapi.Net/Types/DeepgramTranscriberLanguage.cs b/src/Vapi.Net/Types/DeepgramTranscriberLanguage.cs index 9c01821..1454f3a 100644 --- a/src/Vapi.Net/Types/DeepgramTranscriberLanguage.cs +++ b/src/Vapi.Net/Types/DeepgramTranscriberLanguage.cs @@ -2,8 +2,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] diff --git a/src/Vapi.Net/Types/DeepgramTranscriberModel.cs b/src/Vapi.Net/Types/DeepgramTranscriberModel.cs index 5202075..9e17bae 100644 --- a/src/Vapi.Net/Types/DeepgramTranscriberModel.cs +++ b/src/Vapi.Net/Types/DeepgramTranscriberModel.cs @@ -2,8 +2,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] diff --git a/src/Vapi.Net/Types/DeepgramVoice.cs b/src/Vapi.Net/Types/DeepgramVoice.cs index 80e957d..ac7e20a 100644 --- a/src/Vapi.Net/Types/DeepgramVoice.cs +++ b/src/Vapi.Net/Types/DeepgramVoice.cs @@ -2,8 +2,6 @@ using OneOf; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record DeepgramVoice @@ -14,6 +12,16 @@ public record DeepgramVoice [JsonPropertyName("voiceId")] public required OneOf VoiceId { get; set; } + /// + /// If set to true, this will add mip_opt_out=true as a query parameter of all API requests. See https://developers.deepgram.com/docs/the-deepgram-model-improvement-partnership-program#want-to-opt-out + /// + /// This will only be used if you are using your own Deepgram API key. + /// + /// @default false + /// + [JsonPropertyName("mipOptOut")] + public bool? MipOptOut { get; set; } + /// /// This is the plan for chunking the model output before it is sent to the voice provider. /// diff --git a/src/Vapi.Net/Types/DeepgramVoiceIdEnum.cs b/src/Vapi.Net/Types/DeepgramVoiceIdEnum.cs index 16df3d3..338e3c9 100644 --- a/src/Vapi.Net/Types/DeepgramVoiceIdEnum.cs +++ b/src/Vapi.Net/Types/DeepgramVoiceIdEnum.cs @@ -2,8 +2,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] diff --git a/src/Vapi.Net/Types/DtmfTool.cs b/src/Vapi.Net/Types/DtmfTool.cs index e4263ef..7c1d6eb 100644 --- a/src/Vapi.Net/Types/DtmfTool.cs +++ b/src/Vapi.Net/Types/DtmfTool.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record DtmfTool diff --git a/src/Vapi.Net/Types/Edge.cs b/src/Vapi.Net/Types/Edge.cs index 0826814..f9a0ff1 100644 --- a/src/Vapi.Net/Types/Edge.cs +++ b/src/Vapi.Net/Types/Edge.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record Edge @@ -16,6 +14,12 @@ public record Edge [JsonPropertyName("to")] public required string To { get; set; } + /// + /// This is for metadata you want to store on the edge. + /// + [JsonPropertyName("metadata")] + public object? Metadata { get; set; } + public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/ElevenLabsCredential.cs b/src/Vapi.Net/Types/ElevenLabsCredential.cs index 969fed2..97b283b 100644 --- a/src/Vapi.Net/Types/ElevenLabsCredential.cs +++ b/src/Vapi.Net/Types/ElevenLabsCredential.cs @@ -1,14 +1,12 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record ElevenLabsCredential { [JsonPropertyName("provider")] - public required string Provider { get; set; } + public string Provider { get; set; } = "11labs"; /// /// This is not returned in the API. diff --git a/src/Vapi.Net/Types/ElevenLabsVoice.cs b/src/Vapi.Net/Types/ElevenLabsVoice.cs index 982f203..ac0e1ac 100644 --- a/src/Vapi.Net/Types/ElevenLabsVoice.cs +++ b/src/Vapi.Net/Types/ElevenLabsVoice.cs @@ -2,8 +2,6 @@ using OneOf; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record ElevenLabsVoice diff --git a/src/Vapi.Net/Types/ElevenLabsVoiceIdEnum.cs b/src/Vapi.Net/Types/ElevenLabsVoiceIdEnum.cs index ba896b1..ed5e8e8 100644 --- a/src/Vapi.Net/Types/ElevenLabsVoiceIdEnum.cs +++ b/src/Vapi.Net/Types/ElevenLabsVoiceIdEnum.cs @@ -2,8 +2,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] diff --git a/src/Vapi.Net/Types/ElevenLabsVoiceModel.cs b/src/Vapi.Net/Types/ElevenLabsVoiceModel.cs index d982b80..1903b95 100644 --- a/src/Vapi.Net/Types/ElevenLabsVoiceModel.cs +++ b/src/Vapi.Net/Types/ElevenLabsVoiceModel.cs @@ -2,8 +2,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] diff --git a/src/Vapi.Net/Types/EndCallTool.cs b/src/Vapi.Net/Types/EndCallTool.cs index 83ec195..b34270e 100644 --- a/src/Vapi.Net/Types/EndCallTool.cs +++ b/src/Vapi.Net/Types/EndCallTool.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record EndCallTool diff --git a/src/Vapi.Net/Types/Error.cs b/src/Vapi.Net/Types/Error.cs index c39eda9..4f9dfdb 100644 --- a/src/Vapi.Net/Types/Error.cs +++ b/src/Vapi.Net/Types/Error.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record Error diff --git a/src/Vapi.Net/Types/ExactReplacement.cs b/src/Vapi.Net/Types/ExactReplacement.cs index d7ae69f..8a7031e 100644 --- a/src/Vapi.Net/Types/ExactReplacement.cs +++ b/src/Vapi.Net/Types/ExactReplacement.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record ExactReplacement diff --git a/src/Vapi.Net/Types/FailedEdgeCondition.cs b/src/Vapi.Net/Types/FailedEdgeCondition.cs new file mode 100644 index 0000000..603e214 --- /dev/null +++ b/src/Vapi.Net/Types/FailedEdgeCondition.cs @@ -0,0 +1,11 @@ +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record FailedEdgeCondition +{ + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/FallbackAzureVoice.cs b/src/Vapi.Net/Types/FallbackAzureVoice.cs index 2d1c618..1d0f6c3 100644 --- a/src/Vapi.Net/Types/FallbackAzureVoice.cs +++ b/src/Vapi.Net/Types/FallbackAzureVoice.cs @@ -2,8 +2,6 @@ using OneOf; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record FallbackAzureVoice diff --git a/src/Vapi.Net/Types/FallbackAzureVoiceVoiceId.cs b/src/Vapi.Net/Types/FallbackAzureVoiceVoiceId.cs index a9b73d7..8ffacd5 100644 --- a/src/Vapi.Net/Types/FallbackAzureVoiceVoiceId.cs +++ b/src/Vapi.Net/Types/FallbackAzureVoiceVoiceId.cs @@ -2,8 +2,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] diff --git a/src/Vapi.Net/Types/FallbackCartesiaVoice.cs b/src/Vapi.Net/Types/FallbackCartesiaVoice.cs index 663f89f..77498b7 100644 --- a/src/Vapi.Net/Types/FallbackCartesiaVoice.cs +++ b/src/Vapi.Net/Types/FallbackCartesiaVoice.cs @@ -1,12 +1,16 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record FallbackCartesiaVoice { + /// + /// The ID of the particular voice you want to use. + /// + [JsonPropertyName("voiceId")] + public required string VoiceId { get; set; } + /// /// This is the model that will be used. This is optional and will default to the correct model for the voiceId. /// @@ -20,10 +24,10 @@ public record FallbackCartesiaVoice public FallbackCartesiaVoiceLanguage? Language { get; set; } /// - /// This is the provider-specific ID that will be used. + /// Experimental controls for Cartesia voice generation /// - [JsonPropertyName("voiceId")] - public required string VoiceId { get; set; } + [JsonPropertyName("experimentalControls")] + public CartesiaExperimentalControls? ExperimentalControls { get; set; } /// /// This is the plan for chunking the model output before it is sent to the voice provider. diff --git a/src/Vapi.Net/Types/FallbackCartesiaVoiceLanguage.cs b/src/Vapi.Net/Types/FallbackCartesiaVoiceLanguage.cs index 8067ace..9a8face 100644 --- a/src/Vapi.Net/Types/FallbackCartesiaVoiceLanguage.cs +++ b/src/Vapi.Net/Types/FallbackCartesiaVoiceLanguage.cs @@ -2,8 +2,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] diff --git a/src/Vapi.Net/Types/FallbackCartesiaVoiceModel.cs b/src/Vapi.Net/Types/FallbackCartesiaVoiceModel.cs index 65e6bab..0a31d2d 100644 --- a/src/Vapi.Net/Types/FallbackCartesiaVoiceModel.cs +++ b/src/Vapi.Net/Types/FallbackCartesiaVoiceModel.cs @@ -2,8 +2,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] diff --git a/src/Vapi.Net/Types/FallbackCustomVoice.cs b/src/Vapi.Net/Types/FallbackCustomVoice.cs index c89f069..916b79f 100644 --- a/src/Vapi.Net/Types/FallbackCustomVoice.cs +++ b/src/Vapi.Net/Types/FallbackCustomVoice.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record FallbackCustomVoice diff --git a/src/Vapi.Net/Types/FallbackDeepgramVoice.cs b/src/Vapi.Net/Types/FallbackDeepgramVoice.cs index 1a184bb..7bb3e7f 100644 --- a/src/Vapi.Net/Types/FallbackDeepgramVoice.cs +++ b/src/Vapi.Net/Types/FallbackDeepgramVoice.cs @@ -2,8 +2,6 @@ using OneOf; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record FallbackDeepgramVoice @@ -14,6 +12,16 @@ public record FallbackDeepgramVoice [JsonPropertyName("voiceId")] public required OneOf VoiceId { get; set; } + /// + /// If set to true, this will add mip_opt_out=true as a query parameter of all API requests. See https://developers.deepgram.com/docs/the-deepgram-model-improvement-partnership-program#want-to-opt-out + /// + /// This will only be used if you are using your own Deepgram API key. + /// + /// @default false + /// + [JsonPropertyName("mipOptOut")] + public bool? MipOptOut { get; set; } + /// /// This is the plan for chunking the model output before it is sent to the voice provider. /// diff --git a/src/Vapi.Net/Types/FallbackDeepgramVoiceIdEnum.cs b/src/Vapi.Net/Types/FallbackDeepgramVoiceIdEnum.cs index a091d47..a4c773a 100644 --- a/src/Vapi.Net/Types/FallbackDeepgramVoiceIdEnum.cs +++ b/src/Vapi.Net/Types/FallbackDeepgramVoiceIdEnum.cs @@ -2,8 +2,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] diff --git a/src/Vapi.Net/Types/FallbackElevenLabsVoice.cs b/src/Vapi.Net/Types/FallbackElevenLabsVoice.cs index 393cce6..47fa1e7 100644 --- a/src/Vapi.Net/Types/FallbackElevenLabsVoice.cs +++ b/src/Vapi.Net/Types/FallbackElevenLabsVoice.cs @@ -2,8 +2,6 @@ using OneOf; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record FallbackElevenLabsVoice diff --git a/src/Vapi.Net/Types/FallbackElevenLabsVoiceIdEnum.cs b/src/Vapi.Net/Types/FallbackElevenLabsVoiceIdEnum.cs index 545ac95..a1ceac1 100644 --- a/src/Vapi.Net/Types/FallbackElevenLabsVoiceIdEnum.cs +++ b/src/Vapi.Net/Types/FallbackElevenLabsVoiceIdEnum.cs @@ -2,8 +2,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] diff --git a/src/Vapi.Net/Types/FallbackElevenLabsVoiceModel.cs b/src/Vapi.Net/Types/FallbackElevenLabsVoiceModel.cs index 7d6aa45..fb0ff38 100644 --- a/src/Vapi.Net/Types/FallbackElevenLabsVoiceModel.cs +++ b/src/Vapi.Net/Types/FallbackElevenLabsVoiceModel.cs @@ -2,8 +2,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] diff --git a/src/Vapi.Net/Types/FallbackLmntVoice.cs b/src/Vapi.Net/Types/FallbackLmntVoice.cs index c37d6fd..faa28b9 100644 --- a/src/Vapi.Net/Types/FallbackLmntVoice.cs +++ b/src/Vapi.Net/Types/FallbackLmntVoice.cs @@ -2,8 +2,6 @@ using OneOf; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record FallbackLmntVoice diff --git a/src/Vapi.Net/Types/FallbackLmntVoiceIdEnum.cs b/src/Vapi.Net/Types/FallbackLmntVoiceIdEnum.cs index 5b78985..33d374c 100644 --- a/src/Vapi.Net/Types/FallbackLmntVoiceIdEnum.cs +++ b/src/Vapi.Net/Types/FallbackLmntVoiceIdEnum.cs @@ -2,8 +2,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] diff --git a/src/Vapi.Net/Types/FallbackNeetsVoice.cs b/src/Vapi.Net/Types/FallbackNeetsVoice.cs index 9f72f4f..845b236 100644 --- a/src/Vapi.Net/Types/FallbackNeetsVoice.cs +++ b/src/Vapi.Net/Types/FallbackNeetsVoice.cs @@ -2,8 +2,6 @@ using OneOf; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record FallbackNeetsVoice diff --git a/src/Vapi.Net/Types/FallbackNeetsVoiceIdEnum.cs b/src/Vapi.Net/Types/FallbackNeetsVoiceIdEnum.cs index f6b3e9f..659f7cb 100644 --- a/src/Vapi.Net/Types/FallbackNeetsVoiceIdEnum.cs +++ b/src/Vapi.Net/Types/FallbackNeetsVoiceIdEnum.cs @@ -2,8 +2,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] diff --git a/src/Vapi.Net/Types/FallbackOpenAiVoice.cs b/src/Vapi.Net/Types/FallbackOpenAiVoice.cs index 3eb2803..0d654e7 100644 --- a/src/Vapi.Net/Types/FallbackOpenAiVoice.cs +++ b/src/Vapi.Net/Types/FallbackOpenAiVoice.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record FallbackOpenAiVoice diff --git a/src/Vapi.Net/Types/FallbackOpenAiVoiceId.cs b/src/Vapi.Net/Types/FallbackOpenAiVoiceId.cs index 1d9d048..863a67b 100644 --- a/src/Vapi.Net/Types/FallbackOpenAiVoiceId.cs +++ b/src/Vapi.Net/Types/FallbackOpenAiVoiceId.cs @@ -2,8 +2,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] diff --git a/src/Vapi.Net/Types/FallbackPlan.cs b/src/Vapi.Net/Types/FallbackPlan.cs index c4bd0bc..90d7961 100644 --- a/src/Vapi.Net/Types/FallbackPlan.cs +++ b/src/Vapi.Net/Types/FallbackPlan.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record FallbackPlan diff --git a/src/Vapi.Net/Types/FallbackPlayHtVoice.cs b/src/Vapi.Net/Types/FallbackPlayHtVoice.cs index c632e90..0bac5e0 100644 --- a/src/Vapi.Net/Types/FallbackPlayHtVoice.cs +++ b/src/Vapi.Net/Types/FallbackPlayHtVoice.cs @@ -2,8 +2,6 @@ using OneOf; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record FallbackPlayHtVoice diff --git a/src/Vapi.Net/Types/FallbackPlayHtVoiceEmotion.cs b/src/Vapi.Net/Types/FallbackPlayHtVoiceEmotion.cs index 33628a9..1633421 100644 --- a/src/Vapi.Net/Types/FallbackPlayHtVoiceEmotion.cs +++ b/src/Vapi.Net/Types/FallbackPlayHtVoiceEmotion.cs @@ -2,8 +2,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] diff --git a/src/Vapi.Net/Types/FallbackPlayHtVoiceIdEnum.cs b/src/Vapi.Net/Types/FallbackPlayHtVoiceIdEnum.cs index 13e879a..188cfaa 100644 --- a/src/Vapi.Net/Types/FallbackPlayHtVoiceIdEnum.cs +++ b/src/Vapi.Net/Types/FallbackPlayHtVoiceIdEnum.cs @@ -2,8 +2,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] diff --git a/src/Vapi.Net/Types/FallbackPlayHtVoiceLanguage.cs b/src/Vapi.Net/Types/FallbackPlayHtVoiceLanguage.cs index 3f63e8d..8740ec2 100644 --- a/src/Vapi.Net/Types/FallbackPlayHtVoiceLanguage.cs +++ b/src/Vapi.Net/Types/FallbackPlayHtVoiceLanguage.cs @@ -2,8 +2,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] diff --git a/src/Vapi.Net/Types/FallbackPlayHtVoiceModel.cs b/src/Vapi.Net/Types/FallbackPlayHtVoiceModel.cs index 24accca..fe61d85 100644 --- a/src/Vapi.Net/Types/FallbackPlayHtVoiceModel.cs +++ b/src/Vapi.Net/Types/FallbackPlayHtVoiceModel.cs @@ -2,8 +2,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] @@ -17,4 +15,7 @@ public enum FallbackPlayHtVoiceModel [EnumMember(Value = "Play3.0-mini")] Play30Mini, + + [EnumMember(Value = "PlayDialog")] + PlayDialog, } diff --git a/src/Vapi.Net/Types/FallbackRimeAiVoice.cs b/src/Vapi.Net/Types/FallbackRimeAiVoice.cs index 3b93657..900730f 100644 --- a/src/Vapi.Net/Types/FallbackRimeAiVoice.cs +++ b/src/Vapi.Net/Types/FallbackRimeAiVoice.cs @@ -2,8 +2,6 @@ using OneOf; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record FallbackRimeAiVoice diff --git a/src/Vapi.Net/Types/FallbackRimeAiVoiceIdEnum.cs b/src/Vapi.Net/Types/FallbackRimeAiVoiceIdEnum.cs index 679b242..7eec2b1 100644 --- a/src/Vapi.Net/Types/FallbackRimeAiVoiceIdEnum.cs +++ b/src/Vapi.Net/Types/FallbackRimeAiVoiceIdEnum.cs @@ -2,73 +2,11 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] public enum FallbackRimeAiVoiceIdEnum { - [EnumMember(Value = "marsh")] - Marsh, - - [EnumMember(Value = "bayou")] - Bayou, - - [EnumMember(Value = "creek")] - Creek, - - [EnumMember(Value = "brook")] - Brook, - - [EnumMember(Value = "flower")] - Flower, - - [EnumMember(Value = "spore")] - Spore, - - [EnumMember(Value = "glacier")] - Glacier, - - [EnumMember(Value = "gulch")] - Gulch, - - [EnumMember(Value = "alpine")] - Alpine, - - [EnumMember(Value = "cove")] - Cove, - - [EnumMember(Value = "lagoon")] - Lagoon, - - [EnumMember(Value = "tundra")] - Tundra, - - [EnumMember(Value = "steppe")] - Steppe, - - [EnumMember(Value = "mesa")] - Mesa, - - [EnumMember(Value = "grove")] - Grove, - - [EnumMember(Value = "rainforest")] - Rainforest, - - [EnumMember(Value = "moraine")] - Moraine, - - [EnumMember(Value = "wildflower")] - Wildflower, - - [EnumMember(Value = "peak")] - Peak, - - [EnumMember(Value = "boulder")] - Boulder, - [EnumMember(Value = "abbie")] Abbie, @@ -251,4 +189,70 @@ public enum FallbackRimeAiVoiceIdEnum [EnumMember(Value = "yadira")] Yadira, + + [EnumMember(Value = "marsh")] + Marsh, + + [EnumMember(Value = "bayou")] + Bayou, + + [EnumMember(Value = "creek")] + Creek, + + [EnumMember(Value = "brook")] + Brook, + + [EnumMember(Value = "flower")] + Flower, + + [EnumMember(Value = "spore")] + Spore, + + [EnumMember(Value = "glacier")] + Glacier, + + [EnumMember(Value = "gulch")] + Gulch, + + [EnumMember(Value = "alpine")] + Alpine, + + [EnumMember(Value = "cove")] + Cove, + + [EnumMember(Value = "lagoon")] + Lagoon, + + [EnumMember(Value = "tundra")] + Tundra, + + [EnumMember(Value = "steppe")] + Steppe, + + [EnumMember(Value = "mesa")] + Mesa, + + [EnumMember(Value = "grove")] + Grove, + + [EnumMember(Value = "rainforest")] + Rainforest, + + [EnumMember(Value = "moraine")] + Moraine, + + [EnumMember(Value = "wildflower")] + Wildflower, + + [EnumMember(Value = "peak")] + Peak, + + [EnumMember(Value = "boulder")] + Boulder, + + [EnumMember(Value = "gypsum")] + Gypsum, + + [EnumMember(Value = "zest")] + Zest, } diff --git a/src/Vapi.Net/Types/FallbackRimeAiVoiceModel.cs b/src/Vapi.Net/Types/FallbackRimeAiVoiceModel.cs index d860ede..40df01e 100644 --- a/src/Vapi.Net/Types/FallbackRimeAiVoiceModel.cs +++ b/src/Vapi.Net/Types/FallbackRimeAiVoiceModel.cs @@ -2,8 +2,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] @@ -14,4 +12,7 @@ public enum FallbackRimeAiVoiceModel [EnumMember(Value = "mist")] Mist, + + [EnumMember(Value = "mistv2")] + Mistv2, } diff --git a/src/Vapi.Net/Types/FallbackSmallestAiVoice.cs b/src/Vapi.Net/Types/FallbackSmallestAiVoice.cs index bd1fc26..109876d 100644 --- a/src/Vapi.Net/Types/FallbackSmallestAiVoice.cs +++ b/src/Vapi.Net/Types/FallbackSmallestAiVoice.cs @@ -2,8 +2,6 @@ using OneOf; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record FallbackSmallestAiVoice diff --git a/src/Vapi.Net/Types/FallbackSmallestAiVoiceIdEnum.cs b/src/Vapi.Net/Types/FallbackSmallestAiVoiceIdEnum.cs index 7273aee..7cea217 100644 --- a/src/Vapi.Net/Types/FallbackSmallestAiVoiceIdEnum.cs +++ b/src/Vapi.Net/Types/FallbackSmallestAiVoiceIdEnum.cs @@ -2,8 +2,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] diff --git a/src/Vapi.Net/Types/FallbackTavusVoice.cs b/src/Vapi.Net/Types/FallbackTavusVoice.cs index fe927c3..125fd73 100644 --- a/src/Vapi.Net/Types/FallbackTavusVoice.cs +++ b/src/Vapi.Net/Types/FallbackTavusVoice.cs @@ -2,8 +2,6 @@ using OneOf; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record FallbackTavusVoice diff --git a/src/Vapi.Net/Types/File.cs b/src/Vapi.Net/Types/File.cs index e0d83bc..c44b608 100644 --- a/src/Vapi.Net/Types/File.cs +++ b/src/Vapi.Net/Types/File.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record File diff --git a/src/Vapi.Net/Types/FileStatus.cs b/src/Vapi.Net/Types/FileStatus.cs index f666e41..b67f7bb 100644 --- a/src/Vapi.Net/Types/FileStatus.cs +++ b/src/Vapi.Net/Types/FileStatus.cs @@ -2,8 +2,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] diff --git a/src/Vapi.Net/Types/FormatPlan.cs b/src/Vapi.Net/Types/FormatPlan.cs index 259b151..fd21d06 100644 --- a/src/Vapi.Net/Types/FormatPlan.cs +++ b/src/Vapi.Net/Types/FormatPlan.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record FormatPlan @@ -47,6 +45,15 @@ public record FormatPlan [JsonPropertyName("replacements")] public IEnumerable? Replacements { get; set; } + /// + /// List of formatters to apply. If not provided, all default formatters will be applied. + /// If provided, only the specified formatters will be applied. + /// Note: Some essential formatters like angle bracket removal will always be applied. + /// @default undefined + /// + [JsonPropertyName("formattersEnabled")] + public IEnumerable? FormattersEnabled { get; set; } + public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/FormatPlanFormattersEnabledItem.cs b/src/Vapi.Net/Types/FormatPlanFormattersEnabledItem.cs new file mode 100644 index 0000000..562810c --- /dev/null +++ b/src/Vapi.Net/Types/FormatPlanFormattersEnabledItem.cs @@ -0,0 +1,57 @@ +using System.Runtime.Serialization; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[JsonConverter(typeof(EnumSerializer))] +public enum FormatPlanFormattersEnabledItem +{ + [EnumMember(Value = "markdown")] + Markdown, + + [EnumMember(Value = "asterisk")] + Asterisk, + + [EnumMember(Value = "quote")] + Quote, + + [EnumMember(Value = "dash")] + Dash, + + [EnumMember(Value = "newline")] + Newline, + + [EnumMember(Value = "colon")] + Colon, + + [EnumMember(Value = "acronym")] + Acronym, + + [EnumMember(Value = "dollarAmount")] + DollarAmount, + + [EnumMember(Value = "email")] + Email, + + [EnumMember(Value = "date")] + Date, + + [EnumMember(Value = "time")] + Time, + + [EnumMember(Value = "distance")] + Distance, + + [EnumMember(Value = "unit")] + Unit, + + [EnumMember(Value = "percentage")] + Percentage, + + [EnumMember(Value = "phoneNumber")] + PhoneNumber, + + [EnumMember(Value = "number")] + Number, +} diff --git a/src/Vapi.Net/Types/FunctionTool.cs b/src/Vapi.Net/Types/FunctionTool.cs index c9eb067..ecdcf1f 100644 --- a/src/Vapi.Net/Types/FunctionTool.cs +++ b/src/Vapi.Net/Types/FunctionTool.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record FunctionTool diff --git a/src/Vapi.Net/Types/FunctionToolProviderDetails.cs b/src/Vapi.Net/Types/FunctionToolProviderDetails.cs index e957d89..363ec5f 100644 --- a/src/Vapi.Net/Types/FunctionToolProviderDetails.cs +++ b/src/Vapi.Net/Types/FunctionToolProviderDetails.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record FunctionToolProviderDetails diff --git a/src/Vapi.Net/Types/FunctionToolWithToolCall.cs b/src/Vapi.Net/Types/FunctionToolWithToolCall.cs index d59492e..4e2afee 100644 --- a/src/Vapi.Net/Types/FunctionToolWithToolCall.cs +++ b/src/Vapi.Net/Types/FunctionToolWithToolCall.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record FunctionToolWithToolCall diff --git a/src/Vapi.Net/Types/Gather.cs b/src/Vapi.Net/Types/Gather.cs index 12ada97..f713f17 100644 --- a/src/Vapi.Net/Types/Gather.cs +++ b/src/Vapi.Net/Types/Gather.cs @@ -1,24 +1,48 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record Gather { - [JsonPropertyName("type")] - public required string Type { get; set; } + [JsonPropertyName("output")] + public required JsonSchema Output { get; set; } + + /// + /// This is whether or not the workflow should read back the gathered data to the user, and ask about its correctness. + /// + [JsonPropertyName("confirmContent")] + public bool? ConfirmContent { get; set; } - [JsonPropertyName("schema")] - public JsonSchema? Schema { get; set; } + /// + /// This is a list of hooks for a task. + /// Each hook is a list of tasks to run on a trigger (such as on start, on failure, etc). + /// Only Say is supported for now. + /// + [JsonPropertyName("hooks")] + public IEnumerable? Hooks { get; set; } - [JsonPropertyName("instruction")] - public required string Instruction { get; set; } + /// + /// This is the number of times we should try to gather the information from the user before we failover to the fail path. An example of this would be a user refusing to give their phone number for privacy reasons, and then going down a different path on account of this + /// + [JsonPropertyName("maxRetries")] + public double? MaxRetries { get; set; } + + /// + /// This is a liquid templating string. On the first call to Gather, the template will be filled out with variables from the context, and will be spoken verbatim to the user. An example would be "Base on your zipcode, it looks like you could be in one of these counties: {{ counties | join: ", " }}. Which one do you live in?" + /// + [JsonPropertyName("literalTemplate")] + public string? LiteralTemplate { get; set; } [JsonPropertyName("name")] public required string Name { get; set; } + /// + /// This is for metadata you want to store on the task. + /// + [JsonPropertyName("metadata")] + public object? Metadata { get; set; } + public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/GcpCredential.cs b/src/Vapi.Net/Types/GcpCredential.cs index cfb472d..0f7c133 100644 --- a/src/Vapi.Net/Types/GcpCredential.cs +++ b/src/Vapi.Net/Types/GcpCredential.cs @@ -1,14 +1,12 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record GcpCredential { [JsonPropertyName("provider")] - public required string Provider { get; set; } + public string Provider { get; set; } = "gcp"; /// /// This is the unique identifier for the credential. diff --git a/src/Vapi.Net/Types/GcpKey.cs b/src/Vapi.Net/Types/GcpKey.cs index 5ecc733..cc5fade 100644 --- a/src/Vapi.Net/Types/GcpKey.cs +++ b/src/Vapi.Net/Types/GcpKey.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record GcpKey diff --git a/src/Vapi.Net/Types/GeminiMultimodalLivePrebuiltVoiceConfig.cs b/src/Vapi.Net/Types/GeminiMultimodalLivePrebuiltVoiceConfig.cs index 211c386..a8c848b 100644 --- a/src/Vapi.Net/Types/GeminiMultimodalLivePrebuiltVoiceConfig.cs +++ b/src/Vapi.Net/Types/GeminiMultimodalLivePrebuiltVoiceConfig.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record GeminiMultimodalLivePrebuiltVoiceConfig diff --git a/src/Vapi.Net/Types/GeminiMultimodalLivePrebuiltVoiceConfigVoiceName.cs b/src/Vapi.Net/Types/GeminiMultimodalLivePrebuiltVoiceConfigVoiceName.cs index e1af413..f9b0c9f 100644 --- a/src/Vapi.Net/Types/GeminiMultimodalLivePrebuiltVoiceConfigVoiceName.cs +++ b/src/Vapi.Net/Types/GeminiMultimodalLivePrebuiltVoiceConfigVoiceName.cs @@ -2,8 +2,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] diff --git a/src/Vapi.Net/Types/GeminiMultimodalLiveSpeechConfig.cs b/src/Vapi.Net/Types/GeminiMultimodalLiveSpeechConfig.cs index 74dd4d9..cfdcc8f 100644 --- a/src/Vapi.Net/Types/GeminiMultimodalLiveSpeechConfig.cs +++ b/src/Vapi.Net/Types/GeminiMultimodalLiveSpeechConfig.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record GeminiMultimodalLiveSpeechConfig diff --git a/src/Vapi.Net/Types/GeminiMultimodalLiveVoiceConfig.cs b/src/Vapi.Net/Types/GeminiMultimodalLiveVoiceConfig.cs index 5c32ebf..1b65d99 100644 --- a/src/Vapi.Net/Types/GeminiMultimodalLiveVoiceConfig.cs +++ b/src/Vapi.Net/Types/GeminiMultimodalLiveVoiceConfig.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record GeminiMultimodalLiveVoiceConfig diff --git a/src/Vapi.Net/Types/GhlTool.cs b/src/Vapi.Net/Types/GhlTool.cs index 5aab26c..d8d2a91 100644 --- a/src/Vapi.Net/Types/GhlTool.cs +++ b/src/Vapi.Net/Types/GhlTool.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record GhlTool diff --git a/src/Vapi.Net/Types/GhlToolMetadata.cs b/src/Vapi.Net/Types/GhlToolMetadata.cs index 5455abe..bf50f66 100644 --- a/src/Vapi.Net/Types/GhlToolMetadata.cs +++ b/src/Vapi.Net/Types/GhlToolMetadata.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record GhlToolMetadata diff --git a/src/Vapi.Net/Types/GhlToolProviderDetails.cs b/src/Vapi.Net/Types/GhlToolProviderDetails.cs index 9c1e0fe..43cb647 100644 --- a/src/Vapi.Net/Types/GhlToolProviderDetails.cs +++ b/src/Vapi.Net/Types/GhlToolProviderDetails.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record GhlToolProviderDetails diff --git a/src/Vapi.Net/Types/GhlToolWithToolCall.cs b/src/Vapi.Net/Types/GhlToolWithToolCall.cs index 4f42981..596ee0d 100644 --- a/src/Vapi.Net/Types/GhlToolWithToolCall.cs +++ b/src/Vapi.Net/Types/GhlToolWithToolCall.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record GhlToolWithToolCall diff --git a/src/Vapi.Net/Types/GladiaCredential.cs b/src/Vapi.Net/Types/GladiaCredential.cs index 41cbfaf..fc4f316 100644 --- a/src/Vapi.Net/Types/GladiaCredential.cs +++ b/src/Vapi.Net/Types/GladiaCredential.cs @@ -1,14 +1,12 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record GladiaCredential { [JsonPropertyName("provider")] - public required string Provider { get; set; } + public string Provider { get; set; } = "gladia"; /// /// This is not returned in the API. diff --git a/src/Vapi.Net/Types/GladiaTranscriber.cs b/src/Vapi.Net/Types/GladiaTranscriber.cs index f229167..0f1527c 100644 --- a/src/Vapi.Net/Types/GladiaTranscriber.cs +++ b/src/Vapi.Net/Types/GladiaTranscriber.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record GladiaTranscriber diff --git a/src/Vapi.Net/Types/GladiaTranscriberLanguage.cs b/src/Vapi.Net/Types/GladiaTranscriberLanguage.cs index ac9cbe7..c76c61a 100644 --- a/src/Vapi.Net/Types/GladiaTranscriberLanguage.cs +++ b/src/Vapi.Net/Types/GladiaTranscriberLanguage.cs @@ -2,8 +2,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] diff --git a/src/Vapi.Net/Types/GladiaTranscriberLanguageBehaviour.cs b/src/Vapi.Net/Types/GladiaTranscriberLanguageBehaviour.cs index c374251..4e59dc8 100644 --- a/src/Vapi.Net/Types/GladiaTranscriberLanguageBehaviour.cs +++ b/src/Vapi.Net/Types/GladiaTranscriberLanguageBehaviour.cs @@ -2,8 +2,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] diff --git a/src/Vapi.Net/Types/GladiaTranscriberModel.cs b/src/Vapi.Net/Types/GladiaTranscriberModel.cs index e16054b..41ac27d 100644 --- a/src/Vapi.Net/Types/GladiaTranscriberModel.cs +++ b/src/Vapi.Net/Types/GladiaTranscriberModel.cs @@ -2,8 +2,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] diff --git a/src/Vapi.Net/Types/GoHighLevelCredential.cs b/src/Vapi.Net/Types/GoHighLevelCredential.cs index 4796efb..414655c 100644 --- a/src/Vapi.Net/Types/GoHighLevelCredential.cs +++ b/src/Vapi.Net/Types/GoHighLevelCredential.cs @@ -1,14 +1,12 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record GoHighLevelCredential { [JsonPropertyName("provider")] - public required string Provider { get; set; } + public string Provider { get; set; } = "gohighlevel"; /// /// This is not returned in the API. diff --git a/src/Vapi.Net/Types/GoogleCredential.cs b/src/Vapi.Net/Types/GoogleCredential.cs index 58f2f73..c5751af 100644 --- a/src/Vapi.Net/Types/GoogleCredential.cs +++ b/src/Vapi.Net/Types/GoogleCredential.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record GoogleCredential @@ -11,7 +9,7 @@ public record GoogleCredential /// This is the key for Gemini in Google AI Studio. Get it from here: https://aistudio.google.com/app/apikey /// [JsonPropertyName("provider")] - public required string Provider { get; set; } + public string Provider { get; set; } = "google"; /// /// This is not returned in the API. diff --git a/src/Vapi.Net/Types/GoogleModel.cs b/src/Vapi.Net/Types/GoogleModel.cs index ed273c1..2a80acd 100644 --- a/src/Vapi.Net/Types/GoogleModel.cs +++ b/src/Vapi.Net/Types/GoogleModel.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record GoogleModel diff --git a/src/Vapi.Net/Types/GoogleModelModel.cs b/src/Vapi.Net/Types/GoogleModelModel.cs index b8961c9..f93e652 100644 --- a/src/Vapi.Net/Types/GoogleModelModel.cs +++ b/src/Vapi.Net/Types/GoogleModelModel.cs @@ -2,13 +2,23 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] public enum GoogleModelModel { + [EnumMember(Value = "gemini-2.0-flash-thinking-exp")] + Gemini20FlashThinkingExp, + + [EnumMember(Value = "gemini-2.0-pro-exp-02-05")] + Gemini20ProExp0205, + + [EnumMember(Value = "gemini-2.0-flash")] + Gemini20Flash, + + [EnumMember(Value = "gemini-2.0-flash-lite-preview-02-05")] + Gemini20FlashLitePreview0205, + [EnumMember(Value = "gemini-2.0-flash-exp")] Gemini20FlashExp, diff --git a/src/Vapi.Net/Types/GoogleRealtimeConfig.cs b/src/Vapi.Net/Types/GoogleRealtimeConfig.cs index ebfad4b..e1315ba 100644 --- a/src/Vapi.Net/Types/GoogleRealtimeConfig.cs +++ b/src/Vapi.Net/Types/GoogleRealtimeConfig.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record GoogleRealtimeConfig diff --git a/src/Vapi.Net/Types/GroqCredential.cs b/src/Vapi.Net/Types/GroqCredential.cs index 3021135..75e7a17 100644 --- a/src/Vapi.Net/Types/GroqCredential.cs +++ b/src/Vapi.Net/Types/GroqCredential.cs @@ -1,14 +1,12 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record GroqCredential { [JsonPropertyName("provider")] - public required string Provider { get; set; } + public string Provider { get; set; } = "groq"; /// /// This is not returned in the API. diff --git a/src/Vapi.Net/Types/GroqModel.cs b/src/Vapi.Net/Types/GroqModel.cs index 7b1bf23..9b10ce1 100644 --- a/src/Vapi.Net/Types/GroqModel.cs +++ b/src/Vapi.Net/Types/GroqModel.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record GroqModel diff --git a/src/Vapi.Net/Types/GroqModelModel.cs b/src/Vapi.Net/Types/GroqModelModel.cs index 7e4d8a5..b85ef33 100644 --- a/src/Vapi.Net/Types/GroqModelModel.cs +++ b/src/Vapi.Net/Types/GroqModelModel.cs @@ -2,13 +2,14 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] public enum GroqModelModel { + [EnumMember(Value = "deepseek-r1-distill-llama-70b")] + DeepseekR1DistillLlama70B, + [EnumMember(Value = "llama-3.3-70b-versatile")] Llama3370BVersatile, diff --git a/src/Vapi.Net/Types/HandoffStep.cs b/src/Vapi.Net/Types/HandoffStep.cs index d794b5f..58bfb99 100644 --- a/src/Vapi.Net/Types/HandoffStep.cs +++ b/src/Vapi.Net/Types/HandoffStep.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record HandoffStep diff --git a/src/Vapi.Net/Types/Hangup.cs b/src/Vapi.Net/Types/Hangup.cs new file mode 100644 index 0000000..a309e48 --- /dev/null +++ b/src/Vapi.Net/Types/Hangup.cs @@ -0,0 +1,21 @@ +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record Hangup +{ + [JsonPropertyName("name")] + public required string Name { get; set; } + + /// + /// This is for metadata you want to store on the task. + /// + [JsonPropertyName("metadata")] + public object? Metadata { get; set; } + + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/Hook.cs b/src/Vapi.Net/Types/Hook.cs new file mode 100644 index 0000000..1fada66 --- /dev/null +++ b/src/Vapi.Net/Types/Hook.cs @@ -0,0 +1,18 @@ +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record Hook +{ + [JsonPropertyName("on")] + public required HookOn On { get; set; } + + [JsonPropertyName("do")] + public IEnumerable Do { get; set; } = new List(); + + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/HookOn.cs b/src/Vapi.Net/Types/HookOn.cs new file mode 100644 index 0000000..edcdae2 --- /dev/null +++ b/src/Vapi.Net/Types/HookOn.cs @@ -0,0 +1,18 @@ +using System.Runtime.Serialization; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[JsonConverter(typeof(EnumSerializer))] +public enum HookOn +{ + [EnumMember(Value = "task.start")] + TaskStart, + + [EnumMember(Value = "task.output.confirmation")] + TaskOutputConfirmation, + + [EnumMember(Value = "task.delayed")] + TaskDelayed, +} diff --git a/src/Vapi.Net/Types/ImportTwilioPhoneNumberDto.cs b/src/Vapi.Net/Types/ImportTwilioPhoneNumberDto.cs index ebcad34..5a9c23d 100644 --- a/src/Vapi.Net/Types/ImportTwilioPhoneNumberDto.cs +++ b/src/Vapi.Net/Types/ImportTwilioPhoneNumberDto.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record ImportTwilioPhoneNumberDto diff --git a/src/Vapi.Net/Types/ImportVonagePhoneNumberDto.cs b/src/Vapi.Net/Types/ImportVonagePhoneNumberDto.cs index f43b62a..ce3d6c7 100644 --- a/src/Vapi.Net/Types/ImportVonagePhoneNumberDto.cs +++ b/src/Vapi.Net/Types/ImportVonagePhoneNumberDto.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record ImportVonagePhoneNumberDto diff --git a/src/Vapi.Net/Types/InflectionAiCredential.cs b/src/Vapi.Net/Types/InflectionAiCredential.cs index fb8eeb8..bd114e1 100644 --- a/src/Vapi.Net/Types/InflectionAiCredential.cs +++ b/src/Vapi.Net/Types/InflectionAiCredential.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record InflectionAiCredential @@ -11,7 +9,7 @@ public record InflectionAiCredential /// This is the api key for Pi in InflectionAI's console. Get it from here: https://developers.inflection.ai/keys, billing will need to be setup /// [JsonPropertyName("provider")] - public required string Provider { get; set; } + public string Provider { get; set; } = "inflection-ai"; /// /// This is not returned in the API. diff --git a/src/Vapi.Net/Types/InflectionAiModel.cs b/src/Vapi.Net/Types/InflectionAiModel.cs index 23b9176..b0dab8c 100644 --- a/src/Vapi.Net/Types/InflectionAiModel.cs +++ b/src/Vapi.Net/Types/InflectionAiModel.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record InflectionAiModel @@ -45,7 +43,7 @@ public record InflectionAiModel /// This is the name of the model. Ex. cognitivecomputations/dolphin-mixtral-8x7b /// [JsonPropertyName("model")] - public required string Model { get; set; } + public string Model { get; set; } = "inflection_3_pi"; /// /// This is the temperature that will be used for calls. Default is 0 to leverage caching for lower latency. diff --git a/src/Vapi.Net/Types/InviteUserDto.cs b/src/Vapi.Net/Types/InviteUserDto.cs index 30fd1ad..5d34539 100644 --- a/src/Vapi.Net/Types/InviteUserDto.cs +++ b/src/Vapi.Net/Types/InviteUserDto.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record InviteUserDto @@ -13,6 +11,9 @@ public record InviteUserDto [JsonPropertyName("role")] public required InviteUserDtoRole Role { get; set; } + [JsonPropertyName("redirectTo")] + public string? RedirectTo { get; set; } + public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/InviteUserDtoRole.cs b/src/Vapi.Net/Types/InviteUserDtoRole.cs index 1ba3dfb..89da852 100644 --- a/src/Vapi.Net/Types/InviteUserDtoRole.cs +++ b/src/Vapi.Net/Types/InviteUserDtoRole.cs @@ -2,8 +2,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] diff --git a/src/Vapi.Net/Types/JsonSchema.cs b/src/Vapi.Net/Types/JsonSchema.cs index 75f8dba..a70c9c7 100644 --- a/src/Vapi.Net/Types/JsonSchema.cs +++ b/src/Vapi.Net/Types/JsonSchema.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record JsonSchema @@ -51,6 +49,24 @@ public record JsonSchema [JsonPropertyName("required")] public IEnumerable? Required { get; set; } + /// + /// This is a regex that will be used to validate data in question. + /// + [JsonPropertyName("regex")] + public string? Regex { get; set; } + + /// + /// This the value that will be used in filling the property. + /// + [JsonPropertyName("value")] + public string? Value { get; set; } + + /// + /// This the target variable that will be filled with the value of this property. + /// + [JsonPropertyName("target")] + public string? Target { get; set; } + /// /// This array specifies the allowed values that can be used to restrict the output of the model. /// diff --git a/src/Vapi.Net/Types/JsonSchemaType.cs b/src/Vapi.Net/Types/JsonSchemaType.cs index 0beb963..dd27aee 100644 --- a/src/Vapi.Net/Types/JsonSchemaType.cs +++ b/src/Vapi.Net/Types/JsonSchemaType.cs @@ -2,8 +2,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] diff --git a/src/Vapi.Net/Types/KnowledgeBaseResponseDocument.cs b/src/Vapi.Net/Types/KnowledgeBaseResponseDocument.cs index 6d30197..73e2075 100644 --- a/src/Vapi.Net/Types/KnowledgeBaseResponseDocument.cs +++ b/src/Vapi.Net/Types/KnowledgeBaseResponseDocument.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record KnowledgeBaseResponseDocument diff --git a/src/Vapi.Net/Types/LangfuseCredential.cs b/src/Vapi.Net/Types/LangfuseCredential.cs index 9074569..a2d24a7 100644 --- a/src/Vapi.Net/Types/LangfuseCredential.cs +++ b/src/Vapi.Net/Types/LangfuseCredential.cs @@ -1,14 +1,12 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record LangfuseCredential { [JsonPropertyName("provider")] - public required string Provider { get; set; } + public string Provider { get; set; } = "langfuse"; /// /// The public key for Langfuse project. Eg: pk-lf-... diff --git a/src/Vapi.Net/Types/LmntCredential.cs b/src/Vapi.Net/Types/LmntCredential.cs index c93dc0a..85dfeb2 100644 --- a/src/Vapi.Net/Types/LmntCredential.cs +++ b/src/Vapi.Net/Types/LmntCredential.cs @@ -1,14 +1,12 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record LmntCredential { [JsonPropertyName("provider")] - public required string Provider { get; set; } + public string Provider { get; set; } = "lmnt"; /// /// This is not returned in the API. diff --git a/src/Vapi.Net/Types/LmntVoice.cs b/src/Vapi.Net/Types/LmntVoice.cs index 286307a..383b1b0 100644 --- a/src/Vapi.Net/Types/LmntVoice.cs +++ b/src/Vapi.Net/Types/LmntVoice.cs @@ -2,8 +2,6 @@ using OneOf; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record LmntVoice diff --git a/src/Vapi.Net/Types/LmntVoiceIdEnum.cs b/src/Vapi.Net/Types/LmntVoiceIdEnum.cs index a017947..befe183 100644 --- a/src/Vapi.Net/Types/LmntVoiceIdEnum.cs +++ b/src/Vapi.Net/Types/LmntVoiceIdEnum.cs @@ -2,8 +2,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] diff --git a/src/Vapi.Net/Types/Log.cs b/src/Vapi.Net/Types/Log.cs index 1def327..e87fd28 100644 --- a/src/Vapi.Net/Types/Log.cs +++ b/src/Vapi.Net/Types/Log.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record Log diff --git a/src/Vapi.Net/Types/LogRequestHttpMethod.cs b/src/Vapi.Net/Types/LogRequestHttpMethod.cs index 6c3e93f..da60f96 100644 --- a/src/Vapi.Net/Types/LogRequestHttpMethod.cs +++ b/src/Vapi.Net/Types/LogRequestHttpMethod.cs @@ -2,8 +2,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] diff --git a/src/Vapi.Net/Types/LogResource.cs b/src/Vapi.Net/Types/LogResource.cs index 07a48e9..68bef93 100644 --- a/src/Vapi.Net/Types/LogResource.cs +++ b/src/Vapi.Net/Types/LogResource.cs @@ -2,8 +2,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] diff --git a/src/Vapi.Net/Types/LogType.cs b/src/Vapi.Net/Types/LogType.cs index f69f861..2b6ab96 100644 --- a/src/Vapi.Net/Types/LogType.cs +++ b/src/Vapi.Net/Types/LogType.cs @@ -2,8 +2,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] diff --git a/src/Vapi.Net/Types/ProgrammaticEdgeCondition.cs b/src/Vapi.Net/Types/LogicEdgeCondition.cs similarity index 53% rename from src/Vapi.Net/Types/ProgrammaticEdgeCondition.cs rename to src/Vapi.Net/Types/LogicEdgeCondition.cs index 35e5aa1..6f51997 100644 --- a/src/Vapi.Net/Types/ProgrammaticEdgeCondition.cs +++ b/src/Vapi.Net/Types/LogicEdgeCondition.cs @@ -1,14 +1,12 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; -public record ProgrammaticEdgeCondition +public record LogicEdgeCondition { - [JsonPropertyName("booleanExpression")] - public string? BooleanExpression { get; set; } + [JsonPropertyName("liquid")] + public required string Liquid { get; set; } public override string ToString() { diff --git a/src/Vapi.Net/Types/LogsPaginatedResponse.cs b/src/Vapi.Net/Types/LogsPaginatedResponse.cs index 6f5946e..a978e7d 100644 --- a/src/Vapi.Net/Types/LogsPaginatedResponse.cs +++ b/src/Vapi.Net/Types/LogsPaginatedResponse.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record LogsPaginatedResponse diff --git a/src/Vapi.Net/Types/MakeCredential.cs b/src/Vapi.Net/Types/MakeCredential.cs index 0bcc0ae..3fd66ad 100644 --- a/src/Vapi.Net/Types/MakeCredential.cs +++ b/src/Vapi.Net/Types/MakeCredential.cs @@ -1,14 +1,12 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record MakeCredential { [JsonPropertyName("provider")] - public required string Provider { get; set; } + public string Provider { get; set; } = "make"; /// /// Team ID diff --git a/src/Vapi.Net/Types/MakeTool.cs b/src/Vapi.Net/Types/MakeTool.cs index 286eb21..a570731 100644 --- a/src/Vapi.Net/Types/MakeTool.cs +++ b/src/Vapi.Net/Types/MakeTool.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record MakeTool diff --git a/src/Vapi.Net/Types/MakeToolMetadata.cs b/src/Vapi.Net/Types/MakeToolMetadata.cs index 7f1fb9b..e7a2420 100644 --- a/src/Vapi.Net/Types/MakeToolMetadata.cs +++ b/src/Vapi.Net/Types/MakeToolMetadata.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record MakeToolMetadata diff --git a/src/Vapi.Net/Types/MakeToolProviderDetails.cs b/src/Vapi.Net/Types/MakeToolProviderDetails.cs index 353d6f2..1ccc87e 100644 --- a/src/Vapi.Net/Types/MakeToolProviderDetails.cs +++ b/src/Vapi.Net/Types/MakeToolProviderDetails.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record MakeToolProviderDetails diff --git a/src/Vapi.Net/Types/MakeToolWithToolCall.cs b/src/Vapi.Net/Types/MakeToolWithToolCall.cs index 5f40b4c..24227d8 100644 --- a/src/Vapi.Net/Types/MakeToolWithToolCall.cs +++ b/src/Vapi.Net/Types/MakeToolWithToolCall.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record MakeToolWithToolCall diff --git a/src/Vapi.Net/Types/MessagePlan.cs b/src/Vapi.Net/Types/MessagePlan.cs index c33b55a..b5a3bec 100644 --- a/src/Vapi.Net/Types/MessagePlan.cs +++ b/src/Vapi.Net/Types/MessagePlan.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record MessagePlan @@ -35,6 +33,14 @@ public record MessagePlan [JsonPropertyName("idleTimeoutSeconds")] public double? IdleTimeoutSeconds { get; set; } + /// + /// This is the message that the assistant will say if the call ends due to silence. + /// + /// If unspecified, it will hang up without saying anything. + /// + [JsonPropertyName("silenceTimeoutMessage")] + public string? SilenceTimeoutMessage { get; set; } + public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/Metrics.cs b/src/Vapi.Net/Types/Metrics.cs index 7868758..d2a4d87 100644 --- a/src/Vapi.Net/Types/Metrics.cs +++ b/src/Vapi.Net/Types/Metrics.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record Metrics diff --git a/src/Vapi.Net/Types/ModelBasedCondition.cs b/src/Vapi.Net/Types/ModelBasedCondition.cs index 273b2b5..2ff6911 100644 --- a/src/Vapi.Net/Types/ModelBasedCondition.cs +++ b/src/Vapi.Net/Types/ModelBasedCondition.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record ModelBasedCondition diff --git a/src/Vapi.Net/Types/ModelCost.cs b/src/Vapi.Net/Types/ModelCost.cs index 6296bd8..7020467 100644 --- a/src/Vapi.Net/Types/ModelCost.cs +++ b/src/Vapi.Net/Types/ModelCost.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record ModelCost diff --git a/src/Vapi.Net/Types/Monitor.cs b/src/Vapi.Net/Types/Monitor.cs index 48dd9e0..584de46 100644 --- a/src/Vapi.Net/Types/Monitor.cs +++ b/src/Vapi.Net/Types/Monitor.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record Monitor diff --git a/src/Vapi.Net/Types/MonitorPlan.cs b/src/Vapi.Net/Types/MonitorPlan.cs index a04dcce..45501d6 100644 --- a/src/Vapi.Net/Types/MonitorPlan.cs +++ b/src/Vapi.Net/Types/MonitorPlan.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record MonitorPlan diff --git a/src/Vapi.Net/Types/NeetsVoice.cs b/src/Vapi.Net/Types/NeetsVoice.cs index 447fc58..06c8aa4 100644 --- a/src/Vapi.Net/Types/NeetsVoice.cs +++ b/src/Vapi.Net/Types/NeetsVoice.cs @@ -2,8 +2,6 @@ using OneOf; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record NeetsVoice diff --git a/src/Vapi.Net/Types/NeetsVoiceIdEnum.cs b/src/Vapi.Net/Types/NeetsVoiceIdEnum.cs index 316d03a..bdbc791 100644 --- a/src/Vapi.Net/Types/NeetsVoiceIdEnum.cs +++ b/src/Vapi.Net/Types/NeetsVoiceIdEnum.cs @@ -2,8 +2,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] diff --git a/src/Vapi.Net/Types/OAuth2AuthenticationPlan.cs b/src/Vapi.Net/Types/OAuth2AuthenticationPlan.cs index 713f7dc..99345bf 100644 --- a/src/Vapi.Net/Types/OAuth2AuthenticationPlan.cs +++ b/src/Vapi.Net/Types/OAuth2AuthenticationPlan.cs @@ -1,14 +1,12 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record OAuth2AuthenticationPlan { [JsonPropertyName("type")] - public required string Type { get; set; } + public string Type { get; set; } = "oauth2"; /// /// This is the OAuth2 URL. diff --git a/src/Vapi.Net/Types/Oauth2AuthenticationSession.cs b/src/Vapi.Net/Types/Oauth2AuthenticationSession.cs index 925e8b0..63f0d40 100644 --- a/src/Vapi.Net/Types/Oauth2AuthenticationSession.cs +++ b/src/Vapi.Net/Types/Oauth2AuthenticationSession.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record Oauth2AuthenticationSession diff --git a/src/Vapi.Net/Types/OpenAiCredential.cs b/src/Vapi.Net/Types/OpenAiCredential.cs index 3757b9a..6683ec7 100644 --- a/src/Vapi.Net/Types/OpenAiCredential.cs +++ b/src/Vapi.Net/Types/OpenAiCredential.cs @@ -1,14 +1,12 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record OpenAiCredential { [JsonPropertyName("provider")] - public required string Provider { get; set; } + public string Provider { get; set; } = "openai"; /// /// This is not returned in the API. diff --git a/src/Vapi.Net/Types/OpenAiFunction.cs b/src/Vapi.Net/Types/OpenAiFunction.cs index 7da5685..efb5432 100644 --- a/src/Vapi.Net/Types/OpenAiFunction.cs +++ b/src/Vapi.Net/Types/OpenAiFunction.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record OpenAiFunction diff --git a/src/Vapi.Net/Types/OpenAiFunctionParameters.cs b/src/Vapi.Net/Types/OpenAiFunctionParameters.cs index 5f05d35..55198c7 100644 --- a/src/Vapi.Net/Types/OpenAiFunctionParameters.cs +++ b/src/Vapi.Net/Types/OpenAiFunctionParameters.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record OpenAiFunctionParameters @@ -11,7 +9,7 @@ public record OpenAiFunctionParameters /// This must be set to 'object'. It instructs the model to return a JSON object containing the function call properties. /// [JsonPropertyName("type")] - public required string Type { get; set; } + public string Type { get; set; } = "object"; /// /// This provides a description of the properties required by the function. diff --git a/src/Vapi.Net/Types/OpenAiMessage.cs b/src/Vapi.Net/Types/OpenAiMessage.cs index f4d60e6..bee7d3e 100644 --- a/src/Vapi.Net/Types/OpenAiMessage.cs +++ b/src/Vapi.Net/Types/OpenAiMessage.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record OpenAiMessage diff --git a/src/Vapi.Net/Types/OpenAiMessageRole.cs b/src/Vapi.Net/Types/OpenAiMessageRole.cs index fb257f1..e5122e7 100644 --- a/src/Vapi.Net/Types/OpenAiMessageRole.cs +++ b/src/Vapi.Net/Types/OpenAiMessageRole.cs @@ -2,8 +2,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] diff --git a/src/Vapi.Net/Types/OpenAiModel.cs b/src/Vapi.Net/Types/OpenAiModel.cs index 301a553..db97e2f 100644 --- a/src/Vapi.Net/Types/OpenAiModel.cs +++ b/src/Vapi.Net/Types/OpenAiModel.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record OpenAiModel @@ -53,9 +51,6 @@ public record OpenAiModel [JsonPropertyName("fallbackModels")] public IEnumerable? FallbackModels { get; set; } - [JsonPropertyName("semanticCachingEnabled")] - public bool? SemanticCachingEnabled { get; set; } - /// /// This is the temperature that will be used for calls. Default is 0 to leverage caching for lower latency. /// diff --git a/src/Vapi.Net/Types/OpenAiModelFallbackModelsItem.cs b/src/Vapi.Net/Types/OpenAiModelFallbackModelsItem.cs index e48e22d..12c6df0 100644 --- a/src/Vapi.Net/Types/OpenAiModelFallbackModelsItem.cs +++ b/src/Vapi.Net/Types/OpenAiModelFallbackModelsItem.cs @@ -2,13 +2,17 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] public enum OpenAiModelFallbackModelsItem { + [EnumMember(Value = "chatgpt-4o-latest")] + Chatgpt4OLatest, + + [EnumMember(Value = "o3-mini")] + O3Mini, + [EnumMember(Value = "o1-preview")] O1Preview, diff --git a/src/Vapi.Net/Types/OpenAiModelModel.cs b/src/Vapi.Net/Types/OpenAiModelModel.cs index 909496c..87618cc 100644 --- a/src/Vapi.Net/Types/OpenAiModelModel.cs +++ b/src/Vapi.Net/Types/OpenAiModelModel.cs @@ -2,13 +2,17 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] public enum OpenAiModelModel { + [EnumMember(Value = "chatgpt-4o-latest")] + Chatgpt4OLatest, + + [EnumMember(Value = "o3-mini")] + O3Mini, + [EnumMember(Value = "o1-preview")] O1Preview, diff --git a/src/Vapi.Net/Types/OpenAiVoice.cs b/src/Vapi.Net/Types/OpenAiVoice.cs index 96fe48b..c7dc260 100644 --- a/src/Vapi.Net/Types/OpenAiVoice.cs +++ b/src/Vapi.Net/Types/OpenAiVoice.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record OpenAiVoice diff --git a/src/Vapi.Net/Types/OpenAiVoiceId.cs b/src/Vapi.Net/Types/OpenAiVoiceId.cs index 30501ec..7e0f044 100644 --- a/src/Vapi.Net/Types/OpenAiVoiceId.cs +++ b/src/Vapi.Net/Types/OpenAiVoiceId.cs @@ -2,8 +2,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] diff --git a/src/Vapi.Net/Types/OpenRouterCredential.cs b/src/Vapi.Net/Types/OpenRouterCredential.cs index 30ab03b..82974fd 100644 --- a/src/Vapi.Net/Types/OpenRouterCredential.cs +++ b/src/Vapi.Net/Types/OpenRouterCredential.cs @@ -1,14 +1,12 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record OpenRouterCredential { [JsonPropertyName("provider")] - public required string Provider { get; set; } + public string Provider { get; set; } = "openrouter"; /// /// This is not returned in the API. diff --git a/src/Vapi.Net/Types/OpenRouterModel.cs b/src/Vapi.Net/Types/OpenRouterModel.cs index 729571a..5f6faac 100644 --- a/src/Vapi.Net/Types/OpenRouterModel.cs +++ b/src/Vapi.Net/Types/OpenRouterModel.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record OpenRouterModel diff --git a/src/Vapi.Net/Types/Org.cs b/src/Vapi.Net/Types/Org.cs index 13df7a1..676abe8 100644 --- a/src/Vapi.Net/Types/Org.cs +++ b/src/Vapi.Net/Types/Org.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record Org diff --git a/src/Vapi.Net/Types/OrgChannel.cs b/src/Vapi.Net/Types/OrgChannel.cs index 12e24f5..236bc8c 100644 --- a/src/Vapi.Net/Types/OrgChannel.cs +++ b/src/Vapi.Net/Types/OrgChannel.cs @@ -2,8 +2,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] diff --git a/src/Vapi.Net/Types/OrgPlan.cs b/src/Vapi.Net/Types/OrgPlan.cs index f6d7747..84c6549 100644 --- a/src/Vapi.Net/Types/OrgPlan.cs +++ b/src/Vapi.Net/Types/OrgPlan.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record OrgPlan diff --git a/src/Vapi.Net/Types/OrgWithOrgUser.cs b/src/Vapi.Net/Types/OrgWithOrgUser.cs deleted file mode 100644 index c1765e3..0000000 --- a/src/Vapi.Net/Types/OrgWithOrgUser.cs +++ /dev/null @@ -1,127 +0,0 @@ -using System.Text.Json.Serialization; -using Vapi.Net.Core; - -#nullable enable - -namespace Vapi.Net; - -public record OrgWithOrgUser -{ - /// - /// When this is enabled, no logs, recordings, or transcriptions will be stored. At the end of the call, you will still receive an end-of-call-report message to store on your server. Defaults to false. - /// When HIPAA is enabled, only OpenAI/Custom LLM or Azure Providers will be available for LLM and Voice respectively. - /// This is due to the compliance requirements of HIPAA. Other providers may not meet these requirements. - /// - [JsonPropertyName("hipaaEnabled")] - public bool? HipaaEnabled { get; set; } - - [JsonPropertyName("subscription")] - public Subscription? Subscription { get; set; } - - /// - /// This is the ID of the subscription the org belongs to. - /// - [JsonPropertyName("subscriptionId")] - public string? SubscriptionId { get; set; } - - /// - /// This is the unique identifier for the org. - /// - [JsonPropertyName("id")] - public required string Id { get; set; } - - /// - /// This is the ISO 8601 date-time string of when the org was created. - /// - [JsonPropertyName("createdAt")] - public required DateTime CreatedAt { get; set; } - - /// - /// This is the ISO 8601 date-time string of when the org was last updated. - /// - [JsonPropertyName("updatedAt")] - public required DateTime UpdatedAt { get; set; } - - /// - /// This is the Stripe customer for the org. - /// - [JsonPropertyName("stripeCustomerId")] - public string? StripeCustomerId { get; set; } - - /// - /// This is the subscription for the org. - /// - [JsonPropertyName("stripeSubscriptionId")] - public string? StripeSubscriptionId { get; set; } - - /// - /// This is the subscription's subscription item. - /// - [JsonPropertyName("stripeSubscriptionItemId")] - public string? StripeSubscriptionItemId { get; set; } - - /// - /// This is the subscription's current period start. - /// - [JsonPropertyName("stripeSubscriptionCurrentPeriodStart")] - public DateTime? StripeSubscriptionCurrentPeriodStart { get; set; } - - /// - /// This is the subscription's status. - /// - [JsonPropertyName("stripeSubscriptionStatus")] - public string? StripeSubscriptionStatus { get; set; } - - /// - /// This is the plan for the org. - /// - [JsonPropertyName("plan")] - public OrgPlan? Plan { get; set; } - - /// - /// This is the name of the org. This is just for your own reference. - /// - [JsonPropertyName("name")] - public string? Name { get; set; } - - /// - /// This is the channel of the org. There is the cluster the API traffic for the org will be directed. - /// - [JsonPropertyName("channel")] - public OrgWithOrgUserChannel? Channel { get; set; } - - /// - /// This is the monthly billing limit for the org. To go beyond $1000/mo, please contact us at support@vapi.ai. - /// - [JsonPropertyName("billingLimit")] - public double? BillingLimit { get; set; } - - /// - /// This is where Vapi will send webhooks. You can find all webhooks available along with their shape in ServerMessage schema. - /// - /// The order of precedence is: - /// - /// 1. assistant.server - /// 2. phoneNumber.server - /// 3. org.server - /// - [JsonPropertyName("server")] - public Server? Server { get; set; } - - /// - /// This is the concurrency limit for the org. This is the maximum number of calls that can be active at any given time. To go beyond 10, please contact us at support@vapi.ai. - /// - [JsonPropertyName("concurrencyLimit")] - public double? ConcurrencyLimit { get; set; } - - [JsonPropertyName("invitedByUserId")] - public string? InvitedByUserId { get; set; } - - [JsonPropertyName("role")] - public OrgWithOrgUserRole? Role { get; set; } - - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Vapi.Net/Types/OrgWithOrgUserChannel.cs b/src/Vapi.Net/Types/OrgWithOrgUserChannel.cs deleted file mode 100644 index 6580df4..0000000 --- a/src/Vapi.Net/Types/OrgWithOrgUserChannel.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using Vapi.Net.Core; - -#nullable enable - -namespace Vapi.Net; - -[JsonConverter(typeof(EnumSerializer))] -public enum OrgWithOrgUserChannel -{ - [EnumMember(Value = "default")] - Default, - - [EnumMember(Value = "weekly")] - Weekly, -} diff --git a/src/Vapi.Net/Types/OrgWithOrgUserRole.cs b/src/Vapi.Net/Types/OrgWithOrgUserRole.cs deleted file mode 100644 index 2b8045c..0000000 --- a/src/Vapi.Net/Types/OrgWithOrgUserRole.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using Vapi.Net.Core; - -#nullable enable - -namespace Vapi.Net; - -[JsonConverter(typeof(EnumSerializer))] -public enum OrgWithOrgUserRole -{ - [EnumMember(Value = "admin")] - Admin, - - [EnumMember(Value = "editor")] - Editor, - - [EnumMember(Value = "viewer")] - Viewer, -} diff --git a/src/Vapi.Net/Types/OutputTool.cs b/src/Vapi.Net/Types/OutputTool.cs index e6caced..6c52246 100644 --- a/src/Vapi.Net/Types/OutputTool.cs +++ b/src/Vapi.Net/Types/OutputTool.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record OutputTool diff --git a/src/Vapi.Net/Types/PaginationMeta.cs b/src/Vapi.Net/Types/PaginationMeta.cs index 7e394df..1413435 100644 --- a/src/Vapi.Net/Types/PaginationMeta.cs +++ b/src/Vapi.Net/Types/PaginationMeta.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record PaginationMeta diff --git a/src/Vapi.Net/Types/PerplexityAiCredential.cs b/src/Vapi.Net/Types/PerplexityAiCredential.cs index a217fcc..c6a8d0e 100644 --- a/src/Vapi.Net/Types/PerplexityAiCredential.cs +++ b/src/Vapi.Net/Types/PerplexityAiCredential.cs @@ -1,14 +1,12 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record PerplexityAiCredential { [JsonPropertyName("provider")] - public required string Provider { get; set; } + public string Provider { get; set; } = "perplexity-ai"; /// /// This is not returned in the API. diff --git a/src/Vapi.Net/Types/PerplexityAiModel.cs b/src/Vapi.Net/Types/PerplexityAiModel.cs index 46ba1f7..948196c 100644 --- a/src/Vapi.Net/Types/PerplexityAiModel.cs +++ b/src/Vapi.Net/Types/PerplexityAiModel.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record PerplexityAiModel diff --git a/src/Vapi.Net/Types/PhoneNumberPaginatedResponse.cs b/src/Vapi.Net/Types/PhoneNumberPaginatedResponse.cs index 6980766..1f1f522 100644 --- a/src/Vapi.Net/Types/PhoneNumberPaginatedResponse.cs +++ b/src/Vapi.Net/Types/PhoneNumberPaginatedResponse.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record PhoneNumberPaginatedResponse diff --git a/src/Vapi.Net/Types/PlayHtCredential.cs b/src/Vapi.Net/Types/PlayHtCredential.cs index 1b215d0..c929440 100644 --- a/src/Vapi.Net/Types/PlayHtCredential.cs +++ b/src/Vapi.Net/Types/PlayHtCredential.cs @@ -1,14 +1,12 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record PlayHtCredential { [JsonPropertyName("provider")] - public required string Provider { get; set; } + public string Provider { get; set; } = "playht"; /// /// This is not returned in the API. diff --git a/src/Vapi.Net/Types/PlayHtVoice.cs b/src/Vapi.Net/Types/PlayHtVoice.cs index bbce0df..8e561fc 100644 --- a/src/Vapi.Net/Types/PlayHtVoice.cs +++ b/src/Vapi.Net/Types/PlayHtVoice.cs @@ -2,8 +2,6 @@ using OneOf; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record PlayHtVoice diff --git a/src/Vapi.Net/Types/PlayHtVoiceEmotion.cs b/src/Vapi.Net/Types/PlayHtVoiceEmotion.cs index 0760288..88b0e72 100644 --- a/src/Vapi.Net/Types/PlayHtVoiceEmotion.cs +++ b/src/Vapi.Net/Types/PlayHtVoiceEmotion.cs @@ -2,8 +2,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] diff --git a/src/Vapi.Net/Types/PlayHtVoiceIdEnum.cs b/src/Vapi.Net/Types/PlayHtVoiceIdEnum.cs index c3c76b8..9e26f49 100644 --- a/src/Vapi.Net/Types/PlayHtVoiceIdEnum.cs +++ b/src/Vapi.Net/Types/PlayHtVoiceIdEnum.cs @@ -2,8 +2,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] diff --git a/src/Vapi.Net/Types/PlayHtVoiceLanguage.cs b/src/Vapi.Net/Types/PlayHtVoiceLanguage.cs index bfb3d4a..02fea20 100644 --- a/src/Vapi.Net/Types/PlayHtVoiceLanguage.cs +++ b/src/Vapi.Net/Types/PlayHtVoiceLanguage.cs @@ -2,8 +2,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] diff --git a/src/Vapi.Net/Types/PlayHtVoiceModel.cs b/src/Vapi.Net/Types/PlayHtVoiceModel.cs index e82a9e0..2115cb5 100644 --- a/src/Vapi.Net/Types/PlayHtVoiceModel.cs +++ b/src/Vapi.Net/Types/PlayHtVoiceModel.cs @@ -2,8 +2,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] @@ -17,4 +15,7 @@ public enum PlayHtVoiceModel [EnumMember(Value = "Play3.0-mini")] Play30Mini, + + [EnumMember(Value = "PlayDialog")] + PlayDialog, } diff --git a/src/Vapi.Net/Types/PunctuationBoundary.cs b/src/Vapi.Net/Types/PunctuationBoundary.cs index fc7b3a6..ea55b64 100644 --- a/src/Vapi.Net/Types/PunctuationBoundary.cs +++ b/src/Vapi.Net/Types/PunctuationBoundary.cs @@ -2,8 +2,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] diff --git a/src/Vapi.Net/Types/RegexOption.cs b/src/Vapi.Net/Types/RegexOption.cs index 792373a..82377dd 100644 --- a/src/Vapi.Net/Types/RegexOption.cs +++ b/src/Vapi.Net/Types/RegexOption.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record RegexOption diff --git a/src/Vapi.Net/Types/RegexOptionType.cs b/src/Vapi.Net/Types/RegexOptionType.cs index e436fca..82dc61c 100644 --- a/src/Vapi.Net/Types/RegexOptionType.cs +++ b/src/Vapi.Net/Types/RegexOptionType.cs @@ -2,8 +2,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] diff --git a/src/Vapi.Net/Types/RegexReplacement.cs b/src/Vapi.Net/Types/RegexReplacement.cs index 2fb1a15..e1938c2 100644 --- a/src/Vapi.Net/Types/RegexReplacement.cs +++ b/src/Vapi.Net/Types/RegexReplacement.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record RegexReplacement diff --git a/src/Vapi.Net/Types/RimeAiCredential.cs b/src/Vapi.Net/Types/RimeAiCredential.cs index 71a2d70..96e12ff 100644 --- a/src/Vapi.Net/Types/RimeAiCredential.cs +++ b/src/Vapi.Net/Types/RimeAiCredential.cs @@ -1,14 +1,12 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record RimeAiCredential { [JsonPropertyName("provider")] - public required string Provider { get; set; } + public string Provider { get; set; } = "rime-ai"; /// /// This is not returned in the API. diff --git a/src/Vapi.Net/Types/RimeAiVoice.cs b/src/Vapi.Net/Types/RimeAiVoice.cs index 41a5a61..312f0e5 100644 --- a/src/Vapi.Net/Types/RimeAiVoice.cs +++ b/src/Vapi.Net/Types/RimeAiVoice.cs @@ -2,8 +2,6 @@ using OneOf; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record RimeAiVoice diff --git a/src/Vapi.Net/Types/RimeAiVoiceIdEnum.cs b/src/Vapi.Net/Types/RimeAiVoiceIdEnum.cs index 67c4847..a945824 100644 --- a/src/Vapi.Net/Types/RimeAiVoiceIdEnum.cs +++ b/src/Vapi.Net/Types/RimeAiVoiceIdEnum.cs @@ -2,73 +2,11 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] public enum RimeAiVoiceIdEnum { - [EnumMember(Value = "marsh")] - Marsh, - - [EnumMember(Value = "bayou")] - Bayou, - - [EnumMember(Value = "creek")] - Creek, - - [EnumMember(Value = "brook")] - Brook, - - [EnumMember(Value = "flower")] - Flower, - - [EnumMember(Value = "spore")] - Spore, - - [EnumMember(Value = "glacier")] - Glacier, - - [EnumMember(Value = "gulch")] - Gulch, - - [EnumMember(Value = "alpine")] - Alpine, - - [EnumMember(Value = "cove")] - Cove, - - [EnumMember(Value = "lagoon")] - Lagoon, - - [EnumMember(Value = "tundra")] - Tundra, - - [EnumMember(Value = "steppe")] - Steppe, - - [EnumMember(Value = "mesa")] - Mesa, - - [EnumMember(Value = "grove")] - Grove, - - [EnumMember(Value = "rainforest")] - Rainforest, - - [EnumMember(Value = "moraine")] - Moraine, - - [EnumMember(Value = "wildflower")] - Wildflower, - - [EnumMember(Value = "peak")] - Peak, - - [EnumMember(Value = "boulder")] - Boulder, - [EnumMember(Value = "abbie")] Abbie, @@ -251,4 +189,70 @@ public enum RimeAiVoiceIdEnum [EnumMember(Value = "yadira")] Yadira, + + [EnumMember(Value = "marsh")] + Marsh, + + [EnumMember(Value = "bayou")] + Bayou, + + [EnumMember(Value = "creek")] + Creek, + + [EnumMember(Value = "brook")] + Brook, + + [EnumMember(Value = "flower")] + Flower, + + [EnumMember(Value = "spore")] + Spore, + + [EnumMember(Value = "glacier")] + Glacier, + + [EnumMember(Value = "gulch")] + Gulch, + + [EnumMember(Value = "alpine")] + Alpine, + + [EnumMember(Value = "cove")] + Cove, + + [EnumMember(Value = "lagoon")] + Lagoon, + + [EnumMember(Value = "tundra")] + Tundra, + + [EnumMember(Value = "steppe")] + Steppe, + + [EnumMember(Value = "mesa")] + Mesa, + + [EnumMember(Value = "grove")] + Grove, + + [EnumMember(Value = "rainforest")] + Rainforest, + + [EnumMember(Value = "moraine")] + Moraine, + + [EnumMember(Value = "wildflower")] + Wildflower, + + [EnumMember(Value = "peak")] + Peak, + + [EnumMember(Value = "boulder")] + Boulder, + + [EnumMember(Value = "gypsum")] + Gypsum, + + [EnumMember(Value = "zest")] + Zest, } diff --git a/src/Vapi.Net/Types/RimeAiVoiceModel.cs b/src/Vapi.Net/Types/RimeAiVoiceModel.cs index 60e716f..df619c9 100644 --- a/src/Vapi.Net/Types/RimeAiVoiceModel.cs +++ b/src/Vapi.Net/Types/RimeAiVoiceModel.cs @@ -2,8 +2,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] @@ -14,4 +12,7 @@ public enum RimeAiVoiceModel [EnumMember(Value = "mist")] Mist, + + [EnumMember(Value = "mistv2")] + Mistv2, } diff --git a/src/Vapi.Net/Types/RuleBasedCondition.cs b/src/Vapi.Net/Types/RuleBasedCondition.cs index 82079c2..b124abb 100644 --- a/src/Vapi.Net/Types/RuleBasedCondition.cs +++ b/src/Vapi.Net/Types/RuleBasedCondition.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record RuleBasedCondition diff --git a/src/Vapi.Net/Types/RuleBasedConditionOperator.cs b/src/Vapi.Net/Types/RuleBasedConditionOperator.cs index ce3be34..51322ae 100644 --- a/src/Vapi.Net/Types/RuleBasedConditionOperator.cs +++ b/src/Vapi.Net/Types/RuleBasedConditionOperator.cs @@ -2,8 +2,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] diff --git a/src/Vapi.Net/Types/RunpodCredential.cs b/src/Vapi.Net/Types/RunpodCredential.cs index 74d8c93..0391d8e 100644 --- a/src/Vapi.Net/Types/RunpodCredential.cs +++ b/src/Vapi.Net/Types/RunpodCredential.cs @@ -1,14 +1,12 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record RunpodCredential { [JsonPropertyName("provider")] - public required string Provider { get; set; } + public string Provider { get; set; } = "runpod"; /// /// This is not returned in the API. diff --git a/src/Vapi.Net/Types/S3Credential.cs b/src/Vapi.Net/Types/S3Credential.cs index a06a233..1cdf0cd 100644 --- a/src/Vapi.Net/Types/S3Credential.cs +++ b/src/Vapi.Net/Types/S3Credential.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record S3Credential @@ -11,7 +9,7 @@ public record S3Credential /// Credential provider. Only allowed value is s3 /// [JsonPropertyName("provider")] - public required string Provider { get; set; } + public string Provider { get; set; } = "s3"; /// /// AWS access key ID. diff --git a/src/Vapi.Net/Types/Say.cs b/src/Vapi.Net/Types/Say.cs index 9af32b5..411114f 100644 --- a/src/Vapi.Net/Types/Say.cs +++ b/src/Vapi.Net/Types/Say.cs @@ -1,21 +1,25 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record Say { - [JsonPropertyName("type")] - public required string Type { get; set; } + [JsonPropertyName("exact")] + public string? Exact { get; set; } - [JsonPropertyName("instruction")] - public required string Instruction { get; set; } + [JsonPropertyName("prompt")] + public string? Prompt { get; set; } [JsonPropertyName("name")] public required string Name { get; set; } + /// + /// This is for metadata you want to store on the task. + /// + [JsonPropertyName("metadata")] + public object? Metadata { get; set; } + public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/SayHook.cs b/src/Vapi.Net/Types/SayHook.cs new file mode 100644 index 0000000..3a87fb9 --- /dev/null +++ b/src/Vapi.Net/Types/SayHook.cs @@ -0,0 +1,27 @@ +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record SayHook +{ + [JsonPropertyName("type")] + public string Type { get; set; } = "say"; + + /// + /// This is for metadata you want to store on the task. + /// + [JsonPropertyName("metadata")] + public object? Metadata { get; set; } + + [JsonPropertyName("exact")] + public string? Exact { get; set; } + + [JsonPropertyName("prompt")] + public string? Prompt { get; set; } + + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/SbcConfiguration.cs b/src/Vapi.Net/Types/SbcConfiguration.cs index 3971362..18ca377 100644 --- a/src/Vapi.Net/Types/SbcConfiguration.cs +++ b/src/Vapi.Net/Types/SbcConfiguration.cs @@ -1,7 +1,5 @@ using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record SbcConfiguration diff --git a/src/Vapi.Net/Types/Server.cs b/src/Vapi.Net/Types/Server.cs index 399d29b..e410508 100644 --- a/src/Vapi.Net/Types/Server.cs +++ b/src/Vapi.Net/Types/Server.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record Server @@ -37,6 +35,12 @@ public record Server [JsonPropertyName("headers")] public object? Headers { get; set; } + /// + /// This is the backoff plan to use if the request fails. + /// + [JsonPropertyName("backoffPlan")] + public BackoffPlan? BackoffPlan { get; set; } + public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/ServerMessage.cs b/src/Vapi.Net/Types/ServerMessage.cs index 455e810..0e69732 100644 --- a/src/Vapi.Net/Types/ServerMessage.cs +++ b/src/Vapi.Net/Types/ServerMessage.cs @@ -1,8 +1,7 @@ using System.Text.Json.Serialization; +using OneOf; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record ServerMessage @@ -18,7 +17,25 @@ public record ServerMessage /// 4. `org.serverUrl` (if configured) /// [JsonPropertyName("message")] - public required object Message { get; set; } + public required OneOf< + ServerMessageAssistantRequest, + ServerMessageConversationUpdate, + ServerMessageEndOfCallReport, + ServerMessageHang, + ServerMessageKnowledgeBaseRequest, + ServerMessageModelOutput, + ServerMessagePhoneCallControl, + ServerMessageSpeechUpdate, + ServerMessageStatusUpdate, + ServerMessageToolCalls, + ServerMessageTransferDestinationRequest, + ServerMessageTransferUpdate, + ServerMessageTranscript, + ServerMessageUserInterrupted, + ServerMessageLanguageChangeDetected, + ServerMessageVoiceInput, + ServerMessageVoiceRequest + > Message { get; set; } public override string ToString() { diff --git a/src/Vapi.Net/Types/ServerMessageAssistantRequest.cs b/src/Vapi.Net/Types/ServerMessageAssistantRequest.cs index a8eef13..5af6852 100644 --- a/src/Vapi.Net/Types/ServerMessageAssistantRequest.cs +++ b/src/Vapi.Net/Types/ServerMessageAssistantRequest.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record ServerMessageAssistantRequest @@ -17,6 +15,12 @@ public record ServerMessageAssistantRequest [JsonPropertyName("phoneNumber")] public object? PhoneNumber { get; set; } + /// + /// This is the type of the message. "assistant-request" is sent to fetch assistant configuration for an incoming call. + /// + [JsonPropertyName("type")] + public string Type { get; set; } = "assistant-request"; + /// /// This is the ISO-8601 formatted timestamp of when the message was sent. /// diff --git a/src/Vapi.Net/Types/ServerMessageConversationUpdate.cs b/src/Vapi.Net/Types/ServerMessageConversationUpdate.cs index dfefcca..7450030 100644 --- a/src/Vapi.Net/Types/ServerMessageConversationUpdate.cs +++ b/src/Vapi.Net/Types/ServerMessageConversationUpdate.cs @@ -2,8 +2,6 @@ using OneOf; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record ServerMessageConversationUpdate @@ -18,6 +16,12 @@ public record ServerMessageConversationUpdate [JsonPropertyName("phoneNumber")] public object? PhoneNumber { get; set; } + /// + /// This is the type of the message. "conversation-update" is sent when an update is committed to the conversation history. + /// + [JsonPropertyName("type")] + public string Type { get; set; } = "conversation-update"; + /// /// This is the most up-to-date conversation history at the time the message is sent. /// diff --git a/src/Vapi.Net/Types/ServerMessageEndOfCallReport.cs b/src/Vapi.Net/Types/ServerMessageEndOfCallReport.cs index a05bfe6..5615d1a 100644 --- a/src/Vapi.Net/Types/ServerMessageEndOfCallReport.cs +++ b/src/Vapi.Net/Types/ServerMessageEndOfCallReport.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record ServerMessageEndOfCallReport @@ -17,6 +15,12 @@ public record ServerMessageEndOfCallReport [JsonPropertyName("phoneNumber")] public object? PhoneNumber { get; set; } + /// + /// This is the type of the message. "end-of-call-report" is sent when the call ends and post-processing is complete. + /// + [JsonPropertyName("type")] + public string Type { get; set; } = "end-of-call-report"; + /// /// This is the reason the call ended. This can also be found at `call.endedReason` on GET /call/:id. /// diff --git a/src/Vapi.Net/Types/ServerMessageEndOfCallReportEndedReason.cs b/src/Vapi.Net/Types/ServerMessageEndOfCallReportEndedReason.cs index f750eb0..b607102 100644 --- a/src/Vapi.Net/Types/ServerMessageEndOfCallReportEndedReason.cs +++ b/src/Vapi.Net/Types/ServerMessageEndOfCallReportEndedReason.cs @@ -2,15 +2,13 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] public enum ServerMessageEndOfCallReportEndedReason { - [EnumMember(Value = "assistant-not-invalid")] - AssistantNotInvalid, + [EnumMember(Value = "assistant-not-valid")] + AssistantNotValid, [EnumMember(Value = "assistant-not-provided")] AssistantNotProvided, @@ -42,6 +40,9 @@ public enum ServerMessageEndOfCallReportEndedReason [EnumMember(Value = "assistant-said-end-call-phrase")] AssistantSaidEndCallPhrase, + [EnumMember(Value = "assistant-ended-call-with-hangup-task")] + AssistantEndedCallWithHangupTask, + [EnumMember(Value = "assistant-forwarded-call")] AssistantForwardedCall, @@ -111,12 +112,18 @@ public enum ServerMessageEndOfCallReportEndedReason [EnumMember(Value = "pipeline-error-smallest-ai-voice-failed")] PipelineErrorSmallestAiVoiceFailed, + [EnumMember(Value = "pipeline-error-neuphonic-voice-failed")] + PipelineErrorNeuphonicVoiceFailed, + [EnumMember(Value = "pipeline-error-deepgram-transcriber-failed")] PipelineErrorDeepgramTranscriberFailed, [EnumMember(Value = "pipeline-error-gladia-transcriber-failed")] PipelineErrorGladiaTranscriberFailed, + [EnumMember(Value = "pipeline-error-speechmatics-transcriber-failed")] + PipelineErrorSpeechmaticsTranscriberFailed, + [EnumMember(Value = "pipeline-error-assembly-ai-transcriber-failed")] PipelineErrorAssemblyAiTranscriberFailed, @@ -198,6 +205,9 @@ public enum ServerMessageEndOfCallReportEndedReason [EnumMember(Value = "pipeline-error-xai-llm-failed")] PipelineErrorXaiLlmFailed, + [EnumMember(Value = "pipeline-error-mistral-llm-failed")] + PipelineErrorMistralLlmFailed, + [EnumMember(Value = "pipeline-error-inflection-ai-llm-failed")] PipelineErrorInflectionAiLlmFailed, @@ -252,6 +262,21 @@ public enum ServerMessageEndOfCallReportEndedReason [EnumMember(Value = "pipeline-error-xai-500-server-error")] PipelineErrorXai500ServerError, + [EnumMember(Value = "pipeline-error-mistral-400-bad-request-validation-failed")] + PipelineErrorMistral400BadRequestValidationFailed, + + [EnumMember(Value = "pipeline-error-mistral-401-unauthorized")] + PipelineErrorMistral401Unauthorized, + + [EnumMember(Value = "pipeline-error-mistral-403-model-access-denied")] + PipelineErrorMistral403ModelAccessDenied, + + [EnumMember(Value = "pipeline-error-mistral-429-exceeded-quota")] + PipelineErrorMistral429ExceededQuota, + + [EnumMember(Value = "pipeline-error-mistral-500-server-error")] + PipelineErrorMistral500ServerError, + [EnumMember(Value = "pipeline-error-inflection-ai-400-bad-request-validation-failed")] PipelineErrorInflectionAi400BadRequestValidationFailed, diff --git a/src/Vapi.Net/Types/ServerMessageHang.cs b/src/Vapi.Net/Types/ServerMessageHang.cs index 92f18a3..c1214f4 100644 --- a/src/Vapi.Net/Types/ServerMessageHang.cs +++ b/src/Vapi.Net/Types/ServerMessageHang.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record ServerMessageHang @@ -17,6 +15,16 @@ public record ServerMessageHang [JsonPropertyName("phoneNumber")] public object? PhoneNumber { get; set; } + /// + /// This is the type of the message. "hang" is sent when the assistant is hanging due to a delay. The delay can be caused by many factors, such as: + /// - the model is too slow to respond + /// - the voice is too slow to respond + /// - the tool call is still waiting for a response from your server + /// - etc. + /// + [JsonPropertyName("type")] + public string Type { get; set; } = "hang"; + /// /// This is the ISO-8601 formatted timestamp of when the message was sent. /// diff --git a/src/Vapi.Net/Types/ServerMessageKnowledgeBaseRequest.cs b/src/Vapi.Net/Types/ServerMessageKnowledgeBaseRequest.cs index 3677c37..3136941 100644 --- a/src/Vapi.Net/Types/ServerMessageKnowledgeBaseRequest.cs +++ b/src/Vapi.Net/Types/ServerMessageKnowledgeBaseRequest.cs @@ -2,8 +2,6 @@ using OneOf; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record ServerMessageKnowledgeBaseRequest @@ -18,6 +16,12 @@ public record ServerMessageKnowledgeBaseRequest [JsonPropertyName("phoneNumber")] public object? PhoneNumber { get; set; } + /// + /// This is the type of the message. "knowledge-base-request" is sent to request knowledge base documents. To enable, use `assistant.knowledgeBase.provider=custom-knowledge-base`. + /// + [JsonPropertyName("type")] + public string Type { get; set; } = "knowledge-base-request"; + /// /// These are the messages that are going to be sent to the `model` right after the `knowledge-base-request` webhook completes. /// diff --git a/src/Vapi.Net/Types/ServerMessageLanguageChangeDetected.cs b/src/Vapi.Net/Types/ServerMessageLanguageChangeDetected.cs index cb5cf83..469ffde 100644 --- a/src/Vapi.Net/Types/ServerMessageLanguageChangeDetected.cs +++ b/src/Vapi.Net/Types/ServerMessageLanguageChangeDetected.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record ServerMessageLanguageChangeDetected @@ -17,6 +15,12 @@ public record ServerMessageLanguageChangeDetected [JsonPropertyName("phoneNumber")] public object? PhoneNumber { get; set; } + /// + /// This is the type of the message. "language-change-detected" is sent when the transcriber is automatically switched based on the detected language. + /// + [JsonPropertyName("type")] + public string Type { get; set; } = "language-change-detected"; + /// /// This is the ISO-8601 formatted timestamp of when the message was sent. /// diff --git a/src/Vapi.Net/Types/ServerMessageModelOutput.cs b/src/Vapi.Net/Types/ServerMessageModelOutput.cs index edd41f6..7c41a0b 100644 --- a/src/Vapi.Net/Types/ServerMessageModelOutput.cs +++ b/src/Vapi.Net/Types/ServerMessageModelOutput.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record ServerMessageModelOutput @@ -17,6 +15,12 @@ public record ServerMessageModelOutput [JsonPropertyName("phoneNumber")] public object? PhoneNumber { get; set; } + /// + /// This is the type of the message. "model-output" is sent as the model outputs tokens. + /// + [JsonPropertyName("type")] + public string Type { get; set; } = "model-output"; + /// /// This is the ISO-8601 formatted timestamp of when the message was sent. /// diff --git a/src/Vapi.Net/Types/ServerMessagePhoneCallControl.cs b/src/Vapi.Net/Types/ServerMessagePhoneCallControl.cs index 00ecb43..fa3e394 100644 --- a/src/Vapi.Net/Types/ServerMessagePhoneCallControl.cs +++ b/src/Vapi.Net/Types/ServerMessagePhoneCallControl.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record ServerMessagePhoneCallControl @@ -17,6 +15,14 @@ public record ServerMessagePhoneCallControl [JsonPropertyName("phoneNumber")] public object? PhoneNumber { get; set; } + /// + /// This is the type of the message. "phone-call-control" is an advanced type of message. + /// + /// When it is requested in `assistant.serverMessages`, the hangup and forwarding responsibilities are delegated to your server. Vapi will no longer do the actual transfer and hangup. + /// + [JsonPropertyName("type")] + public string Type { get; set; } = "phone-call-control"; + /// /// This is the request to control the phone call. /// diff --git a/src/Vapi.Net/Types/ServerMessagePhoneCallControlRequest.cs b/src/Vapi.Net/Types/ServerMessagePhoneCallControlRequest.cs index e7f5d65..ea37843 100644 --- a/src/Vapi.Net/Types/ServerMessagePhoneCallControlRequest.cs +++ b/src/Vapi.Net/Types/ServerMessagePhoneCallControlRequest.cs @@ -2,8 +2,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] diff --git a/src/Vapi.Net/Types/ServerMessageResponse.cs b/src/Vapi.Net/Types/ServerMessageResponse.cs index 4caf805..da341cd 100644 --- a/src/Vapi.Net/Types/ServerMessageResponse.cs +++ b/src/Vapi.Net/Types/ServerMessageResponse.cs @@ -2,8 +2,6 @@ using OneOf; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record ServerMessageResponse diff --git a/src/Vapi.Net/Types/ServerMessageResponseAssistantRequest.cs b/src/Vapi.Net/Types/ServerMessageResponseAssistantRequest.cs index 94b0c4b..a52cd51 100644 --- a/src/Vapi.Net/Types/ServerMessageResponseAssistantRequest.cs +++ b/src/Vapi.Net/Types/ServerMessageResponseAssistantRequest.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record ServerMessageResponseAssistantRequest diff --git a/src/Vapi.Net/Types/ServerMessageResponseKnowledgeBaseRequest.cs b/src/Vapi.Net/Types/ServerMessageResponseKnowledgeBaseRequest.cs index 14f1bd6..42de12b 100644 --- a/src/Vapi.Net/Types/ServerMessageResponseKnowledgeBaseRequest.cs +++ b/src/Vapi.Net/Types/ServerMessageResponseKnowledgeBaseRequest.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record ServerMessageResponseKnowledgeBaseRequest diff --git a/src/Vapi.Net/Types/ServerMessageResponseToolCalls.cs b/src/Vapi.Net/Types/ServerMessageResponseToolCalls.cs index 60dad35..9c39839 100644 --- a/src/Vapi.Net/Types/ServerMessageResponseToolCalls.cs +++ b/src/Vapi.Net/Types/ServerMessageResponseToolCalls.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record ServerMessageResponseToolCalls diff --git a/src/Vapi.Net/Types/ServerMessageResponseTransferDestinationRequest.cs b/src/Vapi.Net/Types/ServerMessageResponseTransferDestinationRequest.cs index b2b02b3..58e138a 100644 --- a/src/Vapi.Net/Types/ServerMessageResponseTransferDestinationRequest.cs +++ b/src/Vapi.Net/Types/ServerMessageResponseTransferDestinationRequest.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record ServerMessageResponseTransferDestinationRequest diff --git a/src/Vapi.Net/Types/ServerMessageResponseVoiceRequest.cs b/src/Vapi.Net/Types/ServerMessageResponseVoiceRequest.cs index 2ab6fc3..49d598b 100644 --- a/src/Vapi.Net/Types/ServerMessageResponseVoiceRequest.cs +++ b/src/Vapi.Net/Types/ServerMessageResponseVoiceRequest.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record ServerMessageResponseVoiceRequest diff --git a/src/Vapi.Net/Types/ServerMessageSpeechUpdate.cs b/src/Vapi.Net/Types/ServerMessageSpeechUpdate.cs index 1484f41..3a7e332 100644 --- a/src/Vapi.Net/Types/ServerMessageSpeechUpdate.cs +++ b/src/Vapi.Net/Types/ServerMessageSpeechUpdate.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record ServerMessageSpeechUpdate @@ -17,6 +15,12 @@ public record ServerMessageSpeechUpdate [JsonPropertyName("phoneNumber")] public object? PhoneNumber { get; set; } + /// + /// This is the type of the message. "speech-update" is sent whenever assistant or user start or stop speaking. + /// + [JsonPropertyName("type")] + public string Type { get; set; } = "speech-update"; + /// /// This is the status of the speech update. /// diff --git a/src/Vapi.Net/Types/ServerMessageSpeechUpdateRole.cs b/src/Vapi.Net/Types/ServerMessageSpeechUpdateRole.cs index 3d822de..ac21ab7 100644 --- a/src/Vapi.Net/Types/ServerMessageSpeechUpdateRole.cs +++ b/src/Vapi.Net/Types/ServerMessageSpeechUpdateRole.cs @@ -2,8 +2,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] diff --git a/src/Vapi.Net/Types/ServerMessageSpeechUpdateStatus.cs b/src/Vapi.Net/Types/ServerMessageSpeechUpdateStatus.cs index 245b455..71d7dd7 100644 --- a/src/Vapi.Net/Types/ServerMessageSpeechUpdateStatus.cs +++ b/src/Vapi.Net/Types/ServerMessageSpeechUpdateStatus.cs @@ -2,8 +2,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] diff --git a/src/Vapi.Net/Types/ServerMessageStatusUpdate.cs b/src/Vapi.Net/Types/ServerMessageStatusUpdate.cs index 366aa36..9ab5196 100644 --- a/src/Vapi.Net/Types/ServerMessageStatusUpdate.cs +++ b/src/Vapi.Net/Types/ServerMessageStatusUpdate.cs @@ -2,8 +2,6 @@ using OneOf; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record ServerMessageStatusUpdate @@ -18,6 +16,12 @@ public record ServerMessageStatusUpdate [JsonPropertyName("phoneNumber")] public object? PhoneNumber { get; set; } + /// + /// This is the type of the message. "status-update" is sent whenever the `call.status` changes. + /// + [JsonPropertyName("type")] + public string Type { get; set; } = "status-update"; + /// /// This is the status of the call. /// diff --git a/src/Vapi.Net/Types/ServerMessageStatusUpdateEndedReason.cs b/src/Vapi.Net/Types/ServerMessageStatusUpdateEndedReason.cs index a6514c5..ca9f22d 100644 --- a/src/Vapi.Net/Types/ServerMessageStatusUpdateEndedReason.cs +++ b/src/Vapi.Net/Types/ServerMessageStatusUpdateEndedReason.cs @@ -2,15 +2,13 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] public enum ServerMessageStatusUpdateEndedReason { - [EnumMember(Value = "assistant-not-invalid")] - AssistantNotInvalid, + [EnumMember(Value = "assistant-not-valid")] + AssistantNotValid, [EnumMember(Value = "assistant-not-provided")] AssistantNotProvided, @@ -42,6 +40,9 @@ public enum ServerMessageStatusUpdateEndedReason [EnumMember(Value = "assistant-said-end-call-phrase")] AssistantSaidEndCallPhrase, + [EnumMember(Value = "assistant-ended-call-with-hangup-task")] + AssistantEndedCallWithHangupTask, + [EnumMember(Value = "assistant-forwarded-call")] AssistantForwardedCall, @@ -111,12 +112,18 @@ public enum ServerMessageStatusUpdateEndedReason [EnumMember(Value = "pipeline-error-smallest-ai-voice-failed")] PipelineErrorSmallestAiVoiceFailed, + [EnumMember(Value = "pipeline-error-neuphonic-voice-failed")] + PipelineErrorNeuphonicVoiceFailed, + [EnumMember(Value = "pipeline-error-deepgram-transcriber-failed")] PipelineErrorDeepgramTranscriberFailed, [EnumMember(Value = "pipeline-error-gladia-transcriber-failed")] PipelineErrorGladiaTranscriberFailed, + [EnumMember(Value = "pipeline-error-speechmatics-transcriber-failed")] + PipelineErrorSpeechmaticsTranscriberFailed, + [EnumMember(Value = "pipeline-error-assembly-ai-transcriber-failed")] PipelineErrorAssemblyAiTranscriberFailed, @@ -198,6 +205,9 @@ public enum ServerMessageStatusUpdateEndedReason [EnumMember(Value = "pipeline-error-xai-llm-failed")] PipelineErrorXaiLlmFailed, + [EnumMember(Value = "pipeline-error-mistral-llm-failed")] + PipelineErrorMistralLlmFailed, + [EnumMember(Value = "pipeline-error-inflection-ai-llm-failed")] PipelineErrorInflectionAiLlmFailed, @@ -252,6 +262,21 @@ public enum ServerMessageStatusUpdateEndedReason [EnumMember(Value = "pipeline-error-xai-500-server-error")] PipelineErrorXai500ServerError, + [EnumMember(Value = "pipeline-error-mistral-400-bad-request-validation-failed")] + PipelineErrorMistral400BadRequestValidationFailed, + + [EnumMember(Value = "pipeline-error-mistral-401-unauthorized")] + PipelineErrorMistral401Unauthorized, + + [EnumMember(Value = "pipeline-error-mistral-403-model-access-denied")] + PipelineErrorMistral403ModelAccessDenied, + + [EnumMember(Value = "pipeline-error-mistral-429-exceeded-quota")] + PipelineErrorMistral429ExceededQuota, + + [EnumMember(Value = "pipeline-error-mistral-500-server-error")] + PipelineErrorMistral500ServerError, + [EnumMember(Value = "pipeline-error-inflection-ai-400-bad-request-validation-failed")] PipelineErrorInflectionAi400BadRequestValidationFailed, diff --git a/src/Vapi.Net/Types/ServerMessageStatusUpdateStatus.cs b/src/Vapi.Net/Types/ServerMessageStatusUpdateStatus.cs index 8820625..0760ac7 100644 --- a/src/Vapi.Net/Types/ServerMessageStatusUpdateStatus.cs +++ b/src/Vapi.Net/Types/ServerMessageStatusUpdateStatus.cs @@ -2,8 +2,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] diff --git a/src/Vapi.Net/Types/ServerMessageToolCalls.cs b/src/Vapi.Net/Types/ServerMessageToolCalls.cs index 0ab7a75..e39891f 100644 --- a/src/Vapi.Net/Types/ServerMessageToolCalls.cs +++ b/src/Vapi.Net/Types/ServerMessageToolCalls.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record ServerMessageToolCalls @@ -17,6 +15,12 @@ public record ServerMessageToolCalls [JsonPropertyName("phoneNumber")] public object? PhoneNumber { get; set; } + /// + /// This is the type of the message. "tool-calls" is sent to call a tool. + /// + [JsonPropertyName("type")] + public string? Type { get; set; } + /// /// This is the list of tools calls that the model is requesting along with the original tool configuration. /// diff --git a/src/Vapi.Net/Types/ServerMessageTranscript.cs b/src/Vapi.Net/Types/ServerMessageTranscript.cs index 31fb6e6..1b5cda9 100644 --- a/src/Vapi.Net/Types/ServerMessageTranscript.cs +++ b/src/Vapi.Net/Types/ServerMessageTranscript.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record ServerMessageTranscript @@ -17,6 +15,12 @@ public record ServerMessageTranscript [JsonPropertyName("phoneNumber")] public object? PhoneNumber { get; set; } + /// + /// This is the type of the message. "transcript" is sent as transcriber outputs partial or final transcript. + /// + [JsonPropertyName("type")] + public required ServerMessageTranscriptType Type { get; set; } + /// /// This is the ISO-8601 formatted timestamp of when the message was sent. /// diff --git a/src/Vapi.Net/Types/ServerMessageTranscriptRole.cs b/src/Vapi.Net/Types/ServerMessageTranscriptRole.cs index ec867eb..877ce43 100644 --- a/src/Vapi.Net/Types/ServerMessageTranscriptRole.cs +++ b/src/Vapi.Net/Types/ServerMessageTranscriptRole.cs @@ -2,8 +2,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] diff --git a/src/Vapi.Net/Types/ServerMessageTranscriptTranscriptType.cs b/src/Vapi.Net/Types/ServerMessageTranscriptTranscriptType.cs index c9c4cce..59da7f7 100644 --- a/src/Vapi.Net/Types/ServerMessageTranscriptTranscriptType.cs +++ b/src/Vapi.Net/Types/ServerMessageTranscriptTranscriptType.cs @@ -2,8 +2,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] diff --git a/src/Vapi.Net/Types/ServerMessageTranscriptType.cs b/src/Vapi.Net/Types/ServerMessageTranscriptType.cs new file mode 100644 index 0000000..6539ebc --- /dev/null +++ b/src/Vapi.Net/Types/ServerMessageTranscriptType.cs @@ -0,0 +1,15 @@ +using System.Runtime.Serialization; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[JsonConverter(typeof(EnumSerializer))] +public enum ServerMessageTranscriptType +{ + [EnumMember(Value = "transcript")] + Transcript, + + [EnumMember(Value = "transcript[transcriptType='final']")] + TranscriptTranscriptTypeFinal, +} diff --git a/src/Vapi.Net/Types/ServerMessageTransferDestinationRequest.cs b/src/Vapi.Net/Types/ServerMessageTransferDestinationRequest.cs index dafc588..4d63127 100644 --- a/src/Vapi.Net/Types/ServerMessageTransferDestinationRequest.cs +++ b/src/Vapi.Net/Types/ServerMessageTransferDestinationRequest.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record ServerMessageTransferDestinationRequest @@ -17,6 +15,12 @@ public record ServerMessageTransferDestinationRequest [JsonPropertyName("phoneNumber")] public object? PhoneNumber { get; set; } + /// + /// This is the type of the message. "transfer-destination-request" is sent when the model is requesting transfer but destination is unknown. + /// + [JsonPropertyName("type")] + public string Type { get; set; } = "transfer-destination-request"; + /// /// This is the ISO-8601 formatted timestamp of when the message was sent. /// diff --git a/src/Vapi.Net/Types/ServerMessageTransferUpdate.cs b/src/Vapi.Net/Types/ServerMessageTransferUpdate.cs index 0209ef2..4758dd4 100644 --- a/src/Vapi.Net/Types/ServerMessageTransferUpdate.cs +++ b/src/Vapi.Net/Types/ServerMessageTransferUpdate.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record ServerMessageTransferUpdate @@ -17,6 +15,12 @@ public record ServerMessageTransferUpdate [JsonPropertyName("phoneNumber")] public object? PhoneNumber { get; set; } + /// + /// This is the type of the message. "transfer-update" is sent whenever a transfer happens. + /// + [JsonPropertyName("type")] + public string Type { get; set; } = "transfer-update"; + /// /// This is the destination of the transfer. /// diff --git a/src/Vapi.Net/Types/ServerMessageUserInterrupted.cs b/src/Vapi.Net/Types/ServerMessageUserInterrupted.cs index 2e8667a..af1e3d5 100644 --- a/src/Vapi.Net/Types/ServerMessageUserInterrupted.cs +++ b/src/Vapi.Net/Types/ServerMessageUserInterrupted.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record ServerMessageUserInterrupted @@ -17,6 +15,12 @@ public record ServerMessageUserInterrupted [JsonPropertyName("phoneNumber")] public object? PhoneNumber { get; set; } + /// + /// This is the type of the message. "user-interrupted" is sent when the user interrupts the assistant. + /// + [JsonPropertyName("type")] + public string Type { get; set; } = "user-interrupted"; + /// /// This is the ISO-8601 formatted timestamp of when the message was sent. /// diff --git a/src/Vapi.Net/Types/ServerMessageVoiceInput.cs b/src/Vapi.Net/Types/ServerMessageVoiceInput.cs index 90924cf..72bdfae 100644 --- a/src/Vapi.Net/Types/ServerMessageVoiceInput.cs +++ b/src/Vapi.Net/Types/ServerMessageVoiceInput.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record ServerMessageVoiceInput @@ -17,6 +15,12 @@ public record ServerMessageVoiceInput [JsonPropertyName("phoneNumber")] public object? PhoneNumber { get; set; } + /// + /// This is the type of the message. "voice-input" is sent when a generation is requested from voice provider. + /// + [JsonPropertyName("type")] + public string Type { get; set; } = "voice-input"; + /// /// This is the ISO-8601 formatted timestamp of when the message was sent. /// diff --git a/src/Vapi.Net/Types/ServerMessageVoiceRequest.cs b/src/Vapi.Net/Types/ServerMessageVoiceRequest.cs index 76d9bc9..8290e49 100644 --- a/src/Vapi.Net/Types/ServerMessageVoiceRequest.cs +++ b/src/Vapi.Net/Types/ServerMessageVoiceRequest.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record ServerMessageVoiceRequest @@ -17,6 +15,33 @@ public record ServerMessageVoiceRequest [JsonPropertyName("phoneNumber")] public object? PhoneNumber { get; set; } + /// + /// This is the type of the message. "voice-request" is sent when using `assistant.voice={ "type": "custom-voice" }`. + /// + /// Here is what the request will look like: + /// + /// POST https://{assistant.voice.server.url} + /// Content-Type: application/json + /// + /// { + /// "messsage": { + /// "type": "voice-request", + /// "text": "Hello, world!", + /// "sampleRate": 24000, + /// ...other metadata about the call... + /// } + /// } + /// + /// The expected response is 1-channel 16-bit raw PCM audio at the sample rate specified in the request. Here is how the response will be piped to the transport: + /// ``` + /// response.on('data', (chunk: Buffer) => { + /// outputStream.write(chunk); + /// }); + /// ``` + /// + [JsonPropertyName("type")] + public string Type { get; set; } = "voice-request"; + /// /// This is the ISO-8601 formatted timestamp of when the message was sent. /// diff --git a/src/Vapi.Net/Types/SipAuthentication.cs b/src/Vapi.Net/Types/SipAuthentication.cs index 3cbc94e..671db41 100644 --- a/src/Vapi.Net/Types/SipAuthentication.cs +++ b/src/Vapi.Net/Types/SipAuthentication.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record SipAuthentication diff --git a/src/Vapi.Net/Types/SipTrunkGateway.cs b/src/Vapi.Net/Types/SipTrunkGateway.cs index 2822f89..be7da18 100644 --- a/src/Vapi.Net/Types/SipTrunkGateway.cs +++ b/src/Vapi.Net/Types/SipTrunkGateway.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record SipTrunkGateway diff --git a/src/Vapi.Net/Types/SipTrunkGatewayOutboundProtocol.cs b/src/Vapi.Net/Types/SipTrunkGatewayOutboundProtocol.cs index 08c636a..8d8d743 100644 --- a/src/Vapi.Net/Types/SipTrunkGatewayOutboundProtocol.cs +++ b/src/Vapi.Net/Types/SipTrunkGatewayOutboundProtocol.cs @@ -2,8 +2,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] diff --git a/src/Vapi.Net/Types/SipTrunkOutboundAuthenticationPlan.cs b/src/Vapi.Net/Types/SipTrunkOutboundAuthenticationPlan.cs index cef6f5b..794de4b 100644 --- a/src/Vapi.Net/Types/SipTrunkOutboundAuthenticationPlan.cs +++ b/src/Vapi.Net/Types/SipTrunkOutboundAuthenticationPlan.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record SipTrunkOutboundAuthenticationPlan diff --git a/src/Vapi.Net/Types/SipTrunkOutboundSipRegisterPlan.cs b/src/Vapi.Net/Types/SipTrunkOutboundSipRegisterPlan.cs index cbec2f9..e565bec 100644 --- a/src/Vapi.Net/Types/SipTrunkOutboundSipRegisterPlan.cs +++ b/src/Vapi.Net/Types/SipTrunkOutboundSipRegisterPlan.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record SipTrunkOutboundSipRegisterPlan diff --git a/src/Vapi.Net/Types/SmallestAiCredential.cs b/src/Vapi.Net/Types/SmallestAiCredential.cs index 872ef96..ba1f136 100644 --- a/src/Vapi.Net/Types/SmallestAiCredential.cs +++ b/src/Vapi.Net/Types/SmallestAiCredential.cs @@ -1,14 +1,12 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record SmallestAiCredential { [JsonPropertyName("provider")] - public required string Provider { get; set; } + public string Provider { get; set; } = "smallest-ai"; /// /// This is not returned in the API. diff --git a/src/Vapi.Net/Types/SmallestAiVoice.cs b/src/Vapi.Net/Types/SmallestAiVoice.cs index 1487d58..451614b 100644 --- a/src/Vapi.Net/Types/SmallestAiVoice.cs +++ b/src/Vapi.Net/Types/SmallestAiVoice.cs @@ -2,8 +2,6 @@ using OneOf; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record SmallestAiVoice diff --git a/src/Vapi.Net/Types/SmallestAiVoiceIdEnum.cs b/src/Vapi.Net/Types/SmallestAiVoiceIdEnum.cs index 43a3ae4..b18f08e 100644 --- a/src/Vapi.Net/Types/SmallestAiVoiceIdEnum.cs +++ b/src/Vapi.Net/Types/SmallestAiVoiceIdEnum.cs @@ -2,8 +2,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] diff --git a/src/Vapi.Net/Types/Squad.cs b/src/Vapi.Net/Types/Squad.cs index 55f0699..dcb730c 100644 --- a/src/Vapi.Net/Types/Squad.cs +++ b/src/Vapi.Net/Types/Squad.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record Squad diff --git a/src/Vapi.Net/Types/SquadMemberDto.cs b/src/Vapi.Net/Types/SquadMemberDto.cs index f1ee78b..d36b3b4 100644 --- a/src/Vapi.Net/Types/SquadMemberDto.cs +++ b/src/Vapi.Net/Types/SquadMemberDto.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record SquadMemberDto diff --git a/src/Vapi.Net/Types/StartSpeakingPlan.cs b/src/Vapi.Net/Types/StartSpeakingPlan.cs index a5ffc50..9ea614f 100644 --- a/src/Vapi.Net/Types/StartSpeakingPlan.cs +++ b/src/Vapi.Net/Types/StartSpeakingPlan.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record StartSpeakingPlan diff --git a/src/Vapi.Net/Types/StepDestination.cs b/src/Vapi.Net/Types/StepDestination.cs index 0799d8b..7224105 100644 --- a/src/Vapi.Net/Types/StepDestination.cs +++ b/src/Vapi.Net/Types/StepDestination.cs @@ -1,14 +1,12 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record StepDestination { [JsonPropertyName("type")] - public required string Type { get; set; } + public string Type { get; set; } = "step"; /// /// This is an optional array of conditions that must be met for this destination to be triggered. If empty, this is the default destination that the step transfers to. diff --git a/src/Vapi.Net/Types/StopSpeakingPlan.cs b/src/Vapi.Net/Types/StopSpeakingPlan.cs index 17603cd..ff5c05c 100644 --- a/src/Vapi.Net/Types/StopSpeakingPlan.cs +++ b/src/Vapi.Net/Types/StopSpeakingPlan.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record StopSpeakingPlan @@ -49,6 +47,20 @@ public record StopSpeakingPlan [JsonPropertyName("backoffSeconds")] public double? BackoffSeconds { get; set; } + /// + /// These are the phrases that will never interrupt the assistant, even if numWords threshold is met. + /// These are typically acknowledgement or backchanneling phrases. + /// + [JsonPropertyName("acknowledgementPhrases")] + public IEnumerable? AcknowledgementPhrases { get; set; } + + /// + /// These are the phrases that will always interrupt the assistant immediately, regardless of numWords. + /// These are typically phrases indicating disagreement or desire to stop. + /// + [JsonPropertyName("interruptionPhrases")] + public IEnumerable? InterruptionPhrases { get; set; } + public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/StructuredDataPlan.cs b/src/Vapi.Net/Types/StructuredDataPlan.cs index 8c57abf..430e5ae 100644 --- a/src/Vapi.Net/Types/StructuredDataPlan.cs +++ b/src/Vapi.Net/Types/StructuredDataPlan.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record StructuredDataPlan diff --git a/src/Vapi.Net/Types/Subscription.cs b/src/Vapi.Net/Types/Subscription.cs index 0a643fb..d303d02 100644 --- a/src/Vapi.Net/Types/Subscription.cs +++ b/src/Vapi.Net/Types/Subscription.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record Subscription @@ -58,6 +56,18 @@ public record Subscription [JsonPropertyName("concurrencyLimitIncluded")] public required double ConcurrencyLimitIncluded { get; set; } + /// + /// This is the number of free phone numbers the subscription has + /// + [JsonPropertyName("phoneNumbersCounter")] + public double? PhoneNumbersCounter { get; set; } + + /// + /// This is the maximum number of free phone numbers the subscription can have + /// + [JsonPropertyName("phoneNumbersIncluded")] + public double? PhoneNumbersIncluded { get; set; } + /// /// This is the purchased add-on concurrency limit for the subscription. /// @@ -140,17 +150,23 @@ public record Subscription public AutoReloadPlan? AutoReloadPlan { get; set; } /// - /// The number of minutes included in the subscription. Enterprise only. + /// The number of minutes included in the subscription. /// [JsonPropertyName("minutesIncluded")] public double? MinutesIncluded { get; set; } /// - /// The number of minutes used in the subscription. Enterprise only. + /// The number of minutes used in the subscription. /// [JsonPropertyName("minutesUsed")] public double? MinutesUsed { get; set; } + /// + /// This is the timestamp at which the number of monthly free minutes is scheduled to reset at. + /// + [JsonPropertyName("minutesUsedNextResetAt")] + public DateTime? MinutesUsedNextResetAt { get; set; } + /// /// The per minute charge on minutes that exceed the included minutes. Enterprise only. /// diff --git a/src/Vapi.Net/Types/SubscriptionStatus.cs b/src/Vapi.Net/Types/SubscriptionStatus.cs index 4b34231..1b2127c 100644 --- a/src/Vapi.Net/Types/SubscriptionStatus.cs +++ b/src/Vapi.Net/Types/SubscriptionStatus.cs @@ -2,8 +2,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] diff --git a/src/Vapi.Net/Types/SubscriptionType.cs b/src/Vapi.Net/Types/SubscriptionType.cs index 0a853eb..05d0dd8 100644 --- a/src/Vapi.Net/Types/SubscriptionType.cs +++ b/src/Vapi.Net/Types/SubscriptionType.cs @@ -2,8 +2,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] diff --git a/src/Vapi.Net/Types/SuccessEvaluationPlan.cs b/src/Vapi.Net/Types/SuccessEvaluationPlan.cs index ba8bfe4..d54c6f4 100644 --- a/src/Vapi.Net/Types/SuccessEvaluationPlan.cs +++ b/src/Vapi.Net/Types/SuccessEvaluationPlan.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record SuccessEvaluationPlan diff --git a/src/Vapi.Net/Types/SuccessEvaluationPlanRubric.cs b/src/Vapi.Net/Types/SuccessEvaluationPlanRubric.cs index 6e93bd5..6cfcf13 100644 --- a/src/Vapi.Net/Types/SuccessEvaluationPlanRubric.cs +++ b/src/Vapi.Net/Types/SuccessEvaluationPlanRubric.cs @@ -2,8 +2,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] diff --git a/src/Vapi.Net/Types/SummaryPlan.cs b/src/Vapi.Net/Types/SummaryPlan.cs index fd92c3a..fbe73f4 100644 --- a/src/Vapi.Net/Types/SummaryPlan.cs +++ b/src/Vapi.Net/Types/SummaryPlan.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record SummaryPlan diff --git a/src/Vapi.Net/Types/SyncVoiceLibraryDto.cs b/src/Vapi.Net/Types/SyncVoiceLibraryDto.cs index b1f269d..b5b1696 100644 --- a/src/Vapi.Net/Types/SyncVoiceLibraryDto.cs +++ b/src/Vapi.Net/Types/SyncVoiceLibraryDto.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record SyncVoiceLibraryDto diff --git a/src/Vapi.Net/Types/SyncVoiceLibraryDtoProvidersItem.cs b/src/Vapi.Net/Types/SyncVoiceLibraryDtoProvidersItem.cs index fe54951..976b912 100644 --- a/src/Vapi.Net/Types/SyncVoiceLibraryDtoProvidersItem.cs +++ b/src/Vapi.Net/Types/SyncVoiceLibraryDtoProvidersItem.cs @@ -2,8 +2,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] @@ -30,6 +28,9 @@ public enum SyncVoiceLibraryDtoProvidersItem [EnumMember(Value = "neets")] Neets, + [EnumMember(Value = "neuphonic")] + Neuphonic, + [EnumMember(Value = "openai")] Openai, diff --git a/src/Vapi.Net/Types/SystemMessage.cs b/src/Vapi.Net/Types/SystemMessage.cs index ca6b931..3ca2c0d 100644 --- a/src/Vapi.Net/Types/SystemMessage.cs +++ b/src/Vapi.Net/Types/SystemMessage.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record SystemMessage diff --git a/src/Vapi.Net/Types/TalkscriberTranscriber.cs b/src/Vapi.Net/Types/TalkscriberTranscriber.cs index 314443c..32858e3 100644 --- a/src/Vapi.Net/Types/TalkscriberTranscriber.cs +++ b/src/Vapi.Net/Types/TalkscriberTranscriber.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record TalkscriberTranscriber diff --git a/src/Vapi.Net/Types/TalkscriberTranscriberLanguage.cs b/src/Vapi.Net/Types/TalkscriberTranscriberLanguage.cs index f8902fc..4029ec6 100644 --- a/src/Vapi.Net/Types/TalkscriberTranscriberLanguage.cs +++ b/src/Vapi.Net/Types/TalkscriberTranscriberLanguage.cs @@ -2,8 +2,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] diff --git a/src/Vapi.Net/Types/TavusConversationProperties.cs b/src/Vapi.Net/Types/TavusConversationProperties.cs index 46b0ce9..7e04047 100644 --- a/src/Vapi.Net/Types/TavusConversationProperties.cs +++ b/src/Vapi.Net/Types/TavusConversationProperties.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record TavusConversationProperties diff --git a/src/Vapi.Net/Types/TavusCredential.cs b/src/Vapi.Net/Types/TavusCredential.cs index b603870..9a44af7 100644 --- a/src/Vapi.Net/Types/TavusCredential.cs +++ b/src/Vapi.Net/Types/TavusCredential.cs @@ -1,14 +1,12 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record TavusCredential { [JsonPropertyName("provider")] - public required string Provider { get; set; } + public string Provider { get; set; } = "tavus"; /// /// This is not returned in the API. diff --git a/src/Vapi.Net/Types/TavusVoice.cs b/src/Vapi.Net/Types/TavusVoice.cs index a6279b8..9898954 100644 --- a/src/Vapi.Net/Types/TavusVoice.cs +++ b/src/Vapi.Net/Types/TavusVoice.cs @@ -2,8 +2,6 @@ using OneOf; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record TavusVoice diff --git a/src/Vapi.Net/Types/Template.cs b/src/Vapi.Net/Types/Template.cs index 7eb7762..c5ef408 100644 --- a/src/Vapi.Net/Types/Template.cs +++ b/src/Vapi.Net/Types/Template.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record Template @@ -20,7 +18,7 @@ public record Template public TemplateVisibility? Visibility { get; set; } [JsonPropertyName("type")] - public required string Type { get; set; } + public string Type { get; set; } = "tool"; /// /// The name of the template. This is just for your own reference. diff --git a/src/Vapi.Net/Types/TemplateProvider.cs b/src/Vapi.Net/Types/TemplateProvider.cs index a8484ee..ab90fb4 100644 --- a/src/Vapi.Net/Types/TemplateProvider.cs +++ b/src/Vapi.Net/Types/TemplateProvider.cs @@ -2,8 +2,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] diff --git a/src/Vapi.Net/Types/TemplateVisibility.cs b/src/Vapi.Net/Types/TemplateVisibility.cs index 45074d4..2f20a59 100644 --- a/src/Vapi.Net/Types/TemplateVisibility.cs +++ b/src/Vapi.Net/Types/TemplateVisibility.cs @@ -2,8 +2,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] diff --git a/src/Vapi.Net/Types/TestSuite.cs b/src/Vapi.Net/Types/TestSuite.cs new file mode 100644 index 0000000..c713167 --- /dev/null +++ b/src/Vapi.Net/Types/TestSuite.cs @@ -0,0 +1,48 @@ +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record TestSuite +{ + /// + /// This is the unique identifier for the test suite. + /// + [JsonPropertyName("id")] + public required string Id { get; set; } + + /// + /// This is the unique identifier for the org that this test suite belongs to. + /// + [JsonPropertyName("orgId")] + public required string OrgId { get; set; } + + /// + /// This is the ISO 8601 date-time string of when the test suite was created. + /// + [JsonPropertyName("createdAt")] + public required DateTime CreatedAt { get; set; } + + /// + /// This is the ISO 8601 date-time string of when the test suite was last updated. + /// + [JsonPropertyName("updatedAt")] + public required DateTime UpdatedAt { get; set; } + + /// + /// This is the name of the test suite. + /// + [JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// This is the phone number ID associated with this test suite. + /// + [JsonPropertyName("phoneNumberId")] + public string? PhoneNumberId { get; set; } + + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/TestSuiteRun.cs b/src/Vapi.Net/Types/TestSuiteRun.cs new file mode 100644 index 0000000..5e79bfd --- /dev/null +++ b/src/Vapi.Net/Types/TestSuiteRun.cs @@ -0,0 +1,61 @@ +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record TestSuiteRun +{ + /// + /// This is the current status of the test suite run. + /// + [JsonPropertyName("status")] + public required TestSuiteRunStatus Status { get; set; } + + /// + /// This is the unique identifier for the test suite run. + /// + [JsonPropertyName("id")] + public required string Id { get; set; } + + /// + /// This is the unique identifier for the organization this run belongs to. + /// + [JsonPropertyName("orgId")] + public required string OrgId { get; set; } + + /// + /// This is the unique identifier for the test suite this run belongs to. + /// + [JsonPropertyName("testSuiteId")] + public required string TestSuiteId { get; set; } + + /// + /// This is the ISO 8601 date-time string of when the test suite run was created. + /// + [JsonPropertyName("createdAt")] + public required DateTime CreatedAt { get; set; } + + /// + /// This is the ISO 8601 date-time string of when the test suite run was last updated. + /// + [JsonPropertyName("updatedAt")] + public required DateTime UpdatedAt { get; set; } + + /// + /// These are the results of the tests in this test suite run. + /// + [JsonPropertyName("testResults")] + public IEnumerable TestResults { get; set; } = + new List(); + + /// + /// This is the name of the test suite run. + /// + [JsonPropertyName("name")] + public string? Name { get; set; } + + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/TestSuiteRunScorerAi.cs b/src/Vapi.Net/Types/TestSuiteRunScorerAi.cs new file mode 100644 index 0000000..77cb652 --- /dev/null +++ b/src/Vapi.Net/Types/TestSuiteRunScorerAi.cs @@ -0,0 +1,36 @@ +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record TestSuiteRunScorerAi +{ + /// + /// This is the type of the scorer, which must be AI. + /// + [JsonPropertyName("type")] + public string Type { get; set; } = "ai"; + + /// + /// This is the result of the test suite. + /// + [JsonPropertyName("result")] + public required TestSuiteRunScorerAiResult Result { get; set; } + + /// + /// This is the reasoning provided by the AI scorer. + /// + [JsonPropertyName("reasoning")] + public required string Reasoning { get; set; } + + /// + /// This is the rubric used by the AI scorer. + /// + [JsonPropertyName("rubric")] + public required string Rubric { get; set; } + + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/TestSuiteRunScorerAiResult.cs b/src/Vapi.Net/Types/TestSuiteRunScorerAiResult.cs new file mode 100644 index 0000000..95aa2bb --- /dev/null +++ b/src/Vapi.Net/Types/TestSuiteRunScorerAiResult.cs @@ -0,0 +1,15 @@ +using System.Runtime.Serialization; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[JsonConverter(typeof(EnumSerializer))] +public enum TestSuiteRunScorerAiResult +{ + [EnumMember(Value = "pass")] + Pass, + + [EnumMember(Value = "fail")] + Fail, +} diff --git a/src/Vapi.Net/Types/TestSuiteRunStatus.cs b/src/Vapi.Net/Types/TestSuiteRunStatus.cs new file mode 100644 index 0000000..22e5399 --- /dev/null +++ b/src/Vapi.Net/Types/TestSuiteRunStatus.cs @@ -0,0 +1,18 @@ +using System.Runtime.Serialization; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[JsonConverter(typeof(EnumSerializer))] +public enum TestSuiteRunStatus +{ + [EnumMember(Value = "queued")] + Queued, + + [EnumMember(Value = "in-progress")] + InProgress, + + [EnumMember(Value = "completed")] + Completed, +} diff --git a/src/Vapi.Net/Types/TestSuiteRunTestAttempt.cs b/src/Vapi.Net/Types/TestSuiteRunTestAttempt.cs new file mode 100644 index 0000000..453b338 --- /dev/null +++ b/src/Vapi.Net/Types/TestSuiteRunTestAttempt.cs @@ -0,0 +1,25 @@ +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record TestSuiteRunTestAttempt +{ + /// + /// These are the results of the scorers used to evaluate the test attempt. + /// + [JsonPropertyName("scorerResults")] + public IEnumerable ScorerResults { get; set; } = + new List(); + + /// + /// This is the call made during the test attempt. + /// + [JsonPropertyName("call")] + public required TestSuiteRunTestAttemptCall Call { get; set; } + + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/TestSuiteRunTestAttemptCall.cs b/src/Vapi.Net/Types/TestSuiteRunTestAttemptCall.cs new file mode 100644 index 0000000..922d916 --- /dev/null +++ b/src/Vapi.Net/Types/TestSuiteRunTestAttemptCall.cs @@ -0,0 +1,18 @@ +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record TestSuiteRunTestAttemptCall +{ + /// + /// This is the artifact associated with the call. + /// + [JsonPropertyName("artifact")] + public required Artifact Artifact { get; set; } + + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/TestSuiteRunTestResult.cs b/src/Vapi.Net/Types/TestSuiteRunTestResult.cs new file mode 100644 index 0000000..d644aa1 --- /dev/null +++ b/src/Vapi.Net/Types/TestSuiteRunTestResult.cs @@ -0,0 +1,25 @@ +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record TestSuiteRunTestResult +{ + /// + /// This is the test that was run. + /// + [JsonPropertyName("test")] + public required TestSuiteTestVoice Test { get; set; } + + /// + /// These are the attempts made for this test. + /// + [JsonPropertyName("attempts")] + public IEnumerable Attempts { get; set; } = + new List(); + + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/TestSuiteRunsPaginatedResponse.cs b/src/Vapi.Net/Types/TestSuiteRunsPaginatedResponse.cs new file mode 100644 index 0000000..6633500 --- /dev/null +++ b/src/Vapi.Net/Types/TestSuiteRunsPaginatedResponse.cs @@ -0,0 +1,18 @@ +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record TestSuiteRunsPaginatedResponse +{ + [JsonPropertyName("results")] + public IEnumerable Results { get; set; } = new List(); + + [JsonPropertyName("metadata")] + public required PaginationMeta Metadata { get; set; } + + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/TestSuiteTestScorerAi.cs b/src/Vapi.Net/Types/TestSuiteTestScorerAi.cs new file mode 100644 index 0000000..8309b77 --- /dev/null +++ b/src/Vapi.Net/Types/TestSuiteTestScorerAi.cs @@ -0,0 +1,24 @@ +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record TestSuiteTestScorerAi +{ + /// + /// This is the type of the scorer, which must be AI. + /// + [JsonPropertyName("type")] + public string Type { get; set; } = "ai"; + + /// + /// This is the rubric used by the AI scorer. + /// + [JsonPropertyName("rubric")] + public required string Rubric { get; set; } + + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/TestSuiteTestVoice.cs b/src/Vapi.Net/Types/TestSuiteTestVoice.cs new file mode 100644 index 0000000..afaa4d0 --- /dev/null +++ b/src/Vapi.Net/Types/TestSuiteTestVoice.cs @@ -0,0 +1,67 @@ +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record TestSuiteTestVoice +{ + /// + /// These are the scorers used to evaluate the test. + /// + [JsonPropertyName("scorers")] + public IEnumerable Scorers { get; set; } = + new List(); + + /// + /// This is the unique identifier for the test. + /// + [JsonPropertyName("id")] + public required string Id { get; set; } + + /// + /// This is the unique identifier for the test suite this test belongs to. + /// + [JsonPropertyName("testSuiteId")] + public required string TestSuiteId { get; set; } + + /// + /// This is the unique identifier for the organization this test belongs to. + /// + [JsonPropertyName("orgId")] + public required string OrgId { get; set; } + + /// + /// This is the ISO 8601 date-time string of when the test was created. + /// + [JsonPropertyName("createdAt")] + public required DateTime CreatedAt { get; set; } + + /// + /// This is the ISO 8601 date-time string of when the test was last updated. + /// + [JsonPropertyName("updatedAt")] + public required DateTime UpdatedAt { get; set; } + + /// + /// This is the name of the test. + /// + [JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// This is the script to be used for the voice test. + /// + [JsonPropertyName("script")] + public required string Script { get; set; } + + /// + /// This is the number of attempts allowed for the test. + /// + [JsonPropertyName("numAttempts")] + public double? NumAttempts { get; set; } + + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/TestSuiteTestsPaginatedResponse.cs b/src/Vapi.Net/Types/TestSuiteTestsPaginatedResponse.cs new file mode 100644 index 0000000..b997779 --- /dev/null +++ b/src/Vapi.Net/Types/TestSuiteTestsPaginatedResponse.cs @@ -0,0 +1,24 @@ +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record TestSuiteTestsPaginatedResponse +{ + /// + /// A list of test suite tests. + /// + [JsonPropertyName("results")] + public IEnumerable Results { get; set; } = new List(); + + /// + /// Metadata about the pagination. + /// + [JsonPropertyName("metadata")] + public required PaginationMeta Metadata { get; set; } + + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/TestSuitesPaginatedResponse.cs b/src/Vapi.Net/Types/TestSuitesPaginatedResponse.cs new file mode 100644 index 0000000..d191dd0 --- /dev/null +++ b/src/Vapi.Net/Types/TestSuitesPaginatedResponse.cs @@ -0,0 +1,18 @@ +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record TestSuitesPaginatedResponse +{ + [JsonPropertyName("results")] + public IEnumerable Results { get; set; } = new List(); + + [JsonPropertyName("metadata")] + public required PaginationMeta Metadata { get; set; } + + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/TextContent.cs b/src/Vapi.Net/Types/TextContent.cs index 90eaa62..3dbe061 100644 --- a/src/Vapi.Net/Types/TextContent.cs +++ b/src/Vapi.Net/Types/TextContent.cs @@ -1,14 +1,12 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record TextContent { [JsonPropertyName("type")] - public required string Type { get; set; } + public string Type { get; set; } = "text"; [JsonPropertyName("text")] public required string Text { get; set; } diff --git a/src/Vapi.Net/Types/TextContentLanguage.cs b/src/Vapi.Net/Types/TextContentLanguage.cs index 86ee188..18cad1c 100644 --- a/src/Vapi.Net/Types/TextContentLanguage.cs +++ b/src/Vapi.Net/Types/TextContentLanguage.cs @@ -2,8 +2,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] diff --git a/src/Vapi.Net/Types/TextEditorTool.cs b/src/Vapi.Net/Types/TextEditorTool.cs index 99aa082..d721791 100644 --- a/src/Vapi.Net/Types/TextEditorTool.cs +++ b/src/Vapi.Net/Types/TextEditorTool.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record TextEditorTool @@ -31,7 +29,7 @@ public record TextEditorTool /// The sub type of tool. /// [JsonPropertyName("subType")] - public required string SubType { get; set; } + public string SubType { get; set; } = "text_editor_20241022"; /// /// This is the unique identifier for the tool. @@ -81,7 +79,7 @@ public record TextEditorTool /// The name of the tool, fixed to 'str_replace_editor' /// [JsonPropertyName("name")] - public required string Name { get; set; } + public string Name { get; set; } = "str_replace_editor"; public override string ToString() { diff --git a/src/Vapi.Net/Types/TextEditorToolWithToolCall.cs b/src/Vapi.Net/Types/TextEditorToolWithToolCall.cs index f34e0b1..d826f25 100644 --- a/src/Vapi.Net/Types/TextEditorToolWithToolCall.cs +++ b/src/Vapi.Net/Types/TextEditorToolWithToolCall.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record TextEditorToolWithToolCall @@ -31,7 +29,7 @@ public record TextEditorToolWithToolCall /// The sub type of tool. /// [JsonPropertyName("subType")] - public required string SubType { get; set; } + public string SubType { get; set; } = "text_editor_20241022"; [JsonPropertyName("toolCall")] public required ToolCall ToolCall { get; set; } @@ -40,7 +38,7 @@ public record TextEditorToolWithToolCall /// The name of the tool, fixed to 'str_replace_editor' /// [JsonPropertyName("name")] - public required string Name { get; set; } + public string Name { get; set; } = "str_replace_editor"; /// /// This is the function definition of the tool. diff --git a/src/Vapi.Net/Types/TimeRange.cs b/src/Vapi.Net/Types/TimeRange.cs index 481162b..ebdb88c 100644 --- a/src/Vapi.Net/Types/TimeRange.cs +++ b/src/Vapi.Net/Types/TimeRange.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record TimeRange diff --git a/src/Vapi.Net/Types/TimeRangeStep.cs b/src/Vapi.Net/Types/TimeRangeStep.cs index cc53637..2eb76d2 100644 --- a/src/Vapi.Net/Types/TimeRangeStep.cs +++ b/src/Vapi.Net/Types/TimeRangeStep.cs @@ -2,13 +2,14 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] public enum TimeRangeStep { + [EnumMember(Value = "second")] + Second, + [EnumMember(Value = "minute")] Minute, diff --git a/src/Vapi.Net/Types/TogetherAiCredential.cs b/src/Vapi.Net/Types/TogetherAiCredential.cs index fcfc0d1..dde3e5d 100644 --- a/src/Vapi.Net/Types/TogetherAiCredential.cs +++ b/src/Vapi.Net/Types/TogetherAiCredential.cs @@ -1,14 +1,12 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record TogetherAiCredential { [JsonPropertyName("provider")] - public required string Provider { get; set; } + public string Provider { get; set; } = "together-ai"; /// /// This is not returned in the API. diff --git a/src/Vapi.Net/Types/TogetherAiModel.cs b/src/Vapi.Net/Types/TogetherAiModel.cs index abd0a5e..a0263b4 100644 --- a/src/Vapi.Net/Types/TogetherAiModel.cs +++ b/src/Vapi.Net/Types/TogetherAiModel.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record TogetherAiModel diff --git a/src/Vapi.Net/Types/Token.cs b/src/Vapi.Net/Types/Token.cs index 2352d0e..2c777db 100644 --- a/src/Vapi.Net/Types/Token.cs +++ b/src/Vapi.Net/Types/Token.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record Token diff --git a/src/Vapi.Net/Types/TokenRestrictions.cs b/src/Vapi.Net/Types/TokenRestrictions.cs index 882af39..05524aa 100644 --- a/src/Vapi.Net/Types/TokenRestrictions.cs +++ b/src/Vapi.Net/Types/TokenRestrictions.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record TokenRestrictions diff --git a/src/Vapi.Net/Types/TokenTag.cs b/src/Vapi.Net/Types/TokenTag.cs index 8d6c0a6..f292a22 100644 --- a/src/Vapi.Net/Types/TokenTag.cs +++ b/src/Vapi.Net/Types/TokenTag.cs @@ -2,8 +2,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] diff --git a/src/Vapi.Net/Types/ToolCall.cs b/src/Vapi.Net/Types/ToolCall.cs index be80c3f..8c46cf7 100644 --- a/src/Vapi.Net/Types/ToolCall.cs +++ b/src/Vapi.Net/Types/ToolCall.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record ToolCall @@ -11,7 +9,7 @@ public record ToolCall /// This is the type of tool the model called. /// [JsonPropertyName("type")] - public required string Type { get; set; } + public string Type { get; set; } = "function"; /// /// This is the function the model called. diff --git a/src/Vapi.Net/Types/ToolCallBlock.cs b/src/Vapi.Net/Types/ToolCallBlock.cs index ed7a216..2609679 100644 --- a/src/Vapi.Net/Types/ToolCallBlock.cs +++ b/src/Vapi.Net/Types/ToolCallBlock.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record ToolCallBlock diff --git a/src/Vapi.Net/Types/ToolCallFunction.cs b/src/Vapi.Net/Types/ToolCallFunction.cs index a8a05a6..d068f7c 100644 --- a/src/Vapi.Net/Types/ToolCallFunction.cs +++ b/src/Vapi.Net/Types/ToolCallFunction.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record ToolCallFunction diff --git a/src/Vapi.Net/Types/ToolCallMessage.cs b/src/Vapi.Net/Types/ToolCallMessage.cs index 15bb7f6..16a0900 100644 --- a/src/Vapi.Net/Types/ToolCallMessage.cs +++ b/src/Vapi.Net/Types/ToolCallMessage.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record ToolCallMessage diff --git a/src/Vapi.Net/Types/ToolCallResult.cs b/src/Vapi.Net/Types/ToolCallResult.cs index adf4a3f..4731643 100644 --- a/src/Vapi.Net/Types/ToolCallResult.cs +++ b/src/Vapi.Net/Types/ToolCallResult.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record ToolCallResult diff --git a/src/Vapi.Net/Types/ToolCallResultMessage.cs b/src/Vapi.Net/Types/ToolCallResultMessage.cs index 264b751..6ff79cc 100644 --- a/src/Vapi.Net/Types/ToolCallResultMessage.cs +++ b/src/Vapi.Net/Types/ToolCallResultMessage.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record ToolCallResultMessage diff --git a/src/Vapi.Net/Types/ToolMessageComplete.cs b/src/Vapi.Net/Types/ToolMessageComplete.cs index 7c74a11..6894880 100644 --- a/src/Vapi.Net/Types/ToolMessageComplete.cs +++ b/src/Vapi.Net/Types/ToolMessageComplete.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record ToolMessageComplete diff --git a/src/Vapi.Net/Types/ToolMessageCompleteRole.cs b/src/Vapi.Net/Types/ToolMessageCompleteRole.cs index 5602b09..88ad746 100644 --- a/src/Vapi.Net/Types/ToolMessageCompleteRole.cs +++ b/src/Vapi.Net/Types/ToolMessageCompleteRole.cs @@ -2,8 +2,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] diff --git a/src/Vapi.Net/Types/ToolMessageDelayed.cs b/src/Vapi.Net/Types/ToolMessageDelayed.cs index 186badd..9012604 100644 --- a/src/Vapi.Net/Types/ToolMessageDelayed.cs +++ b/src/Vapi.Net/Types/ToolMessageDelayed.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record ToolMessageDelayed diff --git a/src/Vapi.Net/Types/ToolMessageFailed.cs b/src/Vapi.Net/Types/ToolMessageFailed.cs index 476e4e6..f965904 100644 --- a/src/Vapi.Net/Types/ToolMessageFailed.cs +++ b/src/Vapi.Net/Types/ToolMessageFailed.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record ToolMessageFailed diff --git a/src/Vapi.Net/Types/ToolMessageStart.cs b/src/Vapi.Net/Types/ToolMessageStart.cs index 60de987..9959f23 100644 --- a/src/Vapi.Net/Types/ToolMessageStart.cs +++ b/src/Vapi.Net/Types/ToolMessageStart.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record ToolMessageStart @@ -19,6 +17,14 @@ public record ToolMessageStart [JsonPropertyName("contents")] public IEnumerable? Contents { get; set; } + /// + /// This is an optional boolean that if true, the tool call will only trigger after the message is spoken. Default is false. + /// + /// @default false + /// + [JsonPropertyName("blocking")] + public bool? Blocking { get; set; } + /// /// This is the content that the assistant says when this message is triggered. /// diff --git a/src/Vapi.Net/Types/ToolTemplateMetadata.cs b/src/Vapi.Net/Types/ToolTemplateMetadata.cs index 900714e..79c6de3 100644 --- a/src/Vapi.Net/Types/ToolTemplateMetadata.cs +++ b/src/Vapi.Net/Types/ToolTemplateMetadata.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record ToolTemplateMetadata diff --git a/src/Vapi.Net/Types/ToolTemplateSetup.cs b/src/Vapi.Net/Types/ToolTemplateSetup.cs index 769cb6e..9ae9064 100644 --- a/src/Vapi.Net/Types/ToolTemplateSetup.cs +++ b/src/Vapi.Net/Types/ToolTemplateSetup.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record ToolTemplateSetup diff --git a/src/Vapi.Net/Types/TranscriberCost.cs b/src/Vapi.Net/Types/TranscriberCost.cs index 7c2803c..c21739e 100644 --- a/src/Vapi.Net/Types/TranscriberCost.cs +++ b/src/Vapi.Net/Types/TranscriberCost.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record TranscriberCost diff --git a/src/Vapi.Net/Types/TranscriptPlan.cs b/src/Vapi.Net/Types/TranscriptPlan.cs index 2b0e168..c3a975f 100644 --- a/src/Vapi.Net/Types/TranscriptPlan.cs +++ b/src/Vapi.Net/Types/TranscriptPlan.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record TranscriptPlan diff --git a/src/Vapi.Net/Types/TranscriptionEndpointingPlan.cs b/src/Vapi.Net/Types/TranscriptionEndpointingPlan.cs index 116d4d6..049698d 100644 --- a/src/Vapi.Net/Types/TranscriptionEndpointingPlan.cs +++ b/src/Vapi.Net/Types/TranscriptionEndpointingPlan.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record TranscriptionEndpointingPlan diff --git a/src/Vapi.Net/Types/Transfer.cs b/src/Vapi.Net/Types/Transfer.cs new file mode 100644 index 0000000..1471f16 --- /dev/null +++ b/src/Vapi.Net/Types/Transfer.cs @@ -0,0 +1,24 @@ +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record Transfer +{ + [JsonPropertyName("destination")] + public object Destination { get; set; } = new Dictionary(); + + [JsonPropertyName("name")] + public required string Name { get; set; } + + /// + /// This is for metadata you want to store on the task. + /// + [JsonPropertyName("metadata")] + public object? Metadata { get; set; } + + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/TransferAssistantHookAction.cs b/src/Vapi.Net/Types/TransferAssistantHookAction.cs new file mode 100644 index 0000000..e9a1333 --- /dev/null +++ b/src/Vapi.Net/Types/TransferAssistantHookAction.cs @@ -0,0 +1,24 @@ +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record TransferAssistantHookAction +{ + /// + /// This is the type of action - must be "transfer" + /// + [JsonPropertyName("type")] + public string Type { get; set; } = "transfer"; + + /// + /// This is the destination details for the transfer - can be a phone number or SIP URI + /// + [JsonPropertyName("destination")] + public object? Destination { get; set; } + + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/TransferCallTool.cs b/src/Vapi.Net/Types/TransferCallTool.cs index 1eb6e3e..d455796 100644 --- a/src/Vapi.Net/Types/TransferCallTool.cs +++ b/src/Vapi.Net/Types/TransferCallTool.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record TransferCallTool diff --git a/src/Vapi.Net/Types/TransferDestinationAssistant.cs b/src/Vapi.Net/Types/TransferDestinationAssistant.cs index 926e325..ef4ddec 100644 --- a/src/Vapi.Net/Types/TransferDestinationAssistant.cs +++ b/src/Vapi.Net/Types/TransferDestinationAssistant.cs @@ -2,8 +2,6 @@ using OneOf; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record TransferDestinationAssistant @@ -85,6 +83,29 @@ public record TransferDestinationAssistant /// assistant: how can i help? /// user: i need help with my account /// + /// - `swap-system-message-in-history-and-remove-transfer-tool-messages`: This replaces the original system message with the new assistant's system message on transfer and removes transfer tool messages from conversation history sent to the LLM. + /// + /// Example: + /// + /// Pre-transfer: + /// system: assistant1 system message + /// assistant: assistant1 first message + /// user: hey, good morning + /// assistant: how can i help? + /// user: i need help with my account + /// transfer-tool + /// transfer-tool-result + /// assistant: (destination.message) + /// + /// Post-transfer: + /// system: assistant2 system message + /// assistant: assistant1 first message + /// user: hey, good morning + /// assistant: how can i help? + /// user: i need help with my account + /// assistant: (destination.message) + /// assistant: assistant2 first message (or model generated if firstMessageMode is set to `assistant-speaks-first-with-model-generated-message`) + /// /// @default 'rolling-history' /// [JsonPropertyName("transferMode")] diff --git a/src/Vapi.Net/Types/TransferDestinationNumber.cs b/src/Vapi.Net/Types/TransferDestinationNumber.cs index 2ba7246..e26dc37 100644 --- a/src/Vapi.Net/Types/TransferDestinationNumber.cs +++ b/src/Vapi.Net/Types/TransferDestinationNumber.cs @@ -2,8 +2,6 @@ using OneOf; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record TransferDestinationNumber diff --git a/src/Vapi.Net/Types/TransferDestinationSip.cs b/src/Vapi.Net/Types/TransferDestinationSip.cs index 4e4e3a5..11ff5f8 100644 --- a/src/Vapi.Net/Types/TransferDestinationSip.cs +++ b/src/Vapi.Net/Types/TransferDestinationSip.cs @@ -2,8 +2,6 @@ using OneOf; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record TransferDestinationSip diff --git a/src/Vapi.Net/Types/TransferDestinationStep.cs b/src/Vapi.Net/Types/TransferDestinationStep.cs index 930b4fb..2b317be 100644 --- a/src/Vapi.Net/Types/TransferDestinationStep.cs +++ b/src/Vapi.Net/Types/TransferDestinationStep.cs @@ -2,8 +2,6 @@ using OneOf; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record TransferDestinationStep diff --git a/src/Vapi.Net/Types/TransferMode.cs b/src/Vapi.Net/Types/TransferMode.cs index 64423c3..61a5ede 100644 --- a/src/Vapi.Net/Types/TransferMode.cs +++ b/src/Vapi.Net/Types/TransferMode.cs @@ -2,8 +2,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] diff --git a/src/Vapi.Net/Types/TransferPlan.cs b/src/Vapi.Net/Types/TransferPlan.cs index da3e394..90f0e02 100644 --- a/src/Vapi.Net/Types/TransferPlan.cs +++ b/src/Vapi.Net/Types/TransferPlan.cs @@ -2,8 +2,6 @@ using OneOf; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record TransferPlan @@ -18,6 +16,7 @@ public record TransferPlan /// - `warm-transfer-say-summary`: The assistant dials the destination, provides a summary of the call to the destination party, connects the customer, and leaves the call. /// - `warm-transfer-wait-for-operator-to-speak-first-and-then-say-message`: The assistant dials the destination, waits for the operator to speak, delivers the `message` to the destination party, and then connects the customer. /// - `warm-transfer-wait-for-operator-to-speak-first-and-then-say-summary`: The assistant dials the destination, waits for the operator to speak, provides a summary of the call to the destination party, and then connects the customer. + /// - `warm-transfer-twiml`: The assistant dials the destination, executes the twiml instructions on the destination call leg, connects the customer, and leaves the call. /// /// @default 'blind-transfer' /// @@ -41,6 +40,24 @@ public record TransferPlan [JsonPropertyName("sipVerb")] public object? SipVerb { get; set; } + /// + /// This is the TwiML instructions to execute on the destination call leg before connecting the customer. + /// + /// Usage: + /// - Used only when `mode` is `warm-transfer-twiml`. + /// - Supports only `Play`, `Say`, `Gather`, `Hangup` and `Pause` verbs. + /// - Maximum length is 4096 characters. + /// + /// Example: + /// ``` + /// <Say voice="alice" language="en-US">Hello, transferring a customer to you.</Say> + /// <Pause length="2"/> + /// <Say>They called about billing questions.</Say> + /// ``` + /// + [JsonPropertyName("twiml")] + public string? Twiml { get; set; } + /// /// This is the plan for generating a summary of the call to present to the destination party. /// diff --git a/src/Vapi.Net/Types/TransferPlanMode.cs b/src/Vapi.Net/Types/TransferPlanMode.cs index fc4f3ce..3adc789 100644 --- a/src/Vapi.Net/Types/TransferPlanMode.cs +++ b/src/Vapi.Net/Types/TransferPlanMode.cs @@ -2,8 +2,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] @@ -21,6 +19,9 @@ public enum TransferPlanMode [EnumMember(Value = "warm-transfer-say-summary")] WarmTransferSaySummary, + [EnumMember(Value = "warm-transfer-twiml")] + WarmTransferTwiml, + [EnumMember(Value = "warm-transfer-wait-for-operator-to-speak-first-and-then-say-message")] WarmTransferWaitForOperatorToSpeakFirstAndThenSayMessage, diff --git a/src/Vapi.Net/Types/Transport.cs b/src/Vapi.Net/Types/Transport.cs index 08ec1f9..0bdd066 100644 --- a/src/Vapi.Net/Types/Transport.cs +++ b/src/Vapi.Net/Types/Transport.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record Transport diff --git a/src/Vapi.Net/Types/TransportConfigurationTwilio.cs b/src/Vapi.Net/Types/TransportConfigurationTwilio.cs index 71423d7..d4b7101 100644 --- a/src/Vapi.Net/Types/TransportConfigurationTwilio.cs +++ b/src/Vapi.Net/Types/TransportConfigurationTwilio.cs @@ -1,14 +1,12 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record TransportConfigurationTwilio { [JsonPropertyName("provider")] - public required string Provider { get; set; } + public string Provider { get; set; } = "twilio"; /// /// The integer number of seconds that we should allow the phone to ring before assuming there is no answer. diff --git a/src/Vapi.Net/Types/TransportConfigurationTwilioRecordingChannels.cs b/src/Vapi.Net/Types/TransportConfigurationTwilioRecordingChannels.cs index 9515efc..e158a4d 100644 --- a/src/Vapi.Net/Types/TransportConfigurationTwilioRecordingChannels.cs +++ b/src/Vapi.Net/Types/TransportConfigurationTwilioRecordingChannels.cs @@ -2,8 +2,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] diff --git a/src/Vapi.Net/Types/TransportCost.cs b/src/Vapi.Net/Types/TransportCost.cs index 3509bc0..d6bc26a 100644 --- a/src/Vapi.Net/Types/TransportCost.cs +++ b/src/Vapi.Net/Types/TransportCost.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record TransportCost diff --git a/src/Vapi.Net/Types/TransportCostProvider.cs b/src/Vapi.Net/Types/TransportCostProvider.cs index 6b061e1..c15ad6d 100644 --- a/src/Vapi.Net/Types/TransportCostProvider.cs +++ b/src/Vapi.Net/Types/TransportCostProvider.cs @@ -2,8 +2,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] diff --git a/src/Vapi.Net/Types/TransportProvider.cs b/src/Vapi.Net/Types/TransportProvider.cs index e1c5146..90cf160 100644 --- a/src/Vapi.Net/Types/TransportProvider.cs +++ b/src/Vapi.Net/Types/TransportProvider.cs @@ -2,8 +2,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] diff --git a/src/Vapi.Net/Types/TrieveKnowledgeBase.cs b/src/Vapi.Net/Types/TrieveKnowledgeBase.cs index a53d97d..b8abf2e 100644 --- a/src/Vapi.Net/Types/TrieveKnowledgeBase.cs +++ b/src/Vapi.Net/Types/TrieveKnowledgeBase.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record TrieveKnowledgeBase diff --git a/src/Vapi.Net/Types/TrieveKnowledgeBaseChunkPlan.cs b/src/Vapi.Net/Types/TrieveKnowledgeBaseChunkPlan.cs index 67224ff..e2f0956 100644 --- a/src/Vapi.Net/Types/TrieveKnowledgeBaseChunkPlan.cs +++ b/src/Vapi.Net/Types/TrieveKnowledgeBaseChunkPlan.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record TrieveKnowledgeBaseChunkPlan diff --git a/src/Vapi.Net/Types/TrieveKnowledgeBaseCreate.cs b/src/Vapi.Net/Types/TrieveKnowledgeBaseCreate.cs index db7ddfd..65732db 100644 --- a/src/Vapi.Net/Types/TrieveKnowledgeBaseCreate.cs +++ b/src/Vapi.Net/Types/TrieveKnowledgeBaseCreate.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record TrieveKnowledgeBaseCreate diff --git a/src/Vapi.Net/Types/TrieveKnowledgeBaseImport.cs b/src/Vapi.Net/Types/TrieveKnowledgeBaseImport.cs index 5543eb6..32a628b 100644 --- a/src/Vapi.Net/Types/TrieveKnowledgeBaseImport.cs +++ b/src/Vapi.Net/Types/TrieveKnowledgeBaseImport.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record TrieveKnowledgeBaseImport diff --git a/src/Vapi.Net/Types/TrieveKnowledgeBaseSearchPlan.cs b/src/Vapi.Net/Types/TrieveKnowledgeBaseSearchPlan.cs index cbc96b6..5abd6f8 100644 --- a/src/Vapi.Net/Types/TrieveKnowledgeBaseSearchPlan.cs +++ b/src/Vapi.Net/Types/TrieveKnowledgeBaseSearchPlan.cs @@ -1,12 +1,16 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record TrieveKnowledgeBaseSearchPlan { + /// + /// Specifies the number of top chunks to return. This corresponds to the `page_size` parameter in Trieve. + /// + [JsonPropertyName("topK")] + public double? TopK { get; set; } + /// /// If true, stop words (specified in server/src/stop-words.txt in the git repo) will be removed. This will preserve queries that are entirely stop words. /// diff --git a/src/Vapi.Net/Types/TrieveKnowledgeBaseSearchPlanSearchType.cs b/src/Vapi.Net/Types/TrieveKnowledgeBaseSearchPlanSearchType.cs index 1dd06b8..d9b00aa 100644 --- a/src/Vapi.Net/Types/TrieveKnowledgeBaseSearchPlanSearchType.cs +++ b/src/Vapi.Net/Types/TrieveKnowledgeBaseSearchPlanSearchType.cs @@ -2,8 +2,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] diff --git a/src/Vapi.Net/Types/TwilioCredential.cs b/src/Vapi.Net/Types/TwilioCredential.cs index 6e57dac..759c3ab 100644 --- a/src/Vapi.Net/Types/TwilioCredential.cs +++ b/src/Vapi.Net/Types/TwilioCredential.cs @@ -1,14 +1,12 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record TwilioCredential { [JsonPropertyName("provider")] - public required string Provider { get; set; } + public string Provider { get; set; } = "twilio"; /// /// This is not returned in the API. diff --git a/src/Vapi.Net/Types/TwilioPhoneNumber.cs b/src/Vapi.Net/Types/TwilioPhoneNumber.cs index c3b8872..cf5484e 100644 --- a/src/Vapi.Net/Types/TwilioPhoneNumber.cs +++ b/src/Vapi.Net/Types/TwilioPhoneNumber.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record TwilioPhoneNumber @@ -42,6 +40,12 @@ public record TwilioPhoneNumber [JsonPropertyName("updatedAt")] public required DateTime UpdatedAt { get; set; } + /// + /// This is the status of the phone number. + /// + [JsonPropertyName("status")] + public TwilioPhoneNumberStatus? Status { get; set; } + /// /// This is the name of the phone number. This is just for your own reference. /// diff --git a/src/Vapi.Net/Types/TwilioPhoneNumberStatus.cs b/src/Vapi.Net/Types/TwilioPhoneNumberStatus.cs new file mode 100644 index 0000000..3c90e71 --- /dev/null +++ b/src/Vapi.Net/Types/TwilioPhoneNumberStatus.cs @@ -0,0 +1,18 @@ +using System.Runtime.Serialization; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[JsonConverter(typeof(EnumSerializer))] +public enum TwilioPhoneNumberStatus +{ + [EnumMember(Value = "active")] + Active, + + [EnumMember(Value = "activating")] + Activating, + + [EnumMember(Value = "blocked")] + Blocked, +} diff --git a/src/Vapi.Net/Types/TwilioVoicemailDetection.cs b/src/Vapi.Net/Types/TwilioVoicemailDetection.cs index f1af525..9137140 100644 --- a/src/Vapi.Net/Types/TwilioVoicemailDetection.cs +++ b/src/Vapi.Net/Types/TwilioVoicemailDetection.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record TwilioVoicemailDetection @@ -11,7 +9,7 @@ public record TwilioVoicemailDetection /// This is the provider to use for voicemail detection. /// [JsonPropertyName("provider")] - public required string Provider { get; set; } + public string Provider { get; set; } = "twilio"; /// /// These are the AMD messages from Twilio that are considered as voicemail. Default is ['machine_end_beep', 'machine_end_silence']. diff --git a/src/Vapi.Net/Types/TwilioVoicemailDetectionVoicemailDetectionTypesItem.cs b/src/Vapi.Net/Types/TwilioVoicemailDetectionVoicemailDetectionTypesItem.cs index ba6750f..a193770 100644 --- a/src/Vapi.Net/Types/TwilioVoicemailDetectionVoicemailDetectionTypesItem.cs +++ b/src/Vapi.Net/Types/TwilioVoicemailDetectionVoicemailDetectionTypesItem.cs @@ -2,8 +2,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] diff --git a/src/Vapi.Net/Types/UpdateAnthropicCredentialDto.cs b/src/Vapi.Net/Types/UpdateAnthropicCredentialDto.cs index c76a6cd..6e7d414 100644 --- a/src/Vapi.Net/Types/UpdateAnthropicCredentialDto.cs +++ b/src/Vapi.Net/Types/UpdateAnthropicCredentialDto.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record UpdateAnthropicCredentialDto diff --git a/src/Vapi.Net/Types/UpdateAnyscaleCredentialDto.cs b/src/Vapi.Net/Types/UpdateAnyscaleCredentialDto.cs index cf5b1cc..ce49c16 100644 --- a/src/Vapi.Net/Types/UpdateAnyscaleCredentialDto.cs +++ b/src/Vapi.Net/Types/UpdateAnyscaleCredentialDto.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record UpdateAnyscaleCredentialDto diff --git a/src/Vapi.Net/Types/UpdateAssemblyAiCredentialDto.cs b/src/Vapi.Net/Types/UpdateAssemblyAiCredentialDto.cs index b7c1b81..c12b825 100644 --- a/src/Vapi.Net/Types/UpdateAssemblyAiCredentialDto.cs +++ b/src/Vapi.Net/Types/UpdateAssemblyAiCredentialDto.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record UpdateAssemblyAiCredentialDto diff --git a/src/Vapi.Net/Types/UpdateAzureCredentialDto.cs b/src/Vapi.Net/Types/UpdateAzureCredentialDto.cs index 973542f..9766839 100644 --- a/src/Vapi.Net/Types/UpdateAzureCredentialDto.cs +++ b/src/Vapi.Net/Types/UpdateAzureCredentialDto.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record UpdateAzureCredentialDto diff --git a/src/Vapi.Net/Types/UpdateAzureCredentialDtoRegion.cs b/src/Vapi.Net/Types/UpdateAzureCredentialDtoRegion.cs index a97ac71..6870f18 100644 --- a/src/Vapi.Net/Types/UpdateAzureCredentialDtoRegion.cs +++ b/src/Vapi.Net/Types/UpdateAzureCredentialDtoRegion.cs @@ -2,8 +2,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] diff --git a/src/Vapi.Net/Types/UpdateAzureCredentialDtoService.cs b/src/Vapi.Net/Types/UpdateAzureCredentialDtoService.cs index 0b7099e..c9427a1 100644 --- a/src/Vapi.Net/Types/UpdateAzureCredentialDtoService.cs +++ b/src/Vapi.Net/Types/UpdateAzureCredentialDtoService.cs @@ -2,8 +2,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] diff --git a/src/Vapi.Net/Types/UpdateAzureOpenAiCredentialDto.cs b/src/Vapi.Net/Types/UpdateAzureOpenAiCredentialDto.cs index fd4a663..a3f2563 100644 --- a/src/Vapi.Net/Types/UpdateAzureOpenAiCredentialDto.cs +++ b/src/Vapi.Net/Types/UpdateAzureOpenAiCredentialDto.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record UpdateAzureOpenAiCredentialDto diff --git a/src/Vapi.Net/Types/UpdateAzureOpenAiCredentialDtoModelsItem.cs b/src/Vapi.Net/Types/UpdateAzureOpenAiCredentialDtoModelsItem.cs index 3cb3fd7..5bb9003 100644 --- a/src/Vapi.Net/Types/UpdateAzureOpenAiCredentialDtoModelsItem.cs +++ b/src/Vapi.Net/Types/UpdateAzureOpenAiCredentialDtoModelsItem.cs @@ -2,13 +2,14 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] public enum UpdateAzureOpenAiCredentialDtoModelsItem { + [EnumMember(Value = "gpt-4o-2024-08-06-ptu")] + Gpt4O20240806Ptu, + [EnumMember(Value = "gpt-4o-2024-08-06")] Gpt4O20240806, diff --git a/src/Vapi.Net/Types/UpdateAzureOpenAiCredentialDtoRegion.cs b/src/Vapi.Net/Types/UpdateAzureOpenAiCredentialDtoRegion.cs index 44a71e5..bd090d3 100644 --- a/src/Vapi.Net/Types/UpdateAzureOpenAiCredentialDtoRegion.cs +++ b/src/Vapi.Net/Types/UpdateAzureOpenAiCredentialDtoRegion.cs @@ -2,8 +2,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] diff --git a/src/Vapi.Net/Types/UpdateBashToolDto.cs b/src/Vapi.Net/Types/UpdateBashToolDto.cs index c599465..594a414 100644 --- a/src/Vapi.Net/Types/UpdateBashToolDto.cs +++ b/src/Vapi.Net/Types/UpdateBashToolDto.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record UpdateBashToolDto diff --git a/src/Vapi.Net/Types/UpdateByoPhoneNumberDto.cs b/src/Vapi.Net/Types/UpdateByoPhoneNumberDto.cs index ec7a1aa..a096390 100644 --- a/src/Vapi.Net/Types/UpdateByoPhoneNumberDto.cs +++ b/src/Vapi.Net/Types/UpdateByoPhoneNumberDto.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record UpdateByoPhoneNumberDto diff --git a/src/Vapi.Net/Types/UpdateByoSipTrunkCredentialDto.cs b/src/Vapi.Net/Types/UpdateByoSipTrunkCredentialDto.cs index a759ef5..952d9f0 100644 --- a/src/Vapi.Net/Types/UpdateByoSipTrunkCredentialDto.cs +++ b/src/Vapi.Net/Types/UpdateByoSipTrunkCredentialDto.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record UpdateByoSipTrunkCredentialDto diff --git a/src/Vapi.Net/Types/UpdateCartesiaCredentialDto.cs b/src/Vapi.Net/Types/UpdateCartesiaCredentialDto.cs index 093ef3b..69ab2a3 100644 --- a/src/Vapi.Net/Types/UpdateCartesiaCredentialDto.cs +++ b/src/Vapi.Net/Types/UpdateCartesiaCredentialDto.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record UpdateCartesiaCredentialDto diff --git a/src/Vapi.Net/Types/UpdateCerebrasCredentialDto.cs b/src/Vapi.Net/Types/UpdateCerebrasCredentialDto.cs index b556ca1..7713aaf 100644 --- a/src/Vapi.Net/Types/UpdateCerebrasCredentialDto.cs +++ b/src/Vapi.Net/Types/UpdateCerebrasCredentialDto.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record UpdateCerebrasCredentialDto diff --git a/src/Vapi.Net/Types/UpdateCloudflareCredentialDto.cs b/src/Vapi.Net/Types/UpdateCloudflareCredentialDto.cs index 07efa24..f1ca704 100644 --- a/src/Vapi.Net/Types/UpdateCloudflareCredentialDto.cs +++ b/src/Vapi.Net/Types/UpdateCloudflareCredentialDto.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record UpdateCloudflareCredentialDto diff --git a/src/Vapi.Net/Types/UpdateComputerToolDto.cs b/src/Vapi.Net/Types/UpdateComputerToolDto.cs index 865b397..2bf6365 100644 --- a/src/Vapi.Net/Types/UpdateComputerToolDto.cs +++ b/src/Vapi.Net/Types/UpdateComputerToolDto.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record UpdateComputerToolDto diff --git a/src/Vapi.Net/Types/UpdateConversationBlockDto.cs b/src/Vapi.Net/Types/UpdateConversationBlockDto.cs index ed54c08..fbeca07 100644 --- a/src/Vapi.Net/Types/UpdateConversationBlockDto.cs +++ b/src/Vapi.Net/Types/UpdateConversationBlockDto.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record UpdateConversationBlockDto diff --git a/src/Vapi.Net/Types/UpdateCustomKnowledgeBaseDto.cs b/src/Vapi.Net/Types/UpdateCustomKnowledgeBaseDto.cs index d897a50..976d577 100644 --- a/src/Vapi.Net/Types/UpdateCustomKnowledgeBaseDto.cs +++ b/src/Vapi.Net/Types/UpdateCustomKnowledgeBaseDto.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record UpdateCustomKnowledgeBaseDto diff --git a/src/Vapi.Net/Types/UpdateCustomLlmCredentialDto.cs b/src/Vapi.Net/Types/UpdateCustomLlmCredentialDto.cs index 1c98bea..66f2a3a 100644 --- a/src/Vapi.Net/Types/UpdateCustomLlmCredentialDto.cs +++ b/src/Vapi.Net/Types/UpdateCustomLlmCredentialDto.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record UpdateCustomLlmCredentialDto diff --git a/src/Vapi.Net/Types/UpdateDeepInfraCredentialDto.cs b/src/Vapi.Net/Types/UpdateDeepInfraCredentialDto.cs index 8f27fa4..8b9850f 100644 --- a/src/Vapi.Net/Types/UpdateDeepInfraCredentialDto.cs +++ b/src/Vapi.Net/Types/UpdateDeepInfraCredentialDto.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record UpdateDeepInfraCredentialDto diff --git a/src/Vapi.Net/Types/UpdateDeepSeekCredentialDto.cs b/src/Vapi.Net/Types/UpdateDeepSeekCredentialDto.cs index e9f9ff7..dc76c54 100644 --- a/src/Vapi.Net/Types/UpdateDeepSeekCredentialDto.cs +++ b/src/Vapi.Net/Types/UpdateDeepSeekCredentialDto.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record UpdateDeepSeekCredentialDto diff --git a/src/Vapi.Net/Types/UpdateDeepgramCredentialDto.cs b/src/Vapi.Net/Types/UpdateDeepgramCredentialDto.cs index 1a925c9..2746e97 100644 --- a/src/Vapi.Net/Types/UpdateDeepgramCredentialDto.cs +++ b/src/Vapi.Net/Types/UpdateDeepgramCredentialDto.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record UpdateDeepgramCredentialDto diff --git a/src/Vapi.Net/Types/UpdateDtmfToolDto.cs b/src/Vapi.Net/Types/UpdateDtmfToolDto.cs index 96e0259..9b9ba0c 100644 --- a/src/Vapi.Net/Types/UpdateDtmfToolDto.cs +++ b/src/Vapi.Net/Types/UpdateDtmfToolDto.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record UpdateDtmfToolDto diff --git a/src/Vapi.Net/Types/UpdateElevenLabsCredentialDto.cs b/src/Vapi.Net/Types/UpdateElevenLabsCredentialDto.cs index 2092724..3648e11 100644 --- a/src/Vapi.Net/Types/UpdateElevenLabsCredentialDto.cs +++ b/src/Vapi.Net/Types/UpdateElevenLabsCredentialDto.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record UpdateElevenLabsCredentialDto diff --git a/src/Vapi.Net/Types/UpdateEndCallToolDto.cs b/src/Vapi.Net/Types/UpdateEndCallToolDto.cs index b170c7b..e18ee24 100644 --- a/src/Vapi.Net/Types/UpdateEndCallToolDto.cs +++ b/src/Vapi.Net/Types/UpdateEndCallToolDto.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record UpdateEndCallToolDto diff --git a/src/Vapi.Net/Types/UpdateFunctionToolDto.cs b/src/Vapi.Net/Types/UpdateFunctionToolDto.cs index 2fca700..567daf0 100644 --- a/src/Vapi.Net/Types/UpdateFunctionToolDto.cs +++ b/src/Vapi.Net/Types/UpdateFunctionToolDto.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record UpdateFunctionToolDto diff --git a/src/Vapi.Net/Types/UpdateGcpCredentialDto.cs b/src/Vapi.Net/Types/UpdateGcpCredentialDto.cs index 7970b02..65a3801 100644 --- a/src/Vapi.Net/Types/UpdateGcpCredentialDto.cs +++ b/src/Vapi.Net/Types/UpdateGcpCredentialDto.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record UpdateGcpCredentialDto diff --git a/src/Vapi.Net/Types/UpdateGhlToolDto.cs b/src/Vapi.Net/Types/UpdateGhlToolDto.cs index 130818a..de906e1 100644 --- a/src/Vapi.Net/Types/UpdateGhlToolDto.cs +++ b/src/Vapi.Net/Types/UpdateGhlToolDto.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record UpdateGhlToolDto diff --git a/src/Vapi.Net/Types/UpdateGladiaCredentialDto.cs b/src/Vapi.Net/Types/UpdateGladiaCredentialDto.cs index db58d19..a63a51a 100644 --- a/src/Vapi.Net/Types/UpdateGladiaCredentialDto.cs +++ b/src/Vapi.Net/Types/UpdateGladiaCredentialDto.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record UpdateGladiaCredentialDto diff --git a/src/Vapi.Net/Types/UpdateGoHighLevelCredentialDto.cs b/src/Vapi.Net/Types/UpdateGoHighLevelCredentialDto.cs index 5775558..b67dd5b 100644 --- a/src/Vapi.Net/Types/UpdateGoHighLevelCredentialDto.cs +++ b/src/Vapi.Net/Types/UpdateGoHighLevelCredentialDto.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record UpdateGoHighLevelCredentialDto diff --git a/src/Vapi.Net/Types/UpdateGoogleCredentialDto.cs b/src/Vapi.Net/Types/UpdateGoogleCredentialDto.cs index 34422af..e662d06 100644 --- a/src/Vapi.Net/Types/UpdateGoogleCredentialDto.cs +++ b/src/Vapi.Net/Types/UpdateGoogleCredentialDto.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record UpdateGoogleCredentialDto diff --git a/src/Vapi.Net/Types/UpdateGroqCredentialDto.cs b/src/Vapi.Net/Types/UpdateGroqCredentialDto.cs index 8b39142..d2c9d6c 100644 --- a/src/Vapi.Net/Types/UpdateGroqCredentialDto.cs +++ b/src/Vapi.Net/Types/UpdateGroqCredentialDto.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record UpdateGroqCredentialDto diff --git a/src/Vapi.Net/Types/UpdateInflectionAiCredentialDto.cs b/src/Vapi.Net/Types/UpdateInflectionAiCredentialDto.cs index 2f00705..cd0174a 100644 --- a/src/Vapi.Net/Types/UpdateInflectionAiCredentialDto.cs +++ b/src/Vapi.Net/Types/UpdateInflectionAiCredentialDto.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record UpdateInflectionAiCredentialDto diff --git a/src/Vapi.Net/Types/UpdateLangfuseCredentialDto.cs b/src/Vapi.Net/Types/UpdateLangfuseCredentialDto.cs index 9af6c6e..478e04d 100644 --- a/src/Vapi.Net/Types/UpdateLangfuseCredentialDto.cs +++ b/src/Vapi.Net/Types/UpdateLangfuseCredentialDto.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record UpdateLangfuseCredentialDto diff --git a/src/Vapi.Net/Types/UpdateLmntCredentialDto.cs b/src/Vapi.Net/Types/UpdateLmntCredentialDto.cs index 8a97d21..6fba7d7 100644 --- a/src/Vapi.Net/Types/UpdateLmntCredentialDto.cs +++ b/src/Vapi.Net/Types/UpdateLmntCredentialDto.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record UpdateLmntCredentialDto diff --git a/src/Vapi.Net/Types/UpdateMakeCredentialDto.cs b/src/Vapi.Net/Types/UpdateMakeCredentialDto.cs index 292cd8c..8451369 100644 --- a/src/Vapi.Net/Types/UpdateMakeCredentialDto.cs +++ b/src/Vapi.Net/Types/UpdateMakeCredentialDto.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record UpdateMakeCredentialDto diff --git a/src/Vapi.Net/Types/UpdateMakeToolDto.cs b/src/Vapi.Net/Types/UpdateMakeToolDto.cs index d97a7ed..1237494 100644 --- a/src/Vapi.Net/Types/UpdateMakeToolDto.cs +++ b/src/Vapi.Net/Types/UpdateMakeToolDto.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record UpdateMakeToolDto diff --git a/src/Vapi.Net/Types/UpdateOpenAiCredentialDto.cs b/src/Vapi.Net/Types/UpdateOpenAiCredentialDto.cs index a7be671..7bb1ef0 100644 --- a/src/Vapi.Net/Types/UpdateOpenAiCredentialDto.cs +++ b/src/Vapi.Net/Types/UpdateOpenAiCredentialDto.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record UpdateOpenAiCredentialDto diff --git a/src/Vapi.Net/Types/UpdateOpenRouterCredentialDto.cs b/src/Vapi.Net/Types/UpdateOpenRouterCredentialDto.cs index 31a25c5..137f393 100644 --- a/src/Vapi.Net/Types/UpdateOpenRouterCredentialDto.cs +++ b/src/Vapi.Net/Types/UpdateOpenRouterCredentialDto.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record UpdateOpenRouterCredentialDto diff --git a/src/Vapi.Net/Types/UpdateOrgDto.cs b/src/Vapi.Net/Types/UpdateOrgDto.cs index 3e935c5..5aaa289 100644 --- a/src/Vapi.Net/Types/UpdateOrgDto.cs +++ b/src/Vapi.Net/Types/UpdateOrgDto.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record UpdateOrgDto diff --git a/src/Vapi.Net/Types/UpdateOrgDtoChannel.cs b/src/Vapi.Net/Types/UpdateOrgDtoChannel.cs index 4927b3e..254938c 100644 --- a/src/Vapi.Net/Types/UpdateOrgDtoChannel.cs +++ b/src/Vapi.Net/Types/UpdateOrgDtoChannel.cs @@ -2,8 +2,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] diff --git a/src/Vapi.Net/Types/UpdateOutputToolDto.cs b/src/Vapi.Net/Types/UpdateOutputToolDto.cs index 22db748..5d36f42 100644 --- a/src/Vapi.Net/Types/UpdateOutputToolDto.cs +++ b/src/Vapi.Net/Types/UpdateOutputToolDto.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record UpdateOutputToolDto diff --git a/src/Vapi.Net/Types/UpdatePerplexityAiCredentialDto.cs b/src/Vapi.Net/Types/UpdatePerplexityAiCredentialDto.cs index 6ce2170..30b23f1 100644 --- a/src/Vapi.Net/Types/UpdatePerplexityAiCredentialDto.cs +++ b/src/Vapi.Net/Types/UpdatePerplexityAiCredentialDto.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record UpdatePerplexityAiCredentialDto diff --git a/src/Vapi.Net/Types/UpdatePlayHtCredentialDto.cs b/src/Vapi.Net/Types/UpdatePlayHtCredentialDto.cs index 3fadedf..3b848a6 100644 --- a/src/Vapi.Net/Types/UpdatePlayHtCredentialDto.cs +++ b/src/Vapi.Net/Types/UpdatePlayHtCredentialDto.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record UpdatePlayHtCredentialDto diff --git a/src/Vapi.Net/Types/UpdateRimeAiCredentialDto.cs b/src/Vapi.Net/Types/UpdateRimeAiCredentialDto.cs index 29296c4..e6c2bc6 100644 --- a/src/Vapi.Net/Types/UpdateRimeAiCredentialDto.cs +++ b/src/Vapi.Net/Types/UpdateRimeAiCredentialDto.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record UpdateRimeAiCredentialDto diff --git a/src/Vapi.Net/Types/UpdateRunpodCredentialDto.cs b/src/Vapi.Net/Types/UpdateRunpodCredentialDto.cs index ffefc3f..688a709 100644 --- a/src/Vapi.Net/Types/UpdateRunpodCredentialDto.cs +++ b/src/Vapi.Net/Types/UpdateRunpodCredentialDto.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record UpdateRunpodCredentialDto diff --git a/src/Vapi.Net/Types/UpdateS3CredentialDto.cs b/src/Vapi.Net/Types/UpdateS3CredentialDto.cs index 2178bbe..60af4cd 100644 --- a/src/Vapi.Net/Types/UpdateS3CredentialDto.cs +++ b/src/Vapi.Net/Types/UpdateS3CredentialDto.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record UpdateS3CredentialDto diff --git a/src/Vapi.Net/Types/UpdateSmallestAiCredentialDto.cs b/src/Vapi.Net/Types/UpdateSmallestAiCredentialDto.cs index f5de270..8d79caa 100644 --- a/src/Vapi.Net/Types/UpdateSmallestAiCredentialDto.cs +++ b/src/Vapi.Net/Types/UpdateSmallestAiCredentialDto.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record UpdateSmallestAiCredentialDto diff --git a/src/Vapi.Net/Types/UpdateTavusCredentialDto.cs b/src/Vapi.Net/Types/UpdateTavusCredentialDto.cs index 0bc7061..aefc195 100644 --- a/src/Vapi.Net/Types/UpdateTavusCredentialDto.cs +++ b/src/Vapi.Net/Types/UpdateTavusCredentialDto.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record UpdateTavusCredentialDto diff --git a/src/Vapi.Net/Types/UpdateTestSuiteTestVoiceDto.cs b/src/Vapi.Net/Types/UpdateTestSuiteTestVoiceDto.cs new file mode 100644 index 0000000..2135fa5 --- /dev/null +++ b/src/Vapi.Net/Types/UpdateTestSuiteTestVoiceDto.cs @@ -0,0 +1,36 @@ +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record UpdateTestSuiteTestVoiceDto +{ + /// + /// These are the scorers used to evaluate the test. + /// + [JsonPropertyName("scorers")] + public IEnumerable? Scorers { get; set; } + + /// + /// This is the name of the test. + /// + [JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// This is the script to be used for the voice test. + /// + [JsonPropertyName("script")] + public string? Script { get; set; } + + /// + /// This is the number of attempts allowed for the test. + /// + [JsonPropertyName("numAttempts")] + public double? NumAttempts { get; set; } + + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/UpdateTextEditorToolDto.cs b/src/Vapi.Net/Types/UpdateTextEditorToolDto.cs index a6e415d..b0533d8 100644 --- a/src/Vapi.Net/Types/UpdateTextEditorToolDto.cs +++ b/src/Vapi.Net/Types/UpdateTextEditorToolDto.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record UpdateTextEditorToolDto diff --git a/src/Vapi.Net/Types/UpdateTogetherAiCredentialDto.cs b/src/Vapi.Net/Types/UpdateTogetherAiCredentialDto.cs index ff51735..01782dd 100644 --- a/src/Vapi.Net/Types/UpdateTogetherAiCredentialDto.cs +++ b/src/Vapi.Net/Types/UpdateTogetherAiCredentialDto.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record UpdateTogetherAiCredentialDto diff --git a/src/Vapi.Net/Types/UpdateTokenDto.cs b/src/Vapi.Net/Types/UpdateTokenDto.cs index 5d52b82..93c5e31 100644 --- a/src/Vapi.Net/Types/UpdateTokenDto.cs +++ b/src/Vapi.Net/Types/UpdateTokenDto.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record UpdateTokenDto diff --git a/src/Vapi.Net/Types/UpdateTokenDtoTag.cs b/src/Vapi.Net/Types/UpdateTokenDtoTag.cs index e22f262..beb025f 100644 --- a/src/Vapi.Net/Types/UpdateTokenDtoTag.cs +++ b/src/Vapi.Net/Types/UpdateTokenDtoTag.cs @@ -2,8 +2,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] diff --git a/src/Vapi.Net/Types/UpdateToolCallBlockDto.cs b/src/Vapi.Net/Types/UpdateToolCallBlockDto.cs index 31109e4..e18ca0c 100644 --- a/src/Vapi.Net/Types/UpdateToolCallBlockDto.cs +++ b/src/Vapi.Net/Types/UpdateToolCallBlockDto.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record UpdateToolCallBlockDto diff --git a/src/Vapi.Net/Types/UpdateToolTemplateDto.cs b/src/Vapi.Net/Types/UpdateToolTemplateDto.cs index 8c35b30..c396033 100644 --- a/src/Vapi.Net/Types/UpdateToolTemplateDto.cs +++ b/src/Vapi.Net/Types/UpdateToolTemplateDto.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record UpdateToolTemplateDto @@ -20,7 +18,7 @@ public record UpdateToolTemplateDto public UpdateToolTemplateDtoVisibility? Visibility { get; set; } [JsonPropertyName("type")] - public required string Type { get; set; } + public string Type { get; set; } = "tool"; /// /// The name of the template. This is just for your own reference. diff --git a/src/Vapi.Net/Types/UpdateToolTemplateDtoProvider.cs b/src/Vapi.Net/Types/UpdateToolTemplateDtoProvider.cs index 0cc1147..67a55ad 100644 --- a/src/Vapi.Net/Types/UpdateToolTemplateDtoProvider.cs +++ b/src/Vapi.Net/Types/UpdateToolTemplateDtoProvider.cs @@ -2,8 +2,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] diff --git a/src/Vapi.Net/Types/UpdateToolTemplateDtoVisibility.cs b/src/Vapi.Net/Types/UpdateToolTemplateDtoVisibility.cs index 7e6b9d2..e2468d4 100644 --- a/src/Vapi.Net/Types/UpdateToolTemplateDtoVisibility.cs +++ b/src/Vapi.Net/Types/UpdateToolTemplateDtoVisibility.cs @@ -2,8 +2,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] diff --git a/src/Vapi.Net/Types/UpdateTransferCallToolDto.cs b/src/Vapi.Net/Types/UpdateTransferCallToolDto.cs index 5660229..cb9e865 100644 --- a/src/Vapi.Net/Types/UpdateTransferCallToolDto.cs +++ b/src/Vapi.Net/Types/UpdateTransferCallToolDto.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record UpdateTransferCallToolDto diff --git a/src/Vapi.Net/Types/UpdateTrieveKnowledgeBaseDto.cs b/src/Vapi.Net/Types/UpdateTrieveKnowledgeBaseDto.cs index 73fb4cf..cb6902f 100644 --- a/src/Vapi.Net/Types/UpdateTrieveKnowledgeBaseDto.cs +++ b/src/Vapi.Net/Types/UpdateTrieveKnowledgeBaseDto.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record UpdateTrieveKnowledgeBaseDto diff --git a/src/Vapi.Net/Types/UpdateTwilioCredentialDto.cs b/src/Vapi.Net/Types/UpdateTwilioCredentialDto.cs index 0f8fe1d..803c5e1 100644 --- a/src/Vapi.Net/Types/UpdateTwilioCredentialDto.cs +++ b/src/Vapi.Net/Types/UpdateTwilioCredentialDto.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record UpdateTwilioCredentialDto diff --git a/src/Vapi.Net/Types/UpdateTwilioPhoneNumberDto.cs b/src/Vapi.Net/Types/UpdateTwilioPhoneNumberDto.cs index fbcccae..c16620e 100644 --- a/src/Vapi.Net/Types/UpdateTwilioPhoneNumberDto.cs +++ b/src/Vapi.Net/Types/UpdateTwilioPhoneNumberDto.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record UpdateTwilioPhoneNumberDto diff --git a/src/Vapi.Net/Types/UpdateUserRoleDto.cs b/src/Vapi.Net/Types/UpdateUserRoleDto.cs index 7068f49..e28e4a2 100644 --- a/src/Vapi.Net/Types/UpdateUserRoleDto.cs +++ b/src/Vapi.Net/Types/UpdateUserRoleDto.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record UpdateUserRoleDto diff --git a/src/Vapi.Net/Types/UpdateUserRoleDtoRole.cs b/src/Vapi.Net/Types/UpdateUserRoleDtoRole.cs index e550bdd..6a86892 100644 --- a/src/Vapi.Net/Types/UpdateUserRoleDtoRole.cs +++ b/src/Vapi.Net/Types/UpdateUserRoleDtoRole.cs @@ -2,8 +2,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] diff --git a/src/Vapi.Net/Types/UpdateVapiPhoneNumberDto.cs b/src/Vapi.Net/Types/UpdateVapiPhoneNumberDto.cs index 9e63323..9b9dc51 100644 --- a/src/Vapi.Net/Types/UpdateVapiPhoneNumberDto.cs +++ b/src/Vapi.Net/Types/UpdateVapiPhoneNumberDto.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record UpdateVapiPhoneNumberDto diff --git a/src/Vapi.Net/Types/UpdateVonageCredentialDto.cs b/src/Vapi.Net/Types/UpdateVonageCredentialDto.cs index 31a8558..eb06048 100644 --- a/src/Vapi.Net/Types/UpdateVonageCredentialDto.cs +++ b/src/Vapi.Net/Types/UpdateVonageCredentialDto.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record UpdateVonageCredentialDto diff --git a/src/Vapi.Net/Types/UpdateVonagePhoneNumberDto.cs b/src/Vapi.Net/Types/UpdateVonagePhoneNumberDto.cs index a634949..5c58e42 100644 --- a/src/Vapi.Net/Types/UpdateVonagePhoneNumberDto.cs +++ b/src/Vapi.Net/Types/UpdateVonagePhoneNumberDto.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record UpdateVonagePhoneNumberDto diff --git a/src/Vapi.Net/Types/UpdateWorkflowBlockDto.cs b/src/Vapi.Net/Types/UpdateWorkflowBlockDto.cs index 451621b..638e59c 100644 --- a/src/Vapi.Net/Types/UpdateWorkflowBlockDto.cs +++ b/src/Vapi.Net/Types/UpdateWorkflowBlockDto.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record UpdateWorkflowBlockDto diff --git a/src/Vapi.Net/Types/UpdateWorkflowDto.cs b/src/Vapi.Net/Types/UpdateWorkflowDto.cs deleted file mode 100644 index fa0d364..0000000 --- a/src/Vapi.Net/Types/UpdateWorkflowDto.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System.Text.Json.Serialization; -using OneOf; -using Vapi.Net.Core; - -#nullable enable - -namespace Vapi.Net; - -public record UpdateWorkflowDto -{ - [JsonPropertyName("nodes")] - public IEnumerable>? Nodes { get; set; } - - [JsonPropertyName("name")] - public string? Name { get; set; } - - [JsonPropertyName("edges")] - public IEnumerable? Edges { get; set; } - - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Vapi.Net/Types/UpdateXAiCredentialDto.cs b/src/Vapi.Net/Types/UpdateXAiCredentialDto.cs index 26effad..7794f0d 100644 --- a/src/Vapi.Net/Types/UpdateXAiCredentialDto.cs +++ b/src/Vapi.Net/Types/UpdateXAiCredentialDto.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record UpdateXAiCredentialDto diff --git a/src/Vapi.Net/Types/User.cs b/src/Vapi.Net/Types/User.cs index 334531d..77cdc7a 100644 --- a/src/Vapi.Net/Types/User.cs +++ b/src/Vapi.Net/Types/User.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record User diff --git a/src/Vapi.Net/Types/UserMessage.cs b/src/Vapi.Net/Types/UserMessage.cs index d525d1b..44ef4d3 100644 --- a/src/Vapi.Net/Types/UserMessage.cs +++ b/src/Vapi.Net/Types/UserMessage.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record UserMessage diff --git a/src/Vapi.Net/Types/VapiCost.cs b/src/Vapi.Net/Types/VapiCost.cs index 4aeb621..a78d101 100644 --- a/src/Vapi.Net/Types/VapiCost.cs +++ b/src/Vapi.Net/Types/VapiCost.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record VapiCost diff --git a/src/Vapi.Net/Types/VapiCostSubType.cs b/src/Vapi.Net/Types/VapiCostSubType.cs index 06b5e46..42fa682 100644 --- a/src/Vapi.Net/Types/VapiCostSubType.cs +++ b/src/Vapi.Net/Types/VapiCostSubType.cs @@ -2,8 +2,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] diff --git a/src/Vapi.Net/Types/VapiModel.cs b/src/Vapi.Net/Types/VapiModel.cs index b12a69a..f38adc3 100644 --- a/src/Vapi.Net/Types/VapiModel.cs +++ b/src/Vapi.Net/Types/VapiModel.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record VapiModel diff --git a/src/Vapi.Net/Types/VapiPhoneNumber.cs b/src/Vapi.Net/Types/VapiPhoneNumber.cs index fd0e61f..32211ca 100644 --- a/src/Vapi.Net/Types/VapiPhoneNumber.cs +++ b/src/Vapi.Net/Types/VapiPhoneNumber.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record VapiPhoneNumber @@ -42,6 +40,18 @@ public record VapiPhoneNumber [JsonPropertyName("updatedAt")] public required DateTime UpdatedAt { get; set; } + /// + /// This is the status of the phone number. + /// + [JsonPropertyName("status")] + public VapiPhoneNumberStatus? Status { get; set; } + + /// + /// These are the digits of the phone number you purchased from Vapi. + /// + [JsonPropertyName("number")] + public string? Number { get; set; } + /// /// This is the name of the phone number. This is just for your own reference. /// @@ -76,13 +86,19 @@ public record VapiPhoneNumber [JsonPropertyName("server")] public Server? Server { get; set; } + /// + /// This is the area code of the phone number to purchase. + /// + [JsonPropertyName("numberDesiredAreaCode")] + public string? NumberDesiredAreaCode { get; set; } + /// /// This is the SIP URI of the phone number. You can SIP INVITE this. The assistant attached to this number will answer. /// /// This is case-insensitive. /// [JsonPropertyName("sipUri")] - public required string SipUri { get; set; } + public string? SipUri { get; set; } /// /// This enables authentication for incoming SIP INVITE requests to the `sipUri`. diff --git a/src/Vapi.Net/Types/VapiPhoneNumberStatus.cs b/src/Vapi.Net/Types/VapiPhoneNumberStatus.cs new file mode 100644 index 0000000..4a806aa --- /dev/null +++ b/src/Vapi.Net/Types/VapiPhoneNumberStatus.cs @@ -0,0 +1,18 @@ +using System.Runtime.Serialization; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[JsonConverter(typeof(EnumSerializer))] +public enum VapiPhoneNumberStatus +{ + [EnumMember(Value = "active")] + Active, + + [EnumMember(Value = "activating")] + Activating, + + [EnumMember(Value = "blocked")] + Blocked, +} diff --git a/src/Vapi.Net/Types/VoiceCost.cs b/src/Vapi.Net/Types/VoiceCost.cs index adf0889..b6dc960 100644 --- a/src/Vapi.Net/Types/VoiceCost.cs +++ b/src/Vapi.Net/Types/VoiceCost.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record VoiceCost diff --git a/src/Vapi.Net/Types/VoiceLibrary.cs b/src/Vapi.Net/Types/VoiceLibrary.cs index b21e22f..0b9354b 100644 --- a/src/Vapi.Net/Types/VoiceLibrary.cs +++ b/src/Vapi.Net/Types/VoiceLibrary.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record VoiceLibrary diff --git a/src/Vapi.Net/Types/VoiceLibraryGender.cs b/src/Vapi.Net/Types/VoiceLibraryGender.cs index fab7e98..2d5a5f8 100644 --- a/src/Vapi.Net/Types/VoiceLibraryGender.cs +++ b/src/Vapi.Net/Types/VoiceLibraryGender.cs @@ -2,8 +2,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] diff --git a/src/Vapi.Net/Types/VoiceLibraryVoiceResponse.cs b/src/Vapi.Net/Types/VoiceLibraryVoiceResponse.cs index c4426a1..e4bc3f8 100644 --- a/src/Vapi.Net/Types/VoiceLibraryVoiceResponse.cs +++ b/src/Vapi.Net/Types/VoiceLibraryVoiceResponse.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record VoiceLibraryVoiceResponse diff --git a/src/Vapi.Net/Types/VonageCredential.cs b/src/Vapi.Net/Types/VonageCredential.cs index 20610eb..2d73602 100644 --- a/src/Vapi.Net/Types/VonageCredential.cs +++ b/src/Vapi.Net/Types/VonageCredential.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record VonageCredential @@ -14,7 +12,7 @@ public record VonageCredential public required string VonageApplicationPrivateKey { get; set; } [JsonPropertyName("provider")] - public required string Provider { get; set; } + public string Provider { get; set; } = "vonage"; /// /// This is not returned in the API. diff --git a/src/Vapi.Net/Types/VonagePhoneNumber.cs b/src/Vapi.Net/Types/VonagePhoneNumber.cs index 51aa293..a1b5dbe 100644 --- a/src/Vapi.Net/Types/VonagePhoneNumber.cs +++ b/src/Vapi.Net/Types/VonagePhoneNumber.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record VonagePhoneNumber @@ -42,6 +40,12 @@ public record VonagePhoneNumber [JsonPropertyName("updatedAt")] public required DateTime UpdatedAt { get; set; } + /// + /// This is the status of the phone number. + /// + [JsonPropertyName("status")] + public VonagePhoneNumberStatus? Status { get; set; } + /// /// This is the name of the phone number. This is just for your own reference. /// diff --git a/src/Vapi.Net/Types/VonagePhoneNumberStatus.cs b/src/Vapi.Net/Types/VonagePhoneNumberStatus.cs new file mode 100644 index 0000000..7582520 --- /dev/null +++ b/src/Vapi.Net/Types/VonagePhoneNumberStatus.cs @@ -0,0 +1,18 @@ +using System.Runtime.Serialization; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[JsonConverter(typeof(EnumSerializer))] +public enum VonagePhoneNumberStatus +{ + [EnumMember(Value = "active")] + Active, + + [EnumMember(Value = "activating")] + Activating, + + [EnumMember(Value = "blocked")] + Blocked, +} diff --git a/src/Vapi.Net/Types/WebhookCredential.cs b/src/Vapi.Net/Types/WebhookCredential.cs index 91818dc..affb2e0 100644 --- a/src/Vapi.Net/Types/WebhookCredential.cs +++ b/src/Vapi.Net/Types/WebhookCredential.cs @@ -1,14 +1,12 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record WebhookCredential { [JsonPropertyName("provider")] - public required string Provider { get; set; } + public string Provider { get; set; } = "webhook"; /// /// This is the authentication plan. Currently supports OAuth2 RFC 6749. diff --git a/src/Vapi.Net/Types/Workflow.cs b/src/Vapi.Net/Types/Workflow.cs index 37394a5..67e9afd 100644 --- a/src/Vapi.Net/Types/Workflow.cs +++ b/src/Vapi.Net/Types/Workflow.cs @@ -1,19 +1,12 @@ using System.Text.Json.Serialization; -using OneOf; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record Workflow { - [JsonPropertyName("type")] - public required string Type { get; set; } - [JsonPropertyName("nodes")] - public IEnumerable> Nodes { get; set; } = - new List>(); + public IEnumerable Nodes { get; set; } = new List(); [JsonPropertyName("id")] public required string Id { get; set; } diff --git a/src/Vapi.Net/Types/WorkflowBlock.cs b/src/Vapi.Net/Types/WorkflowBlock.cs index b519efa..680f15c 100644 --- a/src/Vapi.Net/Types/WorkflowBlock.cs +++ b/src/Vapi.Net/Types/WorkflowBlock.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record WorkflowBlock diff --git a/src/Vapi.Net/Types/XAiCredential.cs b/src/Vapi.Net/Types/XAiCredential.cs index 8a8eb32..4266054 100644 --- a/src/Vapi.Net/Types/XAiCredential.cs +++ b/src/Vapi.Net/Types/XAiCredential.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record XAiCredential @@ -11,7 +9,7 @@ public record XAiCredential /// This is the api key for Grok in XAi's console. Get it from here: https://console.x.ai /// [JsonPropertyName("provider")] - public required string Provider { get; set; } + public string Provider { get; set; } = "xai"; /// /// This is not returned in the API. diff --git a/src/Vapi.Net/Types/XaiModel.cs b/src/Vapi.Net/Types/XaiModel.cs index 872f2dd..60911a7 100644 --- a/src/Vapi.Net/Types/XaiModel.cs +++ b/src/Vapi.Net/Types/XaiModel.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public record XaiModel @@ -45,7 +43,7 @@ public record XaiModel /// This is the name of the model. Ex. cognitivecomputations/dolphin-mixtral-8x7b /// [JsonPropertyName("model")] - public required string Model { get; set; } + public required XaiModelModel Model { get; set; } /// /// This is the temperature that will be used for calls. Default is 0 to leverage caching for lower latency. diff --git a/src/Vapi.Net/Types/XaiModelModel.cs b/src/Vapi.Net/Types/XaiModelModel.cs new file mode 100644 index 0000000..c36caaf --- /dev/null +++ b/src/Vapi.Net/Types/XaiModelModel.cs @@ -0,0 +1,18 @@ +using System.Runtime.Serialization; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[JsonConverter(typeof(EnumSerializer))] +public enum XaiModelModel +{ + [EnumMember(Value = "grok-beta")] + GrokBeta, + + [EnumMember(Value = "grok-2")] + Grok2, + + [EnumMember(Value = "grok-3")] + Grok3, +} diff --git a/src/Vapi.Net/Vapi.Net.csproj b/src/Vapi.Net/Vapi.Net.csproj index 368526a..1ff029a 100644 --- a/src/Vapi.Net/Vapi.Net.csproj +++ b/src/Vapi.Net/Vapi.Net.csproj @@ -6,7 +6,7 @@ enable 12 enable - 0.4.1 + 0.5.0 $(Version) $(Version) README.md diff --git a/src/Vapi.Net/VapiClient.cs b/src/Vapi.Net/VapiClient.cs index a97ac76..8e0110c 100644 --- a/src/Vapi.Net/VapiClient.cs +++ b/src/Vapi.Net/VapiClient.cs @@ -1,22 +1,21 @@ using Vapi.Net.Core; -#nullable enable - namespace Vapi.Net; public partial class VapiClient { - private RawClient _client; + private readonly RawClient _client; - public VapiClient(string token, ClientOptions? clientOptions = null) + public VapiClient(string? token = null, ClientOptions? clientOptions = null) { var defaultHeaders = new Headers( new Dictionary() { + { "Authorization", $"Bearer {token}" }, { "X-Fern-Language", "C#" }, { "X-Fern-SDK-Name", "Vapi.Net" }, { "X-Fern-SDK-Version", Version.Current }, - { "User-Agent", "Vapi.Net/0.4.1" }, + { "User-Agent", "Vapi.Net/0.5.0" }, } ); clientOptions ??= new ClientOptions(); @@ -38,6 +37,9 @@ public VapiClient(string token, ClientOptions? clientOptions = null) Files = new FilesClient(_client); Analytics = new AnalyticsClient(_client); Logs = new LogsClient(_client); + TestSuites = new TestSuitesClient(_client); + TestSuiteTests = new TestSuiteTestsClient(_client); + TestSuiteRuns = new TestSuiteRunsClient(_client); } public CallsClient Calls { get; init; } @@ -59,4 +61,10 @@ public VapiClient(string token, ClientOptions? clientOptions = null) public AnalyticsClient Analytics { get; init; } public LogsClient Logs { get; init; } + + public TestSuitesClient TestSuites { get; init; } + + public TestSuiteTestsClient TestSuiteTests { get; init; } + + public TestSuiteRunsClient TestSuiteRuns { get; init; } } From abbf95a5dde7a0bdcae648bf8b2ac1bc704f6ac7 Mon Sep 17 00:00:00 2001 From: fern-api <115122769+fern-api[bot]@users.noreply.github.com> Date: Mon, 3 Mar 2025 18:20:52 +0000 Subject: [PATCH 2/5] Release 0.5.0 --- src/Vapi.Net.sln | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/Vapi.Net.sln b/src/Vapi.Net.sln index e495681..3970416 100644 --- a/src/Vapi.Net.sln +++ b/src/Vapi.Net.sln @@ -3,9 +3,9 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 VisualStudioVersion = 17.0.31903.59 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Vapi.Net", "Vapi.Net\Vapi.Net.csproj", "{6586B53D-B956-4662-8F9B-474993193E39}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Vapi.Net", "Vapi.Net\Vapi.Net.csproj", "{E8A06B21-F371-4028-8D33-6BC18C7E5E07}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Vapi.Net.Test", "Vapi.Net.Test\Vapi.Net.Test.csproj", "{CAF72DE5-5EE2-4EA3-A10E-A767F0F975E7}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Vapi.Net.Test", "Vapi.Net.Test\Vapi.Net.Test.csproj", "{3E2EB28E-973C-4CF6-BA5D-D5511F4940FE}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -16,13 +16,13 @@ Global HideSolutionNode = FALSE EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {6586B53D-B956-4662-8F9B-474993193E39}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6586B53D-B956-4662-8F9B-474993193E39}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6586B53D-B956-4662-8F9B-474993193E39}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6586B53D-B956-4662-8F9B-474993193E39}.Release|Any CPU.Build.0 = Release|Any CPU - {CAF72DE5-5EE2-4EA3-A10E-A767F0F975E7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {CAF72DE5-5EE2-4EA3-A10E-A767F0F975E7}.Debug|Any CPU.Build.0 = Debug|Any CPU - {CAF72DE5-5EE2-4EA3-A10E-A767F0F975E7}.Release|Any CPU.ActiveCfg = Release|Any CPU - {CAF72DE5-5EE2-4EA3-A10E-A767F0F975E7}.Release|Any CPU.Build.0 = Release|Any CPU + {E8A06B21-F371-4028-8D33-6BC18C7E5E07}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E8A06B21-F371-4028-8D33-6BC18C7E5E07}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E8A06B21-F371-4028-8D33-6BC18C7E5E07}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E8A06B21-F371-4028-8D33-6BC18C7E5E07}.Release|Any CPU.Build.0 = Release|Any CPU + {3E2EB28E-973C-4CF6-BA5D-D5511F4940FE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3E2EB28E-973C-4CF6-BA5D-D5511F4940FE}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3E2EB28E-973C-4CF6-BA5D-D5511F4940FE}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3E2EB28E-973C-4CF6-BA5D-D5511F4940FE}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection EndGlobal From 0c0002457f40fe7fef67b939f9fb30c82d93b0ad Mon Sep 17 00:00:00 2001 From: fern-api <115122769+fern-api[bot]@users.noreply.github.com> Date: Tue, 4 Mar 2025 17:26:50 +0000 Subject: [PATCH 3/5] Release 0.5.0 --- src/Vapi.Net.sln | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/Vapi.Net.sln b/src/Vapi.Net.sln index 3970416..fcad3c3 100644 --- a/src/Vapi.Net.sln +++ b/src/Vapi.Net.sln @@ -3,9 +3,9 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 VisualStudioVersion = 17.0.31903.59 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Vapi.Net", "Vapi.Net\Vapi.Net.csproj", "{E8A06B21-F371-4028-8D33-6BC18C7E5E07}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Vapi.Net", "Vapi.Net\Vapi.Net.csproj", "{ADA82169-A7DE-4171-89AE-7AF15D7CBEC2}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Vapi.Net.Test", "Vapi.Net.Test\Vapi.Net.Test.csproj", "{3E2EB28E-973C-4CF6-BA5D-D5511F4940FE}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Vapi.Net.Test", "Vapi.Net.Test\Vapi.Net.Test.csproj", "{5242A1F7-47FA-4252-A6DF-9E039C906A89}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -16,13 +16,13 @@ Global HideSolutionNode = FALSE EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {E8A06B21-F371-4028-8D33-6BC18C7E5E07}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E8A06B21-F371-4028-8D33-6BC18C7E5E07}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E8A06B21-F371-4028-8D33-6BC18C7E5E07}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E8A06B21-F371-4028-8D33-6BC18C7E5E07}.Release|Any CPU.Build.0 = Release|Any CPU - {3E2EB28E-973C-4CF6-BA5D-D5511F4940FE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {3E2EB28E-973C-4CF6-BA5D-D5511F4940FE}.Debug|Any CPU.Build.0 = Debug|Any CPU - {3E2EB28E-973C-4CF6-BA5D-D5511F4940FE}.Release|Any CPU.ActiveCfg = Release|Any CPU - {3E2EB28E-973C-4CF6-BA5D-D5511F4940FE}.Release|Any CPU.Build.0 = Release|Any CPU + {ADA82169-A7DE-4171-89AE-7AF15D7CBEC2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {ADA82169-A7DE-4171-89AE-7AF15D7CBEC2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {ADA82169-A7DE-4171-89AE-7AF15D7CBEC2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {ADA82169-A7DE-4171-89AE-7AF15D7CBEC2}.Release|Any CPU.Build.0 = Release|Any CPU + {5242A1F7-47FA-4252-A6DF-9E039C906A89}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5242A1F7-47FA-4252-A6DF-9E039C906A89}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5242A1F7-47FA-4252-A6DF-9E039C906A89}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5242A1F7-47FA-4252-A6DF-9E039C906A89}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection EndGlobal From 639838ad68b00069b01a73110077eb38e710da15 Mon Sep 17 00:00:00 2001 From: fern-api <115122769+fern-api[bot]@users.noreply.github.com> Date: Tue, 22 Apr 2025 01:19:35 +0000 Subject: [PATCH 4/5] Release 0.6.0 --- .editorconfig | 35 + .../Core/Json/DateOnlyJsonTests.cs | 76 ++ .../Core/Json/DateTimeJsonTests.cs | 110 ++ .../Core/{ => Json}/EnumSerializerTests.cs | 2 +- .../Core/Json/JsonAccessAttributeTests.cs | 160 +++ .../Core/{ => Json}/OneOfSerializerTests.cs | 41 +- .../Core/Pagination/GuidCursorTest.cs | 39 +- .../Core/Pagination/HasNextPageOffsetTest.cs | 29 +- .../Core/Pagination/IntOffsetTest.cs | 27 +- .../Core/Pagination/LongOffsetTest.cs | 35 +- .../Core/Pagination/NoRequestCursorTest.cs | 47 +- .../Core/Pagination/NoRequestOffsetTest.cs | 27 +- .../Core/Pagination/StepOffsetTest.cs | 41 +- .../Core/Pagination/StringCursorTest.cs | 49 +- .../Core/QueryStringConverterTests.cs | 122 ++ src/Vapi.Net.Test/Core/RawClientTests.cs | 109 -- .../RawClientTests/AdditionalHeadersTests.cs | 137 ++ .../AdditionalParametersTests.cs | 300 +++++ .../Core/RawClientTests/MultipartFormTests.cs | 1120 ++++++++++++++++ .../Core/RawClientTests/RetriesTests.cs | 214 +++ .../Utils/JsonElementComparer.cs | 236 ++++ src/Vapi.Net.Test/Utils/NUnitExtensions.cs | 28 + src/Vapi.Net.Test/Utils/OneOfComparer.cs | 43 + .../Utils/ReadOnlyMemoryComparer.cs | 87 ++ src/Vapi.Net.Test/Vapi.Net.Test.csproj | 13 +- src/Vapi.Net.sln | 20 +- src/Vapi.Net/Analytics/AnalyticsClient.cs | 19 +- .../Analytics/Requests/AnalyticsQueryDto.cs | 1 + src/Vapi.Net/Assistants/AssistantsClient.cs | 117 +- .../Requests/AssistantsListRequest.cs | 11 + .../Assistants/Requests/UpdateAssistantDto.cs | 36 +- ... UpdateAssistantDtoBackgroundSoundZero.cs} | 4 +- .../UpdateAssistantDtoClientMessagesItem.cs | 3 + src/Vapi.Net/Blocks/BlocksClient.cs | 249 ---- .../Blocks/Requests/BlocksListRequest.cs | 56 - src/Vapi.Net/Calls/CallsClient.cs | 122 +- .../Calls/Requests/CallsListRequest.cs | 14 + src/Vapi.Net/Calls/Requests/CreateCallDto.cs | 21 + src/Vapi.Net/Calls/Requests/UpdateCallDto.cs | 1 + src/Vapi.Net/Core/ApiResponse.cs | 13 + src/Vapi.Net/Core/BaseRequest.cs | 63 + src/Vapi.Net/Core/CollectionItemSerializer.cs | 2 - src/Vapi.Net/Core/DateOnlyConverter.cs | 748 +++++++++++ src/Vapi.Net/Core/EmptyRequest.cs | 11 + src/Vapi.Net/Core/EncodingCache.cs | 11 + src/Vapi.Net/Core/FormUrlEncoder.cs | 33 + src/Vapi.Net/Core/Headers.cs | 17 +- src/Vapi.Net/Core/IIsRetryableContent.cs | 6 + src/Vapi.Net/Core/IRequestOptions.cs | 68 +- src/Vapi.Net/Core/JsonAccessAttribute.cs | 13 + src/Vapi.Net/Core/JsonConfiguration.cs | 139 +- src/Vapi.Net/Core/JsonRequest.cs | 36 + src/Vapi.Net/Core/MultipartFormRequest.cs | 275 ++++ src/Vapi.Net/Core/Page.cs | 24 + src/Vapi.Net/Core/Pager.cs | 528 ++++++-- src/Vapi.Net/Core/Public/ClientOptions.cs | 53 +- src/Vapi.Net/Core/Public/FileParameter.cs | 63 + src/Vapi.Net/Core/Public/RequestOptions.cs | 73 +- src/Vapi.Net/Core/Public/Version.cs | 2 +- src/Vapi.Net/Core/QueryStringConverter.cs | 229 ++++ src/Vapi.Net/Core/RawClient.cs | 383 ++++-- src/Vapi.Net/Core/StreamRequest.cs | 29 + src/Vapi.Net/Core/ValueConvert.cs | 109 ++ src/Vapi.Net/Files/FilesClient.cs | 132 +- src/Vapi.Net/Files/Requests/CreateFileDto.cs | 3 + src/Vapi.Net/Files/Requests/UpdateFileDto.cs | 1 + .../KnowledgeBases/KnowledgeBasesClient.cs | 126 +- .../Requests/KnowledgeBasesListRequest.cs | 11 + src/Vapi.Net/Logs/LogsClient.cs | 220 +-- ...LoggingControllerLogsDeleteQueryRequest.cs | 8 + src/Vapi.Net/Logs/Requests/LogsGetRequest.cs | 20 + .../PhoneNumbers/PhoneNumbersClient.cs | 126 +- .../Requests/PhoneNumbersListRequest.cs | 11 + .../Squads/Requests/SquadsListRequest.cs | 11 + .../Squads/Requests/UpdateSquadDto.cs | 1 + src/Vapi.Net/Squads/SquadsClient.cs | 117 +- .../Requests/CreateTestSuiteRunDto.cs | 1 + ...iteRunControllerFindAllPaginatedRequest.cs | 13 + .../Requests/UpdateTestSuiteRunDto.cs | 1 + .../TestSuiteRuns/TestSuiteRunsClient.cs | 144 +- ...teTestControllerFindAllPaginatedRequest.cs | 13 + .../TestSuiteTests/TestSuiteTestsClient.cs | 156 ++- .../TestSuites/Requests/CreateTestSuiteDto.cs | 15 + ...tSuiteControllerFindAllPaginatedRequest.cs | 13 + .../TestSuites/Requests/UpdateTestSuiteDto.cs | 15 + src/Vapi.Net/TestSuites/TestSuitesClient.cs | 119 +- .../Tools/Requests/ToolsListRequest.cs | 11 + src/Vapi.Net/Tools/ToolsClient.cs | 117 +- src/Vapi.Net/Types/AddVoiceToProviderDto.cs | 12 + src/Vapi.Net/Types/AiEdgeCondition.cs | 19 +- src/Vapi.Net/Types/Analysis.cs | 18 + src/Vapi.Net/Types/AnalysisCost.cs | 12 + src/Vapi.Net/Types/AnalysisCostBreakdown.cs | 12 + src/Vapi.Net/Types/AnalysisPlan.cs | 18 + src/Vapi.Net/Types/AnalyticsOperation.cs | 12 + .../Types/AnalyticsOperationColumn.cs | 3 + src/Vapi.Net/Types/AnalyticsQuery.cs | 12 + src/Vapi.Net/Types/AnalyticsQueryResult.cs | 12 + src/Vapi.Net/Types/AnthropicCredential.cs | 12 + src/Vapi.Net/Types/AnthropicModel.cs | 22 +- src/Vapi.Net/Types/AnthropicModelModel.cs | 3 + src/Vapi.Net/Types/AnthropicThinkingConfig.cs | 34 + src/Vapi.Net/Types/AnyscaleCredential.cs | 12 + src/Vapi.Net/Types/AnyscaleModel.cs | 12 + src/Vapi.Net/Types/ApiRequest.cs | 12 + src/Vapi.Net/Types/Artifact.cs | 12 + src/Vapi.Net/Types/ArtifactPlan.cs | 20 + .../Types/ArtifactPlanRecordingFormat.cs | 15 + src/Vapi.Net/Types/AssemblyAiCredential.cs | 12 + src/Vapi.Net/Types/AssemblyAiTranscriber.cs | 26 + src/Vapi.Net/Types/AssignmentMutation.cs | 74 -- src/Vapi.Net/Types/Assistant.cs | 47 +- ...und.cs => AssistantBackgroundSoundZero.cs} | 4 +- .../Types/AssistantClientMessagesItem.cs | 3 + .../Types/AssistantCustomEndpointingRule.cs | 12 + src/Vapi.Net/Types/AssistantHookActionBase.cs | 13 + src/Vapi.Net/Types/AssistantHookFilter.cs | 12 + src/Vapi.Net/Types/AssistantHooks.cs | 12 + src/Vapi.Net/Types/AssistantOverrides.cs | 47 +- ... AssistantOverridesBackgroundSoundZero.cs} | 4 +- .../AssistantOverridesClientMessagesItem.cs | 3 + .../Types/AssistantPaginatedResponse.cs | 30 + src/Vapi.Net/Types/AutoReloadPlan.cs | 12 + .../Types/AzureBlobStorageBucketPlan.cs | 12 + src/Vapi.Net/Types/AzureCredential.cs | 12 + src/Vapi.Net/Types/AzureOpenAiCredential.cs | 12 + .../Types/AzureOpenAiCredentialModelsItem.cs | 4 +- src/Vapi.Net/Types/AzureSpeechTranscriber.cs | 18 + src/Vapi.Net/Types/AzureVoice.cs | 12 + src/Vapi.Net/Types/BackoffPlan.cs | 12 + src/Vapi.Net/Types/BashTool.cs | 12 + src/Vapi.Net/Types/BashToolWithToolCall.cs | 12 + src/Vapi.Net/Types/BlockCompleteMessage.cs | 36 - src/Vapi.Net/Types/BlockStartMessage.cs | 36 - src/Vapi.Net/Types/BotMessage.cs | 12 + .../Types/BothCustomEndpointingRule.cs | 12 + src/Vapi.Net/Types/BucketPlan.cs | 12 + src/Vapi.Net/Types/ByoPhoneNumber.cs | 18 + src/Vapi.Net/Types/ByoSipTrunkCredential.cs | 12 + src/Vapi.Net/Types/Call.cs | 32 +- src/Vapi.Net/Types/CallBatchError.cs | 30 + src/Vapi.Net/Types/CallBatchResponse.cs | 36 + src/Vapi.Net/Types/CallEndedReason.cs | 1181 +++++++++++++++-- src/Vapi.Net/Types/CallLogPrivileged.cs | 12 + .../Types/CallLogsPaginatedResponse.cs | 12 + src/Vapi.Net/Types/CallPaginatedResponse.cs | 12 + src/Vapi.Net/Types/CallPhoneCallProvider.cs | 3 + src/Vapi.Net/Types/CallStatus.cs | 3 + src/Vapi.Net/Types/CallType.cs | 3 + src/Vapi.Net/Types/CallbackStep.cs | 89 -- src/Vapi.Net/Types/CartesiaCredential.cs | 12 + .../Types/CartesiaExperimentalControls.cs | 15 +- src/Vapi.Net/Types/CartesiaVoice.cs | 12 + src/Vapi.Net/Types/CartesiaVoiceModel.cs | 3 + src/Vapi.Net/Types/CerebrasCredential.cs | 12 + src/Vapi.Net/Types/CerebrasModel.cs | 96 ++ src/Vapi.Net/Types/CerebrasModelModel.cs | 15 + src/Vapi.Net/Types/ChatCompletionMessage.cs | 21 - .../Types/ChatCompletionMessageMetadata.cs | 12 + .../Types/ChatCompletionMessageWorkflows.cs | 33 + src/Vapi.Net/Types/ChatCompletionsDto.cs | 16 +- src/Vapi.Net/Types/ChatDto.cs | 24 - src/Vapi.Net/Types/ChatServiceResponse.cs | 13 + src/Vapi.Net/Types/ChunkPlan.cs | 12 + src/Vapi.Net/Types/ClientInboundMessage.cs | 12 + .../Types/ClientInboundMessageAddMessage.cs | 12 + .../Types/ClientInboundMessageControl.cs | 12 + .../Types/ClientInboundMessageEndCall.cs | 13 + src/Vapi.Net/Types/ClientInboundMessageSay.cs | 18 + .../Types/ClientInboundMessageTransfer.cs | 12 + src/Vapi.Net/Types/ClientMessage.cs | 12 + .../Types/ClientMessageConversationUpdate.cs | 12 + src/Vapi.Net/Types/ClientMessageHang.cs | 12 + .../ClientMessageLanguageChangeDetected.cs | 12 + src/Vapi.Net/Types/ClientMessageMetadata.cs | 12 + .../Types/ClientMessageModelOutput.cs | 12 + .../Types/ClientMessageSpeechUpdate.cs | 18 + src/Vapi.Net/Types/ClientMessageToolCalls.cs | 12 + .../Types/ClientMessageToolCallsResult.cs | 12 + src/Vapi.Net/Types/ClientMessageTranscript.cs | 12 + .../Types/ClientMessageTransferUpdate.cs | 12 + .../Types/ClientMessageUserInterrupted.cs | 12 + src/Vapi.Net/Types/ClientMessageVoiceInput.cs | 12 + .../Types/ClientMessageWorkflowNodeStarted.cs | 12 + src/Vapi.Net/Types/CloneVoiceDto.cs | 12 + src/Vapi.Net/Types/CloudflareCredential.cs | 12 + src/Vapi.Net/Types/CloudflareR2BucketPlan.cs | 12 + src/Vapi.Net/Types/CompliancePlan.cs | 18 +- src/Vapi.Net/Types/ComputerTool.cs | 12 + .../Types/ComputerToolWithToolCall.cs | 12 + src/Vapi.Net/Types/Condition.cs | 12 + src/Vapi.Net/Types/ConversationBlock.cs | 97 -- src/Vapi.Net/Types/CostBreakdown.cs | 12 + .../Types/CreateAnthropicCredentialDto.cs | 12 + .../Types/CreateAnyscaleCredentialDto.cs | 12 + .../Types/CreateAssemblyAiCredentialDto.cs | 12 + src/Vapi.Net/Types/CreateAssistantDto.cs | 47 +- ... CreateAssistantDtoBackgroundSoundZero.cs} | 4 +- .../CreateAssistantDtoClientMessagesItem.cs | 3 + .../Types/CreateAzureCredentialDto.cs | 12 + .../Types/CreateAzureOpenAiCredentialDto.cs | 12 + ...reateAzureOpenAiCredentialDtoModelsItem.cs | 4 +- src/Vapi.Net/Types/CreateBashToolDto.cs | 12 + src/Vapi.Net/Types/CreateByoPhoneNumberDto.cs | 18 + .../Types/CreateByoSipTrunkCredentialDto.cs | 12 + .../Types/CreateCartesiaCredentialDto.cs | 12 + .../Types/CreateCerebrasCredentialDto.cs | 15 +- .../Types/CreateCloudflareCredentialDto.cs | 12 + src/Vapi.Net/Types/CreateComputerToolDto.cs | 12 + .../Types/CreateConversationBlockDto.cs | 73 - .../Types/CreateCustomKnowledgeBaseDto.cs | 12 + .../Types/CreateCustomLlmCredentialDto.cs | 12 + src/Vapi.Net/Types/CreateCustomerDto.cs | 19 + .../Types/CreateDeepInfraCredentialDto.cs | 12 + .../Types/CreateDeepSeekCredentialDto.cs | 12 + .../Types/CreateDeepgramCredentialDto.cs | 12 + src/Vapi.Net/Types/CreateDtmfToolDto.cs | 12 + .../Types/CreateElevenLabsCredentialDto.cs | 12 + src/Vapi.Net/Types/CreateEndCallToolDto.cs | 12 + src/Vapi.Net/Types/CreateFunctionToolDto.cs | 12 + src/Vapi.Net/Types/CreateGcpCredentialDto.cs | 12 + src/Vapi.Net/Types/CreateGhlToolDto.cs | 12 + .../Types/CreateGladiaCredentialDto.cs | 12 + .../Types/CreateGoHighLevelCredentialDto.cs | 12 + ...eGoogleCalendarCheckAvailabilityToolDto.cs | 64 + .../CreateGoogleCalendarCreateEventToolDto.cs | 64 + ...alendarOAuth2AuthorizationCredentialDto.cs | 36 + ...GoogleCalendarOAuth2ClientCredentialDto.cs | 30 + .../Types/CreateGoogleCredentialDto.cs | 18 +- ...eSheetsOAuth2AuthorizationCredentialDto.cs | 36 + .../CreateGoogleSheetsRowAppendToolDto.cs | 64 + src/Vapi.Net/Types/CreateGroqCredentialDto.cs | 12 + src/Vapi.Net/Types/CreateHumeCredentialDto.cs | 36 + .../Types/CreateInflectionAiCredentialDto.cs | 18 +- .../Types/CreateLangfuseCredentialDto.cs | 12 + src/Vapi.Net/Types/CreateLmntCredentialDto.cs | 12 + src/Vapi.Net/Types/CreateMakeCredentialDto.cs | 12 + src/Vapi.Net/Types/CreateMakeToolDto.cs | 12 + src/Vapi.Net/Types/CreateMcpToolDto.cs | 64 + .../Types/CreateMistralCredentialDto.cs | 36 + .../Types/CreateNeuphonicCredentialDto.cs | 36 + .../Types/CreateOpenAiCredentialDto.cs | 12 + .../Types/CreateOpenRouterCredentialDto.cs | 12 + src/Vapi.Net/Types/CreateOrgDto.cs | 23 + src/Vapi.Net/Types/CreateOutboundCallDto.cs | 32 + src/Vapi.Net/Types/CreateOutputToolDto.cs | 12 + .../Types/CreatePerplexityAiCredentialDto.cs | 12 + .../Types/CreatePlayHtCredentialDto.cs | 12 + src/Vapi.Net/Types/CreateQueryToolDto.cs | 70 + .../Types/CreateRimeAiCredentialDto.cs | 12 + .../Types/CreateRunpodCredentialDto.cs | 12 + src/Vapi.Net/Types/CreateS3CredentialDto.cs | 12 + ...teSlackOAuth2AuthorizationCredentialDto.cs | 36 + .../Types/CreateSlackSendMessageToolDto.cs | 64 + .../Types/CreateSmallestAiCredentialDto.cs | 12 + src/Vapi.Net/Types/CreateSmsSendToolDto.cs | 64 + .../Types/CreateSpeechmaticsCredentialDto.cs | 36 + src/Vapi.Net/Types/CreateSquadDto.cs | 12 + .../Types/CreateSupabaseCredentialDto.cs | 33 + .../Types/CreateTavusCredentialDto.cs | 12 + .../Types/CreateTelnyxPhoneNumberDto.cs | 87 ++ .../Types/CreateTestSuiteTestChatDto.cs | 49 + .../Types/CreateTestSuiteTestVoiceDto.cs | 12 + src/Vapi.Net/Types/CreateTextEditorToolDto.cs | 12 + .../Types/CreateTogetherAiCredentialDto.cs | 12 + src/Vapi.Net/Types/CreateTokenDto.cs | 12 + src/Vapi.Net/Types/CreateToolCallBlockDto.cs | 61 - src/Vapi.Net/Types/CreateToolTemplateDto.cs | 12 + .../Types/CreateTransferCallToolDto.cs | 12 + .../Types/CreateTrieveCredentialDto.cs | 36 + .../Types/CreateTrieveKnowledgeBaseDto.cs | 14 +- .../Types/CreateTwilioCredentialDto.cs | 12 + .../Types/CreateTwilioPhoneNumberDto.cs | 18 + .../Types/CreateVapiPhoneNumberDto.cs | 18 + src/Vapi.Net/Types/CreateVoicemailToolDto.cs | 12 + .../Types/CreateVonageCredentialDto.cs | 12 + .../Types/CreateVonagePhoneNumberDto.cs | 20 +- src/Vapi.Net/Types/CreateWebCallDto.cs | 12 + .../Types/CreateWebhookCredentialDto.cs | 12 + src/Vapi.Net/Types/CreateWorkflowBlockDto.cs | 55 - src/Vapi.Net/Types/CreateWorkflowDto.cs | 18 + src/Vapi.Net/Types/CreateXAiCredentialDto.cs | 12 + src/Vapi.Net/Types/CredentialActionRequest.cs | 30 + src/Vapi.Net/Types/CredentialEndUser.cs | 30 + src/Vapi.Net/Types/CredentialSessionDto.cs | 30 + .../Types/CredentialSessionDtoProvider.cs | 21 + src/Vapi.Net/Types/CredentialSessionError.cs | 30 + .../Types/CredentialSessionResponse.cs | 27 + src/Vapi.Net/Types/CredentialWebhookDto.cs | 57 + .../Types/CredentialWebhookDtoAuthMode.cs | 18 + .../Types/CredentialWebhookDtoOperation.cs | 18 + .../Types/CredentialWebhookDtoType.cs | 18 + src/Vapi.Net/Types/CustomKnowledgeBase.cs | 12 + src/Vapi.Net/Types/CustomLlmCredential.cs | 12 + src/Vapi.Net/Types/CustomLlmModel.cs | 18 + src/Vapi.Net/Types/CustomMessage.cs | 12 + src/Vapi.Net/Types/CustomTranscriber.cs | 18 + src/Vapi.Net/Types/CustomVoice.cs | 12 + .../Types/CustomerCustomEndpointingRule.cs | 12 + src/Vapi.Net/Types/DeepInfraCredential.cs | 12 + src/Vapi.Net/Types/DeepInfraModel.cs | 12 + src/Vapi.Net/Types/DeepSeekCredential.cs | 12 + src/Vapi.Net/Types/DeepSeekModel.cs | 12 + src/Vapi.Net/Types/DeepgramCredential.cs | 12 + src/Vapi.Net/Types/DeepgramTranscriber.cs | 34 + .../Types/DeepgramTranscriberModel.cs | 9 + src/Vapi.Net/Types/DeepgramVoice.cs | 21 +- src/Vapi.Net/Types/DeepgramVoiceId.cs | 144 ++ src/Vapi.Net/Types/DeepgramVoiceIdEnum.cs | 45 - src/Vapi.Net/Types/DeepgramVoiceModel.cs | 15 + src/Vapi.Net/Types/DtmfTool.cs | 12 + src/Vapi.Net/Types/Edge.cs | 12 + src/Vapi.Net/Types/ElevenLabsCredential.cs | 12 + src/Vapi.Net/Types/ElevenLabsTranscriber.cs | 39 + .../Types/ElevenLabsTranscriberLanguage.cs | 564 ++++++++ src/Vapi.Net/Types/ElevenLabsVoice.cs | 24 + src/Vapi.Net/Types/EndCallTool.cs | 12 + src/Vapi.Net/Types/Error.cs | 12 + src/Vapi.Net/Types/ExactReplacement.cs | 22 + src/Vapi.Net/Types/FailedEdgeCondition.cs | 13 + .../Types/FallbackAssemblyAiTranscriber.cs | 63 + .../Types/FallbackAzureSpeechTranscriber.cs | 30 + .../FallbackAzureSpeechTranscriberLanguage.cs | 438 ++++++ src/Vapi.Net/Types/FallbackAzureVoice.cs | 12 + src/Vapi.Net/Types/FallbackCartesiaVoice.cs | 12 + .../Types/FallbackCartesiaVoiceModel.cs | 3 + .../Types/FallbackCustomTranscriber.cs | 67 + src/Vapi.Net/Types/FallbackCustomVoice.cs | 12 + .../Types/FallbackDeepgramTranscriber.cs | 129 ++ .../FallbackDeepgramTranscriberLanguage.cs | 177 +++ .../Types/FallbackDeepgramTranscriberModel.cs | 102 ++ src/Vapi.Net/Types/FallbackDeepgramVoice.cs | 21 +- src/Vapi.Net/Types/FallbackDeepgramVoiceId.cs | 144 ++ .../Types/FallbackDeepgramVoiceIdEnum.cs | 45 - .../Types/FallbackDeepgramVoiceModel.cs | 15 + .../Types/FallbackElevenLabsTranscriber.cs | 33 + .../FallbackElevenLabsTranscriberLanguage.cs | 564 ++++++++ src/Vapi.Net/Types/FallbackElevenLabsVoice.cs | 24 + .../Types/FallbackGladiaTranscriber.cs | 63 + .../FallbackGladiaTranscriberLanguage.cs | 306 +++++ ...lbackGladiaTranscriberLanguageBehaviour.cs | 18 + .../Types/FallbackGladiaTranscriberModel.cs | 15 + .../Types/FallbackGoogleTranscriber.cs | 36 + .../FallbackGoogleTranscriberLanguage.cs | 126 ++ .../Types/FallbackGoogleTranscriberModel.cs | 45 + src/Vapi.Net/Types/FallbackHumeVoice.cs | 57 + src/Vapi.Net/Types/FallbackLmntVoice.cs | 12 + src/Vapi.Net/Types/FallbackNeetsVoice.cs | 18 +- .../Types/FallbackNeetsVoiceIdEnum.cs | 12 - src/Vapi.Net/Types/FallbackNeuphonicVoice.cs | 60 + .../Types/FallbackNeuphonicVoiceModel.cs | 15 + .../Types/FallbackOpenAiTranscriber.cs | 36 + .../FallbackOpenAiTranscriberLanguage.cs | 180 +++ .../Types/FallbackOpenAiTranscriberModel.cs | 15 + src/Vapi.Net/Types/FallbackOpenAiVoice.cs | 28 +- ...oiceId.cs => FallbackOpenAiVoiceIdEnum.cs} | 19 +- .../Types/FallbackOpenAiVoiceModel.cs | 18 + src/Vapi.Net/Types/FallbackPlan.cs | 12 + src/Vapi.Net/Types/FallbackPlayHtVoice.cs | 12 + src/Vapi.Net/Types/FallbackRimeAiVoice.cs | 36 + src/Vapi.Net/Types/FallbackSmallestAiVoice.cs | 12 + .../Types/FallbackSpeechmaticsTranscriber.cs | 33 + ...FallbackSpeechmaticsTranscriberLanguage.cs | 177 +++ .../Types/FallbackTalkscriberTranscriber.cs | 36 + .../FallbackTalkscriberTranscriberLanguage.cs | 309 +++++ src/Vapi.Net/Types/FallbackTavusVoice.cs | 12 + src/Vapi.Net/Types/FallbackTranscriberPlan.cs | 27 + src/Vapi.Net/Types/FallbackVapiVoice.cs | 52 + .../Types/FallbackVapiVoiceLanguage.cs | 126 ++ .../Types/FallbackVapiVoiceVoiceId.cs | 39 + src/Vapi.Net/Types/File.cs | 18 + src/Vapi.Net/Types/FileStatus.cs | 11 +- src/Vapi.Net/Types/FormatPlan.cs | 12 + src/Vapi.Net/Types/FunctionTool.cs | 12 + .../Types/FunctionToolProviderDetails.cs | 12 + .../Types/FunctionToolWithToolCall.cs | 12 + src/Vapi.Net/Types/Gather.cs | 12 + src/Vapi.Net/Types/GcpCredential.cs | 12 + src/Vapi.Net/Types/GcpKey.cs | 12 + ...GeminiMultimodalLivePrebuiltVoiceConfig.cs | 12 + .../Types/GeminiMultimodalLiveSpeechConfig.cs | 12 + .../Types/GeminiMultimodalLiveVoiceConfig.cs | 12 + src/Vapi.Net/Types/GhlTool.cs | 12 + src/Vapi.Net/Types/GhlToolMetadata.cs | 12 + src/Vapi.Net/Types/GhlToolProviderDetails.cs | 12 + src/Vapi.Net/Types/GhlToolWithToolCall.cs | 12 + src/Vapi.Net/Types/GladiaCredential.cs | 12 + src/Vapi.Net/Types/GladiaTranscriber.cs | 26 + .../Types/GladiaTranscriberLanguage.cs | 7 +- src/Vapi.Net/Types/GoHighLevelCredential.cs | 12 + .../GoogleCalendarCheckAvailabilityTool.cs | 88 ++ .../Types/GoogleCalendarCreateEventTool.cs | 88 ++ ...eCalendarCreateEventToolProviderDetails.cs | 33 + ...ogleCalendarCreateEventToolWithToolCall.cs | 67 + ...leCalendarOAuth2AuthorizationCredential.cs | 63 + .../GoogleCalendarOAuth2ClientCredential.cs | 57 + src/Vapi.Net/Types/GoogleCredential.cs | 12 + src/Vapi.Net/Types/GoogleModel.cs | 12 + src/Vapi.Net/Types/GoogleModelModel.cs | 3 + src/Vapi.Net/Types/GoogleRealtimeConfig.cs | 12 + ...ogleSheetsOAuth2AuthorizationCredential.cs | 63 + .../Types/GoogleSheetsRowAppendTool.cs | 88 ++ ...oogleSheetsRowAppendToolProviderDetails.cs | 33 + .../GoogleSheetsRowAppendToolWithToolCall.cs | 73 + src/Vapi.Net/Types/GoogleTranscriber.cs | 42 + .../Types/GoogleTranscriberLanguage.cs | 126 ++ src/Vapi.Net/Types/GoogleTranscriberModel.cs | 45 + .../Types/GoogleVoicemailDetectionPlan.cs | 32 + src/Vapi.Net/Types/GroqCredential.cs | 12 + src/Vapi.Net/Types/GroqModel.cs | 12 + src/Vapi.Net/Types/HandoffStep.cs | 89 -- src/Vapi.Net/Types/Hangup.cs | 12 + src/Vapi.Net/Types/Hook.cs | 12 + src/Vapi.Net/Types/HumeCredential.cs | 63 + src/Vapi.Net/Types/HumeVoice.cs | 63 + .../Types/ImportTwilioPhoneNumberDto.cs | 18 + .../Types/ImportVonagePhoneNumberDto.cs | 22 +- src/Vapi.Net/Types/InflectionAiCredential.cs | 12 + src/Vapi.Net/Types/InflectionAiModel.cs | 12 + src/Vapi.Net/Types/InviteUserDto.cs | 12 + src/Vapi.Net/Types/InvoicePlan.cs | 48 + src/Vapi.Net/Types/JsonSchema.cs | 12 + src/Vapi.Net/Types/KeypadInputPlan.cs | 50 + .../Types/KeypadInputPlanDelimiters.cs | 18 + src/Vapi.Net/Types/KnowledgeBase.cs | 54 + src/Vapi.Net/Types/KnowledgeBaseModel.cs | 45 + .../Types/KnowledgeBaseResponseDocument.cs | 12 + src/Vapi.Net/Types/LangfuseCredential.cs | 12 + .../Types/LangfuseObservabilityPlan.cs | 40 + .../Types/LivekitSmartEndpointingPlan.cs | 44 + .../LivekitSmartEndpointingPlanProvider.cs | 15 + src/Vapi.Net/Types/LmntCredential.cs | 12 + src/Vapi.Net/Types/LmntVoice.cs | 12 + src/Vapi.Net/Types/Log.cs | 12 + src/Vapi.Net/Types/LogicEdgeCondition.cs | 12 + src/Vapi.Net/Types/LogsPaginatedResponse.cs | 12 + src/Vapi.Net/Types/MakeCredential.cs | 12 + src/Vapi.Net/Types/MakeTool.cs | 12 + src/Vapi.Net/Types/MakeToolMetadata.cs | 12 + src/Vapi.Net/Types/MakeToolProviderDetails.cs | 12 + src/Vapi.Net/Types/MakeToolWithToolCall.cs | 12 + src/Vapi.Net/Types/McpTool.cs | 88 ++ src/Vapi.Net/Types/MessagePlan.cs | 20 + src/Vapi.Net/Types/Metrics.cs | 12 + src/Vapi.Net/Types/MistralCredential.cs | 63 + src/Vapi.Net/Types/ModelBasedCondition.cs | 41 - src/Vapi.Net/Types/ModelCost.cs | 12 + src/Vapi.Net/Types/Monitor.cs | 12 + src/Vapi.Net/Types/MonitorPlan.cs | 12 + src/Vapi.Net/Types/NeetsVoice.cs | 24 +- src/Vapi.Net/Types/NeetsVoiceIdEnum.cs | 12 - src/Vapi.Net/Types/NeuphonicCredential.cs | 63 + src/Vapi.Net/Types/NeuphonicVoice.cs | 60 + src/Vapi.Net/Types/NeuphonicVoiceModel.cs | 15 + .../Types/OAuth2AuthenticationPlan.cs | 18 + .../Types/Oauth2AuthenticationSession.cs | 12 + src/Vapi.Net/Types/OpenAiCredential.cs | 12 + src/Vapi.Net/Types/OpenAiFunction.cs | 12 + .../Types/OpenAiFunctionParameters.cs | 12 + src/Vapi.Net/Types/OpenAiMessage.cs | 12 + src/Vapi.Net/Types/OpenAiModel.cs | 12 + .../Types/OpenAiModelFallbackModelsItem.cs | 18 +- src/Vapi.Net/Types/OpenAiModelModel.cs | 18 +- src/Vapi.Net/Types/OpenAiTranscriber.cs | 42 + .../Types/OpenAiTranscriberLanguage.cs | 180 +++ src/Vapi.Net/Types/OpenAiTranscriberModel.cs | 15 + src/Vapi.Net/Types/OpenAiVoice.cs | 28 +- ...kOpenAiVoiceId.cs => OpenAiVoiceIdEnum.cs} | 19 +- src/Vapi.Net/Types/OpenAiVoiceModel.cs | 18 + .../Types/OpenAiVoicemailDetectionPlan.cs | 32 + src/Vapi.Net/Types/OpenRouterCredential.cs | 12 + src/Vapi.Net/Types/OpenRouterModel.cs | 12 + src/Vapi.Net/Types/Org.cs | 23 + src/Vapi.Net/Types/OrgPlan.cs | 12 + src/Vapi.Net/Types/OutputTool.cs | 12 + src/Vapi.Net/Types/PaginationMeta.cs | 12 + src/Vapi.Net/Types/PerplexityAiCredential.cs | 12 + src/Vapi.Net/Types/PerplexityAiModel.cs | 12 + .../Types/PhoneNumberHookCallRinging.cs | 37 + .../Types/PhoneNumberPaginatedResponse.cs | 12 + src/Vapi.Net/Types/PlayHtCredential.cs | 12 + src/Vapi.Net/Types/PlayHtVoice.cs | 12 + src/Vapi.Net/Types/QueryTool.cs | 94 ++ src/Vapi.Net/Types/RegexOption.cs | 12 + src/Vapi.Net/Types/RegexReplacement.cs | 12 + src/Vapi.Net/Types/RimeAiCredential.cs | 12 + src/Vapi.Net/Types/RimeAiVoice.cs | 36 + src/Vapi.Net/Types/RuleBasedCondition.cs | 78 -- .../Types/RuleBasedConditionOperator.cs | 27 - src/Vapi.Net/Types/RunpodCredential.cs | 12 + src/Vapi.Net/Types/S3Credential.cs | 12 + src/Vapi.Net/Types/Say.cs | 12 + src/Vapi.Net/Types/SayHook.cs | 12 + src/Vapi.Net/Types/SbcConfiguration.cs | 13 + src/Vapi.Net/Types/SchedulePlan.cs | 36 + src/Vapi.Net/Types/Server.cs | 12 + src/Vapi.Net/Types/ServerMessage.cs | 12 + .../Types/ServerMessageAssistantRequest.cs | 16 +- .../Types/ServerMessageConversationUpdate.cs | 16 +- .../Types/ServerMessageEndOfCallReport.cs | 16 +- ...ServerMessageEndOfCallReportEndedReason.cs | 1181 +++++++++++++++-- src/Vapi.Net/Types/ServerMessageHang.cs | 16 +- .../ServerMessageKnowledgeBaseRequest.cs | 16 +- .../ServerMessageLanguageChangeDetected.cs | 16 +- .../Types/ServerMessageModelOutput.cs | 16 +- .../Types/ServerMessagePhoneCallControl.cs | 16 +- src/Vapi.Net/Types/ServerMessageResponse.cs | 12 + .../ServerMessageResponseAssistantRequest.cs | 12 + ...rverMessageResponseKnowledgeBaseRequest.cs | 12 + .../Types/ServerMessageResponseToolCalls.cs | 12 + ...ssageResponseTransferDestinationRequest.cs | 12 + .../ServerMessageResponseVoiceRequest.cs | 12 + .../Types/ServerMessageSpeechUpdate.cs | 22 +- .../Types/ServerMessageStatusUpdate.cs | 16 +- .../ServerMessageStatusUpdateEndedReason.cs | 1181 +++++++++++++++-- .../Types/ServerMessageStatusUpdateStatus.cs | 3 + src/Vapi.Net/Types/ServerMessageToolCalls.cs | 16 +- src/Vapi.Net/Types/ServerMessageTranscript.cs | 16 +- ...ServerMessageTransferDestinationRequest.cs | 16 +- .../Types/ServerMessageTransferUpdate.cs | 16 +- .../Types/ServerMessageUserInterrupted.cs | 16 +- src/Vapi.Net/Types/ServerMessageVoiceInput.cs | 16 +- .../Types/ServerMessageVoiceRequest.cs | 16 +- src/Vapi.Net/Types/SipAuthentication.cs | 12 + src/Vapi.Net/Types/SipTrunkGateway.cs | 12 + .../SipTrunkOutboundAuthenticationPlan.cs | 12 + .../Types/SipTrunkOutboundSipRegisterPlan.cs | 12 + .../SlackOAuth2AuthorizationCredential.cs | 63 + src/Vapi.Net/Types/SlackSendMessageTool.cs | 88 ++ src/Vapi.Net/Types/SmallestAiCredential.cs | 12 + src/Vapi.Net/Types/SmallestAiVoice.cs | 12 + src/Vapi.Net/Types/SmsSendTool.cs | 88 ++ src/Vapi.Net/Types/SpeechmaticsCredential.cs | 63 + src/Vapi.Net/Types/SpeechmaticsTranscriber.cs | 39 + .../Types/SpeechmaticsTranscriberLanguage.cs | 177 +++ src/Vapi.Net/Types/Squad.cs | 12 + src/Vapi.Net/Types/SquadMemberDto.cs | 12 + src/Vapi.Net/Types/StartSpeakingPlan.cs | 45 +- src/Vapi.Net/Types/StepDestination.cs | 24 - src/Vapi.Net/Types/StopSpeakingPlan.cs | 12 + src/Vapi.Net/Types/StructuredDataMultiPlan.cs | 36 + src/Vapi.Net/Types/StructuredDataPlan.cs | 12 + src/Vapi.Net/Types/Subscription.cs | 31 + src/Vapi.Net/Types/SuccessEvaluationPlan.cs | 12 + src/Vapi.Net/Types/SummaryPlan.cs | 12 + src/Vapi.Net/Types/SupabaseBucketPlan.cs | 71 + .../Types/SupabaseBucketPlanRegion.cs | 57 + src/Vapi.Net/Types/SupabaseCredential.cs | 63 + src/Vapi.Net/Types/SyncVoiceLibraryDto.cs | 12 + .../Types/SyncVoiceLibraryDtoProvidersItem.cs | 12 +- src/Vapi.Net/Types/SystemMessage.cs | 12 + src/Vapi.Net/Types/TalkscriberTranscriber.cs | 18 + src/Vapi.Net/Types/TargetPlan.cs | 54 + .../Types/TavusConversationProperties.cs | 12 + src/Vapi.Net/Types/TavusCredential.cs | 12 + src/Vapi.Net/Types/TavusVoice.cs | 12 + src/Vapi.Net/Types/TelnyxPhoneNumber.cs | 117 ++ src/Vapi.Net/Types/TelnyxPhoneNumberStatus.cs | 18 + src/Vapi.Net/Types/Template.cs | 12 + src/Vapi.Net/Types/TestSuite.cs | 26 + src/Vapi.Net/Types/TestSuitePhoneNumber.cs | 36 + src/Vapi.Net/Types/TestSuiteRun.cs | 12 + src/Vapi.Net/Types/TestSuiteRunScorerAi.cs | 12 + src/Vapi.Net/Types/TestSuiteRunStatus.cs | 3 + src/Vapi.Net/Types/TestSuiteRunTestAttempt.cs | 26 +- .../Types/TestSuiteRunTestAttemptCall.cs | 14 +- .../Types/TestSuiteRunTestAttemptMetadata.cs | 30 + src/Vapi.Net/Types/TestSuiteRunTestResult.cs | 12 + .../Types/TestSuiteRunsPaginatedResponse.cs | 12 + src/Vapi.Net/Types/TestSuiteTestChat.cs | 79 ++ src/Vapi.Net/Types/TestSuiteTestScorerAi.cs | 12 + src/Vapi.Net/Types/TestSuiteTestVoice.cs | 12 + .../Types/TestSuiteTestsPaginatedResponse.cs | 14 +- .../Types/TestSuitesPaginatedResponse.cs | 12 + src/Vapi.Net/Types/TesterPlan.cs | 49 + src/Vapi.Net/Types/TextContent.cs | 12 + src/Vapi.Net/Types/TextEditorTool.cs | 12 + .../Types/TextEditorToolWithToolCall.cs | 12 + src/Vapi.Net/Types/TimeRange.cs | 12 + src/Vapi.Net/Types/TogetherAiCredential.cs | 12 + src/Vapi.Net/Types/TogetherAiModel.cs | 12 + src/Vapi.Net/Types/Token.cs | 12 + src/Vapi.Net/Types/TokenRestrictions.cs | 12 + src/Vapi.Net/Types/ToolCall.cs | 12 + src/Vapi.Net/Types/ToolCallBlock.cs | 85 -- src/Vapi.Net/Types/ToolCallFunction.cs | 12 + src/Vapi.Net/Types/ToolCallMessage.cs | 12 + src/Vapi.Net/Types/ToolCallResult.cs | 12 + src/Vapi.Net/Types/ToolCallResultMessage.cs | 12 + src/Vapi.Net/Types/ToolMessageComplete.cs | 12 + src/Vapi.Net/Types/ToolMessageDelayed.cs | 12 + src/Vapi.Net/Types/ToolMessageFailed.cs | 12 + src/Vapi.Net/Types/ToolMessageStart.cs | 12 + src/Vapi.Net/Types/ToolTemplateMetadata.cs | 12 + src/Vapi.Net/Types/ToolTemplateSetup.cs | 12 + src/Vapi.Net/Types/TranscriberCost.cs | 12 + src/Vapi.Net/Types/TranscriptPlan.cs | 12 + .../Types/TranscriptionEndpointingPlan.cs | 12 + src/Vapi.Net/Types/Transfer.cs | 12 + .../Types/TransferAssistantHookAction.cs | 12 + src/Vapi.Net/Types/TransferCallTool.cs | 12 + .../Types/TransferDestinationAssistant.cs | 12 + .../Types/TransferDestinationNumber.cs | 12 + src/Vapi.Net/Types/TransferDestinationSip.cs | 12 + src/Vapi.Net/Types/TransferDestinationStep.cs | 12 + src/Vapi.Net/Types/TransferPlan.cs | 13 + src/Vapi.Net/Types/Transport.cs | 26 - .../Types/TransportConfigurationTwilio.cs | 12 + src/Vapi.Net/Types/TransportCost.cs | 12 + src/Vapi.Net/Types/TransportProvider.cs | 21 - src/Vapi.Net/Types/TrieveCredential.cs | 63 + src/Vapi.Net/Types/TrieveKnowledgeBase.cs | 14 +- .../Types/TrieveKnowledgeBaseChunkPlan.cs | 12 + .../Types/TrieveKnowledgeBaseCreate.cs | 18 + .../Types/TrieveKnowledgeBaseImport.cs | 18 + .../Types/TrieveKnowledgeBaseSearchPlan.cs | 12 + src/Vapi.Net/Types/TwilioCredential.cs | 12 + src/Vapi.Net/Types/TwilioPhoneNumber.cs | 18 + ...ion.cs => TwilioVoicemailDetectionPlan.cs} | 22 +- ...tectionPlanVoicemailDetectionTypesItem.cs} | 4 +- .../Types/UpdateAnthropicCredentialDto.cs | 12 + .../Types/UpdateAnyscaleCredentialDto.cs | 12 + .../Types/UpdateAssemblyAiCredentialDto.cs | 12 + .../Types/UpdateAzureCredentialDto.cs | 12 + .../Types/UpdateAzureOpenAiCredentialDto.cs | 12 + ...pdateAzureOpenAiCredentialDtoModelsItem.cs | 4 +- src/Vapi.Net/Types/UpdateBashToolDto.cs | 12 + src/Vapi.Net/Types/UpdateByoPhoneNumberDto.cs | 18 + .../Types/UpdateByoSipTrunkCredentialDto.cs | 12 + .../Types/UpdateCartesiaCredentialDto.cs | 12 + .../Types/UpdateCerebrasCredentialDto.cs | 12 + .../Types/UpdateCloudflareCredentialDto.cs | 12 + src/Vapi.Net/Types/UpdateComputerToolDto.cs | 12 + .../Types/UpdateConversationBlockDto.cs | 73 - .../Types/UpdateCustomKnowledgeBaseDto.cs | 12 + .../Types/UpdateCustomLlmCredentialDto.cs | 12 + .../Types/UpdateDeepInfraCredentialDto.cs | 12 + .../Types/UpdateDeepSeekCredentialDto.cs | 12 + .../Types/UpdateDeepgramCredentialDto.cs | 12 + src/Vapi.Net/Types/UpdateDtmfToolDto.cs | 12 + .../Types/UpdateElevenLabsCredentialDto.cs | 12 + src/Vapi.Net/Types/UpdateEndCallToolDto.cs | 12 + src/Vapi.Net/Types/UpdateFunctionToolDto.cs | 12 + src/Vapi.Net/Types/UpdateGcpCredentialDto.cs | 12 + src/Vapi.Net/Types/UpdateGhlToolDto.cs | 12 + .../Types/UpdateGladiaCredentialDto.cs | 12 + .../Types/UpdateGoHighLevelCredentialDto.cs | 12 + ...eGoogleCalendarCheckAvailabilityToolDto.cs | 64 + .../UpdateGoogleCalendarCreateEventToolDto.cs | 64 + ...alendarOAuth2AuthorizationCredentialDto.cs | 36 + ...GoogleCalendarOAuth2ClientCredentialDto.cs | 30 + .../Types/UpdateGoogleCredentialDto.cs | 12 + ...eSheetsOAuth2AuthorizationCredentialDto.cs | 36 + .../UpdateGoogleSheetsRowAppendToolDto.cs | 64 + src/Vapi.Net/Types/UpdateGroqCredentialDto.cs | 12 + src/Vapi.Net/Types/UpdateHumeCredentialDto.cs | 36 + .../Types/UpdateInflectionAiCredentialDto.cs | 12 + .../Types/UpdateLangfuseCredentialDto.cs | 12 + src/Vapi.Net/Types/UpdateLmntCredentialDto.cs | 12 + src/Vapi.Net/Types/UpdateMakeCredentialDto.cs | 12 + src/Vapi.Net/Types/UpdateMakeToolDto.cs | 12 + src/Vapi.Net/Types/UpdateMcpToolDto.cs | 64 + .../Types/UpdateMistralCredentialDto.cs | 36 + .../Types/UpdateNeuphonicCredentialDto.cs | 36 + .../Types/UpdateOpenAiCredentialDto.cs | 12 + .../Types/UpdateOpenRouterCredentialDto.cs | 12 + src/Vapi.Net/Types/UpdateOrgDto.cs | 23 + src/Vapi.Net/Types/UpdateOutputToolDto.cs | 12 + .../Types/UpdatePerplexityAiCredentialDto.cs | 12 + .../Types/UpdatePlayHtCredentialDto.cs | 12 + src/Vapi.Net/Types/UpdateQueryToolDto.cs | 70 + .../Types/UpdateRimeAiCredentialDto.cs | 12 + .../Types/UpdateRunpodCredentialDto.cs | 12 + src/Vapi.Net/Types/UpdateS3CredentialDto.cs | 12 + ...teSlackOAuth2AuthorizationCredentialDto.cs | 36 + .../Types/UpdateSlackSendMessageToolDto.cs | 64 + .../Types/UpdateSmallestAiCredentialDto.cs | 12 + src/Vapi.Net/Types/UpdateSmsSendToolDto.cs | 64 + .../Types/UpdateSpeechmaticsCredentialDto.cs | 36 + .../Types/UpdateSupabaseCredentialDto.cs | 33 + .../Types/UpdateTavusCredentialDto.cs | 12 + .../Types/UpdateTelnyxPhoneNumberDto.cs | 87 ++ .../Types/UpdateTestSuiteTestChatDto.cs | 48 + .../Types/UpdateTestSuiteTestVoiceDto.cs | 12 + src/Vapi.Net/Types/UpdateTextEditorToolDto.cs | 12 + .../Types/UpdateTogetherAiCredentialDto.cs | 12 + src/Vapi.Net/Types/UpdateTokenDto.cs | 12 + src/Vapi.Net/Types/UpdateToolCallBlockDto.cs | 61 - src/Vapi.Net/Types/UpdateToolTemplateDto.cs | 12 + .../Types/UpdateTransferCallToolDto.cs | 12 + .../Types/UpdateTrieveCredentialDto.cs | 36 + .../Types/UpdateTrieveKnowledgeBaseDto.cs | 14 +- .../Types/UpdateTwilioCredentialDto.cs | 12 + .../Types/UpdateTwilioPhoneNumberDto.cs | 18 + src/Vapi.Net/Types/UpdateUserRoleDto.cs | 12 + .../Types/UpdateVapiPhoneNumberDto.cs | 18 + .../Types/UpdateVonageCredentialDto.cs | 12 + .../Types/UpdateVonagePhoneNumberDto.cs | 20 +- .../Types/UpdateWebhookCredentialDto.cs | 36 + src/Vapi.Net/Types/UpdateWorkflowBlockDto.cs | 55 - src/Vapi.Net/Types/UpdateXAiCredentialDto.cs | 12 + src/Vapi.Net/Types/User.cs | 12 + src/Vapi.Net/Types/UserMessage.cs | 12 + src/Vapi.Net/Types/VapiCost.cs | 12 + src/Vapi.Net/Types/VapiModel.cs | 15 +- src/Vapi.Net/Types/VapiPhoneNumber.cs | 18 + .../Types/VapiSmartEndpointingPlan.cs | 30 + .../Types/VapiSmartEndpointingPlanProvider.cs | 15 + src/Vapi.Net/Types/VapiVoice.cs | 58 + src/Vapi.Net/Types/VapiVoiceLanguage.cs | 126 ++ src/Vapi.Net/Types/VapiVoiceVoiceId.cs | 39 + src/Vapi.Net/Types/VoiceCost.cs | 12 + src/Vapi.Net/Types/VoiceLibrary.cs | 12 + .../Types/VoiceLibraryVoiceResponse.cs | 12 + src/Vapi.Net/Types/VoicemailDetectionCost.cs | 66 + .../Types/VoicemailDetectionCostProvider.cs | 18 + src/Vapi.Net/Types/VonageCredential.cs | 12 + src/Vapi.Net/Types/VonagePhoneNumber.cs | 20 +- src/Vapi.Net/Types/WebhookCredential.cs | 12 + src/Vapi.Net/Types/Workflow.cs | 18 + src/Vapi.Net/Types/WorkflowBlock.cs | 79 -- src/Vapi.Net/Types/XAiCredential.cs | 12 + src/Vapi.Net/Types/XaiModel.cs | 12 + src/Vapi.Net/Vapi.Net.csproj | 15 +- src/Vapi.Net/VapiClient.cs | 38 +- .../Workflow/Requests/UpdateWorkflowDto.cs | 28 + src/Vapi.Net/Workflow/WorkflowClient.cs | 225 ++++ 727 files changed, 26311 insertions(+), 3484 deletions(-) create mode 100644 .editorconfig create mode 100644 src/Vapi.Net.Test/Core/Json/DateOnlyJsonTests.cs create mode 100644 src/Vapi.Net.Test/Core/Json/DateTimeJsonTests.cs rename src/Vapi.Net.Test/Core/{ => Json}/EnumSerializerTests.cs (97%) create mode 100644 src/Vapi.Net.Test/Core/Json/JsonAccessAttributeTests.cs rename src/Vapi.Net.Test/Core/{ => Json}/OneOfSerializerTests.cs (87%) create mode 100644 src/Vapi.Net.Test/Core/QueryStringConverterTests.cs delete mode 100644 src/Vapi.Net.Test/Core/RawClientTests.cs create mode 100644 src/Vapi.Net.Test/Core/RawClientTests/AdditionalHeadersTests.cs create mode 100644 src/Vapi.Net.Test/Core/RawClientTests/AdditionalParametersTests.cs create mode 100644 src/Vapi.Net.Test/Core/RawClientTests/MultipartFormTests.cs create mode 100644 src/Vapi.Net.Test/Core/RawClientTests/RetriesTests.cs create mode 100644 src/Vapi.Net.Test/Utils/JsonElementComparer.cs create mode 100644 src/Vapi.Net.Test/Utils/NUnitExtensions.cs create mode 100644 src/Vapi.Net.Test/Utils/OneOfComparer.cs create mode 100644 src/Vapi.Net.Test/Utils/ReadOnlyMemoryComparer.cs rename src/Vapi.Net/Assistants/Types/{UpdateAssistantDtoBackgroundSound.cs => UpdateAssistantDtoBackgroundSoundZero.cs} (80%) delete mode 100644 src/Vapi.Net/Blocks/BlocksClient.cs delete mode 100644 src/Vapi.Net/Blocks/Requests/BlocksListRequest.cs create mode 100644 src/Vapi.Net/Core/ApiResponse.cs create mode 100644 src/Vapi.Net/Core/BaseRequest.cs create mode 100644 src/Vapi.Net/Core/DateOnlyConverter.cs create mode 100644 src/Vapi.Net/Core/EmptyRequest.cs create mode 100644 src/Vapi.Net/Core/EncodingCache.cs create mode 100644 src/Vapi.Net/Core/FormUrlEncoder.cs create mode 100644 src/Vapi.Net/Core/IIsRetryableContent.cs create mode 100644 src/Vapi.Net/Core/JsonAccessAttribute.cs create mode 100644 src/Vapi.Net/Core/JsonRequest.cs create mode 100644 src/Vapi.Net/Core/MultipartFormRequest.cs create mode 100644 src/Vapi.Net/Core/Public/FileParameter.cs create mode 100644 src/Vapi.Net/Core/QueryStringConverter.cs create mode 100644 src/Vapi.Net/Core/StreamRequest.cs create mode 100644 src/Vapi.Net/Core/ValueConvert.cs create mode 100644 src/Vapi.Net/Types/AnthropicThinkingConfig.cs create mode 100644 src/Vapi.Net/Types/ArtifactPlanRecordingFormat.cs delete mode 100644 src/Vapi.Net/Types/AssignmentMutation.cs rename src/Vapi.Net/Types/{AssistantBackgroundSound.cs => AssistantBackgroundSoundZero.cs} (65%) rename src/Vapi.Net/Types/{AssistantOverridesBackgroundSound.cs => AssistantOverridesBackgroundSoundZero.cs} (80%) create mode 100644 src/Vapi.Net/Types/AssistantPaginatedResponse.cs delete mode 100644 src/Vapi.Net/Types/BlockCompleteMessage.cs delete mode 100644 src/Vapi.Net/Types/BlockStartMessage.cs create mode 100644 src/Vapi.Net/Types/CallBatchError.cs create mode 100644 src/Vapi.Net/Types/CallBatchResponse.cs delete mode 100644 src/Vapi.Net/Types/CallbackStep.cs create mode 100644 src/Vapi.Net/Types/CerebrasModel.cs create mode 100644 src/Vapi.Net/Types/CerebrasModelModel.cs delete mode 100644 src/Vapi.Net/Types/ChatCompletionMessage.cs create mode 100644 src/Vapi.Net/Types/ChatCompletionMessageWorkflows.cs delete mode 100644 src/Vapi.Net/Types/ChatDto.cs delete mode 100644 src/Vapi.Net/Types/ConversationBlock.cs rename src/Vapi.Net/Types/{CreateAssistantDtoBackgroundSound.cs => CreateAssistantDtoBackgroundSoundZero.cs} (80%) delete mode 100644 src/Vapi.Net/Types/CreateConversationBlockDto.cs create mode 100644 src/Vapi.Net/Types/CreateGoogleCalendarCheckAvailabilityToolDto.cs create mode 100644 src/Vapi.Net/Types/CreateGoogleCalendarCreateEventToolDto.cs create mode 100644 src/Vapi.Net/Types/CreateGoogleCalendarOAuth2AuthorizationCredentialDto.cs create mode 100644 src/Vapi.Net/Types/CreateGoogleCalendarOAuth2ClientCredentialDto.cs create mode 100644 src/Vapi.Net/Types/CreateGoogleSheetsOAuth2AuthorizationCredentialDto.cs create mode 100644 src/Vapi.Net/Types/CreateGoogleSheetsRowAppendToolDto.cs create mode 100644 src/Vapi.Net/Types/CreateHumeCredentialDto.cs create mode 100644 src/Vapi.Net/Types/CreateMcpToolDto.cs create mode 100644 src/Vapi.Net/Types/CreateMistralCredentialDto.cs create mode 100644 src/Vapi.Net/Types/CreateNeuphonicCredentialDto.cs create mode 100644 src/Vapi.Net/Types/CreateQueryToolDto.cs create mode 100644 src/Vapi.Net/Types/CreateSlackOAuth2AuthorizationCredentialDto.cs create mode 100644 src/Vapi.Net/Types/CreateSlackSendMessageToolDto.cs create mode 100644 src/Vapi.Net/Types/CreateSmsSendToolDto.cs create mode 100644 src/Vapi.Net/Types/CreateSpeechmaticsCredentialDto.cs create mode 100644 src/Vapi.Net/Types/CreateSupabaseCredentialDto.cs create mode 100644 src/Vapi.Net/Types/CreateTelnyxPhoneNumberDto.cs create mode 100644 src/Vapi.Net/Types/CreateTestSuiteTestChatDto.cs delete mode 100644 src/Vapi.Net/Types/CreateToolCallBlockDto.cs create mode 100644 src/Vapi.Net/Types/CreateTrieveCredentialDto.cs delete mode 100644 src/Vapi.Net/Types/CreateWorkflowBlockDto.cs create mode 100644 src/Vapi.Net/Types/CredentialActionRequest.cs create mode 100644 src/Vapi.Net/Types/CredentialEndUser.cs create mode 100644 src/Vapi.Net/Types/CredentialSessionDto.cs create mode 100644 src/Vapi.Net/Types/CredentialSessionDtoProvider.cs create mode 100644 src/Vapi.Net/Types/CredentialSessionError.cs create mode 100644 src/Vapi.Net/Types/CredentialSessionResponse.cs create mode 100644 src/Vapi.Net/Types/CredentialWebhookDto.cs create mode 100644 src/Vapi.Net/Types/CredentialWebhookDtoAuthMode.cs create mode 100644 src/Vapi.Net/Types/CredentialWebhookDtoOperation.cs create mode 100644 src/Vapi.Net/Types/CredentialWebhookDtoType.cs create mode 100644 src/Vapi.Net/Types/DeepgramVoiceId.cs delete mode 100644 src/Vapi.Net/Types/DeepgramVoiceIdEnum.cs create mode 100644 src/Vapi.Net/Types/DeepgramVoiceModel.cs create mode 100644 src/Vapi.Net/Types/ElevenLabsTranscriber.cs create mode 100644 src/Vapi.Net/Types/ElevenLabsTranscriberLanguage.cs create mode 100644 src/Vapi.Net/Types/FallbackAssemblyAiTranscriber.cs create mode 100644 src/Vapi.Net/Types/FallbackAzureSpeechTranscriber.cs create mode 100644 src/Vapi.Net/Types/FallbackAzureSpeechTranscriberLanguage.cs create mode 100644 src/Vapi.Net/Types/FallbackCustomTranscriber.cs create mode 100644 src/Vapi.Net/Types/FallbackDeepgramTranscriber.cs create mode 100644 src/Vapi.Net/Types/FallbackDeepgramTranscriberLanguage.cs create mode 100644 src/Vapi.Net/Types/FallbackDeepgramTranscriberModel.cs create mode 100644 src/Vapi.Net/Types/FallbackDeepgramVoiceId.cs delete mode 100644 src/Vapi.Net/Types/FallbackDeepgramVoiceIdEnum.cs create mode 100644 src/Vapi.Net/Types/FallbackDeepgramVoiceModel.cs create mode 100644 src/Vapi.Net/Types/FallbackElevenLabsTranscriber.cs create mode 100644 src/Vapi.Net/Types/FallbackElevenLabsTranscriberLanguage.cs create mode 100644 src/Vapi.Net/Types/FallbackGladiaTranscriber.cs create mode 100644 src/Vapi.Net/Types/FallbackGladiaTranscriberLanguage.cs create mode 100644 src/Vapi.Net/Types/FallbackGladiaTranscriberLanguageBehaviour.cs create mode 100644 src/Vapi.Net/Types/FallbackGladiaTranscriberModel.cs create mode 100644 src/Vapi.Net/Types/FallbackGoogleTranscriber.cs create mode 100644 src/Vapi.Net/Types/FallbackGoogleTranscriberLanguage.cs create mode 100644 src/Vapi.Net/Types/FallbackGoogleTranscriberModel.cs create mode 100644 src/Vapi.Net/Types/FallbackHumeVoice.cs delete mode 100644 src/Vapi.Net/Types/FallbackNeetsVoiceIdEnum.cs create mode 100644 src/Vapi.Net/Types/FallbackNeuphonicVoice.cs create mode 100644 src/Vapi.Net/Types/FallbackNeuphonicVoiceModel.cs create mode 100644 src/Vapi.Net/Types/FallbackOpenAiTranscriber.cs create mode 100644 src/Vapi.Net/Types/FallbackOpenAiTranscriberLanguage.cs create mode 100644 src/Vapi.Net/Types/FallbackOpenAiTranscriberModel.cs rename src/Vapi.Net/Types/{OpenAiVoiceId.cs => FallbackOpenAiVoiceIdEnum.cs} (56%) create mode 100644 src/Vapi.Net/Types/FallbackOpenAiVoiceModel.cs create mode 100644 src/Vapi.Net/Types/FallbackSpeechmaticsTranscriber.cs create mode 100644 src/Vapi.Net/Types/FallbackSpeechmaticsTranscriberLanguage.cs create mode 100644 src/Vapi.Net/Types/FallbackTalkscriberTranscriber.cs create mode 100644 src/Vapi.Net/Types/FallbackTalkscriberTranscriberLanguage.cs create mode 100644 src/Vapi.Net/Types/FallbackTranscriberPlan.cs create mode 100644 src/Vapi.Net/Types/FallbackVapiVoice.cs create mode 100644 src/Vapi.Net/Types/FallbackVapiVoiceLanguage.cs create mode 100644 src/Vapi.Net/Types/FallbackVapiVoiceVoiceId.cs create mode 100644 src/Vapi.Net/Types/GoogleCalendarCheckAvailabilityTool.cs create mode 100644 src/Vapi.Net/Types/GoogleCalendarCreateEventTool.cs create mode 100644 src/Vapi.Net/Types/GoogleCalendarCreateEventToolProviderDetails.cs create mode 100644 src/Vapi.Net/Types/GoogleCalendarCreateEventToolWithToolCall.cs create mode 100644 src/Vapi.Net/Types/GoogleCalendarOAuth2AuthorizationCredential.cs create mode 100644 src/Vapi.Net/Types/GoogleCalendarOAuth2ClientCredential.cs create mode 100644 src/Vapi.Net/Types/GoogleSheetsOAuth2AuthorizationCredential.cs create mode 100644 src/Vapi.Net/Types/GoogleSheetsRowAppendTool.cs create mode 100644 src/Vapi.Net/Types/GoogleSheetsRowAppendToolProviderDetails.cs create mode 100644 src/Vapi.Net/Types/GoogleSheetsRowAppendToolWithToolCall.cs create mode 100644 src/Vapi.Net/Types/GoogleTranscriber.cs create mode 100644 src/Vapi.Net/Types/GoogleTranscriberLanguage.cs create mode 100644 src/Vapi.Net/Types/GoogleTranscriberModel.cs create mode 100644 src/Vapi.Net/Types/GoogleVoicemailDetectionPlan.cs delete mode 100644 src/Vapi.Net/Types/HandoffStep.cs create mode 100644 src/Vapi.Net/Types/HumeCredential.cs create mode 100644 src/Vapi.Net/Types/HumeVoice.cs create mode 100644 src/Vapi.Net/Types/InvoicePlan.cs create mode 100644 src/Vapi.Net/Types/KeypadInputPlan.cs create mode 100644 src/Vapi.Net/Types/KeypadInputPlanDelimiters.cs create mode 100644 src/Vapi.Net/Types/KnowledgeBase.cs create mode 100644 src/Vapi.Net/Types/KnowledgeBaseModel.cs create mode 100644 src/Vapi.Net/Types/LangfuseObservabilityPlan.cs create mode 100644 src/Vapi.Net/Types/LivekitSmartEndpointingPlan.cs create mode 100644 src/Vapi.Net/Types/LivekitSmartEndpointingPlanProvider.cs create mode 100644 src/Vapi.Net/Types/McpTool.cs create mode 100644 src/Vapi.Net/Types/MistralCredential.cs delete mode 100644 src/Vapi.Net/Types/ModelBasedCondition.cs delete mode 100644 src/Vapi.Net/Types/NeetsVoiceIdEnum.cs create mode 100644 src/Vapi.Net/Types/NeuphonicCredential.cs create mode 100644 src/Vapi.Net/Types/NeuphonicVoice.cs create mode 100644 src/Vapi.Net/Types/NeuphonicVoiceModel.cs create mode 100644 src/Vapi.Net/Types/OpenAiTranscriber.cs create mode 100644 src/Vapi.Net/Types/OpenAiTranscriberLanguage.cs create mode 100644 src/Vapi.Net/Types/OpenAiTranscriberModel.cs rename src/Vapi.Net/Types/{FallbackOpenAiVoiceId.cs => OpenAiVoiceIdEnum.cs} (54%) create mode 100644 src/Vapi.Net/Types/OpenAiVoiceModel.cs create mode 100644 src/Vapi.Net/Types/OpenAiVoicemailDetectionPlan.cs create mode 100644 src/Vapi.Net/Types/PhoneNumberHookCallRinging.cs create mode 100644 src/Vapi.Net/Types/QueryTool.cs delete mode 100644 src/Vapi.Net/Types/RuleBasedCondition.cs delete mode 100644 src/Vapi.Net/Types/RuleBasedConditionOperator.cs create mode 100644 src/Vapi.Net/Types/SchedulePlan.cs create mode 100644 src/Vapi.Net/Types/SlackOAuth2AuthorizationCredential.cs create mode 100644 src/Vapi.Net/Types/SlackSendMessageTool.cs create mode 100644 src/Vapi.Net/Types/SmsSendTool.cs create mode 100644 src/Vapi.Net/Types/SpeechmaticsCredential.cs create mode 100644 src/Vapi.Net/Types/SpeechmaticsTranscriber.cs create mode 100644 src/Vapi.Net/Types/SpeechmaticsTranscriberLanguage.cs delete mode 100644 src/Vapi.Net/Types/StepDestination.cs create mode 100644 src/Vapi.Net/Types/StructuredDataMultiPlan.cs create mode 100644 src/Vapi.Net/Types/SupabaseBucketPlan.cs create mode 100644 src/Vapi.Net/Types/SupabaseBucketPlanRegion.cs create mode 100644 src/Vapi.Net/Types/SupabaseCredential.cs create mode 100644 src/Vapi.Net/Types/TargetPlan.cs create mode 100644 src/Vapi.Net/Types/TelnyxPhoneNumber.cs create mode 100644 src/Vapi.Net/Types/TelnyxPhoneNumberStatus.cs create mode 100644 src/Vapi.Net/Types/TestSuitePhoneNumber.cs create mode 100644 src/Vapi.Net/Types/TestSuiteRunTestAttemptMetadata.cs create mode 100644 src/Vapi.Net/Types/TestSuiteTestChat.cs create mode 100644 src/Vapi.Net/Types/TesterPlan.cs delete mode 100644 src/Vapi.Net/Types/ToolCallBlock.cs delete mode 100644 src/Vapi.Net/Types/Transport.cs delete mode 100644 src/Vapi.Net/Types/TransportProvider.cs create mode 100644 src/Vapi.Net/Types/TrieveCredential.cs rename src/Vapi.Net/Types/{TwilioVoicemailDetection.cs => TwilioVoicemailDetectionPlan.cs} (90%) rename src/Vapi.Net/Types/{TwilioVoicemailDetectionVoicemailDetectionTypesItem.cs => TwilioVoicemailDetectionPlanVoicemailDetectionTypesItem.cs} (76%) delete mode 100644 src/Vapi.Net/Types/UpdateConversationBlockDto.cs create mode 100644 src/Vapi.Net/Types/UpdateGoogleCalendarCheckAvailabilityToolDto.cs create mode 100644 src/Vapi.Net/Types/UpdateGoogleCalendarCreateEventToolDto.cs create mode 100644 src/Vapi.Net/Types/UpdateGoogleCalendarOAuth2AuthorizationCredentialDto.cs create mode 100644 src/Vapi.Net/Types/UpdateGoogleCalendarOAuth2ClientCredentialDto.cs create mode 100644 src/Vapi.Net/Types/UpdateGoogleSheetsOAuth2AuthorizationCredentialDto.cs create mode 100644 src/Vapi.Net/Types/UpdateGoogleSheetsRowAppendToolDto.cs create mode 100644 src/Vapi.Net/Types/UpdateHumeCredentialDto.cs create mode 100644 src/Vapi.Net/Types/UpdateMcpToolDto.cs create mode 100644 src/Vapi.Net/Types/UpdateMistralCredentialDto.cs create mode 100644 src/Vapi.Net/Types/UpdateNeuphonicCredentialDto.cs create mode 100644 src/Vapi.Net/Types/UpdateQueryToolDto.cs create mode 100644 src/Vapi.Net/Types/UpdateSlackOAuth2AuthorizationCredentialDto.cs create mode 100644 src/Vapi.Net/Types/UpdateSlackSendMessageToolDto.cs create mode 100644 src/Vapi.Net/Types/UpdateSmsSendToolDto.cs create mode 100644 src/Vapi.Net/Types/UpdateSpeechmaticsCredentialDto.cs create mode 100644 src/Vapi.Net/Types/UpdateSupabaseCredentialDto.cs create mode 100644 src/Vapi.Net/Types/UpdateTelnyxPhoneNumberDto.cs create mode 100644 src/Vapi.Net/Types/UpdateTestSuiteTestChatDto.cs delete mode 100644 src/Vapi.Net/Types/UpdateToolCallBlockDto.cs create mode 100644 src/Vapi.Net/Types/UpdateTrieveCredentialDto.cs create mode 100644 src/Vapi.Net/Types/UpdateWebhookCredentialDto.cs delete mode 100644 src/Vapi.Net/Types/UpdateWorkflowBlockDto.cs create mode 100644 src/Vapi.Net/Types/VapiSmartEndpointingPlan.cs create mode 100644 src/Vapi.Net/Types/VapiSmartEndpointingPlanProvider.cs create mode 100644 src/Vapi.Net/Types/VapiVoice.cs create mode 100644 src/Vapi.Net/Types/VapiVoiceLanguage.cs create mode 100644 src/Vapi.Net/Types/VapiVoiceVoiceId.cs create mode 100644 src/Vapi.Net/Types/VoicemailDetectionCost.cs create mode 100644 src/Vapi.Net/Types/VoicemailDetectionCostProvider.cs delete mode 100644 src/Vapi.Net/Types/WorkflowBlock.cs create mode 100644 src/Vapi.Net/Workflow/Requests/UpdateWorkflowDto.cs create mode 100644 src/Vapi.Net/Workflow/WorkflowClient.cs diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..1e7a0ad --- /dev/null +++ b/.editorconfig @@ -0,0 +1,35 @@ +root = true + +[*.cs] +resharper_arrange_object_creation_when_type_evident_highlighting = hint +resharper_auto_property_can_be_made_get_only_global_highlighting = hint +resharper_check_namespace_highlighting = hint +resharper_class_never_instantiated_global_highlighting = hint +resharper_class_never_instantiated_local_highlighting = hint +resharper_collection_never_updated_global_highlighting = hint +resharper_convert_type_check_pattern_to_null_check_highlighting = hint +resharper_inconsistent_naming_highlighting = hint +resharper_member_can_be_private_global_highlighting = hint +resharper_member_hides_static_from_outer_class_highlighting = hint +resharper_not_accessed_field_local_highlighting = hint +resharper_nullable_warning_suppression_is_used_highlighting = suggestion +resharper_partial_type_with_single_part_highlighting = hint +resharper_prefer_concrete_value_over_default_highlighting = none +resharper_private_field_can_be_converted_to_local_variable_highlighting = hint +resharper_property_can_be_made_init_only_global_highlighting = hint +resharper_property_can_be_made_init_only_local_highlighting = hint +resharper_redundant_name_qualifier_highlighting = none +resharper_redundant_using_directive_highlighting = hint +resharper_replace_slice_with_range_indexer_highlighting = none +resharper_unused_auto_property_accessor_global_highlighting = hint +resharper_unused_auto_property_accessor_local_highlighting = hint +resharper_unused_member_global_highlighting = hint +resharper_unused_type_global_highlighting = hint +resharper_use_string_interpolation_highlighting = hint +dotnet_diagnostic.CS1591.severity = suggestion + +[src/**/Types/*.cs] +resharper_check_namespace_highlighting = none + +[src/**/Core/Public/*.cs] +resharper_check_namespace_highlighting = none \ No newline at end of file diff --git a/src/Vapi.Net.Test/Core/Json/DateOnlyJsonTests.cs b/src/Vapi.Net.Test/Core/Json/DateOnlyJsonTests.cs new file mode 100644 index 0000000..52a11e3 --- /dev/null +++ b/src/Vapi.Net.Test/Core/Json/DateOnlyJsonTests.cs @@ -0,0 +1,76 @@ +using NUnit.Framework; +using Vapi.Net.Core; + +namespace Vapi.Net.Test.Core.Json; + +[TestFixture] +public class DateOnlyJsonTests +{ + [Test] + public void SerializeDateOnly_ShouldMatchExpectedFormat() + { + (DateOnly dateOnly, string expected)[] testCases = + [ + (new DateOnly(2023, 10, 5), "\"2023-10-05\""), + (new DateOnly(2023, 1, 1), "\"2023-01-01\""), + (new DateOnly(2023, 12, 31), "\"2023-12-31\""), + (new DateOnly(2023, 6, 15), "\"2023-06-15\""), + (new DateOnly(2023, 3, 10), "\"2023-03-10\""), + ]; + foreach (var (dateOnly, expected) in testCases) + { + var json = JsonUtils.Serialize(dateOnly); + Assert.That(json, Is.EqualTo(expected)); + } + } + + [Test] + public void DeserializeDateOnly_ShouldMatchExpectedDateOnly() + { + (DateOnly expected, string json)[] testCases = + [ + (new DateOnly(2023, 10, 5), "\"2023-10-05\""), + (new DateOnly(2023, 1, 1), "\"2023-01-01\""), + (new DateOnly(2023, 12, 31), "\"2023-12-31\""), + (new DateOnly(2023, 6, 15), "\"2023-06-15\""), + (new DateOnly(2023, 3, 10), "\"2023-03-10\""), + ]; + + foreach (var (expected, json) in testCases) + { + var dateOnly = JsonUtils.Deserialize(json); + Assert.That(dateOnly, Is.EqualTo(expected)); + } + } + + [Test] + public void SerializeNullableDateOnly_ShouldMatchExpectedFormat() + { + (DateOnly? dateOnly, string expected)[] testCases = + [ + (new DateOnly(2023, 10, 5), "\"2023-10-05\""), + (null, "null"), + ]; + foreach (var (dateOnly, expected) in testCases) + { + var json = JsonUtils.Serialize(dateOnly); + Assert.That(json, Is.EqualTo(expected)); + } + } + + [Test] + public void DeserializeNullableDateOnly_ShouldMatchExpectedDateOnly() + { + (DateOnly? expected, string json)[] testCases = + [ + (new DateOnly(2023, 10, 5), "\"2023-10-05\""), + (null, "null"), + ]; + + foreach (var (expected, json) in testCases) + { + var dateOnly = JsonUtils.Deserialize(json); + Assert.That(dateOnly, Is.EqualTo(expected)); + } + } +} diff --git a/src/Vapi.Net.Test/Core/Json/DateTimeJsonTests.cs b/src/Vapi.Net.Test/Core/Json/DateTimeJsonTests.cs new file mode 100644 index 0000000..76309ef --- /dev/null +++ b/src/Vapi.Net.Test/Core/Json/DateTimeJsonTests.cs @@ -0,0 +1,110 @@ +using NUnit.Framework; +using Vapi.Net.Core; + +namespace Vapi.Net.Test.Core.Json; + +[TestFixture] +public class DateTimeJsonTests +{ + [Test] + public void SerializeDateTime_ShouldMatchExpectedFormat() + { + (DateTime dateTime, string expected)[] testCases = + [ + ( + new DateTime(2023, 10, 5, 14, 30, 0, DateTimeKind.Utc), + "\"2023-10-05T14:30:00.000Z\"" + ), + (new DateTime(2023, 1, 1, 0, 0, 0, DateTimeKind.Utc), "\"2023-01-01T00:00:00.000Z\""), + ( + new DateTime(2023, 12, 31, 23, 59, 59, DateTimeKind.Utc), + "\"2023-12-31T23:59:59.000Z\"" + ), + (new DateTime(2023, 6, 15, 12, 0, 0, DateTimeKind.Utc), "\"2023-06-15T12:00:00.000Z\""), + ( + new DateTime(2023, 3, 10, 8, 45, 30, DateTimeKind.Utc), + "\"2023-03-10T08:45:30.000Z\"" + ), + ( + new DateTime(2023, 3, 10, 8, 45, 30, 123, DateTimeKind.Utc), + "\"2023-03-10T08:45:30.123Z\"" + ), + ]; + foreach (var (dateTime, expected) in testCases) + { + var json = JsonUtils.Serialize(dateTime); + Assert.That(json, Is.EqualTo(expected)); + } + } + + [Test] + public void DeserializeDateTime_ShouldMatchExpectedDateTime() + { + (DateTime expected, string json)[] testCases = + [ + ( + new DateTime(2023, 10, 5, 14, 30, 0, DateTimeKind.Utc), + "\"2023-10-05T14:30:00.000Z\"" + ), + (new DateTime(2023, 1, 1, 0, 0, 0, DateTimeKind.Utc), "\"2023-01-01T00:00:00.000Z\""), + ( + new DateTime(2023, 12, 31, 23, 59, 59, DateTimeKind.Utc), + "\"2023-12-31T23:59:59.000Z\"" + ), + (new DateTime(2023, 6, 15, 12, 0, 0, DateTimeKind.Utc), "\"2023-06-15T12:00:00.000Z\""), + ( + new DateTime(2023, 3, 10, 8, 45, 30, DateTimeKind.Utc), + "\"2023-03-10T08:45:30.000Z\"" + ), + (new DateTime(2023, 3, 10, 8, 45, 30, DateTimeKind.Utc), "\"2023-03-10T08:45:30Z\""), + ( + new DateTime(2023, 3, 10, 8, 45, 30, 123, DateTimeKind.Utc), + "\"2023-03-10T08:45:30.123Z\"" + ), + ]; + + foreach (var (expected, json) in testCases) + { + var dateTime = JsonUtils.Deserialize(json); + Assert.That(dateTime, Is.EqualTo(expected)); + } + } + + [Test] + public void SerializeNullableDateTime_ShouldMatchExpectedFormat() + { + (DateTime? expected, string json)[] testCases = + [ + ( + new DateTime(2023, 10, 5, 14, 30, 0, DateTimeKind.Utc), + "\"2023-10-05T14:30:00.000Z\"" + ), + (null, "null"), + ]; + + foreach (var (expected, json) in testCases) + { + var dateTime = JsonUtils.Deserialize(json); + Assert.That(dateTime, Is.EqualTo(expected)); + } + } + + [Test] + public void DeserializeNullableDateTime_ShouldMatchExpectedDateTime() + { + (DateTime? expected, string json)[] testCases = + [ + ( + new DateTime(2023, 10, 5, 14, 30, 0, DateTimeKind.Utc), + "\"2023-10-05T14:30:00.000Z\"" + ), + (null, "null"), + ]; + + foreach (var (expected, json) in testCases) + { + var dateTime = JsonUtils.Deserialize(json); + Assert.That(dateTime, Is.EqualTo(expected)); + } + } +} diff --git a/src/Vapi.Net.Test/Core/EnumSerializerTests.cs b/src/Vapi.Net.Test/Core/Json/EnumSerializerTests.cs similarity index 97% rename from src/Vapi.Net.Test/Core/EnumSerializerTests.cs rename to src/Vapi.Net.Test/Core/Json/EnumSerializerTests.cs index 3a54617..6fe576c 100644 --- a/src/Vapi.Net.Test/Core/EnumSerializerTests.cs +++ b/src/Vapi.Net.Test/Core/Json/EnumSerializerTests.cs @@ -4,7 +4,7 @@ using NUnit.Framework; using Vapi.Net.Core; -namespace Vapi.Net.Test.Core; +namespace Vapi.Net.Test.Core.Json; [TestFixture] [Parallelizable(ParallelScope.All)] diff --git a/src/Vapi.Net.Test/Core/Json/JsonAccessAttributeTests.cs b/src/Vapi.Net.Test/Core/Json/JsonAccessAttributeTests.cs new file mode 100644 index 0000000..95db272 --- /dev/null +++ b/src/Vapi.Net.Test/Core/Json/JsonAccessAttributeTests.cs @@ -0,0 +1,160 @@ +using global::System.Text.Json.Serialization; +using NUnit.Framework; +using Vapi.Net.Core; + +namespace Vapi.Net.Test.Core.Json; + +[TestFixture] +public class JsonAccessAttributeTests +{ + private class MyClass + { + [JsonPropertyName("read_only_prop")] + [JsonAccess(JsonAccessType.ReadOnly)] + public string? ReadOnlyProp { get; set; } + + [JsonPropertyName("write_only_prop")] + [JsonAccess(JsonAccessType.WriteOnly)] + public string? WriteOnlyProp { get; set; } + + [JsonPropertyName("normal_prop")] + public string? NormalProp { get; set; } + + [JsonPropertyName("read_only_nullable_list")] + [JsonAccess(JsonAccessType.ReadOnly)] + public IEnumerable? ReadOnlyNullableList { get; set; } + + [JsonPropertyName("read_only_list")] + [JsonAccess(JsonAccessType.ReadOnly)] + public IEnumerable ReadOnlyList { get; set; } = []; + + [JsonPropertyName("write_only_nullable_list")] + [JsonAccess(JsonAccessType.WriteOnly)] + public IEnumerable? WriteOnlyNullableList { get; set; } + + [JsonPropertyName("write_only_list")] + [JsonAccess(JsonAccessType.WriteOnly)] + public IEnumerable WriteOnlyList { get; set; } = []; + + [JsonPropertyName("normal_list")] + public IEnumerable NormalList { get; set; } = []; + + [JsonPropertyName("normal_nullable_list")] + public IEnumerable? NullableNormalList { get; set; } + } + + [Test] + public void JsonAccessAttribute_ShouldWorkAsExpected() + { + const string json = """ + { + "read_only_prop": "read", + "write_only_prop": "write", + "normal_prop": "normal_prop", + "read_only_nullable_list": ["item1", "item2"], + "read_only_list": ["item3", "item4"], + "write_only_nullable_list": ["item5", "item6"], + "write_only_list": ["item7", "item8"], + "normal_list": ["normal1", "normal2"], + "normal_nullable_list": ["normal1", "normal2"] + } + """; + var obj = JsonUtils.Deserialize(json); + + Assert.Multiple(() => + { + // String properties + Assert.That(obj.ReadOnlyProp, Is.EqualTo("read")); + Assert.That(obj.WriteOnlyProp, Is.Null); + Assert.That(obj.NormalProp, Is.EqualTo("normal_prop")); + + // List properties - read only + var nullableReadOnlyList = obj.ReadOnlyNullableList?.ToArray(); + Assert.That(nullableReadOnlyList, Is.Not.Null); + Assert.That(nullableReadOnlyList, Has.Length.EqualTo(2)); + Assert.That(nullableReadOnlyList[0], Is.EqualTo("item1")); + Assert.That(nullableReadOnlyList[1], Is.EqualTo("item2")); + + var readOnlyList = obj.ReadOnlyList.ToArray(); + Assert.That(readOnlyList, Is.Not.Null); + Assert.That(readOnlyList, Has.Length.EqualTo(2)); + Assert.That(readOnlyList[0], Is.EqualTo("item3")); + Assert.That(readOnlyList[1], Is.EqualTo("item4")); + + // List properties - write only + Assert.That(obj.WriteOnlyNullableList, Is.Null); + Assert.That(obj.WriteOnlyList, Is.Not.Null); + Assert.That(obj.WriteOnlyList, Is.Empty); + + // Normal list property + var normalList = obj.NormalList.ToArray(); + Assert.That(normalList, Is.Not.Null); + Assert.That(normalList, Has.Length.EqualTo(2)); + Assert.That(normalList[0], Is.EqualTo("normal1")); + Assert.That(normalList[1], Is.EqualTo("normal2")); + }); + + // Set up values for serialization + obj.WriteOnlyProp = "write"; + obj.NormalProp = "new_value"; + obj.WriteOnlyNullableList = new List { "write1", "write2" }; + obj.WriteOnlyList = new List { "write3", "write4" }; + obj.NormalList = new List { "new_normal" }; + obj.NullableNormalList = new List { "new_normal" }; + + var serializedJson = JsonUtils.Serialize(obj); + const string expectedJson = """ + { + "write_only_prop": "write", + "normal_prop": "new_value", + "write_only_nullable_list": [ + "write1", + "write2" + ], + "write_only_list": [ + "write3", + "write4" + ], + "normal_list": [ + "new_normal" + ], + "normal_nullable_list": [ + "new_normal" + ] + } + """; + Assert.That(serializedJson, Is.EqualTo(expectedJson).IgnoreWhiteSpace); + } + + [Test] + public void JsonAccessAttribute_WithNullListsInJson_ShouldWorkAsExpected() + { + const string json = """ + { + "read_only_prop": "read", + "normal_prop": "normal_prop", + "read_only_nullable_list": null, + "read_only_list": [] + } + """; + var obj = JsonUtils.Deserialize(json); + + Assert.Multiple(() => + { + // Read-only nullable list should be null when JSON contains null + var nullableReadOnlyList = obj.ReadOnlyNullableList?.ToArray(); + Assert.That(nullableReadOnlyList, Is.Null); + + // Read-only non-nullable list should never be null, but empty when JSON contains null + var readOnlyList = obj.ReadOnlyList.ToArray(); // This should be initialized to an empty list by default + Assert.That(readOnlyList, Is.Not.Null); + Assert.That(readOnlyList, Is.Empty); + }); + + // Serialize and verify read-only lists are not included + var serializedJson = JsonUtils.Serialize(obj); + Assert.That(serializedJson, Does.Not.Contain("read_only_prop")); + Assert.That(serializedJson, Does.Not.Contain("read_only_nullable_list")); + Assert.That(serializedJson, Does.Not.Contain("read_only_list")); + } +} diff --git a/src/Vapi.Net.Test/Core/OneOfSerializerTests.cs b/src/Vapi.Net.Test/Core/Json/OneOfSerializerTests.cs similarity index 87% rename from src/Vapi.Net.Test/Core/OneOfSerializerTests.cs rename to src/Vapi.Net.Test/Core/Json/OneOfSerializerTests.cs index 6c3fc20..f527b7e 100644 --- a/src/Vapi.Net.Test/Core/OneOfSerializerTests.cs +++ b/src/Vapi.Net.Test/Core/Json/OneOfSerializerTests.cs @@ -4,7 +4,7 @@ using OneOf; using Vapi.Net.Core; -namespace Vapi.Net.Test.Core; +namespace Vapi.Net.Test.Core.Json; [TestFixture] [Parallelizable(ParallelScope.All)] @@ -56,7 +56,7 @@ private class Bar Foo, Bar >.FromT3(new Foo { StringProp = "test" }); - private const string OneOf4String = "{\n \"string_prop\": \"test\"\n}"; + private const string OneOf4String = "{\"string_prop\": \"test\"}"; private static readonly OneOf OneOf5 = OneOf< string, @@ -65,7 +65,7 @@ private class Bar Foo, Bar >.FromT4(new Bar { IntProp = 5 }); - private const string OneOf5String = "{\n \"int_prop\": 5\n}"; + private const string OneOf5String = "{\"int_prop\": 5}"; [Test] public void Serialize_OneOfs_Should_Return_Expected_String() @@ -83,7 +83,7 @@ public void Serialize_OneOfs_Should_Return_Expected_String() foreach (var (oneOf, expected) in testData) { var result = JsonUtils.Serialize(oneOf); - Assert.That(result, Is.EqualTo(expected)); + Assert.That(result, Is.EqualTo(expected).IgnoreWhiteSpace); } }); } @@ -105,7 +105,7 @@ public void OneOfs_Should_Deserialize_From_String() { var result = JsonUtils.Deserialize>(json); Assert.That(result.Index, Is.EqualTo(oneOf.Index)); - Assert.That(json, Is.EqualTo(JsonUtils.Serialize(result.Value))); + Assert.That(json, Is.EqualTo(JsonUtils.Serialize(result.Value)).IgnoreWhiteSpace); } }); } @@ -120,7 +120,7 @@ public void OneOfs_Should_Deserialize_From_String() Foo, Bar >.FromT4(new Bar { IntProp = 5 }); - private const string NullableOneOf2String = "{\n \"int_prop\": 5\n}"; + private const string NullableOneOf2String = "{\"int_prop\": 5}"; [Test] public void Serialize_NullableOneOfs_Should_Return_Expected_String() @@ -135,7 +135,7 @@ public void Serialize_NullableOneOfs_Should_Return_Expected_String() foreach (var (oneOf, expected) in testData) { var result = JsonUtils.Serialize(oneOf); - Assert.That(result, Is.EqualTo(expected)); + Assert.That(result, Is.EqualTo(expected).IgnoreWhiteSpace); } }); } @@ -154,7 +154,7 @@ public void NullableOneOfs_Should_Deserialize_From_String() { var result = JsonUtils.Deserialize?>(json); Assert.That(result?.Index, Is.EqualTo(oneOf?.Index)); - Assert.That(json, Is.EqualTo(JsonUtils.Serialize(result?.Value))); + Assert.That(json, Is.EqualTo(JsonUtils.Serialize(result?.Value)).IgnoreWhiteSpace); } }); } @@ -171,7 +171,7 @@ public void NullableOneOfs_Should_Deserialize_From_String() int, Foo? >.FromT2(new Foo { StringProp = "test" }); - private const string OneOfWithNullable2String = "{\n \"string_prop\": \"test\"\n}"; + private const string OneOfWithNullable2String = "{\"string_prop\": \"test\"}"; private static readonly OneOf OneOfWithNullable3 = OneOf< string, @@ -194,7 +194,7 @@ public void Serialize_OneOfWithNullables_Should_Return_Expected_String() foreach (var (oneOf, expected) in testData) { var result = JsonUtils.Serialize(oneOf); - Assert.That(result, Is.EqualTo(expected)); + Assert.That(result, Is.EqualTo(expected).IgnoreWhiteSpace); } }); } @@ -214,7 +214,7 @@ public void OneOfWithNullables_Should_Deserialize_From_String() { var result = JsonUtils.Deserialize>(json); Assert.That(result.Index, Is.EqualTo(oneOf.Index)); - Assert.That(json, Is.EqualTo(JsonUtils.Serialize(result.Value))); + Assert.That(json, Is.EqualTo(JsonUtils.Serialize(result.Value)).IgnoreWhiteSpace); } }); } @@ -225,16 +225,16 @@ public void Serialize_OneOfWithObjectLast_Should_Return_Expected_String() var oneOfWithObjectLast = OneOf.FromT4( new { random = "data" } ); - const string oneOfWithObjectLastString = "{\n \"random\": \"data\"\n}"; + const string oneOfWithObjectLastString = "{\"random\": \"data\"}"; var result = JsonUtils.Serialize(oneOfWithObjectLast); - Assert.That(result, Is.EqualTo(oneOfWithObjectLastString)); + Assert.That(result, Is.EqualTo(oneOfWithObjectLastString).IgnoreWhiteSpace); } [Test] public void OneOfWithObjectLast_Should_Deserialize_From_String() { - const string oneOfWithObjectLastString = "{\n \"random\": \"data\"\n}"; + const string oneOfWithObjectLastString = "{\"random\": \"data\"}"; var result = JsonUtils.Deserialize>( oneOfWithObjectLastString ); @@ -242,7 +242,10 @@ public void OneOfWithObjectLast_Should_Deserialize_From_String() { Assert.That(result.Index, Is.EqualTo(4)); Assert.That(result.Value, Is.InstanceOf()); - Assert.That(JsonUtils.Serialize(result.Value), Is.EqualTo(oneOfWithObjectLastString)); + Assert.That( + JsonUtils.Serialize(result.Value), + Is.EqualTo(oneOfWithObjectLastString).IgnoreWhiteSpace + ); }); } @@ -252,16 +255,16 @@ public void Serialize_OneOfWithObjectNotLast_Should_Return_Expected_String() var oneOfWithObjectNotLast = OneOf.FromT1( new { random = "data" } ); - const string oneOfWithObjectNotLastString = "{\n \"random\": \"data\"\n}"; + const string oneOfWithObjectNotLastString = "{\"random\": \"data\"}"; var result = JsonUtils.Serialize(oneOfWithObjectNotLast); - Assert.That(result, Is.EqualTo(oneOfWithObjectNotLastString)); + Assert.That(result, Is.EqualTo(oneOfWithObjectNotLastString).IgnoreWhiteSpace); } [Test] public void OneOfWithObjectNotLast_Should_Deserialize_From_String() { - const string oneOfWithObjectNotLastString = "{\n \"random\": \"data\"\n}"; + const string oneOfWithObjectNotLastString = "{\"random\": \"data\"}"; var result = JsonUtils.Deserialize>( oneOfWithObjectNotLastString ); @@ -271,7 +274,7 @@ public void OneOfWithObjectNotLast_Should_Deserialize_From_String() Assert.That(result.Value, Is.InstanceOf()); Assert.That( JsonUtils.Serialize(result.Value), - Is.EqualTo(oneOfWithObjectNotLastString) + Is.EqualTo(oneOfWithObjectNotLastString).IgnoreWhiteSpace ); }); } diff --git a/src/Vapi.Net.Test/Core/Pagination/GuidCursorTest.cs b/src/Vapi.Net.Test/Core/Pagination/GuidCursorTest.cs index 60f5e2b..6878b94 100644 --- a/src/Vapi.Net.Test/Core/Pagination/GuidCursorTest.cs +++ b/src/Vapi.Net.Test/Core/Pagination/GuidCursorTest.cs @@ -1,25 +1,18 @@ using NUnit.Framework; using Vapi.Net.Core; -using SystemTask = System.Threading.Tasks.Task; +using SystemTask = global::System.Threading.Tasks.Task; namespace Vapi.Net.Test.Core.Pagination; [TestFixture(Category = "Pagination")] public class GuidCursorTest { - [Test] - public async SystemTask CursorPagerShouldWorkWithGuidCursors() - { - var pager = CreatePager(); - await AssertPager(pager); - } - private static readonly Guid? Cursor1 = null; private static readonly Guid Cursor2 = new("00000000-0000-0000-0000-000000000001"); - private static readonly Guid Cursor3 = new("00000000-0000-0000-0000-000000000001"); - private Guid? _cursorCopy; + private static readonly Guid Cursor3 = new("00000000-0000-0000-0000-000000000002"); - private Pager CreatePager() + [Test] + public async SystemTask CursorPagerShouldWorkWithGuidCursors() { var responses = new List { @@ -39,9 +32,15 @@ private Pager CreatePager() Cursor = new() { Next = null }, }, }.GetEnumerator(); - _cursorCopy = Cursor1; - Pager pager = new CursorPager( - new() { Cursor = Cursor1 }, + var cursorCopy = Cursor1; + Pager pager = await CursorPager< + Request, + object?, + Response, + Guid?, + object + >.CreateInstanceAsync( + new Request { Cursor = Cursor1 }, null, (_, _, _) => { @@ -51,35 +50,31 @@ private Pager CreatePager() (request, cursor) => { request.Cursor = cursor; - _cursorCopy = cursor; + cursorCopy = cursor; }, response => response?.Cursor?.Next, response => response?.Data?.Items?.ToList() ); - return pager; - } - private async SystemTask AssertPager(Pager pager) - { var pageEnumerator = pager.AsPagesAsync().GetAsyncEnumerator(); // first page Assert.That(await pageEnumerator.MoveNextAsync(), Is.True); var page = pageEnumerator.Current; Assert.That(page.Items, Has.Count.EqualTo(2)); - Assert.That(_cursorCopy, Is.EqualTo(Cursor1)); + Assert.That(cursorCopy, Is.EqualTo(Cursor2)); // second page Assert.That(await pageEnumerator.MoveNextAsync(), Is.True); page = pageEnumerator.Current; Assert.That(page.Items, Has.Count.EqualTo(1)); - Assert.That(_cursorCopy, Is.EqualTo(Cursor2)); + Assert.That(cursorCopy, Is.EqualTo(Cursor3)); // third page Assert.That(await pageEnumerator.MoveNextAsync(), Is.True); page = pageEnumerator.Current; Assert.That(page.Items, Has.Count.EqualTo(0)); - Assert.That(_cursorCopy, Is.EqualTo(Cursor3)); + Assert.That(cursorCopy, Is.Null); // no more Assert.That(await pageEnumerator.MoveNextAsync(), Is.False); diff --git a/src/Vapi.Net.Test/Core/Pagination/HasNextPageOffsetTest.cs b/src/Vapi.Net.Test/Core/Pagination/HasNextPageOffsetTest.cs index fef18e2..1f0d0bb 100644 --- a/src/Vapi.Net.Test/Core/Pagination/HasNextPageOffsetTest.cs +++ b/src/Vapi.Net.Test/Core/Pagination/HasNextPageOffsetTest.cs @@ -1,6 +1,6 @@ using NUnit.Framework; using Vapi.Net.Core; -using SystemTask = System.Threading.Tasks.Task; +using SystemTask = global::System.Threading.Tasks.Task; namespace Vapi.Net.Test.Core.Pagination; @@ -9,12 +9,6 @@ public class HasNextPageOffsetTest { [Test] public async SystemTask OffsetPagerShouldWorkWithHasNextPage() - { - var pager = CreatePager(); - await AssertPager(pager); - } - - private static Pager CreatePager() { var responses = new List { @@ -34,8 +28,15 @@ private static Pager CreatePager() HasNext = false, }, }.GetEnumerator(); - Pager pager = new OffsetPager( - new() { Pagination = new() { Page = 1 } }, + Pager pager = await OffsetPager< + Request, + object?, + Response, + int, + object?, + object + >.CreateInstanceAsync( + new Request { Pagination = new Pagination { Page = 1 } }, null, (_, _, _) => { @@ -52,11 +53,7 @@ private static Pager CreatePager() response => response?.Data?.Items?.ToList(), response => response.HasNext ); - return pager; - } - private static async SystemTask AssertPager(Pager pager) - { var pageCounter = 0; var itemCounter = 0; await foreach (var page in pager.AsPagesAsync()) @@ -74,7 +71,7 @@ private static async SystemTask AssertPager(Pager pager) private class Request { - public Pagination Pagination { get; set; } + public Pagination? Pagination { get; set; } } private class Pagination @@ -84,12 +81,12 @@ private class Pagination private class Response { - public Data Data { get; set; } + public Data? Data { get; set; } public bool HasNext { get; set; } } private class Data { - public IEnumerable Items { get; set; } + public IEnumerable? Items { get; set; } } } diff --git a/src/Vapi.Net.Test/Core/Pagination/IntOffsetTest.cs b/src/Vapi.Net.Test/Core/Pagination/IntOffsetTest.cs index a9ff29a..4f9decc 100644 --- a/src/Vapi.Net.Test/Core/Pagination/IntOffsetTest.cs +++ b/src/Vapi.Net.Test/Core/Pagination/IntOffsetTest.cs @@ -1,6 +1,6 @@ using NUnit.Framework; using Vapi.Net.Core; -using SystemTask = System.Threading.Tasks.Task; +using SystemTask = global::System.Threading.Tasks.Task; namespace Vapi.Net.Test.Core.Pagination; @@ -9,12 +9,6 @@ public class IntOffsetTest { [Test] public async SystemTask OffsetPagerShouldWorkWithIntPage() - { - var pager = CreatePager(); - await AssertPager(pager); - } - - public Pager CreatePager() { var responses = new List { @@ -22,7 +16,14 @@ public Pager CreatePager() new() { Data = new() { Items = ["item1"] } }, new() { Data = new() { Items = [] } }, }.GetEnumerator(); - Pager pager = new OffsetPager( + Pager pager = await OffsetPager< + Request, + object?, + Response, + int, + object?, + object + >.CreateInstanceAsync( new() { Pagination = new() { Page = 1 } }, null, (_, _, _) => @@ -40,11 +41,7 @@ public Pager CreatePager() response => response?.Data?.Items?.ToList(), null ); - return pager; - } - public async SystemTask AssertPager(Pager pager) - { var pageCounter = 0; var itemCounter = 0; await foreach (var page in pager.AsPagesAsync()) @@ -62,7 +59,7 @@ public async SystemTask AssertPager(Pager pager) private class Request { - public Pagination Pagination { get; set; } + public Pagination? Pagination { get; set; } } private class Pagination @@ -72,11 +69,11 @@ private class Pagination private class Response { - public Data Data { get; set; } + public Data? Data { get; set; } } private class Data { - public IEnumerable Items { get; set; } + public IEnumerable? Items { get; set; } } } diff --git a/src/Vapi.Net.Test/Core/Pagination/LongOffsetTest.cs b/src/Vapi.Net.Test/Core/Pagination/LongOffsetTest.cs index 1daeb20..5fe8c98 100644 --- a/src/Vapi.Net.Test/Core/Pagination/LongOffsetTest.cs +++ b/src/Vapi.Net.Test/Core/Pagination/LongOffsetTest.cs @@ -1,6 +1,6 @@ using NUnit.Framework; using Vapi.Net.Core; -using SystemTask = System.Threading.Tasks.Task; +using SystemTask = global::System.Threading.Tasks.Task; namespace Vapi.Net.Test.Core.Pagination; @@ -9,21 +9,22 @@ public class LongOffsetTest { [Test] public async SystemTask OffsetPagerShouldWorkWithLongPage() - { - var pager = CreatePager(); - await AssertPager(pager); - } - - private static Pager CreatePager() { var responses = new List { - new() { Data = new() { Items = ["item1", "item2"] } }, - new() { Data = new() { Items = ["item1"] } }, - new() { Data = new() { Items = [] } }, + new() { Data = new Data { Items = ["item1", "item2"] } }, + new() { Data = new Data { Items = ["item1"] } }, + new() { Data = new Data { Items = [] } }, }.GetEnumerator(); - Pager pager = new OffsetPager( - new() { Pagination = new() { Page = 1 } }, + Pager pager = await OffsetPager< + Request, + object?, + Response, + long, + object?, + object + >.CreateInstanceAsync( + new Request { Pagination = new Pagination { Page = 1 } }, null, (_, _, _) => { @@ -40,11 +41,7 @@ private static Pager CreatePager() response => response?.Data?.Items?.ToList(), null ); - return pager; - } - private static async SystemTask AssertPager(Pager pager) - { var pageCounter = 0; var itemCounter = 0; await foreach (var page in pager.AsPagesAsync()) @@ -62,7 +59,7 @@ private static async SystemTask AssertPager(Pager pager) private class Request { - public Pagination Pagination { get; set; } + public Pagination? Pagination { get; set; } } private class Pagination @@ -72,11 +69,11 @@ private class Pagination private class Response { - public Data Data { get; set; } + public Data? Data { get; set; } } private class Data { - public IEnumerable Items { get; set; } + public IEnumerable? Items { get; set; } } } diff --git a/src/Vapi.Net.Test/Core/Pagination/NoRequestCursorTest.cs b/src/Vapi.Net.Test/Core/Pagination/NoRequestCursorTest.cs index 42a8270..8ffcdcf 100644 --- a/src/Vapi.Net.Test/Core/Pagination/NoRequestCursorTest.cs +++ b/src/Vapi.Net.Test/Core/Pagination/NoRequestCursorTest.cs @@ -1,46 +1,45 @@ using NUnit.Framework; using Vapi.Net.Core; -using SystemTask = System.Threading.Tasks.Task; +using SystemTask = global::System.Threading.Tasks.Task; namespace Vapi.Net.Test.Core.Pagination; [TestFixture(Category = "Pagination")] public class NoRequestCursorTest { - [Test] - public async SystemTask CursorPagerShouldWorkWithStringCursor() - { - var pager = CreatePager(); - await AssertPager(pager); - } - private const string? Cursor1 = null; private const string Cursor2 = "cursor2"; private const string Cursor3 = "cursor3"; - private string? _cursorCopy; - private Pager CreatePager() + [Test] + public async SystemTask CursorPagerShouldWorkWithStringCursor() { var responses = new List { new() { - Data = new() { Items = ["item1", "item2"] }, - Cursor = new() { Next = Cursor2 }, + Data = new Data { Items = ["item1", "item2"] }, + Cursor = new Cursor { Next = Cursor2 }, }, new() { - Data = new() { Items = ["item1"] }, - Cursor = new() { Next = Cursor3 }, + Data = new Data { Items = ["item1"] }, + Cursor = new Cursor { Next = Cursor3 }, }, new() { - Data = new() { Items = [] }, - Cursor = new() { Next = null }, + Data = new Data { Items = [] }, + Cursor = new Cursor { Next = null }, }, }.GetEnumerator(); - _cursorCopy = Cursor1; - Pager pager = new CursorPager( + var cursorCopy = Cursor1; + Pager pager = await CursorPager< + Request?, + object?, + Response, + string, + object + >.CreateInstanceAsync( null, null, (_, _, _) => @@ -51,35 +50,31 @@ private Pager CreatePager() (request, cursor) => { request.Cursor = cursor; - _cursorCopy = cursor; + cursorCopy = cursor; }, response => response?.Cursor?.Next, response => response?.Data?.Items?.ToList() ); - return pager; - } - private async SystemTask AssertPager(Pager pager) - { var pageEnumerator = pager.AsPagesAsync().GetAsyncEnumerator(); // first page Assert.That(await pageEnumerator.MoveNextAsync(), Is.True); var page = pageEnumerator.Current; Assert.That(page.Items, Has.Count.EqualTo(2)); - Assert.That(_cursorCopy, Is.EqualTo(Cursor1)); + Assert.That(cursorCopy, Is.EqualTo(Cursor2)); // second page Assert.That(await pageEnumerator.MoveNextAsync(), Is.True); page = pageEnumerator.Current; Assert.That(page.Items, Has.Count.EqualTo(1)); - Assert.That(_cursorCopy, Is.EqualTo(Cursor2)); + Assert.That(cursorCopy, Is.EqualTo(Cursor3)); // third page Assert.That(await pageEnumerator.MoveNextAsync(), Is.True); page = pageEnumerator.Current; Assert.That(page.Items, Has.Count.EqualTo(0)); - Assert.That(_cursorCopy, Is.EqualTo(Cursor3)); + Assert.That(cursorCopy, Is.Null); // no more Assert.That(await pageEnumerator.MoveNextAsync(), Is.False); diff --git a/src/Vapi.Net.Test/Core/Pagination/NoRequestOffsetTest.cs b/src/Vapi.Net.Test/Core/Pagination/NoRequestOffsetTest.cs index 445a0d7..1452f91 100644 --- a/src/Vapi.Net.Test/Core/Pagination/NoRequestOffsetTest.cs +++ b/src/Vapi.Net.Test/Core/Pagination/NoRequestOffsetTest.cs @@ -1,6 +1,6 @@ using NUnit.Framework; using Vapi.Net.Core; -using SystemTask = System.Threading.Tasks.Task; +using SystemTask = global::System.Threading.Tasks.Task; namespace Vapi.Net.Test.Core.Pagination; @@ -9,12 +9,6 @@ public class NoRequestOffsetTest { [Test] public async SystemTask OffsetPagerShouldWorkWithoutRequest() - { - var pager = CreatePager(); - await AssertPager(pager); - } - - public Pager CreatePager() { var responses = new List { @@ -22,7 +16,14 @@ public Pager CreatePager() new() { Data = new() { Items = ["item1"] } }, new() { Data = new() { Items = [] } }, }.GetEnumerator(); - Pager pager = new OffsetPager( + Pager pager = await OffsetPager< + Request?, + object?, + Response, + int, + object?, + object + >.CreateInstanceAsync( null, null, (_, _, _) => @@ -40,11 +41,7 @@ public Pager CreatePager() response => response?.Data?.Items?.ToList(), null ); - return pager; - } - public async SystemTask AssertPager(Pager pager) - { var pageCounter = 0; var itemCounter = 0; await foreach (var page in pager.AsPagesAsync()) @@ -62,7 +59,7 @@ public async SystemTask AssertPager(Pager pager) private class Request { - public Pagination Pagination { get; set; } + public Pagination? Pagination { get; set; } } private class Pagination @@ -72,11 +69,11 @@ private class Pagination private class Response { - public Data Data { get; set; } + public Data? Data { get; set; } } private class Data { - public IEnumerable Items { get; set; } + public IEnumerable? Items { get; set; } } } diff --git a/src/Vapi.Net.Test/Core/Pagination/StepOffsetTest.cs b/src/Vapi.Net.Test/Core/Pagination/StepOffsetTest.cs index 97dc707..34a44bf 100644 --- a/src/Vapi.Net.Test/Core/Pagination/StepOffsetTest.cs +++ b/src/Vapi.Net.Test/Core/Pagination/StepOffsetTest.cs @@ -1,6 +1,6 @@ using NUnit.Framework; using Vapi.Net.Core; -using SystemTask = System.Threading.Tasks.Task; +using SystemTask = global::System.Threading.Tasks.Task; namespace Vapi.Net.Test.Core.Pagination; @@ -9,14 +9,6 @@ public class StepPageOffsetPaginationTest { [Test] public async SystemTask OffsetPagerShouldWorkWithStep() - { - var pager = CreatePager(); - await AssertPager(pager); - } - - private Pagination _paginationCopy; - - private Pager CreatePager() { var responses = new List { @@ -24,9 +16,16 @@ private Pager CreatePager() new() { Data = new() { Items = ["item1"] } }, new() { Data = new() { Items = [] } }, }.GetEnumerator(); - _paginationCopy = new() { ItemOffset = 0, PageSize = 2 }; - Pager pager = new OffsetPager( - new() { Pagination = _paginationCopy }, + Pagination paginationCopy = new() { ItemOffset = 0, PageSize = 2 }; + Pager pager = await OffsetPager< + Request, + object?, + Response, + int, + object?, + object + >.CreateInstanceAsync( + new Request { Pagination = paginationCopy }, null, (_, _, _) => { @@ -38,36 +37,32 @@ private Pager CreatePager() { request.Pagination ??= new(); request.Pagination.ItemOffset = offset; - _paginationCopy = request.Pagination; + paginationCopy = request.Pagination; }, request => request?.Pagination?.PageSize, response => response?.Data?.Items?.ToList(), null ); - return pager; - } - private async SystemTask AssertPager(Pager pager) - { var pageEnumerator = pager.AsPagesAsync().GetAsyncEnumerator(); // first page Assert.That(await pageEnumerator.MoveNextAsync(), Is.True); var page = pageEnumerator.Current; Assert.That(page.Items, Has.Count.EqualTo(2)); - Assert.That(_paginationCopy.ItemOffset, Is.EqualTo(0)); + Assert.That(paginationCopy.ItemOffset, Is.EqualTo(2)); // second page Assert.That(await pageEnumerator.MoveNextAsync(), Is.True); page = pageEnumerator.Current; Assert.That(page.Items, Has.Count.EqualTo(1)); - Assert.That(_paginationCopy.ItemOffset, Is.EqualTo(2)); + Assert.That(paginationCopy.ItemOffset, Is.EqualTo(3)); // third page Assert.That(await pageEnumerator.MoveNextAsync(), Is.True); page = pageEnumerator.Current; Assert.That(page.Items, Has.Count.EqualTo(0)); - Assert.That(_paginationCopy.ItemOffset, Is.EqualTo(3)); + Assert.That(paginationCopy.ItemOffset, Is.EqualTo(3)); // no more Assert.That(await pageEnumerator.MoveNextAsync(), Is.False); @@ -75,7 +70,7 @@ private async SystemTask AssertPager(Pager pager) private class Request { - public Pagination Pagination { get; set; } + public Pagination? Pagination { get; set; } } private class Pagination @@ -86,12 +81,12 @@ private class Pagination private class Response { - public Data Data { get; set; } + public Data? Data { get; set; } public bool HasNext { get; set; } } private class Data { - public IEnumerable Items { get; set; } + public IEnumerable? Items { get; set; } } } diff --git a/src/Vapi.Net.Test/Core/Pagination/StringCursorTest.cs b/src/Vapi.Net.Test/Core/Pagination/StringCursorTest.cs index 6f45b90..8ee8e2a 100644 --- a/src/Vapi.Net.Test/Core/Pagination/StringCursorTest.cs +++ b/src/Vapi.Net.Test/Core/Pagination/StringCursorTest.cs @@ -1,47 +1,46 @@ using NUnit.Framework; using Vapi.Net.Core; -using SystemTask = System.Threading.Tasks.Task; +using SystemTask = global::System.Threading.Tasks.Task; namespace Vapi.Net.Test.Core.Pagination; [TestFixture(Category = "Pagination")] public class StringCursorTest { - [Test] - public async SystemTask CursorPagerShouldWorkWithStringCursor() - { - var pager = CreatePager(); - await AssertPager(pager); - } - private const string? Cursor1 = null; private const string Cursor2 = "cursor2"; private const string Cursor3 = "cursor3"; - private string? _cursorCopy; - private Pager CreatePager() + [Test] + public async SystemTask CursorPagerShouldWorkWithStringCursor() { var responses = new List { new() { - Data = new() { Items = ["item1", "item2"] }, - Cursor = new() { Next = Cursor2 }, + Data = new Data { Items = ["item1", "item2"] }, + Cursor = new Cursor { Next = Cursor2 }, }, new() { - Data = new() { Items = ["item1"] }, - Cursor = new() { Next = Cursor3 }, + Data = new Data { Items = ["item1"] }, + Cursor = new Cursor { Next = Cursor3 }, }, new() { - Data = new() { Items = [] }, - Cursor = new() { Next = null }, + Data = new Data { Items = [] }, + Cursor = new Cursor { Next = null }, }, }.GetEnumerator(); - _cursorCopy = Cursor1; - Pager pager = new CursorPager( - new() { Cursor = Cursor1 }, + var cursorCopy = Cursor1; + Pager pager = await CursorPager< + Request, + object?, + Response, + string, + object + >.CreateInstanceAsync( + new Request { Cursor = Cursor1 }, null, (_, _, _) => { @@ -51,35 +50,31 @@ private Pager CreatePager() (request, cursor) => { request.Cursor = cursor; - _cursorCopy = cursor; + cursorCopy = cursor; }, response => response?.Cursor?.Next, response => response?.Data?.Items?.ToList() ); - return pager; - } - private async SystemTask AssertPager(Pager pager) - { var pageEnumerator = pager.AsPagesAsync().GetAsyncEnumerator(); // first page Assert.That(await pageEnumerator.MoveNextAsync(), Is.True); var page = pageEnumerator.Current; Assert.That(page.Items, Has.Count.EqualTo(2)); - Assert.That(_cursorCopy, Is.EqualTo(Cursor1)); + Assert.That(cursorCopy, Is.EqualTo(Cursor2)); // second page Assert.That(await pageEnumerator.MoveNextAsync(), Is.True); page = pageEnumerator.Current; Assert.That(page.Items, Has.Count.EqualTo(1)); - Assert.That(_cursorCopy, Is.EqualTo(Cursor2)); + Assert.That(cursorCopy, Is.EqualTo(Cursor3)); // third page Assert.That(await pageEnumerator.MoveNextAsync(), Is.True); page = pageEnumerator.Current; Assert.That(page.Items, Has.Count.EqualTo(0)); - Assert.That(_cursorCopy, Is.EqualTo(Cursor3)); + Assert.That(cursorCopy, Is.Null); // no more Assert.That(await pageEnumerator.MoveNextAsync(), Is.False); diff --git a/src/Vapi.Net.Test/Core/QueryStringConverterTests.cs b/src/Vapi.Net.Test/Core/QueryStringConverterTests.cs new file mode 100644 index 0000000..9dfa88e --- /dev/null +++ b/src/Vapi.Net.Test/Core/QueryStringConverterTests.cs @@ -0,0 +1,122 @@ +using NUnit.Framework; +using Vapi.Net.Core; + +namespace Vapi.Net.Test.Core; + +[TestFixture] +public class QueryStringConverterTests +{ + [Test] + public void ToQueryStringCollection_Form() + { + var obj = new + { + Name = "John", + Age = 30, + Address = new + { + Street = "123 Main St", + City = "Anytown", + Coordinates = new[] { 39.781721f, -89.650148f }, + }, + Tags = new[] { "Developer", "Blogger" }, + }; + var result = QueryStringConverter.ToForm(obj); + var expected = new List> + { + new("Name", "John"), + new("Age", "30"), + new("Address[Street]", "123 Main St"), + new("Address[City]", "Anytown"), + new("Address[Coordinates]", "39.78172,-89.65015"), + new("Tags", "Developer,Blogger"), + }; + Assert.That(result, Is.EqualTo(expected)); + } + + [Test] + public void ToQueryStringCollection_ExplodedForm() + { + var obj = new + { + Name = "John", + Age = 30, + Address = new + { + Street = "123 Main St", + City = "Anytown", + Coordinates = new[] { 39.781721f, -89.650148f }, + }, + Tags = new[] { "Developer", "Blogger" }, + }; + var result = QueryStringConverter.ToExplodedForm(obj); + var expected = new List> + { + new("Name", "John"), + new("Age", "30"), + new("Address[Street]", "123 Main St"), + new("Address[City]", "Anytown"), + new("Address[Coordinates]", "39.78172"), + new("Address[Coordinates]", "-89.65015"), + new("Tags", "Developer"), + new("Tags", "Blogger"), + }; + Assert.That(result, Is.EqualTo(expected)); + } + + [Test] + public void ToQueryStringCollection_DeepObject() + { + var obj = new + { + Name = "John", + Age = 30, + Address = new + { + Street = "123 Main St", + City = "Anytown", + Coordinates = new[] { 39.781721f, -89.650148f }, + }, + Tags = new[] { "Developer", "Blogger" }, + }; + var result = QueryStringConverter.ToDeepObject(obj); + var expected = new List> + { + new("Name", "John"), + new("Age", "30"), + new("Address[Street]", "123 Main St"), + new("Address[City]", "Anytown"), + new("Address[Coordinates][0]", "39.78172"), + new("Address[Coordinates][1]", "-89.65015"), + new("Tags[0]", "Developer"), + new("Tags[1]", "Blogger"), + }; + Assert.That(result, Is.EqualTo(expected)); + } + + [Test] + public void ToQueryStringCollection_OnString_ThrowsException() + { + var exception = Assert.Throws(() => QueryStringConverter.ToForm("invalid")); + Assert.That( + exception.Message, + Is.EqualTo( + "Only objects can be converted to query string collections. Given type is String." + ) + ); + } + + [Test] + public void ToQueryStringCollection_OnArray_ThrowsException() + { + var exception = Assert.Throws( + () => QueryStringConverter.ToForm(Array.Empty()) + ); + Assert.That( + exception.Message, + Is.EqualTo( + "Only objects can be converted to query string collections. Given type is Array." + ) + ); + } +} diff --git a/src/Vapi.Net.Test/Core/RawClientTests.cs b/src/Vapi.Net.Test/Core/RawClientTests.cs deleted file mode 100644 index c48e0be..0000000 --- a/src/Vapi.Net.Test/Core/RawClientTests.cs +++ /dev/null @@ -1,109 +0,0 @@ -using NUnit.Framework; -using Vapi.Net.Core; -using WireMock.Server; -using SystemTask = System.Threading.Tasks.Task; -using WireMockRequest = WireMock.RequestBuilders.Request; -using WireMockResponse = WireMock.ResponseBuilders.Response; - -namespace Vapi.Net.Test.Core; - -[TestFixture] -[Parallelizable(ParallelScope.Self)] -public class RawClientTests -{ - private const int MaxRetries = 3; - private WireMockServer _server; - private HttpClient _httpClient; - private RawClient _rawClient; - private string _baseUrl; - - [SetUp] - public void SetUp() - { - _server = WireMockServer.Start(); - _baseUrl = _server.Url ?? ""; - _httpClient = new HttpClient { BaseAddress = new Uri(_baseUrl) }; - _rawClient = new RawClient( - new ClientOptions { HttpClient = _httpClient, MaxRetries = MaxRetries } - ) - { - BaseRetryDelay = 0, - }; - } - - [Test] - [TestCase(408)] - [TestCase(429)] - [TestCase(500)] - [TestCase(504)] - public async SystemTask MakeRequestAsync_ShouldRetry_OnRetryableStatusCodes(int statusCode) - { - _server - .Given(WireMockRequest.Create().WithPath("/test").UsingGet()) - .InScenario("Retry") - .WillSetStateTo("Server Error") - .RespondWith(WireMockResponse.Create().WithStatusCode(statusCode)); - - _server - .Given(WireMockRequest.Create().WithPath("/test").UsingGet()) - .InScenario("Retry") - .WhenStateIs("Server Error") - .WillSetStateTo("Success") - .RespondWith(WireMockResponse.Create().WithStatusCode(statusCode)); - - _server - .Given(WireMockRequest.Create().WithPath("/test").UsingGet()) - .InScenario("Retry") - .WhenStateIs("Success") - .RespondWith(WireMockResponse.Create().WithStatusCode(200).WithBody("Success")); - - var request = new RawClient.BaseApiRequest - { - BaseUrl = _baseUrl, - Method = HttpMethod.Get, - Path = "/test", - }; - - var response = await _rawClient.MakeRequestAsync(request); - Assert.That(response.StatusCode, Is.EqualTo(200)); - - var content = await response.Raw.Content.ReadAsStringAsync(); - Assert.That(content, Is.EqualTo("Success")); - - Assert.That(_server.LogEntries.Count, Is.EqualTo(MaxRetries)); - } - - [Test] - [TestCase(400)] - [TestCase(409)] - public async SystemTask MakeRequestAsync_ShouldRetry_OnNonRetryableStatusCodes(int statusCode) - { - _server - .Given(WireMockRequest.Create().WithPath("/test").UsingGet()) - .InScenario("Retry") - .WillSetStateTo("Server Error") - .RespondWith(WireMockResponse.Create().WithStatusCode(statusCode).WithBody("Failure")); - - var request = new RawClient.BaseApiRequest - { - BaseUrl = _baseUrl, - Method = HttpMethod.Get, - Path = "/test", - }; - - var response = await _rawClient.MakeRequestAsync(request); - Assert.That(response.StatusCode, Is.EqualTo(statusCode)); - - var content = await response.Raw.Content.ReadAsStringAsync(); - Assert.That(content, Is.EqualTo("Failure")); - - Assert.That(_server.LogEntries.Count, Is.EqualTo(1)); - } - - [TearDown] - public void TearDown() - { - _server.Dispose(); - _httpClient.Dispose(); - } -} diff --git a/src/Vapi.Net.Test/Core/RawClientTests/AdditionalHeadersTests.cs b/src/Vapi.Net.Test/Core/RawClientTests/AdditionalHeadersTests.cs new file mode 100644 index 0000000..9149333 --- /dev/null +++ b/src/Vapi.Net.Test/Core/RawClientTests/AdditionalHeadersTests.cs @@ -0,0 +1,137 @@ +using NUnit.Framework; +using Vapi.Net.Core; +using WireMock.Server; +using SystemTask = global::System.Threading.Tasks.Task; +using WireMockRequest = WireMock.RequestBuilders.Request; +using WireMockResponse = WireMock.ResponseBuilders.Response; + +// ReSharper disable NullableWarningSuppressionIsUsed + +namespace Vapi.Net.Test.Core.RawClientTests; + +[TestFixture] +[Parallelizable(ParallelScope.Self)] +public class AdditionalHeadersTests +{ + private WireMockServer _server; + private HttpClient _httpClient; + private RawClient _rawClient; + private string _baseUrl; + + [SetUp] + public void SetUp() + { + _server = WireMockServer.Start(); + _baseUrl = _server.Url ?? ""; + _httpClient = new HttpClient { BaseAddress = new Uri(_baseUrl) }; + _rawClient = new RawClient( + new ClientOptions + { + HttpClient = _httpClient, + Headers = new Headers( + new Dictionary + { + ["a"] = "client_headers", + ["b"] = "client_headers", + ["c"] = "client_headers", + ["d"] = "client_headers", + ["e"] = "client_headers", + ["f"] = "client_headers", + ["client_multiple"] = "client_headers", + } + ), + AdditionalHeaders = new List> + { + new("b", "client_additional_headers"), + new("c", "client_additional_headers"), + new("d", "client_additional_headers"), + new("e", null), + new("client_multiple", "client_additional_headers1"), + new("client_multiple", "client_additional_headers2"), + }, + } + ); + } + + [Test] + public async SystemTask SendRequestAsync_AdditionalHeaderParameters() + { + _server + .Given(WireMockRequest.Create().WithPath("/test").UsingGet()) + .RespondWith(WireMockResponse.Create().WithStatusCode(200).WithBody("Success")); + + var request = new JsonRequest + { + BaseUrl = _baseUrl, + Method = HttpMethod.Get, + Path = "/test", + Headers = new Headers( + new Dictionary + { + ["c"] = "request_headers", + ["d"] = "request_headers", + ["request_multiple"] = "request_headers", + } + ), + Options = new RequestOptions + { + AdditionalHeaders = new List> + { + new("d", "request_additional_headers"), + new("f", null), + new("request_multiple", "request_additional_headers1"), + new("request_multiple", "request_additional_headers2"), + }, + }, + }; + + var response = await _rawClient.SendRequestAsync(request); + Assert.That(response.StatusCode, Is.EqualTo(200)); + + var content = await response.Raw.Content.ReadAsStringAsync(); + Assert.Multiple(() => + { + Assert.That(content, Is.EqualTo("Success")); + Assert.That(_server.LogEntries.Count, Is.EqualTo(1)); + var headers = + _server.LogEntries[0].RequestMessage.Headers + ?? throw new Exception("Headers are null"); + + Assert.That(headers, Contains.Key("client_multiple")); + Assert.That(headers!["client_multiple"][0], Does.Contain("client_additional_headers1")); + Assert.That(headers["client_multiple"][0], Does.Contain("client_additional_headers2")); + + Assert.That(headers, Contains.Key("request_multiple")); + Assert.That( + headers["request_multiple"][0], + Does.Contain("request_additional_headers1") + ); + Assert.That( + headers["request_multiple"][0], + Does.Contain("request_additional_headers2") + ); + + Assert.That(headers, Contains.Key("a")); + Assert.That(headers["a"][0], Does.Contain("client_headers")); + + Assert.That(headers, Contains.Key("b")); + Assert.That(headers["b"][0], Does.Contain("client_additional_headers")); + + Assert.That(headers, Contains.Key("c")); + Assert.That(headers["c"][0], Does.Contain("request_headers")); + + Assert.That(headers, Contains.Key("d")); + Assert.That(headers["d"][0], Does.Contain("request_additional_headers")); + + Assert.That(headers, Does.Not.ContainKey("e")); + Assert.That(headers, Does.Not.ContainKey("f")); + }); + } + + [TearDown] + public void TearDown() + { + _server.Dispose(); + _httpClient.Dispose(); + } +} diff --git a/src/Vapi.Net.Test/Core/RawClientTests/AdditionalParametersTests.cs b/src/Vapi.Net.Test/Core/RawClientTests/AdditionalParametersTests.cs new file mode 100644 index 0000000..3dc60dc --- /dev/null +++ b/src/Vapi.Net.Test/Core/RawClientTests/AdditionalParametersTests.cs @@ -0,0 +1,300 @@ +using NUnit.Framework; +using Vapi.Net.Core; +using WireMock.Matchers; +using WireMock.Server; +using SystemTask = global::System.Threading.Tasks.Task; +using WireMockRequest = WireMock.RequestBuilders.Request; +using WireMockResponse = WireMock.ResponseBuilders.Response; + +namespace Vapi.Net.Test.Core.RawClientTests; + +[TestFixture] +[Parallelizable(ParallelScope.Self)] +public class AdditionalParametersTests +{ + private WireMockServer _server; + private HttpClient _httpClient; + private RawClient _rawClient; + private string _baseUrl; + + [SetUp] + public void SetUp() + { + _server = WireMockServer.Start(); + _baseUrl = _server.Url ?? ""; + _httpClient = new HttpClient { BaseAddress = new Uri(_baseUrl) }; + _rawClient = new RawClient(new ClientOptions { HttpClient = _httpClient }); + } + + [Test] + public async SystemTask SendRequestAsync_AdditionalQueryParameters() + { + _server + .Given(WireMockRequest.Create().WithPath("/test").WithParam("foo", "bar").UsingGet()) + .RespondWith(WireMockResponse.Create().WithStatusCode(200).WithBody("Success")); + + var request = new JsonRequest() + { + BaseUrl = _baseUrl, + Method = HttpMethod.Get, + Path = "/test", + Options = new RequestOptions + { + AdditionalQueryParameters = new List> + { + new("foo", "bar"), + }, + }, + }; + + var response = await _rawClient.SendRequestAsync(request); + Assert.That(response.StatusCode, Is.EqualTo(200)); + + var content = await response.Raw.Content.ReadAsStringAsync(); + Assert.That(content, Is.EqualTo("Success")); + + Assert.That(_server.LogEntries.Count, Is.EqualTo(1)); + } + + [Test] + public async SystemTask SendRequestAsync_AdditionalQueryParameters_Override() + { + _server + .Given(WireMockRequest.Create().WithPath("/test").WithParam("foo", "null").UsingGet()) + .RespondWith(WireMockResponse.Create().WithStatusCode(200).WithBody("Success")); + + var request = new JsonRequest() + { + BaseUrl = _baseUrl, + Method = HttpMethod.Get, + Path = "/test", + Query = new Dictionary { { "foo", "bar" } }, + Options = new RequestOptions + { + AdditionalQueryParameters = new List> + { + new("foo", "null"), + }, + }, + }; + + var response = await _rawClient.SendRequestAsync(request); + Assert.That(response.StatusCode, Is.EqualTo(200)); + + var content = await response.Raw.Content.ReadAsStringAsync(); + Assert.That(content, Is.EqualTo("Success")); + + Assert.That(_server.LogEntries.Count, Is.EqualTo(1)); + } + + [Test] + public async SystemTask SendRequestAsync_AdditionalQueryParameters_Merge() + { + _server + .Given(WireMockRequest.Create().WithPath("/test").UsingGet()) + .RespondWith(WireMockResponse.Create().WithStatusCode(200).WithBody("Success")); + + var request = new JsonRequest() + { + BaseUrl = _baseUrl, + Method = HttpMethod.Get, + Path = "/test", + Query = new Dictionary { { "foo", "baz" } }, + Options = new RequestOptions + { + AdditionalQueryParameters = new List> + { + new("foo", "one"), + new("foo", "two"), + }, + }, + }; + + var response = await _rawClient.SendRequestAsync(request); + Assert.That(response.StatusCode, Is.EqualTo(200)); + + var content = await response.Raw.Content.ReadAsStringAsync(); + Assert.That(content, Is.EqualTo("Success")); + + Assert.That(_server.LogEntries.Count, Is.EqualTo(1)); + + var requestUrl = _server.LogEntries.First().RequestMessage.Url; + Assert.That(requestUrl, Does.Contain("foo=one")); + Assert.That(requestUrl, Does.Contain("foo=two")); + Assert.That(requestUrl, Does.Not.Contain("foo=baz")); + } + + [Test] + public async SystemTask SendRequestAsync_AdditionalBodyProperties() + { + string expectedBody = "{\n \"foo\": \"bar\",\n \"baz\": \"qux\"\n}"; + _server + .Given( + WireMockRequest + .Create() + .WithPath("/test") + .UsingPost() + .WithBody(new JsonMatcher(expectedBody)) + ) + .RespondWith(WireMockResponse.Create().WithStatusCode(200).WithBody("Success")); + + var request = new JsonRequest + { + BaseUrl = _baseUrl, + Method = HttpMethod.Post, + Path = "/test", + Body = new Dictionary { { "foo", "bar" } }, + Options = new RequestOptions + { + AdditionalBodyProperties = new Dictionary { { "baz", "qux" } }, + }, + }; + + var response = await _rawClient.SendRequestAsync(request); + Assert.That(response.StatusCode, Is.EqualTo(200)); + + var content = await response.Raw.Content.ReadAsStringAsync(); + Assert.That(content, Is.EqualTo("Success")); + + Assert.That(_server.LogEntries.Count, Is.EqualTo(1)); + } + + [Test] + public async SystemTask SendRequestAsync_AdditionalBodyProperties_Override() + { + string expectedBody = "{\n \"foo\": null\n}"; + _server + .Given( + WireMockRequest + .Create() + .WithPath("/test") + .UsingPost() + .WithBody(new JsonMatcher(expectedBody)) + ) + .RespondWith(WireMockResponse.Create().WithStatusCode(200).WithBody("Success")); + + var request = new JsonRequest + { + BaseUrl = _baseUrl, + Method = HttpMethod.Post, + Path = "/test", + Body = new Dictionary { { "foo", "bar" } }, + Options = new RequestOptions + { + AdditionalBodyProperties = new Dictionary { { "foo", null } }, + }, + }; + + var response = await _rawClient.SendRequestAsync(request); + Assert.That(response.StatusCode, Is.EqualTo(200)); + + var content = await response.Raw.Content.ReadAsStringAsync(); + Assert.That(content, Is.EqualTo("Success")); + + Assert.That(_server.LogEntries.Count, Is.EqualTo(1)); + } + + [Test] + public async SystemTask SendRequestAsync_AdditionalBodyProperties_DeepMerge() + { + const string expectedBody = """ + { + "foo": { + "inner1": "original", + "inner2": "overridden", + "inner3": { + "deepProp1": "deep-override", + "deepProp2": "original", + "deepProp3": null, + "deepProp4": "new-value" + } + }, + "bar": "new-value", + "baz": ["new","value"] + } + """; + + _server + .Given( + WireMockRequest + .Create() + .WithPath("/test-deep-merge") + .UsingPost() + .WithBody(new JsonMatcher(expectedBody)) + ) + .RespondWith(WireMockResponse.Create().WithStatusCode(200).WithBody("Success")); + + var request = new JsonRequest + { + BaseUrl = _baseUrl, + Method = HttpMethod.Post, + Path = "/test-deep-merge", + Body = new Dictionary + { + { + "foo", + new Dictionary + { + { "inner1", "original" }, + { "inner2", "original" }, + { + "inner3", + new Dictionary + { + { "deepProp1", "deep-original" }, + { "deepProp2", "original" }, + { "deepProp3", "" }, + } + }, + } + }, + { + "baz", + new List { "original" } + }, + }, + Options = new RequestOptions + { + AdditionalBodyProperties = new Dictionary + { + { + "foo", + new Dictionary + { + { "inner2", "overridden" }, + { + "inner3", + new Dictionary + { + { "deepProp1", "deep-override" }, + { "deepProp3", null }, + { "deepProp4", "new-value" }, + } + }, + } + }, + { "bar", "new-value" }, + { + "baz", + new List { "new", "value" } + }, + }, + }, + }; + + var response = await _rawClient.SendRequestAsync(request); + Assert.That(response.StatusCode, Is.EqualTo(200)); + + var content = await response.Raw.Content.ReadAsStringAsync(); + Assert.That(content, Is.EqualTo("Success")); + + Assert.That(_server.LogEntries.Count, Is.EqualTo(1)); + } + + [TearDown] + public void TearDown() + { + _server.Dispose(); + _httpClient.Dispose(); + } +} diff --git a/src/Vapi.Net.Test/Core/RawClientTests/MultipartFormTests.cs b/src/Vapi.Net.Test/Core/RawClientTests/MultipartFormTests.cs new file mode 100644 index 0000000..db6baf4 --- /dev/null +++ b/src/Vapi.Net.Test/Core/RawClientTests/MultipartFormTests.cs @@ -0,0 +1,1120 @@ +using global::System.Net.Http; +using global::System.Text; +using global::System.Text.Json.Serialization; +using NUnit.Framework; +using Vapi.Net.Core; +using SystemTask = global::System.Threading.Tasks.Task; + +namespace Vapi.Net.Test.Core.RawClientTests; + +[TestFixture] +[Parallelizable(ParallelScope.Self)] +public class MultipartFormTests +{ + private static SimpleObject _simpleObject = new(); + + private static string _simpleFormEncoded = + "meta=data&Date=2023-10-01&Time=12:00:00&Duration=01:00:00&Id=1a1bb98f-47c6-407b-9481-78476affe52a&IsActive=true&Count=42&Initial=A&Values=data,2023-10-01,12:00:00,01:00:00,1a1bb98f-47c6-407b-9481-78476affe52a,true,42,A"; + + private static string _simpleExplodedFormEncoded = + "meta=data&Date=2023-10-01&Time=12:00:00&Duration=01:00:00&Id=1a1bb98f-47c6-407b-9481-78476affe52a&IsActive=true&Count=42&Initial=A&Values=data&Values=2023-10-01&Values=12:00:00&Values=01:00:00&Values=1a1bb98f-47c6-407b-9481-78476affe52a&Values=true&Values=42&Values=A"; + + private static ComplexObject _complexObject = new(); + + private static string _complexJson = """ + { + "meta": "data", + "Nested": { + "foo": "value" + }, + "NestedDictionary": { + "key": { + "foo": "value" + } + }, + "ListOfObjects": [ + { + "foo": "value" + }, + { + "foo": "value2" + } + ], + "Date": "2023-10-01", + "Time": "12:00:00", + "Duration": "01:00:00", + "Id": "1a1bb98f-47c6-407b-9481-78476affe52a", + "IsActive": true, + "Count": 42, + "Initial": "A" + } + """; + + [Test] + public async SystemTask ShouldAddStringPart() + { + const string partInput = "string content"; + var multipartFormRequest = CreateMultipartFormRequest(); + multipartFormRequest.AddStringPart("string", partInput); + var httpContent = multipartFormRequest.CreateContent(); + Assert.That(httpContent, Is.InstanceOf()); + var multipartContent = (MultipartFormDataContent)httpContent; + var boundary = GetBoundary(multipartContent); + var expected = $""" + --{boundary} + Content-Type: text/plain + Content-Disposition: form-data; name=string + + {partInput} + --{boundary}-- + """; + var actual = await multipartContent.ReadAsStringAsync(); + Assert.That(actual, Is.EqualTo(expected).IgnoreWhiteSpace); + } + + [Test] + public async SystemTask ShouldAddStringParts() + { + const string partInput = "string content"; + var multipartFormRequest = CreateMultipartFormRequest(); + multipartFormRequest.AddStringParts("strings", [partInput, partInput]); + var httpContent = multipartFormRequest.CreateContent(); + Assert.That(httpContent, Is.InstanceOf()); + var multipartContent = (MultipartFormDataContent)httpContent; + var boundary = GetBoundary(multipartContent); + var expected = $""" + --{boundary} + Content-Type: text/plain + Content-Disposition: form-data; name=strings + + {partInput} + --{boundary} + Content-Type: text/plain + Content-Disposition: form-data; name=strings + + {partInput} + --{boundary}-- + """; + var actual = await multipartContent.ReadAsStringAsync(); + Assert.That(actual, Is.EqualTo(expected).IgnoreWhiteSpace); + } + + [Test] + public async SystemTask GivenNull_ShouldNotAddStringPart() + { + var multipartFormRequest = CreateMultipartFormRequest(); + multipartFormRequest.AddStringPart("string", null); + var httpContent = multipartFormRequest.CreateContent(); + Assert.That(httpContent, Is.InstanceOf()); + var multipartContent = (MultipartFormDataContent)httpContent; + var boundary = GetBoundary(multipartContent); + var expected = $""" + --{boundary} + --{boundary}-- + """; + var actual = await multipartContent.ReadAsStringAsync(); + Assert.That(actual, Is.EqualTo(expected).IgnoreWhiteSpace); + } + + [Test] + public async SystemTask ShouldAddStringParts_WithNullsInList() + { + const string partInput = "string content"; + var multipartFormRequest = CreateMultipartFormRequest(); + multipartFormRequest.AddStringParts("strings", [partInput, null, partInput]); + var httpContent = multipartFormRequest.CreateContent(); + Assert.That(httpContent, Is.InstanceOf()); + var multipartContent = (MultipartFormDataContent)httpContent; + var boundary = GetBoundary(multipartContent); + var expected = $""" + --{boundary} + Content-Type: text/plain + Content-Disposition: form-data; name=strings + + {partInput} + --{boundary} + Content-Type: text/plain + Content-Disposition: form-data; name=strings + + {partInput} + --{boundary}-- + """; + var actual = await multipartContent.ReadAsStringAsync(); + Assert.That(actual, Is.EqualTo(expected).IgnoreWhiteSpace); + } + + [Test] + public async SystemTask ShouldAddStringPart_WithContentType() + { + const string partInput = "string content"; + var multipartFormRequest = CreateMultipartFormRequest(); + multipartFormRequest.AddStringPart("string", partInput, "text/xml"); + var httpContent = multipartFormRequest.CreateContent(); + Assert.That(httpContent, Is.InstanceOf()); + var multipartContent = (MultipartFormDataContent)httpContent; + var boundary = GetBoundary(multipartContent); + var expected = $""" + --{boundary} + Content-Type: text/xml + Content-Disposition: form-data; name=string + + {partInput} + --{boundary}-- + """; + var actual = await multipartContent.ReadAsStringAsync(); + Assert.That(actual, Is.EqualTo(expected).IgnoreWhiteSpace); + } + + [Test] + public async SystemTask ShouldAddStringPart_WithContentTypeAndCharset() + { + const string partInput = "string content"; + var multipartFormRequest = CreateMultipartFormRequest(); + multipartFormRequest.AddStringPart("string", partInput, "text/xml; charset=utf-8"); + var httpContent = multipartFormRequest.CreateContent(); + Assert.That(httpContent, Is.InstanceOf()); + var multipartContent = (MultipartFormDataContent)httpContent; + var boundary = GetBoundary(multipartContent); + var expected = $""" + --{boundary} + Content-Type: text/xml; charset=utf-8 + Content-Disposition: form-data; name=string + + {partInput} + --{boundary}-- + """; + var actual = await multipartContent.ReadAsStringAsync(); + Assert.That(actual, Is.EqualTo(expected).IgnoreWhiteSpace); + } + + [Test] + public async SystemTask ShouldAddStringParts_WithContentType() + { + const string partInput = "string content"; + var multipartFormRequest = CreateMultipartFormRequest(); + multipartFormRequest.AddStringParts("strings", [partInput, partInput], "text/xml"); + var httpContent = multipartFormRequest.CreateContent(); + Assert.That(httpContent, Is.InstanceOf()); + var multipartContent = (MultipartFormDataContent)httpContent; + var boundary = GetBoundary(multipartContent); + var expected = $""" + --{boundary} + Content-Type: text/xml + Content-Disposition: form-data; name=strings + + {partInput} + --{boundary} + Content-Type: text/xml + Content-Disposition: form-data; name=strings + + {partInput} + --{boundary}-- + """; + var actual = await multipartContent.ReadAsStringAsync(); + Assert.That(actual, Is.EqualTo(expected).IgnoreWhiteSpace); + } + + [Test] + public async SystemTask ShouldAddStringParts_WithContentTypeAndCharset() + { + const string partInput = "string content"; + var multipartFormRequest = CreateMultipartFormRequest(); + multipartFormRequest.AddStringParts( + "strings", + [partInput, partInput], + "text/xml; charset=utf-8" + ); + var httpContent = multipartFormRequest.CreateContent(); + Assert.That(httpContent, Is.InstanceOf()); + var multipartContent = (MultipartFormDataContent)httpContent; + var boundary = GetBoundary(multipartContent); + var expected = $""" + --{boundary} + Content-Type: text/xml; charset=utf-8 + Content-Disposition: form-data; name=strings + + {partInput} + --{boundary} + Content-Type: text/xml; charset=utf-8 + Content-Disposition: form-data; name=strings + + {partInput} + --{boundary}-- + """; + var actual = await multipartContent.ReadAsStringAsync(); + Assert.That(actual, Is.EqualTo(expected).IgnoreWhiteSpace); + } + + [Test] + public async SystemTask ShouldAddFileParameter_WithFileName() + { + var (partInput, partExpectedString) = GetFileParameterTestData(); + var file = new FileParameter { Stream = partInput, FileName = "test.txt" }; + var multipartFormRequest = CreateMultipartFormRequest(); + multipartFormRequest.AddFileParameterPart("file", file); + + var httpContent = multipartFormRequest.CreateContent(); + Assert.That(httpContent, Is.InstanceOf()); + var multipartContent = (MultipartFormDataContent)httpContent; + + var boundary = GetBoundary(multipartContent); + var expected = $""" + --{boundary} + Content-Type: application/octet-stream + Content-Disposition: form-data; name=file; filename=test.txt; filename*=utf-8''test.txt + + {partExpectedString} + --{boundary}-- + """; + + var actual = await multipartContent.ReadAsStringAsync(); + Assert.That(actual, Is.EqualTo(expected).IgnoreWhiteSpace); + } + + [Test] + public async SystemTask ShouldAddFileParameter_WithoutFileName() + { + var (partInput, partExpectedString) = GetFileParameterTestData(); + var multipartFormRequest = CreateMultipartFormRequest(); + multipartFormRequest.AddFileParameterPart("file", partInput); + + var httpContent = multipartFormRequest.CreateContent(); + Assert.That(httpContent, Is.InstanceOf()); + var multipartContent = (MultipartFormDataContent)httpContent; + + var boundary = GetBoundary(multipartContent); + var expected = $""" + --{boundary} + Content-Type: application/octet-stream + Content-Disposition: form-data; name=file + + {partExpectedString} + --{boundary}-- + """; + + var actual = await multipartContent.ReadAsStringAsync(); + Assert.That(actual, Is.EqualTo(expected).IgnoreWhiteSpace); + } + + [Test] + public async SystemTask ShouldAddFileParameter_WithContentType() + { + var (partInput, partExpectedString) = GetFileParameterTestData(); + var file = new FileParameter + { + Stream = partInput, + FileName = "test.txt", + ContentType = "text/plain", + }; + var multipartFormRequest = CreateMultipartFormRequest(); + multipartFormRequest.AddFileParameterPart("file", file, "ignored-fallback-content-type"); + + var httpContent = multipartFormRequest.CreateContent(); + Assert.That(httpContent, Is.InstanceOf()); + var multipartContent = (MultipartFormDataContent)httpContent; + + var boundary = GetBoundary(multipartContent); + var expected = $""" + --{boundary} + Content-Type: text/plain + Content-Disposition: form-data; name=file; filename=test.txt; filename*=utf-8''test.txt + + {partExpectedString} + --{boundary}-- + """; + + var actual = await multipartContent.ReadAsStringAsync(); + Assert.That(actual, Is.EqualTo(expected).IgnoreWhiteSpace); + } + + [Test] + public async SystemTask ShouldAddFileParameter_WithContentTypeAndCharset() + { + var (partInput, partExpectedString) = GetFileParameterTestData(); + var file = new FileParameter + { + Stream = partInput, + FileName = "test.txt", + ContentType = "text/plain; charset=utf-8", + }; + var multipartFormRequest = CreateMultipartFormRequest(); + multipartFormRequest.AddFileParameterPart("file", file, "ignored-fallback-content-type"); + + var httpContent = multipartFormRequest.CreateContent(); + Assert.That(httpContent, Is.InstanceOf()); + var multipartContent = (MultipartFormDataContent)httpContent; + + var boundary = GetBoundary(multipartContent); + var expected = $""" + --{boundary} + Content-Type: text/plain; charset=utf-8 + Content-Disposition: form-data; name=file; filename=test.txt; filename*=utf-8''test.txt + + {partExpectedString} + --{boundary}-- + """; + + var actual = await multipartContent.ReadAsStringAsync(); + Assert.That(actual, Is.EqualTo(expected).IgnoreWhiteSpace); + } + + [Test] + public async SystemTask ShouldAddFileParameter_WithFallbackContentType() + { + var (partInput, partExpectedString) = GetFileParameterTestData(); + var file = new FileParameter { Stream = partInput, FileName = "test.txt" }; + var multipartFormRequest = CreateMultipartFormRequest(); + multipartFormRequest.AddFileParameterPart("file", file, "text/plain"); + + var httpContent = multipartFormRequest.CreateContent(); + Assert.That(httpContent, Is.InstanceOf()); + var multipartContent = (MultipartFormDataContent)httpContent; + + var boundary = GetBoundary(multipartContent); + var expected = $""" + --{boundary} + Content-Type: text/plain + Content-Disposition: form-data; name=file; filename=test.txt; filename*=utf-8''test.txt + + {partExpectedString} + --{boundary}-- + """; + + var actual = await multipartContent.ReadAsStringAsync(); + Assert.That(actual, Is.EqualTo(expected).IgnoreWhiteSpace); + } + + [Test] + public async SystemTask ShouldAddFileParameter_WithFallbackContentTypeAndCharset() + { + var (partInput, partExpectedString) = GetFileParameterTestData(); + var file = new FileParameter { Stream = partInput, FileName = "test.txt" }; + var multipartFormRequest = CreateMultipartFormRequest(); + multipartFormRequest.AddFileParameterPart("file", file, "text/plain; charset=utf-8"); + + var httpContent = multipartFormRequest.CreateContent(); + Assert.That(httpContent, Is.InstanceOf()); + var multipartContent = (MultipartFormDataContent)httpContent; + + var boundary = GetBoundary(multipartContent); + var expected = $""" + --{boundary} + Content-Type: text/plain; charset=utf-8 + Content-Disposition: form-data; name=file; filename=test.txt; filename*=utf-8''test.txt + + {partExpectedString} + --{boundary}-- + """; + + var actual = await multipartContent.ReadAsStringAsync(); + Assert.That(actual, Is.EqualTo(expected).IgnoreWhiteSpace); + } + + [Test] + public async SystemTask ShouldAddFileParameters() + { + var (partInput1, partExpectedString1) = GetFileParameterTestData(); + var (partInput2, partExpectedString2) = GetFileParameterTestData(); + var file1 = new FileParameter { Stream = partInput1, FileName = "test1.txt" }; + var file2 = new FileParameter { Stream = partInput2, FileName = "test2.txt" }; + var multipartFormRequest = CreateMultipartFormRequest(); + multipartFormRequest.AddFileParameterParts("file", [file1, file2]); + + var httpContent = multipartFormRequest.CreateContent(); + Assert.That(httpContent, Is.InstanceOf()); + var multipartContent = (MultipartFormDataContent)httpContent; + + var boundary = GetBoundary(multipartContent); + var expected = $""" + --{boundary} + Content-Type: application/octet-stream + Content-Disposition: form-data; name=file; filename=test1.txt; filename*=utf-8''test1.txt + + {partExpectedString1} + --{boundary} + Content-Type: application/octet-stream + Content-Disposition: form-data; name=file; filename=test2.txt; filename*=utf-8''test2.txt + + {partExpectedString2} + --{boundary}-- + """; + + var actual = await multipartContent.ReadAsStringAsync(); + Assert.That(actual, Is.EqualTo(expected).IgnoreWhiteSpace); + } + + [Test] + public async SystemTask ShouldAddFileParameters_WithNullsInList() + { + var (partInput1, partExpectedString1) = GetFileParameterTestData(); + var (partInput2, partExpectedString2) = GetFileParameterTestData(); + var file1 = new FileParameter { Stream = partInput1, FileName = "test1.txt" }; + var file2 = new FileParameter { Stream = partInput2, FileName = "test2.txt" }; + var multipartFormRequest = CreateMultipartFormRequest(); + multipartFormRequest.AddFileParameterParts("file", [file1, null, file2]); + + var httpContent = multipartFormRequest.CreateContent(); + Assert.That(httpContent, Is.InstanceOf()); + var multipartContent = (MultipartFormDataContent)httpContent; + + var boundary = GetBoundary(multipartContent); + var expected = $""" + --{boundary} + Content-Type: application/octet-stream + Content-Disposition: form-data; name=file; filename=test1.txt; filename*=utf-8''test1.txt + + {partExpectedString1} + --{boundary} + Content-Type: application/octet-stream + Content-Disposition: form-data; name=file; filename=test2.txt; filename*=utf-8''test2.txt + + {partExpectedString2} + --{boundary}-- + """; + + var actual = await multipartContent.ReadAsStringAsync(); + Assert.That(actual, Is.EqualTo(expected).IgnoreWhiteSpace); + } + + [Test] + public async SystemTask GivenNull_ShouldNotAddFileParameter() + { + var multipartFormRequest = CreateMultipartFormRequest(); + multipartFormRequest.AddFileParameterPart("file", null); + + var httpContent = multipartFormRequest.CreateContent(); + Assert.That(httpContent, Is.InstanceOf()); + var multipartContent = (MultipartFormDataContent)httpContent; + + var boundary = GetBoundary(multipartContent); + var expected = $""" + --{boundary} + --{boundary}-- + """; + + var actual = await multipartContent.ReadAsStringAsync(); + Assert.That(actual, Is.EqualTo(expected).IgnoreWhiteSpace); + } + + [Test] + public async SystemTask ShouldAddJsonPart_WithComplexObject() + { + var multipartFormRequest = CreateMultipartFormRequest(); + multipartFormRequest.AddJsonPart("object", _complexObject); + + var httpContent = multipartFormRequest.CreateContent(); + Assert.That(httpContent, Is.InstanceOf()); + var multipartContent = (MultipartFormDataContent)httpContent; + + var boundary = GetBoundary(multipartContent); + var expected = $""" + --{boundary} + Content-Type: application/json + Content-Disposition: form-data; name=object + + {_complexJson} + --{boundary}-- + """; + + var actual = await multipartContent.ReadAsStringAsync(); + Assert.That(actual, Is.EqualTo(expected).IgnoreWhiteSpace); + } + + [Test] + public async SystemTask ShouldAddJsonPart_WithComplexObjectList() + { + var multipartFormRequest = CreateMultipartFormRequest(); + multipartFormRequest.AddJsonParts("objects", [_complexObject, _complexObject]); + + var httpContent = multipartFormRequest.CreateContent(); + Assert.That(httpContent, Is.InstanceOf()); + var multipartContent = (MultipartFormDataContent)httpContent; + + var boundary = GetBoundary(multipartContent); + var expected = $""" + --{boundary} + Content-Type: application/json + Content-Disposition: form-data; name=objects + + {_complexJson} + --{boundary} + Content-Type: application/json + Content-Disposition: form-data; name=objects + + {_complexJson} + --{boundary}-- + """; + + var actual = await multipartContent.ReadAsStringAsync(); + Assert.That(actual, Is.EqualTo(expected).IgnoreWhiteSpace); + } + + [Test] + public async SystemTask GivenNull_ShouldNotAddJsonPart() + { + var multipartFormRequest = CreateMultipartFormRequest(); + multipartFormRequest.AddJsonPart("object", null); + + var httpContent = multipartFormRequest.CreateContent(); + Assert.That(httpContent, Is.InstanceOf()); + var multipartContent = (MultipartFormDataContent)httpContent; + + var boundary = GetBoundary(multipartContent); + var expected = $""" + --{boundary} + --{boundary}-- + """; + + var actual = await multipartContent.ReadAsStringAsync(); + Assert.That(actual, Is.EqualTo(expected).IgnoreWhiteSpace); + } + + [Test] + public async SystemTask ShouldAddJsonParts_WithNullsInList() + { + var multipartFormRequest = CreateMultipartFormRequest(); + multipartFormRequest.AddJsonParts("objects", [_complexObject, null]); + + var httpContent = multipartFormRequest.CreateContent(); + Assert.That(httpContent, Is.InstanceOf()); + var multipartContent = (MultipartFormDataContent)httpContent; + + var boundary = GetBoundary(multipartContent); + var expected = $""" + --{boundary} + Content-Type: application/json + Content-Disposition: form-data; name=objects + + {_complexJson} + --{boundary}-- + """; + + var actual = await multipartContent.ReadAsStringAsync(); + Assert.That(actual, Is.EqualTo(expected).IgnoreWhiteSpace); + } + + [Test] + public async SystemTask ShouldAddJsonParts_WithContentType() + { + var multipartFormRequest = CreateMultipartFormRequest(); + multipartFormRequest.AddJsonParts("objects", [new { }], "application/json-patch+json"); + + var httpContent = multipartFormRequest.CreateContent(); + Assert.That(httpContent, Is.InstanceOf()); + var multipartContent = (MultipartFormDataContent)httpContent; + + var boundary = GetBoundary(multipartContent); + var expected = $$""" + --{{boundary}} + Content-Type: application/json-patch+json + Content-Disposition: form-data; name=objects + + {} + --{{boundary}}-- + """; + + var actual = await multipartContent.ReadAsStringAsync(); + Assert.That(actual, Is.EqualTo(expected).IgnoreWhiteSpace); + } + + [Test] + public async SystemTask ShouldAddFormEncodedParts_WithSimpleObject() + { + var multipartFormRequest = CreateMultipartFormRequest(); + multipartFormRequest.AddFormEncodedPart("object", _simpleObject); + + var httpContent = multipartFormRequest.CreateContent(); + Assert.That(httpContent, Is.InstanceOf()); + var multipartContent = (MultipartFormDataContent)httpContent; + + var boundary = GetBoundary(multipartContent); + var expected = $""" + --{boundary} + Content-Type: application/x-www-form-urlencoded + Content-Disposition: form-data; name=object + + {EscapeFormEncodedString(_simpleFormEncoded)} + --{boundary}-- + """; + + var actual = await multipartContent.ReadAsStringAsync(); + Assert.That(actual, Is.EqualTo(expected).IgnoreWhiteSpace); + } + + [Test] + public async SystemTask ShouldAddFormEncodedParts_WithSimpleObjectList() + { + var multipartFormRequest = CreateMultipartFormRequest(); + multipartFormRequest.AddFormEncodedParts("objects", [_simpleObject, _simpleObject]); + + var httpContent = multipartFormRequest.CreateContent(); + Assert.That(httpContent, Is.InstanceOf()); + var multipartContent = (MultipartFormDataContent)httpContent; + + var boundary = GetBoundary(multipartContent); + var expected = $""" + --{boundary} + Content-Type: application/x-www-form-urlencoded + Content-Disposition: form-data; name=objects + + {EscapeFormEncodedString(_simpleFormEncoded)} + --{boundary} + Content-Type: application/x-www-form-urlencoded + Content-Disposition: form-data; name=objects + + {EscapeFormEncodedString(_simpleFormEncoded)} + --{boundary}-- + """; + + var actual = await multipartContent.ReadAsStringAsync(); + Assert.That(actual, Is.EqualTo(expected).IgnoreWhiteSpace); + } + + [Test] + public async SystemTask ShouldNotAddFormEncodedParts_WithNull() + { + var multipartFormRequest = CreateMultipartFormRequest(); + multipartFormRequest.AddFormEncodedParts("object", null); + + var httpContent = multipartFormRequest.CreateContent(); + Assert.That(httpContent, Is.InstanceOf()); + var multipartContent = (MultipartFormDataContent)httpContent; + + var boundary = GetBoundary(multipartContent); + var expected = $""" + --{boundary} + --{boundary}-- + """; + + var actual = await multipartContent.ReadAsStringAsync(); + Assert.That(actual, Is.EqualTo(expected).IgnoreWhiteSpace); + } + + [Test] + public async SystemTask ShouldNotAddFormEncodedParts_WithNullsInList() + { + var multipartFormRequest = CreateMultipartFormRequest(); + multipartFormRequest.AddFormEncodedParts("objects", [_simpleObject, null]); + + var httpContent = multipartFormRequest.CreateContent(); + Assert.That(httpContent, Is.InstanceOf()); + var multipartContent = (MultipartFormDataContent)httpContent; + + var boundary = GetBoundary(multipartContent); + var expected = $""" + --{boundary} + Content-Type: application/x-www-form-urlencoded + Content-Disposition: form-data; name=objects + + {EscapeFormEncodedString(_simpleFormEncoded)} + --{boundary}-- + """; + + var actual = await multipartContent.ReadAsStringAsync(); + Assert.That(actual, Is.EqualTo(expected).IgnoreWhiteSpace); + } + + [Test] + public async SystemTask ShouldAddFormEncodedPart_WithContentType() + { + var multipartFormRequest = CreateMultipartFormRequest(); + multipartFormRequest.AddFormEncodedPart( + "objects", + new { foo = "bar" }, + "application/x-www-form-urlencoded" + ); + + var httpContent = multipartFormRequest.CreateContent(); + Assert.That(httpContent, Is.InstanceOf()); + var multipartContent = (MultipartFormDataContent)httpContent; + + var boundary = GetBoundary(multipartContent); + var expected = $""" + --{boundary} + Content-Type: application/x-www-form-urlencoded + Content-Disposition: form-data; name=objects + + foo=bar + --{boundary}-- + """; + + var actual = await multipartContent.ReadAsStringAsync(); + Assert.That(actual, Is.EqualTo(expected).IgnoreWhiteSpace); + } + + [Test] + public async SystemTask ShouldAddFormEncodedPart_WithContentTypeAndCharset() + { + var multipartFormRequest = CreateMultipartFormRequest(); + multipartFormRequest.AddFormEncodedPart( + "objects", + new { foo = "bar" }, + "application/x-www-form-urlencoded; charset=utf-8" + ); + + var httpContent = multipartFormRequest.CreateContent(); + Assert.That(httpContent, Is.InstanceOf()); + var multipartContent = (MultipartFormDataContent)httpContent; + + var boundary = GetBoundary(multipartContent); + var expected = $""" + --{boundary} + Content-Type: application/x-www-form-urlencoded; charset=utf-8 + Content-Disposition: form-data; name=objects + + foo=bar + --{boundary}-- + """; + + var actual = await multipartContent.ReadAsStringAsync(); + Assert.That(actual, Is.EqualTo(expected).IgnoreWhiteSpace); + } + + [Test] + public async SystemTask ShouldAddFormEncodedParts_WithContentType() + { + var multipartFormRequest = CreateMultipartFormRequest(); + multipartFormRequest.AddFormEncodedParts( + "objects", + [new { foo = "bar" }], + "application/x-www-form-urlencoded" + ); + + var httpContent = multipartFormRequest.CreateContent(); + Assert.That(httpContent, Is.InstanceOf()); + var multipartContent = (MultipartFormDataContent)httpContent; + + var boundary = GetBoundary(multipartContent); + var expected = $""" + --{boundary} + Content-Type: application/x-www-form-urlencoded + Content-Disposition: form-data; name=objects + + foo=bar + --{boundary}-- + """; + + var actual = await multipartContent.ReadAsStringAsync(); + Assert.That(actual, Is.EqualTo(expected).IgnoreWhiteSpace); + } + + [Test] + public async SystemTask ShouldAddFormEncodedParts_WithContentTypeAndCharset() + { + var multipartFormRequest = CreateMultipartFormRequest(); + multipartFormRequest.AddFormEncodedParts( + "objects", + [new { foo = "bar" }], + "application/x-www-form-urlencoded; charset=utf-8" + ); + + var httpContent = multipartFormRequest.CreateContent(); + Assert.That(httpContent, Is.InstanceOf()); + var multipartContent = (MultipartFormDataContent)httpContent; + + var boundary = GetBoundary(multipartContent); + var expected = $""" + --{boundary} + Content-Type: application/x-www-form-urlencoded; charset=utf-8 + Content-Disposition: form-data; name=objects + + foo=bar + --{boundary}-- + """; + + var actual = await multipartContent.ReadAsStringAsync(); + Assert.That(actual, Is.EqualTo(expected).IgnoreWhiteSpace); + } + + [Test] + public async SystemTask ShouldAddExplodedFormEncodedParts_WithSimpleObject() + { + var multipartFormRequest = CreateMultipartFormRequest(); + multipartFormRequest.AddExplodedFormEncodedPart("object", _simpleObject); + + var httpContent = multipartFormRequest.CreateContent(); + Assert.That(httpContent, Is.InstanceOf()); + var multipartContent = (MultipartFormDataContent)httpContent; + + var boundary = GetBoundary(multipartContent); + var expected = $""" + --{boundary} + Content-Type: application/x-www-form-urlencoded + Content-Disposition: form-data; name=object + + {EscapeFormEncodedString(_simpleExplodedFormEncoded)} + --{boundary}-- + """; + + var actual = await multipartContent.ReadAsStringAsync(); + Assert.That(actual, Is.EqualTo(expected).IgnoreWhiteSpace); + } + + [Test] + public async SystemTask ShouldAddExplodedFormEncodedParts_WithSimpleObjectList() + { + var multipartFormRequest = CreateMultipartFormRequest(); + multipartFormRequest.AddExplodedFormEncodedParts("objects", [_simpleObject, _simpleObject]); + + var httpContent = multipartFormRequest.CreateContent(); + Assert.That(httpContent, Is.InstanceOf()); + var multipartContent = (MultipartFormDataContent)httpContent; + + var boundary = GetBoundary(multipartContent); + var expected = $""" + --{boundary} + Content-Type: application/x-www-form-urlencoded + Content-Disposition: form-data; name=objects + + {EscapeFormEncodedString(_simpleExplodedFormEncoded)} + --{boundary} + Content-Type: application/x-www-form-urlencoded + Content-Disposition: form-data; name=objects + + {EscapeFormEncodedString(_simpleExplodedFormEncoded)} + --{boundary}-- + """; + + var actual = await multipartContent.ReadAsStringAsync(); + Assert.That(actual, Is.EqualTo(expected).IgnoreWhiteSpace); + } + + [Test] + public async SystemTask ShouldNotAddExplodedFormEncodedParts_WithNull() + { + var multipartFormRequest = CreateMultipartFormRequest(); + multipartFormRequest.AddExplodedFormEncodedPart("object", null); + + var httpContent = multipartFormRequest.CreateContent(); + Assert.That(httpContent, Is.InstanceOf()); + var multipartContent = (MultipartFormDataContent)httpContent; + + var boundary = GetBoundary(multipartContent); + var expected = $""" + --{boundary} + --{boundary}-- + """; + + var actual = await multipartContent.ReadAsStringAsync(); + Assert.That(actual, Is.EqualTo(expected).IgnoreWhiteSpace); + } + + [Test] + public async SystemTask ShouldNotAddExplodedFormEncodedParts_WithNullsInList() + { + var multipartFormRequest = CreateMultipartFormRequest(); + multipartFormRequest.AddExplodedFormEncodedParts("objects", [_simpleObject, null]); + + var httpContent = multipartFormRequest.CreateContent(); + Assert.That(httpContent, Is.InstanceOf()); + var multipartContent = (MultipartFormDataContent)httpContent; + + var boundary = GetBoundary(multipartContent); + var expected = $""" + --{boundary} + Content-Type: application/x-www-form-urlencoded + Content-Disposition: form-data; name=objects + + {EscapeFormEncodedString(_simpleExplodedFormEncoded)} + --{boundary}-- + """; + + var actual = await multipartContent.ReadAsStringAsync(); + Assert.That(actual, Is.EqualTo(expected).IgnoreWhiteSpace); + } + + [Test] + public async SystemTask ShouldAddExplodedFormEncodedPart_WithContentType() + { + var multipartFormRequest = CreateMultipartFormRequest(); + multipartFormRequest.AddExplodedFormEncodedPart( + "objects", + new { foo = "bar" }, + "application/x-www-form-urlencoded" + ); + + var httpContent = multipartFormRequest.CreateContent(); + Assert.That(httpContent, Is.InstanceOf()); + var multipartContent = (MultipartFormDataContent)httpContent; + + var boundary = GetBoundary(multipartContent); + var expected = $""" + --{boundary} + Content-Type: application/x-www-form-urlencoded + Content-Disposition: form-data; name=objects + + foo=bar + --{boundary}-- + """; + + var actual = await multipartContent.ReadAsStringAsync(); + Assert.That(actual, Is.EqualTo(expected).IgnoreWhiteSpace); + } + + [Test] + public async SystemTask ShouldAddExplodedFormEncodedPart_WithContentTypeAndCharset() + { + var multipartFormRequest = CreateMultipartFormRequest(); + multipartFormRequest.AddExplodedFormEncodedPart( + "objects", + new { foo = "bar" }, + "application/x-www-form-urlencoded; charset=utf-8" + ); + + var httpContent = multipartFormRequest.CreateContent(); + Assert.That(httpContent, Is.InstanceOf()); + var multipartContent = (MultipartFormDataContent)httpContent; + + var boundary = GetBoundary(multipartContent); + var expected = $""" + --{boundary} + Content-Type: application/x-www-form-urlencoded; charset=utf-8 + Content-Disposition: form-data; name=objects + + foo=bar + --{boundary}-- + """; + + var actual = await multipartContent.ReadAsStringAsync(); + Assert.That(actual, Is.EqualTo(expected).IgnoreWhiteSpace); + } + + [Test] + public async SystemTask ShouldAddExplodedFormEncodedParts_WithContentType() + { + var multipartFormRequest = CreateMultipartFormRequest(); + multipartFormRequest.AddExplodedFormEncodedParts( + "objects", + [new { foo = "bar" }], + "application/x-www-form-urlencoded" + ); + + var httpContent = multipartFormRequest.CreateContent(); + Assert.That(httpContent, Is.InstanceOf()); + var multipartContent = (MultipartFormDataContent)httpContent; + + var boundary = GetBoundary(multipartContent); + var expected = $""" + --{boundary} + Content-Type: application/x-www-form-urlencoded + Content-Disposition: form-data; name=objects + + foo=bar + --{boundary}-- + """; + + var actual = await multipartContent.ReadAsStringAsync(); + Assert.That(actual, Is.EqualTo(expected).IgnoreWhiteSpace); + } + + [Test] + public async SystemTask ShouldAddExplodedFormEncodedParts_WithContentTypeAndCharset() + { + var multipartFormRequest = CreateMultipartFormRequest(); + multipartFormRequest.AddExplodedFormEncodedParts( + "objects", + [new { foo = "bar" }], + "application/x-www-form-urlencoded; charset=utf-8" + ); + + var httpContent = multipartFormRequest.CreateContent(); + Assert.That(httpContent, Is.InstanceOf()); + var multipartContent = (MultipartFormDataContent)httpContent; + + var boundary = GetBoundary(multipartContent); + var expected = $""" + --{boundary} + Content-Type: application/x-www-form-urlencoded; charset=utf-8 + Content-Disposition: form-data; name=objects + + foo=bar + --{boundary}-- + """; + + var actual = await multipartContent.ReadAsStringAsync(); + Assert.That(actual, Is.EqualTo(expected).IgnoreWhiteSpace); + } + + private static string EscapeFormEncodedString(string input) + { + return string.Join( + "&", + input + .Split('&') + .Select(x => x.Split('=')) + .Select(x => $"{Uri.EscapeDataString(x[0])}={Uri.EscapeDataString(x[1])}") + ); + } + + private static string GetBoundary(MultipartFormDataContent content) + { + return content + .Headers.ContentType?.Parameters.Single(p => + p.Name.Equals("boundary", StringComparison.OrdinalIgnoreCase) + ) + .Value?.Trim('"') ?? throw new Exception("Boundary not found"); + } + + private static MultipartFormRequest CreateMultipartFormRequest() + { + return new MultipartFormRequest + { + BaseUrl = "https://localhost", + Method = HttpMethod.Post, + Path = "", + }; + } + + private static (Stream partInput, string partExpectedString) GetFileParameterTestData() + { + const string partExpectedString = "file content"; + var partInput = new MemoryStream(Encoding.Default.GetBytes(partExpectedString)); + return (partInput, partExpectedString); + } + + private class SimpleObject + { + [JsonPropertyName("meta")] + public string Meta { get; set; } = "data"; + public DateOnly Date { get; set; } = DateOnly.Parse("2023-10-01"); + public TimeOnly Time { get; set; } = TimeOnly.Parse("12:00:00"); + public TimeSpan Duration { get; set; } = TimeSpan.FromHours(1); + public Guid Id { get; set; } = Guid.Parse("1a1bb98f-47c6-407b-9481-78476affe52a"); + public bool IsActive { get; set; } = true; + public int Count { get; set; } = 42; + public char Initial { get; set; } = 'A'; + public IEnumerable Values { get; set; } = + [ + "data", + DateOnly.Parse("2023-10-01"), + TimeOnly.Parse("12:00:00"), + TimeSpan.FromHours(1), + Guid.Parse("1a1bb98f-47c6-407b-9481-78476affe52a"), + true, + 42, + 'A', + ]; + } + + private class ComplexObject + { + [JsonPropertyName("meta")] + public string Meta { get; set; } = "data"; + + public object Nested { get; set; } = new { foo = "value" }; + + public Dictionary NestedDictionary { get; set; } = + new() { { "key", new { foo = "value" } } }; + + public IEnumerable ListOfObjects { get; set; } = + new List { new { foo = "value" }, new { foo = "value2" } }; + + public DateOnly Date { get; set; } = DateOnly.Parse("2023-10-01"); + public TimeOnly Time { get; set; } = TimeOnly.Parse("12:00:00"); + public TimeSpan Duration { get; set; } = TimeSpan.FromHours(1); + public Guid Id { get; set; } = Guid.Parse("1a1bb98f-47c6-407b-9481-78476affe52a"); + public bool IsActive { get; set; } = true; + public int Count { get; set; } = 42; + public char Initial { get; set; } = 'A'; + } +} diff --git a/src/Vapi.Net.Test/Core/RawClientTests/RetriesTests.cs b/src/Vapi.Net.Test/Core/RawClientTests/RetriesTests.cs new file mode 100644 index 0000000..35a9031 --- /dev/null +++ b/src/Vapi.Net.Test/Core/RawClientTests/RetriesTests.cs @@ -0,0 +1,214 @@ +using global::System.Net.Http; +using NUnit.Framework; +using Vapi.Net.Core; +using WireMock.Server; +using SystemTask = global::System.Threading.Tasks.Task; +using WireMockRequest = WireMock.RequestBuilders.Request; +using WireMockResponse = WireMock.ResponseBuilders.Response; + +namespace Vapi.Net.Test.Core.RawClientTests; + +[TestFixture] +[Parallelizable(ParallelScope.Self)] +public class RetriesTests +{ + private const int MaxRetries = 3; + private WireMockServer _server; + private HttpClient _httpClient; + private RawClient _rawClient; + private string _baseUrl; + + [SetUp] + public void SetUp() + { + _server = WireMockServer.Start(); + _baseUrl = _server.Url ?? ""; + _httpClient = new HttpClient { BaseAddress = new Uri(_baseUrl) }; + _rawClient = new RawClient( + new ClientOptions { HttpClient = _httpClient, MaxRetries = MaxRetries } + ) + { + BaseRetryDelay = 0, + }; + } + + [Test] + [TestCase(408)] + [TestCase(429)] + [TestCase(500)] + [TestCase(504)] + public async SystemTask SendRequestAsync_ShouldRetry_OnRetryableStatusCodes(int statusCode) + { + _server + .Given(WireMockRequest.Create().WithPath("/test").UsingGet()) + .InScenario("Retry") + .WillSetStateTo("Server Error") + .RespondWith(WireMockResponse.Create().WithStatusCode(statusCode)); + + _server + .Given(WireMockRequest.Create().WithPath("/test").UsingGet()) + .InScenario("Retry") + .WhenStateIs("Server Error") + .WillSetStateTo("Success") + .RespondWith(WireMockResponse.Create().WithStatusCode(statusCode)); + + _server + .Given(WireMockRequest.Create().WithPath("/test").UsingGet()) + .InScenario("Retry") + .WhenStateIs("Success") + .RespondWith(WireMockResponse.Create().WithStatusCode(200).WithBody("Success")); + + var request = new EmptyRequest + { + BaseUrl = _baseUrl, + Method = HttpMethod.Get, + Path = "/test", + }; + + var response = await _rawClient.SendRequestAsync(request); + Assert.That(response.StatusCode, Is.EqualTo(200)); + + var content = await response.Raw.Content.ReadAsStringAsync(); + using (Assert.EnterMultipleScope()) + { + Assert.That(content, Is.EqualTo("Success")); + + Assert.That(_server.LogEntries, Has.Count.EqualTo(MaxRetries)); + } + } + + [Test] + [TestCase(400)] + [TestCase(409)] + public async SystemTask SendRequestAsync_ShouldRetry_OnNonRetryableStatusCodes(int statusCode) + { + _server + .Given(WireMockRequest.Create().WithPath("/test").UsingGet()) + .InScenario("Retry") + .WillSetStateTo("Server Error") + .RespondWith(WireMockResponse.Create().WithStatusCode(statusCode).WithBody("Failure")); + + var request = new JsonRequest + { + BaseUrl = _baseUrl, + Method = HttpMethod.Get, + Path = "/test", + Body = new { }, + }; + + var response = await _rawClient.SendRequestAsync(request); + Assert.That(response.StatusCode, Is.EqualTo(statusCode)); + + var content = await response.Raw.Content.ReadAsStringAsync(); + Assert.Multiple(() => + { + Assert.That(content, Is.EqualTo("Failure")); + + Assert.That(_server.LogEntries, Has.Count.EqualTo(1)); + }); + } + + [Test] + public async SystemTask SendRequestAsync_ShouldNotRetry_WithStreamRequest() + { + _server + .Given(WireMockRequest.Create().WithPath("/test").UsingPost()) + .InScenario("Retry") + .WillSetStateTo("Server Error") + .RespondWith(WireMockResponse.Create().WithStatusCode(429).WithBody("Failure")); + + var request = new StreamRequest + { + BaseUrl = _baseUrl, + Method = HttpMethod.Post, + Path = "/test", + Body = new MemoryStream(), + }; + + var response = await _rawClient.SendRequestAsync(request); + Assert.That(response.StatusCode, Is.EqualTo(429)); + + var content = await response.Raw.Content.ReadAsStringAsync(); + Assert.Multiple(() => + { + Assert.That(content, Is.EqualTo("Failure")); + Assert.That(_server.LogEntries, Has.Count.EqualTo(1)); + }); + } + + [Test] + public async SystemTask SendRequestAsync_ShouldNotRetry_WithMultiPartFormRequest_WithStream() + { + _server + .Given(WireMockRequest.Create().WithPath("/test").UsingPost()) + .InScenario("Retry") + .WillSetStateTo("Server Error") + .RespondWith(WireMockResponse.Create().WithStatusCode(429).WithBody("Failure")); + + var request = new MultipartFormRequest + { + BaseUrl = _baseUrl, + Method = HttpMethod.Post, + Path = "/test", + }; + request.AddFileParameterPart("file", new MemoryStream()); + + var response = await _rawClient.SendRequestAsync(request); + Assert.That(response.StatusCode, Is.EqualTo(429)); + + var content = await response.Raw.Content.ReadAsStringAsync(); + Assert.Multiple(() => + { + Assert.That(content, Is.EqualTo("Failure")); + Assert.That(_server.LogEntries, Has.Count.EqualTo(1)); + }); + } + + [Test] + public async SystemTask SendRequestAsync_ShouldRetry_WithMultiPartFormRequest_WithoutStream() + { + _server + .Given(WireMockRequest.Create().WithPath("/test").UsingPost()) + .InScenario("Retry") + .WillSetStateTo("Server Error") + .RespondWith(WireMockResponse.Create().WithStatusCode(429)); + + _server + .Given(WireMockRequest.Create().WithPath("/test").UsingPost()) + .InScenario("Retry") + .WhenStateIs("Server Error") + .WillSetStateTo("Success") + .RespondWith(WireMockResponse.Create().WithStatusCode(429)); + + _server + .Given(WireMockRequest.Create().WithPath("/test").UsingPost()) + .InScenario("Retry") + .WhenStateIs("Success") + .RespondWith(WireMockResponse.Create().WithStatusCode(200).WithBody("Success")); + + var request = new MultipartFormRequest + { + BaseUrl = _baseUrl, + Method = HttpMethod.Post, + Path = "/test", + }; + request.AddJsonPart("object", new { }); + + var response = await _rawClient.SendRequestAsync(request); + Assert.That(response.StatusCode, Is.EqualTo(200)); + + var content = await response.Raw.Content.ReadAsStringAsync(); + Assert.Multiple(() => + { + Assert.That(content, Is.EqualTo("Success")); + Assert.That(_server.LogEntries, Has.Count.EqualTo(MaxRetries)); + }); + } + + [TearDown] + public void TearDown() + { + _server.Dispose(); + _httpClient.Dispose(); + } +} diff --git a/src/Vapi.Net.Test/Utils/JsonElementComparer.cs b/src/Vapi.Net.Test/Utils/JsonElementComparer.cs new file mode 100644 index 0000000..1704c99 --- /dev/null +++ b/src/Vapi.Net.Test/Utils/JsonElementComparer.cs @@ -0,0 +1,236 @@ +using System.Text.Json; +using NUnit.Framework.Constraints; + +namespace NUnit.Framework; + +/// +/// Extensions for EqualConstraint to handle JsonElement objects. +/// +public static class JsonElementComparerExtensions +{ + /// + /// Extension method for comparing JsonElement objects in NUnit tests. + /// Property order doesn't matter, but array order does matter. + /// Includes special handling for DateTime string formats. + /// + /// The Is.EqualTo() constraint instance. + /// A constraint that can compare JsonElements with detailed diffs. + public static EqualConstraint UsingJsonElementComparer(this EqualConstraint constraint) + { + return constraint.Using(new JsonElementComparer()); + } +} + +/// +/// Equality comparer for JsonElement with detailed reporting. +/// Property order doesn't matter, but array order does matter. +/// Now includes special handling for DateTime string formats with improved null handling. +/// +public class JsonElementComparer : IEqualityComparer +{ + private string _failurePath = string.Empty; + + /// + public bool Equals(JsonElement x, JsonElement y) + { + _failurePath = string.Empty; + return CompareJsonElements(x, y, string.Empty); + } + + /// + public int GetHashCode(JsonElement obj) + { + return JsonSerializer.Serialize(obj).GetHashCode(); + } + + private bool CompareJsonElements(JsonElement x, JsonElement y, string path) + { + // If value kinds don't match, they're not equivalent + if (x.ValueKind != y.ValueKind) + { + _failurePath = $"{path}: Expected {x.ValueKind} but got {y.ValueKind}"; + return false; + } + + switch (x.ValueKind) + { + case JsonValueKind.Object: + return CompareJsonObjects(x, y, path); + + case JsonValueKind.Array: + return CompareJsonArraysInOrder(x, y, path); + + case JsonValueKind.String: + string? xStr = x.GetString(); + string? yStr = y.GetString(); + + // Handle null strings + if (xStr is null && yStr is null) + return true; + + if (xStr is null || yStr is null) + { + _failurePath = + $"{path}: Expected {(xStr is null ? "null" : $"\"{xStr}\"")} but got {(yStr is null ? "null" : $"\"{yStr}\"")}"; + return false; + } + + // Check if they are identical strings + if (xStr == yStr) + return true; + + // Try to handle DateTime strings + if (IsLikelyDateTimeString(xStr) && IsLikelyDateTimeString(yStr)) + { + if (AreEquivalentDateTimeStrings(xStr, yStr)) + return true; + } + + _failurePath = $"{path}: Expected \"{xStr}\" but got \"{yStr}\""; + return false; + + case JsonValueKind.Number: + if (x.GetDecimal() != y.GetDecimal()) + { + _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + + return true; + + case JsonValueKind.True: + case JsonValueKind.False: + if (x.GetBoolean() != y.GetBoolean()) + { + _failurePath = $"{path}: Expected {x.GetBoolean()} but got {y.GetBoolean()}"; + return false; + } + + return true; + + case JsonValueKind.Null: + return true; + + default: + _failurePath = $"{path}: Unsupported JsonValueKind {x.ValueKind}"; + return false; + } + } + + private bool IsLikelyDateTimeString(string? str) + { + // Simple heuristic to identify likely ISO date time strings + return str != null + && (str.Contains("T") && (str.EndsWith("Z") || str.Contains("+") || str.Contains("-"))); + } + + private bool AreEquivalentDateTimeStrings(string str1, string str2) + { + // Try to parse both as DateTime + if (DateTime.TryParse(str1, out DateTime dt1) && DateTime.TryParse(str2, out DateTime dt2)) + { + return dt1 == dt2; + } + + return false; + } + + private bool CompareJsonObjects(JsonElement x, JsonElement y, string path) + { + // Create dictionaries for both JSON objects + var xProps = new Dictionary(); + var yProps = new Dictionary(); + + foreach (var prop in x.EnumerateObject()) + xProps[prop.Name] = prop.Value; + + foreach (var prop in y.EnumerateObject()) + yProps[prop.Name] = prop.Value; + + // Check if all properties in x exist in y + foreach (var key in xProps.Keys) + { + if (!yProps.ContainsKey(key)) + { + _failurePath = $"{path}: Missing property '{key}'"; + return false; + } + } + + // Check if y has extra properties + foreach (var key in yProps.Keys) + { + if (!xProps.ContainsKey(key)) + { + _failurePath = $"{path}: Unexpected property '{key}'"; + return false; + } + } + + // Compare each property value + foreach (var key in xProps.Keys) + { + var propPath = string.IsNullOrEmpty(path) ? key : $"{path}.{key}"; + if (!CompareJsonElements(xProps[key], yProps[key], propPath)) + { + return false; + } + } + + return true; + } + + private bool CompareJsonArraysInOrder(JsonElement x, JsonElement y, string path) + { + var xArray = x.EnumerateArray(); + var yArray = y.EnumerateArray(); + + // Count x elements + var xCount = 0; + var xElements = new List(); + foreach (var item in xArray) + { + xElements.Add(item); + xCount++; + } + + // Count y elements + var yCount = 0; + var yElements = new List(); + foreach (var item in yArray) + { + yElements.Add(item); + yCount++; + } + + // Check if counts match + if (xCount != yCount) + { + _failurePath = $"{path}: Expected {xCount} items but found {yCount}"; + return false; + } + + // Compare elements in order + for (var i = 0; i < xCount; i++) + { + var itemPath = $"{path}[{i}]"; + if (!CompareJsonElements(xElements[i], yElements[i], itemPath)) + { + return false; + } + } + + return true; + } + + /// + public override string ToString() + { + if (!string.IsNullOrEmpty(_failurePath)) + { + return $"JSON comparison failed at {_failurePath}"; + } + + return "JsonElementEqualityComparer"; + } +} diff --git a/src/Vapi.Net.Test/Utils/NUnitExtensions.cs b/src/Vapi.Net.Test/Utils/NUnitExtensions.cs new file mode 100644 index 0000000..426df12 --- /dev/null +++ b/src/Vapi.Net.Test/Utils/NUnitExtensions.cs @@ -0,0 +1,28 @@ +using NUnit.Framework.Constraints; + +namespace NUnit.Framework; + +/// +/// Extensions for NUnit constraints. +/// +public static class NUnitExtensions +{ + /// + /// Modifies the EqualConstraint to use our own set of default comparers. + /// + /// + /// + public static EqualConstraint UsingDefaults(this EqualConstraint constraint) => + constraint + .UsingPropertiesComparer() + .UsingReadOnlyMemoryComparer() + .UsingReadOnlyMemoryComparer() + .UsingReadOnlyMemoryComparer() + .UsingReadOnlyMemoryComparer() + .UsingReadOnlyMemoryComparer() + .UsingReadOnlyMemoryComparer() + .UsingReadOnlyMemoryComparer() + .UsingReadOnlyMemoryComparer() + .UsingOneOfComparer() + .UsingJsonElementComparer(); +} diff --git a/src/Vapi.Net.Test/Utils/OneOfComparer.cs b/src/Vapi.Net.Test/Utils/OneOfComparer.cs new file mode 100644 index 0000000..0c975b4 --- /dev/null +++ b/src/Vapi.Net.Test/Utils/OneOfComparer.cs @@ -0,0 +1,43 @@ +using NUnit.Framework.Constraints; +using OneOf; + +namespace NUnit.Framework; + +/// +/// Extensions for EqualConstraint to handle OneOf values. +/// +public static class EqualConstraintExtensions +{ + /// + /// Modifies the EqualConstraint to handle OneOf instances by comparing their inner values. + /// This works alongside other comparison modifiers like UsingPropertiesComparer. + /// + /// The EqualConstraint to modify. + /// The same constraint instance for method chaining. + public static EqualConstraint UsingOneOfComparer(this EqualConstraint constraint) + { + // Register a comparer factory for IOneOf types + constraint.Using( + (x, y) => + { + // ReSharper disable ConditionIsAlwaysTrueOrFalseAccordingToNullableAPIContract + if (x.Value is null && y.Value is null) + { + return true; + } + + if (x.Value is null) + { + return false; + } + + var propertiesComparer = new NUnitEqualityComparer(); + var tolerance = Tolerance.Default; + propertiesComparer.CompareProperties = true; + return propertiesComparer.AreEqual(x.Value, y.Value, ref tolerance); + } + ); + + return constraint; + } +} diff --git a/src/Vapi.Net.Test/Utils/ReadOnlyMemoryComparer.cs b/src/Vapi.Net.Test/Utils/ReadOnlyMemoryComparer.cs new file mode 100644 index 0000000..fc0b595 --- /dev/null +++ b/src/Vapi.Net.Test/Utils/ReadOnlyMemoryComparer.cs @@ -0,0 +1,87 @@ +using NUnit.Framework.Constraints; + +namespace NUnit.Framework; + +/// +/// Extensions for NUnit constraints. +/// +public static class ReadOnlyMemoryComparerExtensions +{ + /// + /// Extension method for comparing ReadOnlyMemory<T> in NUnit tests. + /// + /// The type of elements in the ReadOnlyMemory. + /// The Is.EqualTo() constraint instance. + /// A constraint that can compare ReadOnlyMemory<T>. + public static EqualConstraint UsingReadOnlyMemoryComparer(this EqualConstraint constraint) + where T : IComparable + { + return constraint.Using(new ReadOnlyMemoryComparer()); + } +} + +/// +/// Comparer for ReadOnlyMemory<T>. Compares sequences by value. +/// +/// +/// The type of elements in the ReadOnlyMemory. +/// +public class ReadOnlyMemoryComparer : IComparer> + where T : IComparable +{ + /// + public int Compare(ReadOnlyMemory x, ReadOnlyMemory y) + { + // Check if sequences are equal + var xSpan = x.Span; + var ySpan = y.Span; + + // Optimized case for IEquatable implementations + if (typeof(IEquatable).IsAssignableFrom(typeof(T))) + { + var areEqual = xSpan.SequenceEqual(ySpan); + if (areEqual) + { + return 0; // Sequences are equal + } + } + else + { + // Manual equality check for non-IEquatable types + if (xSpan.Length == ySpan.Length) + { + var areEqual = true; + for (var i = 0; i < xSpan.Length; i++) + { + if (!EqualityComparer.Default.Equals(xSpan[i], ySpan[i])) + { + areEqual = false; + break; + } + } + + if (areEqual) + { + return 0; // Sequences are equal + } + } + } + + // For non-equal sequences, we need to return a consistent ordering + // First compare lengths + if (x.Length != y.Length) + return x.Length.CompareTo(y.Length); + + // Same length but different content - compare first differing element + for (var i = 0; i < x.Length; i++) + { + if (!EqualityComparer.Default.Equals(xSpan[i], ySpan[i])) + { + return xSpan[i].CompareTo(ySpan[i]); + } + } + + // Should never reach here if not equal + return 0; + } +} diff --git a/src/Vapi.Net.Test/Vapi.Net.Test.csproj b/src/Vapi.Net.Test/Vapi.Net.Test.csproj index 3cdf534..35f11ab 100644 --- a/src/Vapi.Net.Test/Vapi.Net.Test.csproj +++ b/src/Vapi.Net.Test/Vapi.Net.Test.csproj @@ -15,19 +15,18 @@ runtime; build; native; contentfiles; analyzers; buildtransitive all - - - - + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive - - + diff --git a/src/Vapi.Net.sln b/src/Vapi.Net.sln index fcad3c3..c6149ec 100644 --- a/src/Vapi.Net.sln +++ b/src/Vapi.Net.sln @@ -3,9 +3,9 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 VisualStudioVersion = 17.0.31903.59 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Vapi.Net", "Vapi.Net\Vapi.Net.csproj", "{ADA82169-A7DE-4171-89AE-7AF15D7CBEC2}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Vapi.Net", "Vapi.Net\Vapi.Net.csproj", "{97511217-C45A-49CD-A9C8-4B0F42EA576C}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Vapi.Net.Test", "Vapi.Net.Test\Vapi.Net.Test.csproj", "{5242A1F7-47FA-4252-A6DF-9E039C906A89}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Vapi.Net.Test", "Vapi.Net.Test\Vapi.Net.Test.csproj", "{1A0450D4-0B00-479A-88B4-38C53981E4B5}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -16,13 +16,13 @@ Global HideSolutionNode = FALSE EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {ADA82169-A7DE-4171-89AE-7AF15D7CBEC2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {ADA82169-A7DE-4171-89AE-7AF15D7CBEC2}.Debug|Any CPU.Build.0 = Debug|Any CPU - {ADA82169-A7DE-4171-89AE-7AF15D7CBEC2}.Release|Any CPU.ActiveCfg = Release|Any CPU - {ADA82169-A7DE-4171-89AE-7AF15D7CBEC2}.Release|Any CPU.Build.0 = Release|Any CPU - {5242A1F7-47FA-4252-A6DF-9E039C906A89}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {5242A1F7-47FA-4252-A6DF-9E039C906A89}.Debug|Any CPU.Build.0 = Debug|Any CPU - {5242A1F7-47FA-4252-A6DF-9E039C906A89}.Release|Any CPU.ActiveCfg = Release|Any CPU - {5242A1F7-47FA-4252-A6DF-9E039C906A89}.Release|Any CPU.Build.0 = Release|Any CPU + {97511217-C45A-49CD-A9C8-4B0F42EA576C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {97511217-C45A-49CD-A9C8-4B0F42EA576C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {97511217-C45A-49CD-A9C8-4B0F42EA576C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {97511217-C45A-49CD-A9C8-4B0F42EA576C}.Release|Any CPU.Build.0 = Release|Any CPU + {1A0450D4-0B00-479A-88B4-38C53981E4B5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1A0450D4-0B00-479A-88B4-38C53981E4B5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1A0450D4-0B00-479A-88B4-38C53981E4B5}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1A0450D4-0B00-479A-88B4-38C53981E4B5}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection EndGlobal diff --git a/src/Vapi.Net/Analytics/AnalyticsClient.cs b/src/Vapi.Net/Analytics/AnalyticsClient.cs index e1da96d..2d231ed 100644 --- a/src/Vapi.Net/Analytics/AnalyticsClient.cs +++ b/src/Vapi.Net/Analytics/AnalyticsClient.cs @@ -21,8 +21,8 @@ public async Task> GetAsync( ) { var response = await _client - .MakeRequestAsync( - new RawClient.JsonApiRequest + .SendRequestAsync( + new JsonRequest { BaseUrl = _client.Options.BaseUrl, Method = HttpMethod.Post, @@ -34,9 +34,9 @@ public async Task> GetAsync( cancellationToken ) .ConfigureAwait(false); - var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { + var responseBody = await response.Raw.Content.ReadAsStringAsync(); try { return JsonUtils.Deserialize>(responseBody)!; @@ -47,10 +47,13 @@ public async Task> GetAsync( } } - throw new VapiClientApiException( - $"Error with status code {response.StatusCode}", - response.StatusCode, - responseBody - ); + { + var responseBody = await response.Raw.Content.ReadAsStringAsync(); + throw new VapiClientApiException( + $"Error with status code {response.StatusCode}", + response.StatusCode, + responseBody + ); + } } } diff --git a/src/Vapi.Net/Analytics/Requests/AnalyticsQueryDto.cs b/src/Vapi.Net/Analytics/Requests/AnalyticsQueryDto.cs index e598505..64a56dd 100644 --- a/src/Vapi.Net/Analytics/Requests/AnalyticsQueryDto.cs +++ b/src/Vapi.Net/Analytics/Requests/AnalyticsQueryDto.cs @@ -11,6 +11,7 @@ public record AnalyticsQueryDto [JsonPropertyName("queries")] public IEnumerable Queries { get; set; } = new List(); + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Assistants/AssistantsClient.cs b/src/Vapi.Net/Assistants/AssistantsClient.cs index e975700..b44e14a 100644 --- a/src/Vapi.Net/Assistants/AssistantsClient.cs +++ b/src/Vapi.Net/Assistants/AssistantsClient.cs @@ -27,39 +27,39 @@ public async Task> ListAsync( } if (request.CreatedAtGt != null) { - _query["createdAtGt"] = request.CreatedAtGt.Value.ToString(Constants.DateTimeFormat); + _query["createdAtGt"] = request.CreatedAtGt.Value.ToString(); } if (request.CreatedAtLt != null) { - _query["createdAtLt"] = request.CreatedAtLt.Value.ToString(Constants.DateTimeFormat); + _query["createdAtLt"] = request.CreatedAtLt.Value.ToString(); } if (request.CreatedAtGe != null) { - _query["createdAtGe"] = request.CreatedAtGe.Value.ToString(Constants.DateTimeFormat); + _query["createdAtGe"] = request.CreatedAtGe.Value.ToString(); } if (request.CreatedAtLe != null) { - _query["createdAtLe"] = request.CreatedAtLe.Value.ToString(Constants.DateTimeFormat); + _query["createdAtLe"] = request.CreatedAtLe.Value.ToString(); } if (request.UpdatedAtGt != null) { - _query["updatedAtGt"] = request.UpdatedAtGt.Value.ToString(Constants.DateTimeFormat); + _query["updatedAtGt"] = request.UpdatedAtGt.Value.ToString(); } if (request.UpdatedAtLt != null) { - _query["updatedAtLt"] = request.UpdatedAtLt.Value.ToString(Constants.DateTimeFormat); + _query["updatedAtLt"] = request.UpdatedAtLt.Value.ToString(); } if (request.UpdatedAtGe != null) { - _query["updatedAtGe"] = request.UpdatedAtGe.Value.ToString(Constants.DateTimeFormat); + _query["updatedAtGe"] = request.UpdatedAtGe.Value.ToString(); } if (request.UpdatedAtLe != null) { - _query["updatedAtLe"] = request.UpdatedAtLe.Value.ToString(Constants.DateTimeFormat); + _query["updatedAtLe"] = request.UpdatedAtLe.Value.ToString(); } var response = await _client - .MakeRequestAsync( - new RawClient.JsonApiRequest + .SendRequestAsync( + new JsonRequest { BaseUrl = _client.Options.BaseUrl, Method = HttpMethod.Get, @@ -70,9 +70,9 @@ public async Task> ListAsync( cancellationToken ) .ConfigureAwait(false); - var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { + var responseBody = await response.Raw.Content.ReadAsStringAsync(); try { return JsonUtils.Deserialize>(responseBody)!; @@ -83,11 +83,14 @@ public async Task> ListAsync( } } - throw new VapiClientApiException( - $"Error with status code {response.StatusCode}", - response.StatusCode, - responseBody - ); + { + var responseBody = await response.Raw.Content.ReadAsStringAsync(); + throw new VapiClientApiException( + $"Error with status code {response.StatusCode}", + response.StatusCode, + responseBody + ); + } } public async Task CreateAsync( @@ -97,8 +100,8 @@ public async Task CreateAsync( ) { var response = await _client - .MakeRequestAsync( - new RawClient.JsonApiRequest + .SendRequestAsync( + new JsonRequest { BaseUrl = _client.Options.BaseUrl, Method = HttpMethod.Post, @@ -110,9 +113,9 @@ public async Task CreateAsync( cancellationToken ) .ConfigureAwait(false); - var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { + var responseBody = await response.Raw.Content.ReadAsStringAsync(); try { return JsonUtils.Deserialize(responseBody)!; @@ -123,11 +126,14 @@ public async Task CreateAsync( } } - throw new VapiClientApiException( - $"Error with status code {response.StatusCode}", - response.StatusCode, - responseBody - ); + { + var responseBody = await response.Raw.Content.ReadAsStringAsync(); + throw new VapiClientApiException( + $"Error with status code {response.StatusCode}", + response.StatusCode, + responseBody + ); + } } public async Task GetAsync( @@ -137,20 +143,20 @@ public async Task GetAsync( ) { var response = await _client - .MakeRequestAsync( - new RawClient.JsonApiRequest + .SendRequestAsync( + new JsonRequest { BaseUrl = _client.Options.BaseUrl, Method = HttpMethod.Get, - Path = $"assistant/{JsonUtils.SerializeAsString(id)}", + Path = string.Format("assistant/{0}", ValueConvert.ToPathParameterString(id)), Options = options, }, cancellationToken ) .ConfigureAwait(false); - var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { + var responseBody = await response.Raw.Content.ReadAsStringAsync(); try { return JsonUtils.Deserialize(responseBody)!; @@ -161,11 +167,14 @@ public async Task GetAsync( } } - throw new VapiClientApiException( - $"Error with status code {response.StatusCode}", - response.StatusCode, - responseBody - ); + { + var responseBody = await response.Raw.Content.ReadAsStringAsync(); + throw new VapiClientApiException( + $"Error with status code {response.StatusCode}", + response.StatusCode, + responseBody + ); + } } public async Task DeleteAsync( @@ -175,20 +184,20 @@ public async Task DeleteAsync( ) { var response = await _client - .MakeRequestAsync( - new RawClient.JsonApiRequest + .SendRequestAsync( + new JsonRequest { BaseUrl = _client.Options.BaseUrl, Method = HttpMethod.Delete, - Path = $"assistant/{JsonUtils.SerializeAsString(id)}", + Path = string.Format("assistant/{0}", ValueConvert.ToPathParameterString(id)), Options = options, }, cancellationToken ) .ConfigureAwait(false); - var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { + var responseBody = await response.Raw.Content.ReadAsStringAsync(); try { return JsonUtils.Deserialize(responseBody)!; @@ -199,11 +208,14 @@ public async Task DeleteAsync( } } - throw new VapiClientApiException( - $"Error with status code {response.StatusCode}", - response.StatusCode, - responseBody - ); + { + var responseBody = await response.Raw.Content.ReadAsStringAsync(); + throw new VapiClientApiException( + $"Error with status code {response.StatusCode}", + response.StatusCode, + responseBody + ); + } } public async Task UpdateAsync( @@ -214,12 +226,12 @@ public async Task UpdateAsync( ) { var response = await _client - .MakeRequestAsync( - new RawClient.JsonApiRequest + .SendRequestAsync( + new JsonRequest { BaseUrl = _client.Options.BaseUrl, Method = HttpMethodExtensions.Patch, - Path = $"assistant/{JsonUtils.SerializeAsString(id)}", + Path = string.Format("assistant/{0}", ValueConvert.ToPathParameterString(id)), Body = request, ContentType = "application/json", Options = options, @@ -227,9 +239,9 @@ public async Task UpdateAsync( cancellationToken ) .ConfigureAwait(false); - var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { + var responseBody = await response.Raw.Content.ReadAsStringAsync(); try { return JsonUtils.Deserialize(responseBody)!; @@ -240,10 +252,13 @@ public async Task UpdateAsync( } } - throw new VapiClientApiException( - $"Error with status code {response.StatusCode}", - response.StatusCode, - responseBody - ); + { + var responseBody = await response.Raw.Content.ReadAsStringAsync(); + throw new VapiClientApiException( + $"Error with status code {response.StatusCode}", + response.StatusCode, + responseBody + ); + } } } diff --git a/src/Vapi.Net/Assistants/Requests/AssistantsListRequest.cs b/src/Vapi.Net/Assistants/Requests/AssistantsListRequest.cs index 8e461d6..5f7c89a 100644 --- a/src/Vapi.Net/Assistants/Requests/AssistantsListRequest.cs +++ b/src/Vapi.Net/Assistants/Requests/AssistantsListRequest.cs @@ -1,3 +1,4 @@ +using System.Text.Json.Serialization; using Vapi.Net.Core; namespace Vapi.Net; @@ -7,48 +8,58 @@ public record AssistantsListRequest /// /// This is the maximum number of items to return. Defaults to 100. /// + [JsonIgnore] public double? Limit { get; set; } /// /// This will return items where the createdAt is greater than the specified value. /// + [JsonIgnore] public DateTime? CreatedAtGt { get; set; } /// /// This will return items where the createdAt is less than the specified value. /// + [JsonIgnore] public DateTime? CreatedAtLt { get; set; } /// /// This will return items where the createdAt is greater than or equal to the specified value. /// + [JsonIgnore] public DateTime? CreatedAtGe { get; set; } /// /// This will return items where the createdAt is less than or equal to the specified value. /// + [JsonIgnore] public DateTime? CreatedAtLe { get; set; } /// /// This will return items where the updatedAt is greater than the specified value. /// + [JsonIgnore] public DateTime? UpdatedAtGt { get; set; } /// /// This will return items where the updatedAt is less than the specified value. /// + [JsonIgnore] public DateTime? UpdatedAtLt { get; set; } /// /// This will return items where the updatedAt is greater than or equal to the specified value. /// + [JsonIgnore] public DateTime? UpdatedAtGe { get; set; } /// /// This will return items where the updatedAt is less than or equal to the specified value. /// + [JsonIgnore] public DateTime? UpdatedAtLe { get; set; } + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Assistants/Requests/UpdateAssistantDto.cs b/src/Vapi.Net/Assistants/Requests/UpdateAssistantDto.cs index 5856caa..5b219f8 100644 --- a/src/Vapi.Net/Assistants/Requests/UpdateAssistantDto.cs +++ b/src/Vapi.Net/Assistants/Requests/UpdateAssistantDto.cs @@ -1,4 +1,5 @@ using System.Text.Json.Serialization; +using OneOf; using Vapi.Net.Core; namespace Vapi.Net; @@ -31,6 +32,9 @@ public record UpdateAssistantDto [JsonPropertyName("firstMessage")] public string? FirstMessage { get; set; } + [JsonPropertyName("firstMessageInterruptionsEnabled")] + public bool? FirstMessageInterruptionsEnabled { get; set; } + /// /// This is the mode for the first message. Default is 'assistant-speaks-first'. /// @@ -45,7 +49,15 @@ public record UpdateAssistantDto public UpdateAssistantDtoFirstMessageMode? FirstMessageMode { get; set; } /// - /// These are the messages that will be sent to your Client SDKs. Default is conversation-update,function-call,hang,model-output,speech-update,status-update,transfer-update,transcript,tool-calls,user-interrupted,voice-input. You can check the shape of the messages in ClientMessage schema. + /// These are the settings to configure or disable voicemail detection. Alternatively, voicemail detection can be configured using the model.tools=[VoicemailTool]. + /// This uses Twilio's built-in detection while the VoicemailTool relies on the model to detect if a voicemail was reached. + /// You can use neither of them, one of them, or both of them. By default, Twilio built-in detection is enabled while VoicemailTool is not. + /// + [JsonPropertyName("voicemailDetection")] + public object? VoicemailDetection { get; set; } + + /// + /// These are the messages that will be sent to your Client SDKs. Default is conversation-update,function-call,hang,model-output,speech-update,status-update,transfer-update,transcript,tool-calls,user-interrupted,voice-input,workflow.node.started. You can check the shape of the messages in ClientMessage schema. /// [JsonPropertyName("clientMessages")] public IEnumerable? ClientMessages { get; set; } @@ -74,9 +86,10 @@ public record UpdateAssistantDto /// /// This is the background sound in the call. Default for phone calls is 'office' and default for web calls is 'off'. + /// You can also provide a custom sound by providing a URL to an audio file. /// [JsonPropertyName("backgroundSound")] - public UpdateAssistantDtoBackgroundSound? BackgroundSound { get; set; } + public OneOf? BackgroundSound { get; set; } /// /// This enables filtering of noise and background speech while the user is talking. @@ -104,6 +117,13 @@ public record UpdateAssistantDto [JsonPropertyName("transportConfigurations")] public IEnumerable? TransportConfigurations { get; set; } + /// + /// This is the plan for observability configuration of assistant's calls. + /// Currently supports Langfuse for tracing and monitoring. + /// + [JsonPropertyName("observabilityPlan")] + public LangfuseObservabilityPlan? ObservabilityPlan { get; set; } + /// /// These are dynamic credentials that will be used for the assistant calls. By default, all the credentials are available for use in the call but you can supplement an additional credentials using this. Dynamic credentials override existing credentials. /// @@ -118,14 +138,6 @@ public record UpdateAssistantDto [JsonPropertyName("name")] public string? Name { get; set; } - /// - /// These are the settings to configure or disable voicemail detection. Alternatively, voicemail detection can be configured using the model.tools=[VoicemailTool]. - /// This uses Twilio's built-in detection while the VoicemailTool relies on the model to detect if a voicemail was reached. - /// You can use neither of them, one of them, or both of them. By default, Twilio built-in detection is enabled while VoicemailTool is not. - /// - [JsonPropertyName("voicemailDetection")] - public TwilioVoicemailDetection? VoicemailDetection { get; set; } - /// /// This is the message that the assistant will say if the call is forwarded to voicemail. /// @@ -239,6 +251,10 @@ public record UpdateAssistantDto [JsonPropertyName("hooks")] public IEnumerable? Hooks { get; set; } + [JsonPropertyName("keypadInputPlan")] + public KeypadInputPlan? KeypadInputPlan { get; set; } + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Assistants/Types/UpdateAssistantDtoBackgroundSound.cs b/src/Vapi.Net/Assistants/Types/UpdateAssistantDtoBackgroundSoundZero.cs similarity index 80% rename from src/Vapi.Net/Assistants/Types/UpdateAssistantDtoBackgroundSound.cs rename to src/Vapi.Net/Assistants/Types/UpdateAssistantDtoBackgroundSoundZero.cs index 2bc68c0..63abdb7 100644 --- a/src/Vapi.Net/Assistants/Types/UpdateAssistantDtoBackgroundSound.cs +++ b/src/Vapi.Net/Assistants/Types/UpdateAssistantDtoBackgroundSoundZero.cs @@ -4,8 +4,8 @@ namespace Vapi.Net; -[JsonConverter(typeof(EnumSerializer))] -public enum UpdateAssistantDtoBackgroundSound +[JsonConverter(typeof(EnumSerializer))] +public enum UpdateAssistantDtoBackgroundSoundZero { [EnumMember(Value = "off")] Off, diff --git a/src/Vapi.Net/Assistants/Types/UpdateAssistantDtoClientMessagesItem.cs b/src/Vapi.Net/Assistants/Types/UpdateAssistantDtoClientMessagesItem.cs index f60d0a7..0809e39 100644 --- a/src/Vapi.Net/Assistants/Types/UpdateAssistantDtoClientMessagesItem.cs +++ b/src/Vapi.Net/Assistants/Types/UpdateAssistantDtoClientMessagesItem.cs @@ -51,4 +51,7 @@ public enum UpdateAssistantDtoClientMessagesItem [EnumMember(Value = "voice-input")] VoiceInput, + + [EnumMember(Value = "workflow.node.started")] + WorkflowNodeStarted, } diff --git a/src/Vapi.Net/Blocks/BlocksClient.cs b/src/Vapi.Net/Blocks/BlocksClient.cs deleted file mode 100644 index c9b4c8b..0000000 --- a/src/Vapi.Net/Blocks/BlocksClient.cs +++ /dev/null @@ -1,249 +0,0 @@ -using System.Net.Http; -using System.Text.Json; -using System.Threading; -using Vapi.Net.Core; - -namespace Vapi.Net; - -public partial class BlocksClient -{ - private RawClient _client; - - internal BlocksClient(RawClient client) - { - _client = client; - } - - public async Task> ListAsync( - BlocksListRequest request, - RequestOptions? options = null, - CancellationToken cancellationToken = default - ) - { - var _query = new Dictionary(); - if (request.Limit != null) - { - _query["limit"] = request.Limit.Value.ToString(); - } - if (request.CreatedAtGt != null) - { - _query["createdAtGt"] = request.CreatedAtGt.Value.ToString(Constants.DateTimeFormat); - } - if (request.CreatedAtLt != null) - { - _query["createdAtLt"] = request.CreatedAtLt.Value.ToString(Constants.DateTimeFormat); - } - if (request.CreatedAtGe != null) - { - _query["createdAtGe"] = request.CreatedAtGe.Value.ToString(Constants.DateTimeFormat); - } - if (request.CreatedAtLe != null) - { - _query["createdAtLe"] = request.CreatedAtLe.Value.ToString(Constants.DateTimeFormat); - } - if (request.UpdatedAtGt != null) - { - _query["updatedAtGt"] = request.UpdatedAtGt.Value.ToString(Constants.DateTimeFormat); - } - if (request.UpdatedAtLt != null) - { - _query["updatedAtLt"] = request.UpdatedAtLt.Value.ToString(Constants.DateTimeFormat); - } - if (request.UpdatedAtGe != null) - { - _query["updatedAtGe"] = request.UpdatedAtGe.Value.ToString(Constants.DateTimeFormat); - } - if (request.UpdatedAtLe != null) - { - _query["updatedAtLe"] = request.UpdatedAtLe.Value.ToString(Constants.DateTimeFormat); - } - var response = await _client - .MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "block", - Query = _query, - Options = options, - }, - cancellationToken - ) - .ConfigureAwait(false); - var responseBody = await response.Raw.Content.ReadAsStringAsync(); - if (response.StatusCode is >= 200 and < 400) - { - try - { - return JsonUtils.Deserialize>(responseBody)!; - } - catch (JsonException e) - { - throw new VapiClientException("Failed to deserialize response", e); - } - } - - throw new VapiClientApiException( - $"Error with status code {response.StatusCode}", - response.StatusCode, - responseBody - ); - } - - public async Task CreateAsync( - object request, - RequestOptions? options = null, - CancellationToken cancellationToken = default - ) - { - var response = await _client - .MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Post, - Path = "block", - Body = request, - ContentType = "application/json", - Options = options, - }, - cancellationToken - ) - .ConfigureAwait(false); - var responseBody = await response.Raw.Content.ReadAsStringAsync(); - if (response.StatusCode is >= 200 and < 400) - { - try - { - return JsonUtils.Deserialize(responseBody)!; - } - catch (JsonException e) - { - throw new VapiClientException("Failed to deserialize response", e); - } - } - - throw new VapiClientApiException( - $"Error with status code {response.StatusCode}", - response.StatusCode, - responseBody - ); - } - - public async Task GetAsync( - string id, - RequestOptions? options = null, - CancellationToken cancellationToken = default - ) - { - var response = await _client - .MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = $"block/{JsonUtils.SerializeAsString(id)}", - Options = options, - }, - cancellationToken - ) - .ConfigureAwait(false); - var responseBody = await response.Raw.Content.ReadAsStringAsync(); - if (response.StatusCode is >= 200 and < 400) - { - try - { - return JsonUtils.Deserialize(responseBody)!; - } - catch (JsonException e) - { - throw new VapiClientException("Failed to deserialize response", e); - } - } - - throw new VapiClientApiException( - $"Error with status code {response.StatusCode}", - response.StatusCode, - responseBody - ); - } - - public async Task DeleteAsync( - string id, - RequestOptions? options = null, - CancellationToken cancellationToken = default - ) - { - var response = await _client - .MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Delete, - Path = $"block/{JsonUtils.SerializeAsString(id)}", - Options = options, - }, - cancellationToken - ) - .ConfigureAwait(false); - var responseBody = await response.Raw.Content.ReadAsStringAsync(); - if (response.StatusCode is >= 200 and < 400) - { - try - { - return JsonUtils.Deserialize(responseBody)!; - } - catch (JsonException e) - { - throw new VapiClientException("Failed to deserialize response", e); - } - } - - throw new VapiClientApiException( - $"Error with status code {response.StatusCode}", - response.StatusCode, - responseBody - ); - } - - public async Task UpdateAsync( - string id, - object request, - RequestOptions? options = null, - CancellationToken cancellationToken = default - ) - { - var response = await _client - .MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethodExtensions.Patch, - Path = $"block/{JsonUtils.SerializeAsString(id)}", - Body = request, - ContentType = "application/json", - Options = options, - }, - cancellationToken - ) - .ConfigureAwait(false); - var responseBody = await response.Raw.Content.ReadAsStringAsync(); - if (response.StatusCode is >= 200 and < 400) - { - try - { - return JsonUtils.Deserialize(responseBody)!; - } - catch (JsonException e) - { - throw new VapiClientException("Failed to deserialize response", e); - } - } - - throw new VapiClientApiException( - $"Error with status code {response.StatusCode}", - response.StatusCode, - responseBody - ); - } -} diff --git a/src/Vapi.Net/Blocks/Requests/BlocksListRequest.cs b/src/Vapi.Net/Blocks/Requests/BlocksListRequest.cs deleted file mode 100644 index 3018a00..0000000 --- a/src/Vapi.Net/Blocks/Requests/BlocksListRequest.cs +++ /dev/null @@ -1,56 +0,0 @@ -using Vapi.Net.Core; - -namespace Vapi.Net; - -public record BlocksListRequest -{ - /// - /// This is the maximum number of items to return. Defaults to 100. - /// - public double? Limit { get; set; } - - /// - /// This will return items where the createdAt is greater than the specified value. - /// - public DateTime? CreatedAtGt { get; set; } - - /// - /// This will return items where the createdAt is less than the specified value. - /// - public DateTime? CreatedAtLt { get; set; } - - /// - /// This will return items where the createdAt is greater than or equal to the specified value. - /// - public DateTime? CreatedAtGe { get; set; } - - /// - /// This will return items where the createdAt is less than or equal to the specified value. - /// - public DateTime? CreatedAtLe { get; set; } - - /// - /// This will return items where the updatedAt is greater than the specified value. - /// - public DateTime? UpdatedAtGt { get; set; } - - /// - /// This will return items where the updatedAt is less than the specified value. - /// - public DateTime? UpdatedAtLt { get; set; } - - /// - /// This will return items where the updatedAt is greater than or equal to the specified value. - /// - public DateTime? UpdatedAtGe { get; set; } - - /// - /// This will return items where the updatedAt is less than or equal to the specified value. - /// - public DateTime? UpdatedAtLe { get; set; } - - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Vapi.Net/Calls/CallsClient.cs b/src/Vapi.Net/Calls/CallsClient.cs index 0ef2ed9..17eeb0a 100644 --- a/src/Vapi.Net/Calls/CallsClient.cs +++ b/src/Vapi.Net/Calls/CallsClient.cs @@ -1,6 +1,7 @@ using System.Net.Http; using System.Text.Json; using System.Threading; +using OneOf; using Vapi.Net.Core; namespace Vapi.Net; @@ -39,39 +40,39 @@ public async Task> ListAsync( } if (request.CreatedAtGt != null) { - _query["createdAtGt"] = request.CreatedAtGt.Value.ToString(Constants.DateTimeFormat); + _query["createdAtGt"] = request.CreatedAtGt.Value.ToString(); } if (request.CreatedAtLt != null) { - _query["createdAtLt"] = request.CreatedAtLt.Value.ToString(Constants.DateTimeFormat); + _query["createdAtLt"] = request.CreatedAtLt.Value.ToString(); } if (request.CreatedAtGe != null) { - _query["createdAtGe"] = request.CreatedAtGe.Value.ToString(Constants.DateTimeFormat); + _query["createdAtGe"] = request.CreatedAtGe.Value.ToString(); } if (request.CreatedAtLe != null) { - _query["createdAtLe"] = request.CreatedAtLe.Value.ToString(Constants.DateTimeFormat); + _query["createdAtLe"] = request.CreatedAtLe.Value.ToString(); } if (request.UpdatedAtGt != null) { - _query["updatedAtGt"] = request.UpdatedAtGt.Value.ToString(Constants.DateTimeFormat); + _query["updatedAtGt"] = request.UpdatedAtGt.Value.ToString(); } if (request.UpdatedAtLt != null) { - _query["updatedAtLt"] = request.UpdatedAtLt.Value.ToString(Constants.DateTimeFormat); + _query["updatedAtLt"] = request.UpdatedAtLt.Value.ToString(); } if (request.UpdatedAtGe != null) { - _query["updatedAtGe"] = request.UpdatedAtGe.Value.ToString(Constants.DateTimeFormat); + _query["updatedAtGe"] = request.UpdatedAtGe.Value.ToString(); } if (request.UpdatedAtLe != null) { - _query["updatedAtLe"] = request.UpdatedAtLe.Value.ToString(Constants.DateTimeFormat); + _query["updatedAtLe"] = request.UpdatedAtLe.Value.ToString(); } var response = await _client - .MakeRequestAsync( - new RawClient.JsonApiRequest + .SendRequestAsync( + new JsonRequest { BaseUrl = _client.Options.BaseUrl, Method = HttpMethod.Get, @@ -82,9 +83,9 @@ public async Task> ListAsync( cancellationToken ) .ConfigureAwait(false); - var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { + var responseBody = await response.Raw.Content.ReadAsStringAsync(); try { return JsonUtils.Deserialize>(responseBody)!; @@ -95,22 +96,25 @@ public async Task> ListAsync( } } - throw new VapiClientApiException( - $"Error with status code {response.StatusCode}", - response.StatusCode, - responseBody - ); + { + var responseBody = await response.Raw.Content.ReadAsStringAsync(); + throw new VapiClientApiException( + $"Error with status code {response.StatusCode}", + response.StatusCode, + responseBody + ); + } } - public async Task CreateAsync( + public async Task> CreateAsync( CreateCallDto request, RequestOptions? options = null, CancellationToken cancellationToken = default ) { var response = await _client - .MakeRequestAsync( - new RawClient.JsonApiRequest + .SendRequestAsync( + new JsonRequest { BaseUrl = _client.Options.BaseUrl, Method = HttpMethod.Post, @@ -122,12 +126,12 @@ public async Task CreateAsync( cancellationToken ) .ConfigureAwait(false); - var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { + var responseBody = await response.Raw.Content.ReadAsStringAsync(); try { - return JsonUtils.Deserialize(responseBody)!; + return JsonUtils.Deserialize>(responseBody)!; } catch (JsonException e) { @@ -135,11 +139,14 @@ public async Task CreateAsync( } } - throw new VapiClientApiException( - $"Error with status code {response.StatusCode}", - response.StatusCode, - responseBody - ); + { + var responseBody = await response.Raw.Content.ReadAsStringAsync(); + throw new VapiClientApiException( + $"Error with status code {response.StatusCode}", + response.StatusCode, + responseBody + ); + } } public async Task GetAsync( @@ -149,20 +156,20 @@ public async Task GetAsync( ) { var response = await _client - .MakeRequestAsync( - new RawClient.JsonApiRequest + .SendRequestAsync( + new JsonRequest { BaseUrl = _client.Options.BaseUrl, Method = HttpMethod.Get, - Path = $"call/{JsonUtils.SerializeAsString(id)}", + Path = string.Format("call/{0}", ValueConvert.ToPathParameterString(id)), Options = options, }, cancellationToken ) .ConfigureAwait(false); - var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { + var responseBody = await response.Raw.Content.ReadAsStringAsync(); try { return JsonUtils.Deserialize(responseBody)!; @@ -173,11 +180,14 @@ public async Task GetAsync( } } - throw new VapiClientApiException( - $"Error with status code {response.StatusCode}", - response.StatusCode, - responseBody - ); + { + var responseBody = await response.Raw.Content.ReadAsStringAsync(); + throw new VapiClientApiException( + $"Error with status code {response.StatusCode}", + response.StatusCode, + responseBody + ); + } } public async Task DeleteAsync( @@ -187,20 +197,20 @@ public async Task DeleteAsync( ) { var response = await _client - .MakeRequestAsync( - new RawClient.JsonApiRequest + .SendRequestAsync( + new JsonRequest { BaseUrl = _client.Options.BaseUrl, Method = HttpMethod.Delete, - Path = $"call/{JsonUtils.SerializeAsString(id)}", + Path = string.Format("call/{0}", ValueConvert.ToPathParameterString(id)), Options = options, }, cancellationToken ) .ConfigureAwait(false); - var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { + var responseBody = await response.Raw.Content.ReadAsStringAsync(); try { return JsonUtils.Deserialize(responseBody)!; @@ -211,11 +221,14 @@ public async Task DeleteAsync( } } - throw new VapiClientApiException( - $"Error with status code {response.StatusCode}", - response.StatusCode, - responseBody - ); + { + var responseBody = await response.Raw.Content.ReadAsStringAsync(); + throw new VapiClientApiException( + $"Error with status code {response.StatusCode}", + response.StatusCode, + responseBody + ); + } } public async Task UpdateAsync( @@ -226,12 +239,12 @@ public async Task UpdateAsync( ) { var response = await _client - .MakeRequestAsync( - new RawClient.JsonApiRequest + .SendRequestAsync( + new JsonRequest { BaseUrl = _client.Options.BaseUrl, Method = HttpMethodExtensions.Patch, - Path = $"call/{JsonUtils.SerializeAsString(id)}", + Path = string.Format("call/{0}", ValueConvert.ToPathParameterString(id)), Body = request, ContentType = "application/json", Options = options, @@ -239,9 +252,9 @@ public async Task UpdateAsync( cancellationToken ) .ConfigureAwait(false); - var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { + var responseBody = await response.Raw.Content.ReadAsStringAsync(); try { return JsonUtils.Deserialize(responseBody)!; @@ -252,10 +265,13 @@ public async Task UpdateAsync( } } - throw new VapiClientApiException( - $"Error with status code {response.StatusCode}", - response.StatusCode, - responseBody - ); + { + var responseBody = await response.Raw.Content.ReadAsStringAsync(); + throw new VapiClientApiException( + $"Error with status code {response.StatusCode}", + response.StatusCode, + responseBody + ); + } } } diff --git a/src/Vapi.Net/Calls/Requests/CallsListRequest.cs b/src/Vapi.Net/Calls/Requests/CallsListRequest.cs index d55b3e1..990f952 100644 --- a/src/Vapi.Net/Calls/Requests/CallsListRequest.cs +++ b/src/Vapi.Net/Calls/Requests/CallsListRequest.cs @@ -1,3 +1,4 @@ +using System.Text.Json.Serialization; using Vapi.Net.Core; namespace Vapi.Net; @@ -7,11 +8,13 @@ public record CallsListRequest /// /// This is the unique identifier for the call. /// + [JsonIgnore] public string? Id { get; set; } /// /// This will return calls with the specified assistantId. /// + [JsonIgnore] public string? AssistantId { get; set; } /// @@ -19,53 +22,64 @@ public record CallsListRequest /// /// Only relevant for `outboundPhoneCall` and `inboundPhoneCall` type. /// + [JsonIgnore] public string? PhoneNumberId { get; set; } /// /// This is the maximum number of items to return. Defaults to 100. /// + [JsonIgnore] public double? Limit { get; set; } /// /// This will return items where the createdAt is greater than the specified value. /// + [JsonIgnore] public DateTime? CreatedAtGt { get; set; } /// /// This will return items where the createdAt is less than the specified value. /// + [JsonIgnore] public DateTime? CreatedAtLt { get; set; } /// /// This will return items where the createdAt is greater than or equal to the specified value. /// + [JsonIgnore] public DateTime? CreatedAtGe { get; set; } /// /// This will return items where the createdAt is less than or equal to the specified value. /// + [JsonIgnore] public DateTime? CreatedAtLe { get; set; } /// /// This will return items where the updatedAt is greater than the specified value. /// + [JsonIgnore] public DateTime? UpdatedAtGt { get; set; } /// /// This will return items where the updatedAt is less than the specified value. /// + [JsonIgnore] public DateTime? UpdatedAtLt { get; set; } /// /// This will return items where the updatedAt is greater than or equal to the specified value. /// + [JsonIgnore] public DateTime? UpdatedAtGe { get; set; } /// /// This will return items where the updatedAt is less than or equal to the specified value. /// + [JsonIgnore] public DateTime? UpdatedAtLe { get; set; } + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Calls/Requests/CreateCallDto.cs b/src/Vapi.Net/Calls/Requests/CreateCallDto.cs index 62cafe6..5e86ab1 100644 --- a/src/Vapi.Net/Calls/Requests/CreateCallDto.cs +++ b/src/Vapi.Net/Calls/Requests/CreateCallDto.cs @@ -5,12 +5,32 @@ namespace Vapi.Net; public record CreateCallDto { + /// + /// This is used to issue batch calls to multiple customers. + /// + /// Only relevant for `outboundPhoneCall`. To call a single customer, use `customer` instead. + /// + [JsonPropertyName("customers")] + public IEnumerable? Customers { get; set; } + /// /// This is the name of the call. This is just for your own reference. /// [JsonPropertyName("name")] public string? Name { get; set; } + /// + /// This is the schedule plan of the call. + /// + [JsonPropertyName("schedulePlan")] + public SchedulePlan? SchedulePlan { get; set; } + + /// + /// This is the transport of the call. + /// + [JsonPropertyName("transport")] + public object? Transport { get; set; } + /// /// This is the assistant that will be used for the call. To use a transient assistant, use `assistant` instead. /// @@ -73,6 +93,7 @@ public record CreateCallDto [JsonPropertyName("customer")] public CreateCustomerDto? Customer { get; set; } + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Calls/Requests/UpdateCallDto.cs b/src/Vapi.Net/Calls/Requests/UpdateCallDto.cs index 8cf34b4..4605a7f 100644 --- a/src/Vapi.Net/Calls/Requests/UpdateCallDto.cs +++ b/src/Vapi.Net/Calls/Requests/UpdateCallDto.cs @@ -11,6 +11,7 @@ public record UpdateCallDto [JsonPropertyName("name")] public string? Name { get; set; } + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Core/ApiResponse.cs b/src/Vapi.Net/Core/ApiResponse.cs new file mode 100644 index 0000000..6db8089 --- /dev/null +++ b/src/Vapi.Net/Core/ApiResponse.cs @@ -0,0 +1,13 @@ +using System.Net.Http; + +namespace Vapi.Net.Core; + +/// +/// The response object returned from the API. +/// +internal record ApiResponse +{ + internal required int StatusCode { get; init; } + + internal required HttpResponseMessage Raw { get; init; } +} diff --git a/src/Vapi.Net/Core/BaseRequest.cs b/src/Vapi.Net/Core/BaseRequest.cs new file mode 100644 index 0000000..56cd337 --- /dev/null +++ b/src/Vapi.Net/Core/BaseRequest.cs @@ -0,0 +1,63 @@ +using System.Net.Http; +using System.Net.Http.Headers; +using System.Text; + +namespace Vapi.Net.Core; + +internal abstract record BaseRequest +{ + internal required string BaseUrl { get; init; } + + internal required HttpMethod Method { get; init; } + + internal required string Path { get; init; } + + internal string? ContentType { get; init; } + + internal Dictionary Query { get; init; } = new(); + + internal Headers Headers { get; init; } = new(); + + internal IRequestOptions? Options { get; init; } + + internal abstract HttpContent? CreateContent(); + + protected static ( + Encoding encoding, + string? charset, + string mediaType + ) ParseContentTypeOrDefault( + string? contentType, + Encoding encodingFallback, + string mediaTypeFallback + ) + { + var encoding = encodingFallback; + var mediaType = mediaTypeFallback; + string? charset = null; + if (string.IsNullOrEmpty(contentType)) + { + return (encoding, charset, mediaType); + } + + if (!MediaTypeHeaderValue.TryParse(contentType, out var mediaTypeHeaderValue)) + { + return (encoding, charset, mediaType); + } + + if (!string.IsNullOrEmpty(mediaTypeHeaderValue.CharSet)) + { + charset = mediaTypeHeaderValue.CharSet; + encoding = Encoding.GetEncoding(mediaTypeHeaderValue.CharSet); + } + + if (!string.IsNullOrEmpty(mediaTypeHeaderValue.MediaType)) + { + mediaType = mediaTypeHeaderValue.MediaType; + } + + return (encoding, charset, mediaType); + } + + protected static Encoding Utf8NoBom => EncodingCache.Utf8NoBom; +} diff --git a/src/Vapi.Net/Core/CollectionItemSerializer.cs b/src/Vapi.Net/Core/CollectionItemSerializer.cs index fde0844..b7d6467 100644 --- a/src/Vapi.Net/Core/CollectionItemSerializer.cs +++ b/src/Vapi.Net/Core/CollectionItemSerializer.cs @@ -1,5 +1,3 @@ -using System; -using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; diff --git a/src/Vapi.Net/Core/DateOnlyConverter.cs b/src/Vapi.Net/Core/DateOnlyConverter.cs new file mode 100644 index 0000000..2b43ef5 --- /dev/null +++ b/src/Vapi.Net/Core/DateOnlyConverter.cs @@ -0,0 +1,748 @@ +// ReSharper disable All +#pragma warning disable + +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using global::System.Diagnostics; +using global::System.Diagnostics.CodeAnalysis; +using global::System.Globalization; +using global::System.Runtime.CompilerServices; +using global::System.Runtime.InteropServices; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +// ReSharper disable SuggestVarOrType_SimpleTypes +// ReSharper disable SuggestVarOrType_BuiltInTypes + +namespace Vapi.Net.Core +{ + /// + /// Custom converter for handling the data type with the System.Text.Json library. + /// + /// + /// This class backported from: + /// + /// System.Text.Json.Serialization.Converters.DateOnlyConverter + /// + public sealed class DateOnlyConverter : JsonConverter + { + private const int FormatLength = 10; // YYYY-MM-DD + + private const int MaxEscapedFormatLength = + FormatLength * JsonConstants.MaxExpansionFactorWhileEscaping; + + /// + public override DateOnly Read( + ref Utf8JsonReader reader, + global::System.Type typeToConvert, + JsonSerializerOptions options + ) + { + if (reader.TokenType != JsonTokenType.String) + { + ThrowHelper.ThrowInvalidOperationException_ExpectedString(reader.TokenType); + } + + return ReadCore(ref reader); + } + + /// + public override DateOnly ReadAsPropertyName( + ref Utf8JsonReader reader, + global::System.Type typeToConvert, + JsonSerializerOptions options + ) + { + Debug.Assert(reader.TokenType == JsonTokenType.PropertyName); + return ReadCore(ref reader); + } + + private static DateOnly ReadCore(ref Utf8JsonReader reader) + { + if ( + !JsonHelpers.IsInRangeInclusive( + reader.ValueLength(), + FormatLength, + MaxEscapedFormatLength + ) + ) + { + ThrowHelper.ThrowFormatException(DataType.DateOnly); + } + + scoped ReadOnlySpan source; + if (!reader.HasValueSequence && !reader.ValueIsEscaped) + { + source = reader.ValueSpan; + } + else + { + Span stackSpan = stackalloc byte[MaxEscapedFormatLength]; + int bytesWritten = reader.CopyString(stackSpan); + source = stackSpan.Slice(0, bytesWritten); + } + + if (!JsonHelpers.TryParseAsIso(source, out DateOnly value)) + { + ThrowHelper.ThrowFormatException(DataType.DateOnly); + } + + return value; + } + + /// + public override void Write( + Utf8JsonWriter writer, + DateOnly value, + JsonSerializerOptions options + ) + { +#if NET8_0_OR_GREATER + Span buffer = stackalloc byte[FormatLength]; +#else + Span buffer = stackalloc char[FormatLength]; +#endif + // ReSharper disable once RedundantAssignment + bool formattedSuccessfully = value.TryFormat( + buffer, + out int charsWritten, + "O".AsSpan(), + CultureInfo.InvariantCulture + ); + Debug.Assert(formattedSuccessfully && charsWritten == FormatLength); + writer.WriteStringValue(buffer); + } + + /// + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + DateOnly value, + JsonSerializerOptions options + ) + { +#if NET8_0_OR_GREATER + Span buffer = stackalloc byte[FormatLength]; +#else + Span buffer = stackalloc char[FormatLength]; +#endif + // ReSharper disable once RedundantAssignment + bool formattedSuccessfully = value.TryFormat( + buffer, + out int charsWritten, + "O".AsSpan(), + CultureInfo.InvariantCulture + ); + Debug.Assert(formattedSuccessfully && charsWritten == FormatLength); + writer.WritePropertyName(buffer); + } + } + + internal static class JsonConstants + { + // The maximum number of fraction digits the Json DateTime parser allows + public const int DateTimeParseNumFractionDigits = 16; + + // In the worst case, an ASCII character represented as a single utf-8 byte could expand 6x when escaped. + public const int MaxExpansionFactorWhileEscaping = 6; + + // The largest fraction expressible by TimeSpan and DateTime formats + public const int MaxDateTimeFraction = 9_999_999; + + // TimeSpan and DateTime formats allow exactly up to many digits for specifying the fraction after the seconds. + public const int DateTimeNumFractionDigits = 7; + + public const byte UtcOffsetToken = (byte)'Z'; + + public const byte TimePrefix = (byte)'T'; + + public const byte Period = (byte)'.'; + + public const byte Hyphen = (byte)'-'; + + public const byte Colon = (byte)':'; + + public const byte Plus = (byte)'+'; + } + + // ReSharper disable SuggestVarOrType_Elsewhere + // ReSharper disable SuggestVarOrType_SimpleTypes + // ReSharper disable SuggestVarOrType_BuiltInTypes + + + internal static class JsonHelpers + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool IsInRangeInclusive(int value, int lowerBound, int upperBound) => + (uint)(value - lowerBound) <= (uint)(upperBound - lowerBound); + + public static bool IsDigit(byte value) => (uint)(value - '0') <= '9' - '0'; + + [StructLayout(LayoutKind.Auto)] + private struct DateTimeParseData + { + public int Year; + public int Month; + public int Day; + public bool IsCalendarDateOnly; + public int Hour; + public int Minute; + public int Second; + public int Fraction; // This value should never be greater than 9_999_999. + public int OffsetHours; + public int OffsetMinutes; + + // ReSharper disable once NotAccessedField.Local + public byte OffsetToken; + } + + public static bool TryParseAsIso(ReadOnlySpan source, out DateOnly value) + { + if ( + TryParseDateTimeOffset(source, out DateTimeParseData parseData) + && parseData.IsCalendarDateOnly + && TryCreateDateTime(parseData, DateTimeKind.Unspecified, out DateTime dateTime) + ) + { + value = DateOnly.FromDateTime(dateTime); + return true; + } + + value = default; + return false; + } + + /// + /// ISO 8601 date time parser (ISO 8601-1:2019). + /// + /// The date/time to parse in UTF-8 format. + /// The parsed for the given . + /// + /// Supports extended calendar date (5.2.2.1) and complete (5.4.2.1) calendar date/time of day + /// representations with optional specification of seconds and fractional seconds. + /// + /// Times can be explicitly specified as UTC ("Z" - 5.3.3) or offsets from UTC ("+/-hh:mm" 5.3.4.2). + /// If unspecified they are considered to be local per spec. + /// + /// Examples: (TZD is either "Z" or hh:mm offset from UTC) + /// + /// YYYY-MM-DD (e.g. 1997-07-16) + /// YYYY-MM-DDThh:mm (e.g. 1997-07-16T19:20) + /// YYYY-MM-DDThh:mm:ss (e.g. 1997-07-16T19:20:30) + /// YYYY-MM-DDThh:mm:ss.s (e.g. 1997-07-16T19:20:30.45) + /// YYYY-MM-DDThh:mmTZD (e.g. 1997-07-16T19:20+01:00) + /// YYYY-MM-DDThh:mm:ssTZD (e.g. 1997-07-16T19:20:3001:00) + /// YYYY-MM-DDThh:mm:ss.sTZD (e.g. 1997-07-16T19:20:30.45Z) + /// + /// Generally speaking we always require the "extended" option when one exists (3.1.3.5). + /// The extended variants have separator characters between components ('-', ':', '.', etc.). + /// Spaces are not permitted. + /// + /// "true" if successfully parsed. + private static bool TryParseDateTimeOffset( + ReadOnlySpan source, + out DateTimeParseData parseData + ) + { + parseData = default; + + // too short datetime + Debug.Assert(source.Length >= 10); + + // Parse the calendar date + // ----------------------- + // ISO 8601-1:2019 5.2.2.1b "Calendar date complete extended format" + // [dateX] = [year]["-"][month]["-"][day] + // [year] = [YYYY] [0000 - 9999] (4.3.2) + // [month] = [MM] [01 - 12] (4.3.3) + // [day] = [DD] [01 - 28, 29, 30, 31] (4.3.4) + // + // Note: 5.2.2.2 "Representations with reduced precision" allows for + // just [year]["-"][month] (a) and just [year] (b), but we currently + // don't permit it. + + { + uint digit1 = source[0] - (uint)'0'; + uint digit2 = source[1] - (uint)'0'; + uint digit3 = source[2] - (uint)'0'; + uint digit4 = source[3] - (uint)'0'; + + if (digit1 > 9 || digit2 > 9 || digit3 > 9 || digit4 > 9) + { + return false; + } + + parseData.Year = (int)(digit1 * 1000 + digit2 * 100 + digit3 * 10 + digit4); + } + + if ( + source[4] != JsonConstants.Hyphen + || !TryGetNextTwoDigits(source.Slice(start: 5, length: 2), ref parseData.Month) + || source[7] != JsonConstants.Hyphen + || !TryGetNextTwoDigits(source.Slice(start: 8, length: 2), ref parseData.Day) + ) + { + return false; + } + + // We now have YYYY-MM-DD [dateX] + // ReSharper disable once ConvertIfStatementToSwitchStatement + if (source.Length == 10) + { + parseData.IsCalendarDateOnly = true; + return true; + } + + // Parse the time of day + // --------------------- + // + // ISO 8601-1:2019 5.3.1.2b "Local time of day complete extended format" + // [timeX] = ["T"][hour][":"][min][":"][sec] + // [hour] = [hh] [00 - 23] (4.3.8a) + // [minute] = [mm] [00 - 59] (4.3.9a) + // [sec] = [ss] [00 - 59, 60 with a leap second] (4.3.10a) + // + // ISO 8601-1:2019 5.3.3 "UTC of day" + // [timeX]["Z"] + // + // ISO 8601-1:2019 5.3.4.2 "Local time of day with the time shift between + // local timescale and UTC" (Extended format) + // + // [shiftX] = ["+"|"-"][hour][":"][min] + // + // Notes: + // + // "T" is optional per spec, but _only_ when times are used alone. In our + // case, we're reading out a complete date & time and as such require "T". + // (5.4.2.1b). + // + // For [timeX] We allow seconds to be omitted per 5.3.1.3a "Representations + // with reduced precision". 5.3.1.3b allows just specifying the hour, but + // we currently don't permit this. + // + // Decimal fractions are allowed for hours, minutes and seconds (5.3.14). + // We only allow fractions for seconds currently. Lower order components + // can't follow, i.e. you can have T23.3, but not T23.3:04. There must be + // one digit, but the max number of digits is implementation defined. We + // currently allow up to 16 digits of fractional seconds only. While we + // support 16 fractional digits we only parse the first seven, anything + // past that is considered a zero. This is to stay compatible with the + // DateTime implementation which is limited to this resolution. + + if (source.Length < 16) + { + // Source does not have enough characters for YYYY-MM-DDThh:mm + return false; + } + + // Parse THH:MM (e.g. "T10:32") + if ( + source[10] != JsonConstants.TimePrefix + || source[13] != JsonConstants.Colon + || !TryGetNextTwoDigits(source.Slice(start: 11, length: 2), ref parseData.Hour) + || !TryGetNextTwoDigits(source.Slice(start: 14, length: 2), ref parseData.Minute) + ) + { + return false; + } + + // We now have YYYY-MM-DDThh:mm + Debug.Assert(source.Length >= 16); + if (source.Length == 16) + { + return true; + } + + byte curByte = source[16]; + int sourceIndex = 17; + + // Either a TZD ['Z'|'+'|'-'] or a seconds separator [':'] is valid at this point + switch (curByte) + { + case JsonConstants.UtcOffsetToken: + parseData.OffsetToken = JsonConstants.UtcOffsetToken; + return sourceIndex == source.Length; + case JsonConstants.Plus: + case JsonConstants.Hyphen: + parseData.OffsetToken = curByte; + return ParseOffset(ref parseData, source.Slice(sourceIndex)); + case JsonConstants.Colon: + break; + default: + return false; + } + + // Try reading the seconds + if ( + source.Length < 19 + || !TryGetNextTwoDigits(source.Slice(start: 17, length: 2), ref parseData.Second) + ) + { + return false; + } + + // We now have YYYY-MM-DDThh:mm:ss + Debug.Assert(source.Length >= 19); + if (source.Length == 19) + { + return true; + } + + curByte = source[19]; + sourceIndex = 20; + + // Either a TZD ['Z'|'+'|'-'] or a seconds decimal fraction separator ['.'] is valid at this point + switch (curByte) + { + case JsonConstants.UtcOffsetToken: + parseData.OffsetToken = JsonConstants.UtcOffsetToken; + return sourceIndex == source.Length; + case JsonConstants.Plus: + case JsonConstants.Hyphen: + parseData.OffsetToken = curByte; + return ParseOffset(ref parseData, source.Slice(sourceIndex)); + case JsonConstants.Period: + break; + default: + return false; + } + + // Source does not have enough characters for second fractions (i.e. ".s") + // YYYY-MM-DDThh:mm:ss.s + if (source.Length < 21) + { + return false; + } + + // Parse fraction. This value should never be greater than 9_999_999 + int numDigitsRead = 0; + int fractionEnd = Math.Min( + sourceIndex + JsonConstants.DateTimeParseNumFractionDigits, + source.Length + ); + + while (sourceIndex < fractionEnd && IsDigit(curByte = source[sourceIndex])) + { + if (numDigitsRead < JsonConstants.DateTimeNumFractionDigits) + { + parseData.Fraction = parseData.Fraction * 10 + (int)(curByte - (uint)'0'); + numDigitsRead++; + } + + sourceIndex++; + } + + if (parseData.Fraction != 0) + { + while (numDigitsRead < JsonConstants.DateTimeNumFractionDigits) + { + parseData.Fraction *= 10; + numDigitsRead++; + } + } + + // We now have YYYY-MM-DDThh:mm:ss.s + Debug.Assert(sourceIndex <= source.Length); + if (sourceIndex == source.Length) + { + return true; + } + + curByte = source[sourceIndex++]; + + // TZD ['Z'|'+'|'-'] is valid at this point + switch (curByte) + { + case JsonConstants.UtcOffsetToken: + parseData.OffsetToken = JsonConstants.UtcOffsetToken; + return sourceIndex == source.Length; + case JsonConstants.Plus: + case JsonConstants.Hyphen: + parseData.OffsetToken = curByte; + return ParseOffset(ref parseData, source.Slice(sourceIndex)); + default: + return false; + } + + static bool ParseOffset(ref DateTimeParseData parseData, ReadOnlySpan offsetData) + { + // Parse the hours for the offset + if ( + offsetData.Length < 2 + || !TryGetNextTwoDigits(offsetData.Slice(0, 2), ref parseData.OffsetHours) + ) + { + return false; + } + + // We now have YYYY-MM-DDThh:mm:ss.s+|-hh + + if (offsetData.Length == 2) + { + // Just hours offset specified + return true; + } + + // Ensure we have enough for ":mm" + return offsetData.Length == 5 + && offsetData[2] == JsonConstants.Colon + && TryGetNextTwoDigits(offsetData.Slice(3), ref parseData.OffsetMinutes); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + // ReSharper disable once RedundantAssignment + private static bool TryGetNextTwoDigits(ReadOnlySpan source, ref int value) + { + Debug.Assert(source.Length == 2); + + uint digit1 = source[0] - (uint)'0'; + uint digit2 = source[1] - (uint)'0'; + + if (digit1 > 9 || digit2 > 9) + { + value = 0; + return false; + } + + value = (int)(digit1 * 10 + digit2); + return true; + } + + // The following methods are borrowed verbatim from src/Common/src/CoreLib/System/Buffers/Text/Utf8Parser/Utf8Parser.Date.Helpers.cs + + /// + /// Overflow-safe DateTime factory. + /// + private static bool TryCreateDateTime( + DateTimeParseData parseData, + DateTimeKind kind, + out DateTime value + ) + { + if (parseData.Year == 0) + { + value = default; + return false; + } + + Debug.Assert(parseData.Year <= 9999); // All of our callers to date parse the year from fixed 4-digit fields so this value is trusted. + + if ((uint)parseData.Month - 1 >= 12) + { + value = default; + return false; + } + + uint dayMinusOne = (uint)parseData.Day - 1; + if ( + dayMinusOne >= 28 + && dayMinusOne >= DateTime.DaysInMonth(parseData.Year, parseData.Month) + ) + { + value = default; + return false; + } + + if ((uint)parseData.Hour > 23) + { + value = default; + return false; + } + + if ((uint)parseData.Minute > 59) + { + value = default; + return false; + } + + // This needs to allow leap seconds when appropriate. + // See https://github.com/dotnet/runtime/issues/30135. + if ((uint)parseData.Second > 59) + { + value = default; + return false; + } + + Debug.Assert(parseData.Fraction is >= 0 and <= JsonConstants.MaxDateTimeFraction); // All of our callers to date parse the fraction from fixed 7-digit fields so this value is trusted. + + ReadOnlySpan days = DateTime.IsLeapYear(parseData.Year) + ? DaysToMonth366 + : DaysToMonth365; + int yearMinusOne = parseData.Year - 1; + int totalDays = + yearMinusOne * 365 + + yearMinusOne / 4 + - yearMinusOne / 100 + + yearMinusOne / 400 + + days[parseData.Month - 1] + + parseData.Day + - 1; + long ticks = totalDays * TimeSpan.TicksPerDay; + int totalSeconds = parseData.Hour * 3600 + parseData.Minute * 60 + parseData.Second; + ticks += totalSeconds * TimeSpan.TicksPerSecond; + ticks += parseData.Fraction; + value = new DateTime(ticks: ticks, kind: kind); + return true; + } + + private static ReadOnlySpan DaysToMonth365 => + [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365]; + private static ReadOnlySpan DaysToMonth366 => + [0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366]; + } + + internal static class ThrowHelper + { + private const string ExceptionSourceValueToRethrowAsJsonException = + "System.Text.Json.Rethrowable"; + + [DoesNotReturn] + public static void ThrowInvalidOperationException_ExpectedString(JsonTokenType tokenType) + { + throw GetInvalidOperationException("string", tokenType); + } + + public static void ThrowFormatException(DataType dataType) + { + throw new FormatException(SR.Format(SR.UnsupportedFormat, dataType)) + { + Source = ExceptionSourceValueToRethrowAsJsonException, + }; + } + + private static Exception GetInvalidOperationException( + string message, + JsonTokenType tokenType + ) + { + return GetInvalidOperationException(SR.Format(SR.InvalidCast, tokenType, message)); + } + + private static InvalidOperationException GetInvalidOperationException(string message) + { + return new InvalidOperationException(message) + { + Source = ExceptionSourceValueToRethrowAsJsonException, + }; + } + } + + internal static class Utf8JsonReaderExtensions + { + internal static int ValueLength(this Utf8JsonReader reader) => + reader.HasValueSequence + ? checked((int)reader.ValueSequence.Length) + : reader.ValueSpan.Length; + } + + internal enum DataType + { + TimeOnly, + DateOnly, + } + + [SuppressMessage("ReSharper", "InconsistentNaming")] + internal static class SR + { + private static readonly bool s_usingResourceKeys = + AppContext.TryGetSwitch( + "System.Resources.UseSystemResourceKeys", + out bool usingResourceKeys + ) && usingResourceKeys; + + public static string UnsupportedFormat => Strings.UnsupportedFormat; + + public static string InvalidCast => Strings.InvalidCast; + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static string Format(string resourceFormat, object? p1) => + s_usingResourceKeys + ? string.Join(", ", resourceFormat, p1) + : string.Format(resourceFormat, p1); + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static string Format(string resourceFormat, object? p1, object? p2) => + s_usingResourceKeys + ? string.Join(", ", resourceFormat, p1, p2) + : string.Format(resourceFormat, p1, p2); + } + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute( + "System.Resources.Tools.StronglyTypedResourceBuilder", + "17.0.0.0" + )] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Strings + { + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute( + "Microsoft.Performance", + "CA1811:AvoidUncalledPrivateCode" + )] + internal Strings() { } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute( + global::System.ComponentModel.EditorBrowsableState.Advanced + )] + internal static global::System.Resources.ResourceManager ResourceManager + { + get + { + if (object.ReferenceEquals(resourceMan, null)) + { + global::System.Resources.ResourceManager temp = + new global::System.Resources.ResourceManager( + "System.Text.Json.Resources.Strings", + typeof(Strings).Assembly + ); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute( + global::System.ComponentModel.EditorBrowsableState.Advanced + )] + internal static global::System.Globalization.CultureInfo Culture + { + get { return resourceCulture; } + set { resourceCulture = value; } + } + + /// + /// Looks up a localized string similar to Cannot get the value of a token type '{0}' as a {1}.. + /// + internal static string InvalidCast + { + get { return ResourceManager.GetString("InvalidCast", resourceCulture); } + } + + /// + /// Looks up a localized string similar to The JSON value is not in a supported {0} format.. + /// + internal static string UnsupportedFormat + { + get { return ResourceManager.GetString("UnsupportedFormat", resourceCulture); } + } + } +} diff --git a/src/Vapi.Net/Core/EmptyRequest.cs b/src/Vapi.Net/Core/EmptyRequest.cs new file mode 100644 index 0000000..9ad9248 --- /dev/null +++ b/src/Vapi.Net/Core/EmptyRequest.cs @@ -0,0 +1,11 @@ +using System.Net.Http; + +namespace Vapi.Net.Core; + +/// +/// The request object to send without a request body. +/// +internal record EmptyRequest : BaseRequest +{ + internal override HttpContent? CreateContent() => null; +} diff --git a/src/Vapi.Net/Core/EncodingCache.cs b/src/Vapi.Net/Core/EncodingCache.cs new file mode 100644 index 0000000..783e01a --- /dev/null +++ b/src/Vapi.Net/Core/EncodingCache.cs @@ -0,0 +1,11 @@ +using System.Text; + +namespace Vapi.Net.Core; + +internal static class EncodingCache +{ + internal static readonly Encoding Utf8NoBom = new UTF8Encoding( + encoderShouldEmitUTF8Identifier: false, + throwOnInvalidBytes: true + ); +} diff --git a/src/Vapi.Net/Core/FormUrlEncoder.cs b/src/Vapi.Net/Core/FormUrlEncoder.cs new file mode 100644 index 0000000..17817b3 --- /dev/null +++ b/src/Vapi.Net/Core/FormUrlEncoder.cs @@ -0,0 +1,33 @@ +using global::System.Net.Http; + +namespace Vapi.Net.Core; + +/// +/// Encodes an object into a form URL-encoded content. +/// +public static class FormUrlEncoder +{ + /// + /// Encodes an object into a form URL-encoded content using Deep Object notation. + /// + /// Object to form URL-encode. You can pass in an object or dictionary, but not lists, strings, or primitives. + /// Throws when passing in a list, a string, or a primitive value. + internal static FormUrlEncodedContent EncodeAsDeepObject(object value) => + new(QueryStringConverter.ToDeepObject(value)); + + /// + /// Encodes an object into a form URL-encoded content using Exploded Form notation. + /// + /// Object to form URL-encode. You can pass in an object or dictionary, but not lists, strings, or primitives. + /// Throws when passing in a list, a string, or a primitive value. + internal static FormUrlEncodedContent EncodeAsExplodedForm(object value) => + new(QueryStringConverter.ToExplodedForm(value)); + + /// + /// Encodes an object into a form URL-encoded content using Form notation without exploding parameters. + /// + /// Object to form URL-encode. You can pass in an object or dictionary, but not lists, strings, or primitives. + /// Throws when passing in a list, a string, or a primitive value. + internal static FormUrlEncodedContent EncodeAsForm(object value) => + new(QueryStringConverter.ToForm(value)); +} diff --git a/src/Vapi.Net/Core/Headers.cs b/src/Vapi.Net/Core/Headers.cs index fd786b6..0a0943b 100644 --- a/src/Vapi.Net/Core/Headers.cs +++ b/src/Vapi.Net/Core/Headers.cs @@ -1,10 +1,17 @@ namespace Vapi.Net.Core; +/// +/// Represents the headers sent with the request. +/// internal sealed class Headers : Dictionary { - public Headers() { } + internal Headers() { } - public Headers(Dictionary value) + /// + /// Initializes a new instance of the Headers class with the specified value. + /// + /// + internal Headers(Dictionary value) { foreach (var kvp in value) { @@ -12,6 +19,10 @@ public Headers(Dictionary value) } } - public Headers(IEnumerable> value) + /// + /// Initializes a new instance of the Headers class with the specified value. + /// + /// + internal Headers(IEnumerable> value) : base(value.ToDictionary(e => e.Key, e => e.Value)) { } } diff --git a/src/Vapi.Net/Core/IIsRetryableContent.cs b/src/Vapi.Net/Core/IIsRetryableContent.cs new file mode 100644 index 0000000..4c854eb --- /dev/null +++ b/src/Vapi.Net/Core/IIsRetryableContent.cs @@ -0,0 +1,6 @@ +namespace Vapi.Net.Core; + +public interface IIsRetryableContent +{ + public bool IsRetryable { get; } +} diff --git a/src/Vapi.Net/Core/IRequestOptions.cs b/src/Vapi.Net/Core/IRequestOptions.cs index 1a46b86..fa2be0d 100644 --- a/src/Vapi.Net/Core/IRequestOptions.cs +++ b/src/Vapi.Net/Core/IRequestOptions.cs @@ -1,4 +1,5 @@ using System; +using System.Collections.Generic; using System.Net.Http; namespace Vapi.Net.Core; @@ -8,25 +9,84 @@ internal interface IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http headers sent with the request. /// internal Headers Headers { get; init; } + /// + /// Additional headers to be sent with the request. + /// Headers previously set with matching keys will be overwritten. + /// + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } + /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } + + /// + /// Additional query parameters sent with the request. + /// + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } + + /// + /// Additional body properties sent with the request. + /// This is only applied to JSON requests. + /// + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/src/Vapi.Net/Core/JsonAccessAttribute.cs b/src/Vapi.Net/Core/JsonAccessAttribute.cs new file mode 100644 index 0000000..38ae333 --- /dev/null +++ b/src/Vapi.Net/Core/JsonAccessAttribute.cs @@ -0,0 +1,13 @@ +namespace Vapi.Net.Core; + +[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field)] +internal class JsonAccessAttribute(JsonAccessType accessType) : Attribute +{ + internal JsonAccessType AccessType { get; init; } = accessType; +} + +internal enum JsonAccessType +{ + ReadOnly, + WriteOnly, +} diff --git a/src/Vapi.Net/Core/JsonConfiguration.cs b/src/Vapi.Net/Core/JsonConfiguration.cs index eb563b6..73e05cf 100644 --- a/src/Vapi.Net/Core/JsonConfiguration.cs +++ b/src/Vapi.Net/Core/JsonConfiguration.cs @@ -1,19 +1,78 @@ -using System.Text.Json; -using System.Text.Json.Serialization; +using global::System.Text.Json; +using global::System.Text.Json.Nodes; +using global::System.Text.Json.Serialization; +using global::System.Text.Json.Serialization.Metadata; namespace Vapi.Net.Core; internal static partial class JsonOptions { - public static readonly JsonSerializerOptions JsonSerializerOptions; + internal static readonly JsonSerializerOptions JsonSerializerOptions; static JsonOptions() { var options = new JsonSerializerOptions { - Converters = { new DateTimeSerializer(), new OneOfSerializer() }, + Converters = { new DateTimeSerializer(), +#if USE_PORTABLE_DATE_ONLY + new DateOnlyConverter(), +#endif + new OneOfSerializer() }, +#if DEBUG WriteIndented = true, +#endif DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull, + TypeInfoResolver = new DefaultJsonTypeInfoResolver + { + Modifiers = + { + static typeInfo => + { + if (typeInfo.Kind != JsonTypeInfoKind.Object) + return; + + foreach (var propertyInfo in typeInfo.Properties) + { + var jsonAccessAttribute = propertyInfo + .AttributeProvider?.GetCustomAttributes( + typeof(JsonAccessAttribute), + true + ) + .OfType() + .FirstOrDefault(); + + if (jsonAccessAttribute != null) + { + propertyInfo.IsRequired = false; + switch (jsonAccessAttribute.AccessType) + { + case JsonAccessType.ReadOnly: + propertyInfo.ShouldSerialize = (_, _) => false; + break; + case JsonAccessType.WriteOnly: + propertyInfo.Set = null; + break; + default: + throw new ArgumentOutOfRangeException(); + } + } + + var jsonIgnoreAttribute = propertyInfo + .AttributeProvider?.GetCustomAttributes( + typeof(JsonIgnoreAttribute), + true + ) + .OfType() + .FirstOrDefault(); + + if (jsonIgnoreAttribute is not null) + { + propertyInfo.IsRequired = false; + } + } + }, + }, + }, }; ConfigureJsonSerializerOptions(options); JsonSerializerOptions = options; @@ -24,19 +83,73 @@ static JsonOptions() internal static class JsonUtils { - public static string Serialize(T obj) - { - return JsonSerializer.Serialize(obj, JsonOptions.JsonSerializerOptions); - } + internal static string Serialize(T obj) => + JsonSerializer.Serialize(obj, JsonOptions.JsonSerializerOptions); + + internal static JsonElement SerializeToElement(T obj) => + JsonSerializer.SerializeToElement(obj, JsonOptions.JsonSerializerOptions); + + internal static JsonDocument SerializeToDocument(T obj) => + JsonSerializer.SerializeToDocument(obj, JsonOptions.JsonSerializerOptions); - public static string SerializeAsString(T obj) + internal static JsonNode? SerializeToNode(T obj) => + JsonSerializer.SerializeToNode(obj, JsonOptions.JsonSerializerOptions); + + internal static byte[] SerializeToUtf8Bytes(T obj) => + JsonSerializer.SerializeToUtf8Bytes(obj, JsonOptions.JsonSerializerOptions); + + internal static string SerializeWithAdditionalProperties( + T obj, + object? additionalProperties = null + ) { - var json = JsonSerializer.Serialize(obj, JsonOptions.JsonSerializerOptions); - return json.Trim('"'); + if (additionalProperties == null) + { + return Serialize(obj); + } + var additionalPropertiesJsonNode = SerializeToNode(additionalProperties); + if (additionalPropertiesJsonNode is not JsonObject additionalPropertiesJsonObject) + { + throw new InvalidOperationException( + "The additional properties must serialize to a JSON object." + ); + } + var jsonNode = SerializeToNode(obj); + if (jsonNode is not JsonObject jsonObject) + { + throw new InvalidOperationException( + "The serialized object must be a JSON object to add properties." + ); + } + MergeJsonObjects(jsonObject, additionalPropertiesJsonObject); + return jsonObject.ToJsonString(JsonOptions.JsonSerializerOptions); } - public static T Deserialize(string json) + private static void MergeJsonObjects(JsonObject baseObject, JsonObject overrideObject) { - return JsonSerializer.Deserialize(json, JsonOptions.JsonSerializerOptions)!; + foreach (var property in overrideObject) + { + if (!baseObject.TryGetPropertyValue(property.Key, out JsonNode? existingValue)) + { + baseObject[property.Key] = + property.Value != null ? JsonNode.Parse(property.Value.ToJsonString()) : null; + continue; + } + if ( + existingValue is JsonObject nestedBaseObject + && property.Value is JsonObject nestedOverrideObject + ) + { + // If both values are objects, recursively merge them. + MergeJsonObjects(nestedBaseObject, nestedOverrideObject); + continue; + } + // Otherwise, the overrideObject takes precedence. + baseObject[property.Key] = + property.Value != null ? JsonNode.Parse(property.Value.ToJsonString()) : null; + } } + + internal static T Deserialize(string json) => + JsonSerializer.Deserialize(json, JsonOptions.JsonSerializerOptions)!; } diff --git a/src/Vapi.Net/Core/JsonRequest.cs b/src/Vapi.Net/Core/JsonRequest.cs new file mode 100644 index 0000000..e39dd08 --- /dev/null +++ b/src/Vapi.Net/Core/JsonRequest.cs @@ -0,0 +1,36 @@ +using System.Net.Http; + +namespace Vapi.Net.Core; + +/// +/// The request object to be sent for JSON APIs. +/// +internal record JsonRequest : BaseRequest +{ + internal object? Body { get; init; } + + internal override HttpContent? CreateContent() + { + if (Body is null && Options?.AdditionalBodyProperties is null) + { + return null; + } + + var (encoding, charset, mediaType) = ParseContentTypeOrDefault( + ContentType, + Utf8NoBom, + "application/json" + ); + var content = new StringContent( + JsonUtils.SerializeWithAdditionalProperties(Body, Options?.AdditionalBodyProperties), + encoding, + mediaType + ); + if (string.IsNullOrEmpty(charset) && content.Headers.ContentType is not null) + { + content.Headers.ContentType.CharSet = ""; + } + + return content; + } +} diff --git a/src/Vapi.Net/Core/MultipartFormRequest.cs b/src/Vapi.Net/Core/MultipartFormRequest.cs new file mode 100644 index 0000000..9eb6e40 --- /dev/null +++ b/src/Vapi.Net/Core/MultipartFormRequest.cs @@ -0,0 +1,275 @@ +using System.Net.Http; +using System.Net.Http.Headers; + +namespace Vapi.Net.Core; + +/// +/// The request object to be sent for multipart form data. +/// +internal record MultipartFormRequest : BaseRequest +{ + private readonly List> _partAdders = []; + + internal void AddJsonPart(string name, object? value) => AddJsonPart(name, value, null); + + internal void AddJsonPart(string name, object? value, string? contentType) + { + if (value is null) + { + return; + } + + _partAdders.Add(form => + { + var (encoding, charset, mediaType) = ParseContentTypeOrDefault( + contentType, + Utf8NoBom, + "application/json" + ); + var content = new StringContent(JsonUtils.Serialize(value), encoding, mediaType); + if (string.IsNullOrEmpty(charset) && content.Headers.ContentType is not null) + { + content.Headers.ContentType.CharSet = ""; + } + + form.Add(content, name); + }); + } + + internal void AddJsonParts(string name, IEnumerable? value) => + AddJsonParts(name, value, null); + + internal void AddJsonParts(string name, IEnumerable? value, string? contentType) + { + if (value is null) + { + return; + } + + foreach (var item in value) + { + AddJsonPart(name, item, contentType); + } + } + + internal void AddStringPart(string name, object? value) => AddStringPart(name, value, null); + + internal void AddStringPart(string name, object? value, string? contentType) + { + if (value is null) + { + return; + } + + AddStringPart(name, ValueConvert.ToString(value), contentType); + } + + internal void AddStringPart(string name, string? value) => AddStringPart(name, value, null); + + internal void AddStringPart(string name, string? value, string? contentType) + { + if (value is null) + { + return; + } + + _partAdders.Add(form => + { + var (encoding, charset, mediaType) = ParseContentTypeOrDefault( + contentType, + Utf8NoBom, + "text/plain" + ); + var content = new StringContent(value, encoding, mediaType); + if (string.IsNullOrEmpty(charset) && content.Headers.ContentType is not null) + { + content.Headers.ContentType.CharSet = ""; + } + + form.Add(content, name); + }); + } + + internal void AddStringParts(string name, IEnumerable? value) => + AddStringParts(name, value, null); + + internal void AddStringParts(string name, IEnumerable? value, string? contentType) + { + if (value is null) + { + return; + } + + AddStringPart(name, ValueConvert.ToString(value), contentType); + } + + internal void AddStringParts(string name, IEnumerable? value) => + AddStringParts(name, value, null); + + internal void AddStringParts(string name, IEnumerable? value, string? contentType) + { + if (value is null) + { + return; + } + + foreach (var item in value) + { + AddStringPart(name, item, contentType); + } + } + + internal void AddStreamPart(string name, Stream? stream, string? fileName) => + AddStreamPart(name, stream, fileName, null); + + internal void AddStreamPart(string name, Stream? stream, string? fileName, string? contentType) + { + if (stream is null) + { + return; + } + + _partAdders.Add(form => + { + var content = new StreamContent(stream) + { + Headers = + { + ContentType = MediaTypeHeaderValue.Parse( + contentType ?? "application/octet-stream" + ), + }, + }; + + if (fileName is not null) + { + form.Add(content, name, fileName); + } + else + { + form.Add(content, name); + } + }); + } + + internal void AddFileParameterPart(string name, FileParameter? file) => + AddFileParameterPart(name, file, null); + + internal void AddFileParameterPart( + string name, + FileParameter? file, + string? fallbackContentType + ) => + AddStreamPart(name, file?.Stream, file?.FileName, file?.ContentType ?? fallbackContentType); + + internal void AddFileParameterParts(string name, IEnumerable? files) => + AddFileParameterParts(name, files, null); + + internal void AddFileParameterParts( + string name, + IEnumerable? files, + string? fallbackContentType + ) + { + if (files is null) + { + return; + } + + foreach (var file in files) + { + AddFileParameterPart(name, file, fallbackContentType); + } + } + + internal void AddFormEncodedPart(string name, object? value) => + AddFormEncodedPart(name, value, null); + + internal void AddFormEncodedPart(string name, object? value, string? contentType) + { + if (value is null) + { + return; + } + + _partAdders.Add(form => + { + var content = FormUrlEncoder.EncodeAsForm(value); + if (!string.IsNullOrEmpty(contentType)) + { + content.Headers.ContentType = MediaTypeHeaderValue.Parse(contentType); + } + + form.Add(content, name); + }); + } + + internal void AddFormEncodedParts(string name, IEnumerable? value) => + AddFormEncodedParts(name, value, null); + + internal void AddFormEncodedParts(string name, IEnumerable? value, string? contentType) + { + if (value is null) + { + return; + } + + foreach (var item in value) + { + AddFormEncodedPart(name, item, contentType); + } + } + + internal void AddExplodedFormEncodedPart(string name, object? value) => + AddExplodedFormEncodedPart(name, value, null); + + internal void AddExplodedFormEncodedPart(string name, object? value, string? contentType) + { + if (value is null) + { + return; + } + + _partAdders.Add(form => + { + var content = FormUrlEncoder.EncodeAsExplodedForm(value); + if (!string.IsNullOrEmpty(contentType)) + { + content.Headers.ContentType = MediaTypeHeaderValue.Parse(contentType); + } + + form.Add(content, name); + }); + } + + internal void AddExplodedFormEncodedParts(string name, IEnumerable? value) => + AddExplodedFormEncodedParts(name, value, null); + + internal void AddExplodedFormEncodedParts( + string name, + IEnumerable? value, + string? contentType + ) + { + if (value is null) + { + return; + } + + foreach (var item in value) + { + AddExplodedFormEncodedPart(name, item, contentType); + } + } + + internal override HttpContent CreateContent() + { + var form = new MultipartFormDataContent(); + foreach (var adder in _partAdders) + { + adder(form); + } + + return form; + } +} diff --git a/src/Vapi.Net/Core/Page.cs b/src/Vapi.Net/Core/Page.cs index 4b129e5..eceb7f6 100644 --- a/src/Vapi.Net/Core/Page.cs +++ b/src/Vapi.Net/Core/Page.cs @@ -1,4 +1,5 @@ using System.Collections; +using System.Collections.ObjectModel; namespace Vapi.Net.Core; @@ -9,6 +10,10 @@ namespace Vapi.Net.Core; /// The type of items. public class Page : IEnumerable { + /// + /// Creates a new with the specified items. + /// + /// public Page(IReadOnlyList items) { Items = items; @@ -19,7 +24,26 @@ public Page(IReadOnlyList items) /// public IReadOnlyList Items { get; } + /// + /// Enumerate the items in this . + /// + /// public IEnumerator GetEnumerator() => Items.GetEnumerator(); + /// + /// Enumerate the items in this . + /// + /// IEnumerator IEnumerable.GetEnumerator() => Items.GetEnumerator(); + + /// + /// An empty . + /// + public static Page Empty { get; } = + new(new ReadOnlyCollection(Array.Empty())); + + /// + /// Indicates whether this is empty. + /// + public bool IsEmpty => Items.Count == 0; } diff --git a/src/Vapi.Net/Core/Pager.cs b/src/Vapi.Net/Core/Pager.cs index 7efbf48..e1daa03 100644 --- a/src/Vapi.Net/Core/Pager.cs +++ b/src/Vapi.Net/Core/Pager.cs @@ -7,8 +7,27 @@ namespace Vapi.Net.Core; /// iterate over. /// /// The type of the values. -public abstract class Pager : IAsyncEnumerable +public interface Pager : IAsyncEnumerable { + /// + /// Get the current . + /// + public Page CurrentPage { get; } + + /// + /// Indicates whether there is a next page. + /// + public bool HasNextPage { get; } + + /// + /// Get the next . + /// + /// + /// + /// The next . + /// + public Task> GetNextPageAsync(CancellationToken cancellationToken = default); + /// /// Enumerate the values a at a time. This may /// make multiple service requests. @@ -19,43 +38,58 @@ public abstract class Pager : IAsyncEnumerable public abstract IAsyncEnumerable> AsPagesAsync( CancellationToken cancellationToken = default ); +} +/// +/// Interface for implementing pagination in two directions. +/// +/// The type of the values. +// ReSharper disable once InconsistentNaming +public interface BiPager : IAsyncEnumerable +{ /// - /// Enumerate the values in the collection asynchronously. This may - /// make multiple service requests. + /// Get the current . /// - /// - /// The used for requests made while - /// enumerating asynchronously. - /// - /// An async sequence of values. - public virtual async IAsyncEnumerator GetAsyncEnumerator( - CancellationToken cancellationToken = default - ) - { - await foreach (var page in AsPagesAsync(cancellationToken).ConfigureAwait(false)) - { - foreach (var value in page.Items) - { - yield return value; - } - } - } + public Page CurrentPage { get; } + + /// + /// Indicates whether there is a next page. + /// + public bool HasNextPage { get; } + + /// + /// Indicates whether there is a previous page. + /// + public bool HasPreviousPage { get; } + + /// + /// Get the next . + /// + /// + /// + /// The next . + /// + public Task> GetNextPageAsync(CancellationToken cancellationToken = default); + + /// + /// Get the previous . + /// + /// + /// + /// The previous . + /// + public Task> GetPreviousPageAsync(CancellationToken cancellationToken = default); } internal sealed class OffsetPager : Pager { - private TRequest _request; + private TRequest? _request; private readonly TRequestOptions? _options; - private readonly GetNextPage _getNextPage; - private readonly GetOffset _getOffset; - private readonly SetOffset _setOffset; - private readonly GetStep? _getStep; - private readonly GetItems _getItems; - private readonly HasNextPage? _hasNextPage; - - internal delegate Task GetNextPage( + private readonly SendRequest _sendRequest; + private readonly ParseApiCallDelegate _parseApiCall; + + internal delegate Task SendRequest( TRequest request, TRequestOptions? options, CancellationToken cancellationToken @@ -69,139 +103,423 @@ CancellationToken cancellationToken internal delegate IReadOnlyList? GetItems(TResponse response); - internal delegate bool? HasNextPage(TResponse response); + internal delegate bool? GetHasNextPage(TResponse response); + + private delegate ( + TRequest? nextRequest, + bool hasNextPage, + Page page + ) ParseApiCallDelegate(TRequest request, TResponse response); - internal OffsetPager( + public Page CurrentPage { get; private set; } + public bool HasNextPage { get; private set; } + + private OffsetPager( + TRequest? request, + TRequestOptions? options, + SendRequest sendRequest, + ParseApiCallDelegate parseApiCall, + Page page, + bool hasNextPage + ) + { + _request = request; + _options = options; + _sendRequest = sendRequest; + _parseApiCall = parseApiCall; + CurrentPage = page; + HasNextPage = hasNextPage; + } + + internal static async Task< + OffsetPager + > CreateInstanceAsync( TRequest request, TRequestOptions? options, - GetNextPage getNextPage, + SendRequest sendRequest, GetOffset getOffset, SetOffset setOffset, GetStep? getStep, GetItems getItems, - HasNextPage? hasNextPage + GetHasNextPage? getHasNextPage, + CancellationToken cancellationToken = default ) { - _request = request; - _options = options; - _getNextPage = getNextPage; - _getOffset = getOffset; - _setOffset = setOffset; - _getStep = getStep; - _getItems = getItems; - _hasNextPage = hasNextPage; + request ??= Activator.CreateInstance(); + var response = await sendRequest(request, options, cancellationToken).ConfigureAwait(false); + var parseApiCall = CreateParseApiCallDelegate( + getItems, + getOffset, + setOffset, + getStep, + getHasNextPage + ); + var (nextRequest, hasNextPage, page) = parseApiCall(request, response); + return new OffsetPager( + nextRequest, + options, + sendRequest, + parseApiCall, + page, + hasNextPage + ); } - public override async IAsyncEnumerable> AsPagesAsync( - [EnumeratorCancellation] CancellationToken cancellationToken = default + private static ParseApiCallDelegate CreateParseApiCallDelegate( + GetItems getItems, + GetOffset getOffset, + SetOffset setOffset, + GetStep? getStep, + GetHasNextPage? getHasNextPage ) { - var hasStep = false; - if (_getStep is not null) + return (request, response) => + ParseApiCall( + request, + response, + getItems, + getOffset, + setOffset, + getStep, + getHasNextPage + ); + } + + private async Task> SendRequestAndHandleResponse( + TRequest request, + TRequestOptions? options, + CancellationToken cancellationToken = default + ) + { + var response = await _sendRequest(request, options, cancellationToken) + .ConfigureAwait(false); + var (nextRequest, hasNextPageFlag, page) = _parseApiCall(request, response); + _request = nextRequest; + HasNextPage = hasNextPageFlag; + CurrentPage = page; + return page; + } + + private static (TRequest? nextRequest, bool hasNextPage, Page page) ParseApiCall( + TRequest request, + TResponse response, + GetItems getItems, + GetOffset getOffset, + SetOffset setOffset, + GetStep? getStep, + GetHasNextPage? getHasNextPage + ) + { + var items = getItems(response); + var page = items is not null ? new Page(items) : Page.Empty; + var offset = getOffset(request); + var hasNextPage = getHasNextPage?.Invoke(response) ?? items?.Count > 0; + if (!hasNextPage) { - hasStep = _getStep(_request) is not null; + return (default, false, page); } - var offset = _getOffset(_request); - var longOffset = Convert.ToInt64(offset); - bool hasNextPage; - do + + switch (offset) { - var response = await _getNextPage(_request, _options, cancellationToken) - .ConfigureAwait(false); - var items = _getItems(response); - var itemCount = items?.Count ?? 0; - hasNextPage = _hasNextPage?.Invoke(response) ?? itemCount > 0; - if (items is not null) + case int offsetInt: { - yield return new Page(items); + if (getStep is not null) + { + offsetInt += items?.Count ?? 1; + } + else + { + offsetInt++; + } + offset = (TOffset)(object)offsetInt; + break; } - - if (hasStep) + case long offsetLong: { - longOffset += items?.Count ?? 1; + if (getStep is not null) + { + offsetLong += items?.Count ?? 1; + } + else + { + offsetLong++; + } + offset = (TOffset)(object)offsetLong; + break; } - else + case float offsetFloat: { - longOffset++; + if (getStep is not null) + { + offsetFloat += items?.Count ?? 1; + } + else + { + offsetFloat++; + } + offset = (TOffset)(object)offsetFloat; + break; } + case double offsetDouble: + { + if (getStep is not null) + { + offsetDouble += items?.Count ?? 1; + } + else + { + offsetDouble++; + } + offset = (TOffset)(object)offsetDouble; + break; + } + case decimal offsetDecimal: + { + if (getStep is not null) + { + offsetDecimal += items?.Count ?? 1; + } + else + { + offsetDecimal++; + } + offset = (TOffset)(object)offsetDecimal; + break; + } + default: + throw new NotSupportedException( + "Offset must be int, long, float, double, or decimal" + ); + } + + setOffset(request, offset); + return (request, hasNextPage, page); + } + + public async Task> GetNextPageAsync(CancellationToken cancellationToken = default) + { + if (_request is null) + { + return Page.Empty; + } - _request ??= Activator.CreateInstance(); - switch (offset) + return await SendRequestAndHandleResponse(_request, _options, cancellationToken) + .ConfigureAwait(false); + } + + public async IAsyncEnumerable> AsPagesAsync( + [EnumeratorCancellation] CancellationToken cancellationToken = default + ) + { + yield return CurrentPage; + while (HasNextPage) + { + yield return await GetNextPageAsync(cancellationToken).ConfigureAwait(false); + } + } + + /// + /// Enumerate the values in the collection asynchronously. This may + /// make multiple service requests. + /// + /// + /// The used for requests made while + /// enumerating asynchronously. + /// + /// An async sequence of values. + public async IAsyncEnumerator GetAsyncEnumerator( + CancellationToken cancellationToken = default + ) + { + await foreach (var page in AsPagesAsync(cancellationToken).ConfigureAwait(false)) + { + foreach (var value in page.Items) { - case int: - _setOffset(_request, (TOffset)(object)(int)longOffset); - break; - case long: - _setOffset(_request, (TOffset)(object)longOffset); - break; - default: - throw new InvalidOperationException("Offset must be int or long"); + yield return value; } - } while (hasNextPage); + } } } internal sealed class CursorPager : Pager { - private TRequest _request; + private TRequest? _request; + private readonly ParseApiCallDelegate _parseApiCall; private readonly TRequestOptions? _options; - private readonly GetNextPage _getNextPage; - private readonly SetCursor _setCursor; - private readonly GetNextCursor _getNextCursor; - private readonly GetItems _getItems; + private readonly SendRequest _sendRequest; - internal delegate Task GetNextPage( + /// + /// Delegate for sending a request. + /// + internal delegate Task SendRequest( TRequest request, TRequestOptions? options, CancellationToken cancellationToken ); - internal delegate void SetCursor(TRequest request, TCursor cursor); + /// + /// Delegate for setting the cursor on a request. + /// + internal delegate void SetCursor(TRequest request, TCursor? cursor); + /// + /// Delegate for getting the next cursor from a response. + /// internal delegate TCursor? GetNextCursor(TResponse response); + /// + /// Delegate for getting the items from a response. + /// internal delegate IReadOnlyList? GetItems(TResponse response); - internal CursorPager( - TRequest request, + private delegate ( + TRequest? nextRequest, + bool hasNextPage, + Page page + ) ParseApiCallDelegate(TRequest request, TResponse response); + + /// + /// The current . + /// + public Page CurrentPage { get; private set; } + + /// + /// Indicates whether there is a next page. + /// + public bool HasNextPage { get; private set; } + + private CursorPager( + TRequest? request, TRequestOptions? options, - GetNextPage getNextPage, - SetCursor setCursor, - GetNextCursor getNextCursor, - GetItems getItems + SendRequest sendRequest, + ParseApiCallDelegate parseApiCall, + Page page, + bool hasNextPage ) { _request = request; _options = options; - _getNextPage = getNextPage; - _setCursor = setCursor; - _getNextCursor = getNextCursor; - _getItems = getItems; + _sendRequest = sendRequest; + _parseApiCall = parseApiCall; + CurrentPage = page; + HasNextPage = hasNextPage; } - public override async IAsyncEnumerable> AsPagesAsync( - [EnumeratorCancellation] CancellationToken cancellationToken = default + /// + /// Create a new instance of . + /// + internal static async Task< + CursorPager + > CreateInstanceAsync( + TRequest? request, + TRequestOptions? options, + SendRequest sendRequest, + SetCursor setCursor, + GetNextCursor getNextCursor, + GetItems getItems, + CancellationToken cancellationToken = default ) { - do + request ??= Activator.CreateInstance(); + var response = await sendRequest(request, options, cancellationToken).ConfigureAwait(false); + var parseApiCall = CreateParseApiCallDelegate(getItems, getNextCursor, setCursor); + var (nextRequest, hasNextPage, page) = parseApiCall(request, response); + return new CursorPager( + nextRequest, + options, + sendRequest, + parseApiCall, + page, + hasNextPage + ); + } + + private static ParseApiCallDelegate CreateParseApiCallDelegate( + GetItems getItems, + GetNextCursor getNextCursor, + SetCursor setCursor + ) + { + return (request, response) => { - var response = await _getNextPage(_request, _options, cancellationToken) - .ConfigureAwait(false); - var items = _getItems(response); - var nextCursor = _getNextCursor(response); - if (items != null) + var items = getItems(response); + var page = items is not null ? new Page(items) : Page.Empty; + var cursor = getNextCursor(response); + var hasNextPage = cursor is not null; + setCursor(request, cursor); + if (cursor is null) { - yield return new Page(items); + return (default, false, page); } - if (nextCursor == null) + return (request, hasNextPage, page); + }; + } + + private async Task> SendRequestAndHandleResponse( + TRequest request, + TRequestOptions? options, + CancellationToken cancellationToken = default + ) + { + var response = await _sendRequest(request, options, cancellationToken) + .ConfigureAwait(false); + var (nextRequest, hasNextPage, page) = _parseApiCall(request, response); + _request = nextRequest; + HasNextPage = hasNextPage; + CurrentPage = page; + return page; + } + + public async Task> GetNextPageAsync(CancellationToken cancellationToken = default) + { + if (_request is null) + { + return Page.Empty; + } + + return await SendRequestAndHandleResponse(_request, _options, cancellationToken) + .ConfigureAwait(false); + } + + /// + /// Enumerate the values a at a time. This may make multiple HTTP requests. + /// + /// + /// + /// An async sequence of s. + /// + public async IAsyncEnumerable> AsPagesAsync( + [EnumeratorCancellation] CancellationToken cancellationToken = default + ) + { + yield return CurrentPage; + while (HasNextPage) + { + yield return await GetNextPageAsync(cancellationToken).ConfigureAwait(false); + } + } + + /// + /// Enumerate the values in the collection asynchronously. This may + /// make multiple service requests. + /// + /// + /// The used for requests made while + /// enumerating asynchronously. + /// + /// An async sequence of s. + public async IAsyncEnumerator GetAsyncEnumerator( + CancellationToken cancellationToken = default + ) + { + await foreach (var page in AsPagesAsync(cancellationToken).ConfigureAwait(false)) + { + foreach (var value in page.Items) { - break; + yield return value; } - - _request ??= Activator.CreateInstance(); - _setCursor(_request, nextCursor); - } while (true); + } } } diff --git a/src/Vapi.Net/Core/Public/ClientOptions.cs b/src/Vapi.Net/Core/Public/ClientOptions.cs index 5b88816..e3d0e1c 100644 --- a/src/Vapi.Net/Core/Public/ClientOptions.cs +++ b/src/Vapi.Net/Core/Public/ClientOptions.cs @@ -1,4 +1,5 @@ using System; +using System.Collections.Generic; using System.Net.Http; using Vapi.Net.Core; @@ -6,30 +7,66 @@ namespace Vapi.Net; public partial class ClientOptions { + /// + /// The http headers sent with the request. + /// + internal Headers Headers { get; init; } = new(); + /// /// The Base URL for the API. /// - public string BaseUrl { get; init; } = VapiClientEnvironment.Default; + public string BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = VapiClientEnvironment.Default; /// /// The http client used to make requests. /// - public HttpClient HttpClient { get; init; } = new HttpClient(); + public HttpClient HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = new HttpClient(); /// - /// The http client used to make requests. + /// Additional headers to be sent with HTTP requests. + /// Headers with matching keys will be overwritten by headers set on the request. /// - public int MaxRetries { get; init; } = 2; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// - /// The timeout for the request. + /// The http client used to make requests. /// - public TimeSpan Timeout { get; init; } = TimeSpan.FromSeconds(30); + public int MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = 2; /// - /// The http headers sent with the request. + /// The timeout for the request. /// - internal Headers Headers { get; init; } = new(); + public TimeSpan Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = TimeSpan.FromSeconds(30); /// /// Clones this and returns a new instance diff --git a/src/Vapi.Net/Core/Public/FileParameter.cs b/src/Vapi.Net/Core/Public/FileParameter.cs new file mode 100644 index 0000000..c1819ef --- /dev/null +++ b/src/Vapi.Net/Core/Public/FileParameter.cs @@ -0,0 +1,63 @@ +namespace Vapi.Net; + +/// +/// File parameter for uploading files. +/// +public record FileParameter : IDisposable +#if NET6_0_OR_GREATER + , IAsyncDisposable +#endif +{ + private bool _disposed; + + /// + /// The name of the file to be uploaded. + /// + public string? FileName { get; set; } + + /// + /// The content type of the file to be uploaded. + /// + public string? ContentType { get; set; } + + /// + /// The content of the file to be uploaded. + /// + public required Stream Stream { get; set; } + + /// + public void Dispose() + { + Dispose(true); + GC.SuppressFinalize(this); + } + + /// + protected virtual void Dispose(bool disposing) + { + if (_disposed) + return; + if (disposing) + { + Stream.Dispose(); + } + + _disposed = true; + } + +#if NET6_0_OR_GREATER + /// + public async ValueTask DisposeAsync() + { + if (!_disposed) + { + await Stream.DisposeAsync().ConfigureAwait(false); + _disposed = true; + } + + GC.SuppressFinalize(this); + } +#endif + + public static implicit operator FileParameter(Stream stream) => new() { Stream = stream }; +} diff --git a/src/Vapi.Net/Core/Public/RequestOptions.cs b/src/Vapi.Net/Core/Public/RequestOptions.cs index a499345..69a534f 100644 --- a/src/Vapi.Net/Core/Public/RequestOptions.cs +++ b/src/Vapi.Net/Core/Public/RequestOptions.cs @@ -1,4 +1,6 @@ using System; +using System.Collections.Generic; +using System.Linq; using System.Net.Http; using Vapi.Net.Core; @@ -6,28 +8,87 @@ namespace Vapi.Net; public partial class RequestOptions : IRequestOptions { + /// + /// The http headers sent with the request. + /// + Headers IRequestOptions.Headers { get; init; } = new(); + /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } + + /// + /// Additional headers to be sent with the request. + /// Headers previously set with matching keys will be overwritten. + /// + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// - /// The http headers sent with the request. + /// Additional query parameters sent with the request. /// - Headers IRequestOptions.Headers { get; init; } = new(); + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = Enumerable.Empty>(); + + /// + /// Additional body properties sent with the request. + /// This is only applied to JSON requests. + /// + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/src/Vapi.Net/Core/Public/Version.cs b/src/Vapi.Net/Core/Public/Version.cs index ad76d19..0852d98 100644 --- a/src/Vapi.Net/Core/Public/Version.cs +++ b/src/Vapi.Net/Core/Public/Version.cs @@ -2,5 +2,5 @@ namespace Vapi.Net; internal class Version { - public const string Current = "0.5.0"; + public const string Current = "0.6.0"; } diff --git a/src/Vapi.Net/Core/QueryStringConverter.cs b/src/Vapi.Net/Core/QueryStringConverter.cs new file mode 100644 index 0000000..95b2260 --- /dev/null +++ b/src/Vapi.Net/Core/QueryStringConverter.cs @@ -0,0 +1,229 @@ +using global::System.Text.Json; + +namespace Vapi.Net.Core; + +/// +/// Converts an object into a query string collection. +/// +internal static class QueryStringConverter +{ + /// + /// Converts an object into a query string collection using Deep Object notation. + /// + /// Object to form URL-encode. You can pass in an object or dictionary, but not lists, strings, or primitives. + /// Throws when passing in a list, a string, or a primitive value. + /// A collection of key value pairs. The keys and values are not URL encoded. + internal static IEnumerable> ToDeepObject(object value) + { + var queryCollection = new List>(); + var json = JsonUtils.SerializeToElement(value); + AssertRootJson(json); + JsonToDeepObject(json, "", queryCollection); + return queryCollection; + } + + /// + /// Converts an object into a query string collection using Exploded Form notation. + /// + /// Object to form URL-encode. You can pass in an object or dictionary, but not lists, strings, or primitives. + /// Throws when passing in a list, a string, or a primitive value. + /// A collection of key value pairs. The keys and values are not URL encoded. + internal static IEnumerable> ToExplodedForm(object value) + { + var queryCollection = new List>(); + var json = JsonUtils.SerializeToElement(value); + AssertRootJson(json); + JsonToFormExploded(json, "", queryCollection); + return queryCollection; + } + + /// + /// Converts an object into a query string collection using Form notation without exploding parameters. + /// + /// Object to form URL-encode. You can pass in an object or dictionary, but not lists, strings, or primitives. + /// Throws when passing in a list, a string, or a primitive value. + /// A collection of key value pairs. The keys and values are not URL encoded. + internal static IEnumerable> ToForm(object value) + { + var queryCollection = new List>(); + var json = JsonUtils.SerializeToElement(value); + AssertRootJson(json); + JsonToForm(json, "", queryCollection); + return queryCollection; + } + + private static void AssertRootJson(JsonElement json) + { + switch (json.ValueKind) + { + case JsonValueKind.Object: + break; + case JsonValueKind.Array: + case JsonValueKind.Undefined: + case JsonValueKind.String: + case JsonValueKind.Number: + case JsonValueKind.True: + case JsonValueKind.False: + case JsonValueKind.Null: + default: + throw new Exception( + $"Only objects can be converted to query string collections. Given type is {json.ValueKind}." + ); + } + } + + private static void JsonToForm( + JsonElement element, + string prefix, + List> parameters + ) + { + switch (element.ValueKind) + { + case JsonValueKind.Object: + foreach (var property in element.EnumerateObject()) + { + var newPrefix = string.IsNullOrEmpty(prefix) + ? property.Name + : $"{prefix}[{property.Name}]"; + + JsonToForm(property.Value, newPrefix, parameters); + } + break; + case JsonValueKind.Array: + var arrayValues = element.EnumerateArray().Select(ValueToString).ToArray(); + parameters.Add( + new KeyValuePair(prefix, string.Join(",", arrayValues)) + ); + break; + case JsonValueKind.Null: + break; + case JsonValueKind.Undefined: + case JsonValueKind.String: + case JsonValueKind.Number: + case JsonValueKind.True: + case JsonValueKind.False: + default: + parameters.Add(new KeyValuePair(prefix, ValueToString(element))); + break; + } + } + + private static void JsonToFormExploded( + JsonElement element, + string prefix, + List> parameters + ) + { + switch (element.ValueKind) + { + case JsonValueKind.Object: + foreach (var property in element.EnumerateObject()) + { + var newPrefix = string.IsNullOrEmpty(prefix) + ? property.Name + : $"{prefix}[{property.Name}]"; + + JsonToFormExploded(property.Value, newPrefix, parameters); + } + + break; + case JsonValueKind.Array: + foreach (var item in element.EnumerateArray()) + { + if ( + item.ValueKind != JsonValueKind.Object + && item.ValueKind != JsonValueKind.Array + ) + { + parameters.Add( + new KeyValuePair(prefix, ValueToString(item)) + ); + } + else + { + JsonToFormExploded(item, prefix, parameters); + } + } + + break; + case JsonValueKind.Null: + break; + case JsonValueKind.Undefined: + case JsonValueKind.String: + case JsonValueKind.Number: + case JsonValueKind.True: + case JsonValueKind.False: + default: + parameters.Add(new KeyValuePair(prefix, ValueToString(element))); + break; + } + } + + private static void JsonToDeepObject( + JsonElement element, + string prefix, + List> parameters + ) + { + switch (element.ValueKind) + { + case JsonValueKind.Object: + foreach (var property in element.EnumerateObject()) + { + var newPrefix = string.IsNullOrEmpty(prefix) + ? property.Name + : $"{prefix}[{property.Name}]"; + + JsonToDeepObject(property.Value, newPrefix, parameters); + } + + break; + case JsonValueKind.Array: + var index = 0; + foreach (var item in element.EnumerateArray()) + { + var newPrefix = $"{prefix}[{index++}]"; + + if ( + item.ValueKind != JsonValueKind.Object + && item.ValueKind != JsonValueKind.Array + ) + { + parameters.Add( + new KeyValuePair(newPrefix, ValueToString(item)) + ); + } + else + { + JsonToDeepObject(item, newPrefix, parameters); + } + } + + break; + case JsonValueKind.Null: + break; + case JsonValueKind.Undefined: + case JsonValueKind.String: + case JsonValueKind.Number: + case JsonValueKind.True: + case JsonValueKind.False: + default: + parameters.Add(new KeyValuePair(prefix, ValueToString(element))); + break; + } + } + + private static string ValueToString(JsonElement element) + { + return element.ValueKind switch + { + JsonValueKind.String => element.GetString() ?? "", + JsonValueKind.Number => element.GetRawText(), + JsonValueKind.True => "true", + JsonValueKind.False => "false", + JsonValueKind.Null => "", + _ => element.GetRawText(), + }; + } +} diff --git a/src/Vapi.Net/Core/RawClient.cs b/src/Vapi.Net/Core/RawClient.cs index ba67dff..a7513d5 100644 --- a/src/Vapi.Net/Core/RawClient.cs +++ b/src/Vapi.Net/Core/RawClient.cs @@ -1,15 +1,14 @@ -using System.Net.Http; -using System.Net.Http.Headers; -using System.Text; -using System.Threading; -using SystemTask = System.Threading.Tasks.Task; +using global::System.Net.Http; +using global::System.Net.Http.Headers; +using global::System.Text; +using SystemTask = global::System.Threading.Tasks.Task; namespace Vapi.Net.Core; /// /// Utility class for making raw HTTP requests to the API. /// -internal class RawClient(ClientOptions clientOptions) +internal partial class RawClient(ClientOptions clientOptions) { private const int MaxRetryDelayMs = 60000; internal int BaseRetryDelay { get; set; } = 1000; @@ -17,10 +16,19 @@ internal class RawClient(ClientOptions clientOptions) /// /// The client options applied on every request. /// - public readonly ClientOptions Options = clientOptions; + internal readonly ClientOptions Options = clientOptions; - public async Task MakeRequestAsync( - BaseApiRequest request, + [Obsolete("Use SendRequestAsync instead.")] + internal Task MakeRequestAsync( + Vapi.Net.Core.BaseRequest request, + CancellationToken cancellationToken = default + ) + { + return SendRequestAsync(request, cancellationToken); + } + + internal async Task SendRequestAsync( + Vapi.Net.Core.BaseRequest request, CancellationToken cancellationToken = default ) { @@ -29,76 +37,118 @@ public async Task MakeRequestAsync( var timeout = request.Options?.Timeout ?? Options.Timeout; cts.CancelAfter(timeout); + var httpRequest = CreateHttpRequest(request); // Send the request. - return await SendWithRetriesAsync(request, cts.Token).ConfigureAwait(false); + return await SendWithRetriesAsync(httpRequest, request.Options, cts.Token) + .ConfigureAwait(false); } - public record BaseApiRequest + internal async Task SendRequestAsync( + HttpRequestMessage request, + IRequestOptions? options, + CancellationToken cancellationToken = default + ) { - public required string BaseUrl { get; init; } - - public required HttpMethod Method { get; init; } - - public required string Path { get; init; } + // Apply the request timeout. + var cts = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken); + var timeout = options?.Timeout ?? Options.Timeout; + cts.CancelAfter(timeout); - public string? ContentType { get; init; } + // Send the request. + return await SendWithRetriesAsync(request, options, cts.Token).ConfigureAwait(false); + } - public Dictionary Query { get; init; } = new(); + private static async Task CloneRequestAsync(HttpRequestMessage request) + { + var clonedRequest = new HttpRequestMessage(request.Method, request.RequestUri); + clonedRequest.Version = request.Version; + switch (request.Content) + { + case MultipartContent oldMultipartFormContent: + var originalBoundary = + oldMultipartFormContent + .Headers.ContentType?.Parameters.First(p => + p.Name.Equals("boundary", StringComparison.OrdinalIgnoreCase) + ) + .Value?.Trim('"') ?? Guid.NewGuid().ToString(); + var newMultipartContent = oldMultipartFormContent switch + { + MultipartFormDataContent => new MultipartFormDataContent(originalBoundary), + _ => new MultipartContent(), + }; + foreach (var content in oldMultipartFormContent) + { + var ms = new MemoryStream(); + await content.CopyToAsync(ms).ConfigureAwait(false); + ms.Position = 0; + var newPart = new StreamContent(ms); + foreach (var header in oldMultipartFormContent.Headers) + { + newPart.Headers.TryAddWithoutValidation(header.Key, header.Value); + } - public Headers Headers { get; init; } = new(); + newMultipartContent.Add(newPart); + } - public IRequestOptions? Options { get; init; } - } + clonedRequest.Content = newMultipartContent; + break; + default: + clonedRequest.Content = request.Content; + break; + } - /// - /// The request object to be sent for streaming uploads. - /// - public record StreamApiRequest : BaseApiRequest - { - public Stream? Body { get; init; } - } + foreach (var header in request.Headers) + { + clonedRequest.Headers.TryAddWithoutValidation(header.Key, header.Value); + } - /// - /// The request object to be sent for JSON APIs. - /// - public record JsonApiRequest : BaseApiRequest - { - public object? Body { get; init; } + return clonedRequest; } /// - /// The response object returned from the API. + /// Sends the request with retries, unless the request content is not retryable, + /// such as stream requests and multipart form data with stream content. /// - public record ApiResponse - { - public required int StatusCode { get; init; } - - public required HttpResponseMessage Raw { get; init; } - } - - private async Task SendWithRetriesAsync( - BaseApiRequest request, + private async Task SendWithRetriesAsync( + HttpRequestMessage request, + IRequestOptions? options, CancellationToken cancellationToken ) { - var httpClient = request.Options?.HttpClient ?? Options.HttpClient; - var maxRetries = request.Options?.MaxRetries ?? Options.MaxRetries; - var response = await httpClient - .SendAsync(BuildHttpRequest(request), cancellationToken) - .ConfigureAwait(false); + var httpClient = options?.HttpClient ?? Options.HttpClient; + var maxRetries = options?.MaxRetries ?? Options.MaxRetries; + var response = await httpClient.SendAsync(request, cancellationToken).ConfigureAwait(false); + var isRetryableContent = IsRetryableContent(request); + + if (!isRetryableContent) + { + return new Vapi.Net.Core.ApiResponse + { + StatusCode = (int)response.StatusCode, + Raw = response, + }; + } + for (var i = 0; i < maxRetries; i++) { if (!ShouldRetry(response)) { break; } + var delayMs = Math.Min(BaseRetryDelay * (int)Math.Pow(2, i), MaxRetryDelayMs); await SystemTask.Delay(delayMs, cancellationToken).ConfigureAwait(false); + using var retryRequest = await CloneRequestAsync(request).ConfigureAwait(false); response = await httpClient - .SendAsync(BuildHttpRequest(request), cancellationToken) + .SendAsync(retryRequest, cancellationToken) .ConfigureAwait(false); } - return new ApiResponse { StatusCode = (int)response.StatusCode, Raw = response }; + + return new Vapi.Net.Core.ApiResponse + { + StatusCode = (int)response.StatusCode, + Raw = response, + }; } private static bool ShouldRetry(HttpResponseMessage response) @@ -107,52 +157,46 @@ private static bool ShouldRetry(HttpResponseMessage response) return statusCode is 408 or 429 or >= 500; } - private HttpRequestMessage BuildHttpRequest(BaseApiRequest request) + private static bool IsRetryableContent(HttpRequestMessage request) + { + return request.Content switch + { + IIsRetryableContent c => c.IsRetryable, + StreamContent => false, + MultipartContent content => !content.Any(c => c is StreamContent), + _ => true, + }; + } + + internal HttpRequestMessage CreateHttpRequest(Vapi.Net.Core.BaseRequest request) { var url = BuildUrl(request); var httpRequest = new HttpRequestMessage(request.Method, url); - switch (request) - { - // Add the request body to the request. - case JsonApiRequest jsonRequest: - { - if (jsonRequest.Body != null) - { - httpRequest.Content = new StringContent( - JsonUtils.Serialize(jsonRequest.Body), - Encoding.UTF8, - "application/json" - ); - } - break; - } - case StreamApiRequest { Body: not null } streamRequest: - httpRequest.Content = new StreamContent(streamRequest.Body); - break; - } - if (request.ContentType != null) - { - httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse( - request.ContentType - ); - } - SetHeaders(httpRequest, Options.Headers); - SetHeaders(httpRequest, request.Headers); - SetHeaders(httpRequest, request.Options?.Headers ?? new Headers()); + httpRequest.Content = request.CreateContent(); + var mergedHeaders = new Dictionary>(); + MergeHeaders(mergedHeaders, Options.Headers); + MergeAdditionalHeaders(mergedHeaders, Options.AdditionalHeaders); + MergeHeaders(mergedHeaders, request.Headers); + MergeHeaders(mergedHeaders, request.Options?.Headers); + MergeAdditionalHeaders(mergedHeaders, request.Options?.AdditionalHeaders ?? []); + SetHeaders(httpRequest, mergedHeaders); return httpRequest; } - private static string BuildUrl(BaseApiRequest request) + private static string BuildUrl(Vapi.Net.Core.BaseRequest request) { var baseUrl = request.Options?.BaseUrl ?? request.BaseUrl; var trimmedBaseUrl = baseUrl.TrimEnd('/'); var trimmedBasePath = request.Path.TrimStart('/'); var url = $"{trimmedBaseUrl}/{trimmedBasePath}"; - if (request.Query.Count <= 0) + + var queryParameters = GetQueryParameters(request); + if (!queryParameters.Any()) return url; + url += "?"; - url = request.Query.Aggregate( + url = queryParameters.Aggregate( url, (current, queryItem) => { @@ -175,6 +219,7 @@ and not string { current += $"{queryItem.Key}={queryItem.Value}&"; } + return current; } ); @@ -182,15 +227,183 @@ and not string return url; } - private static void SetHeaders(HttpRequestMessage httpRequest, Headers headers) + private static List> GetQueryParameters( + Vapi.Net.Core.BaseRequest request + ) { + var result = TransformToKeyValuePairs(request.Query); + if ( + request.Options?.AdditionalQueryParameters is null + || !request.Options.AdditionalQueryParameters.Any() + ) + { + return result; + } + + var additionalKeys = request + .Options.AdditionalQueryParameters.Select(p => p.Key) + .Distinct(); + foreach (var key in additionalKeys) + { + result.RemoveAll(kv => kv.Key == key); + } + + result.AddRange(request.Options.AdditionalQueryParameters); + return result; + } + + private static List> TransformToKeyValuePairs( + Dictionary inputDict + ) + { + var result = new List>(); + foreach (var kvp in inputDict) + { + switch (kvp.Value) + { + case string str: + result.Add(new KeyValuePair(kvp.Key, str)); + break; + case IEnumerable strList: + { + foreach (var value in strList) + { + result.Add(new KeyValuePair(kvp.Key, value)); + } + + break; + } + } + } + + return result; + } + + private static void MergeHeaders( + Dictionary> mergedHeaders, + Headers? headers + ) + { + if (headers is null) + { + return; + } + foreach (var header in headers) { var value = header.Value?.Match(str => str, func => func.Invoke()); if (value != null) { - httpRequest.Headers.TryAddWithoutValidation(header.Key, value); + mergedHeaders[header.Key] = [value]; } } } + + private static void MergeAdditionalHeaders( + Dictionary> mergedHeaders, + IEnumerable>? headers + ) + { + if (headers is null) + { + return; + } + + var usedKeys = new HashSet(); + foreach (var header in headers) + { + if (header.Value is null) + { + mergedHeaders.Remove(header.Key); + usedKeys.Remove(header.Key); + continue; + } + + if (usedKeys.Contains(header.Key)) + { + mergedHeaders[header.Key].Add(header.Value); + } + else + { + mergedHeaders[header.Key] = [header.Value]; + usedKeys.Add(header.Key); + } + } + } + + private void SetHeaders( + HttpRequestMessage httpRequest, + Dictionary> mergedHeaders + ) + { + foreach (var kv in mergedHeaders) + { + foreach (var header in kv.Value) + { + if (header is null) + { + continue; + } + + httpRequest.Headers.TryAddWithoutValidation(kv.Key, header); + } + } + } + + private static (Encoding encoding, string? charset, string mediaType) ParseContentTypeOrDefault( + string? contentType, + Encoding encodingFallback, + string mediaTypeFallback + ) + { + var encoding = encodingFallback; + var mediaType = mediaTypeFallback; + string? charset = null; + if (string.IsNullOrEmpty(contentType)) + { + return (encoding, charset, mediaType); + } + + if (!MediaTypeHeaderValue.TryParse(contentType, out var mediaTypeHeaderValue)) + { + return (encoding, charset, mediaType); + } + + if (!string.IsNullOrEmpty(mediaTypeHeaderValue.CharSet)) + { + charset = mediaTypeHeaderValue.CharSet; + encoding = Encoding.GetEncoding(mediaTypeHeaderValue.CharSet); + } + + if (!string.IsNullOrEmpty(mediaTypeHeaderValue.MediaType)) + { + mediaType = mediaTypeHeaderValue.MediaType; + } + + return (encoding, charset, mediaType); + } + + /// + [Obsolete("Use Vapi.Net.Core.ApiResponse instead.")] + internal record ApiResponse : Vapi.Net.Core.ApiResponse; + + /// + [Obsolete("Use Vapi.Net.Core.BaseRequest instead.")] + internal abstract record BaseApiRequest : Vapi.Net.Core.BaseRequest; + + /// + [Obsolete("Use Vapi.Net.Core.EmptyRequest instead.")] + internal abstract record EmptyApiRequest : Vapi.Net.Core.EmptyRequest; + + /// + [Obsolete("Use Vapi.Net.Core.JsonRequest instead.")] + internal abstract record JsonApiRequest : Vapi.Net.Core.JsonRequest; + + /// + [Obsolete("Use Vapi.Net.Core.MultipartFormRequest instead.")] + internal abstract record MultipartFormRequest : Vapi.Net.Core.MultipartFormRequest; + + /// + [Obsolete("Use Vapi.Net.Core.StreamRequest instead.")] + internal abstract record StreamApiRequest : Vapi.Net.Core.StreamRequest; } diff --git a/src/Vapi.Net/Core/StreamRequest.cs b/src/Vapi.Net/Core/StreamRequest.cs new file mode 100644 index 0000000..23b0b7e --- /dev/null +++ b/src/Vapi.Net/Core/StreamRequest.cs @@ -0,0 +1,29 @@ +using System.Net.Http; +using System.Net.Http.Headers; + +namespace Vapi.Net.Core; + +/// +/// The request object to be sent for streaming uploads. +/// +internal record StreamRequest : BaseRequest +{ + internal Stream? Body { get; init; } + + internal override HttpContent? CreateContent() + { + if (Body is null) + { + return null; + } + + var content = new StreamContent(Body) + { + Headers = + { + ContentType = MediaTypeHeaderValue.Parse(ContentType ?? "application/octet-stream"), + }, + }; + return content; + } +} diff --git a/src/Vapi.Net/Core/ValueConvert.cs b/src/Vapi.Net/Core/ValueConvert.cs new file mode 100644 index 0000000..250e1a0 --- /dev/null +++ b/src/Vapi.Net/Core/ValueConvert.cs @@ -0,0 +1,109 @@ +using global::System.Globalization; + +namespace Vapi.Net.Core; + +/// +/// Convert values to string for path and query parameters. +/// +public static class ValueConvert +{ + internal static string ToPathParameterString(T value) => ToString(value); + + internal static string ToPathParameterString(bool v) => ToString(v); + + internal static string ToPathParameterString(int v) => ToString(v); + + internal static string ToPathParameterString(long v) => ToString(v); + + internal static string ToPathParameterString(float v) => ToString(v); + + internal static string ToPathParameterString(double v) => ToString(v); + + internal static string ToPathParameterString(decimal v) => ToString(v); + + internal static string ToPathParameterString(short v) => ToString(v); + + internal static string ToPathParameterString(ushort v) => ToString(v); + + internal static string ToPathParameterString(uint v) => ToString(v); + + internal static string ToPathParameterString(ulong v) => ToString(v); + + internal static string ToPathParameterString(char v) => ToString(v); + + internal static string ToPathParameterString(Guid v) => ToString(v); + + internal static string ToQueryStringValue(T value) => value is null ? "" : ToString(value); + + internal static string ToQueryStringValue(bool v) => ToString(v); + + internal static string ToQueryStringValue(int v) => ToString(v); + + internal static string ToQueryStringValue(long v) => ToString(v); + + internal static string ToQueryStringValue(float v) => ToString(v); + + internal static string ToQueryStringValue(double v) => ToString(v); + + internal static string ToQueryStringValue(decimal v) => ToString(v); + + internal static string ToQueryStringValue(short v) => ToString(v); + + internal static string ToQueryStringValue(ushort v) => ToString(v); + + internal static string ToQueryStringValue(uint v) => ToString(v); + + internal static string ToQueryStringValue(ulong v) => ToString(v); + + internal static string ToQueryStringValue(char v) => ToString(v); + + internal static string ToQueryStringValue(Guid v) => ToString(v); + + internal static string ToString(T value) + { + return value switch + { + null => "null", + string str => str, + true => "true", + false => "false", + int i => ToString(i), + long l => ToString(l), + float f => ToString(f), + double d => ToString(d), + decimal dec => ToString(dec), + short s => ToString(s), + ushort u => ToString(u), + uint u => ToString(u), + ulong u => ToString(u), + char c => ToString(c), + Guid guid => ToString(guid), + Enum e => JsonUtils.Serialize(e).Trim('"'), + _ => JsonUtils.Serialize(value).Trim('"'), + }; + } + + internal static string ToString(bool v) => v ? "true" : "false"; + + internal static string ToString(int v) => v.ToString(CultureInfo.InvariantCulture); + + internal static string ToString(long v) => v.ToString(CultureInfo.InvariantCulture); + + internal static string ToString(float v) => v.ToString(CultureInfo.InvariantCulture); + + internal static string ToString(double v) => v.ToString(CultureInfo.InvariantCulture); + + internal static string ToString(decimal v) => v.ToString(CultureInfo.InvariantCulture); + + internal static string ToString(short v) => v.ToString(CultureInfo.InvariantCulture); + + internal static string ToString(ushort v) => v.ToString(CultureInfo.InvariantCulture); + + internal static string ToString(uint v) => v.ToString(CultureInfo.InvariantCulture); + + internal static string ToString(ulong v) => v.ToString(CultureInfo.InvariantCulture); + + internal static string ToString(char v) => v.ToString(CultureInfo.InvariantCulture); + + internal static string ToString(Guid v) => v.ToString("D"); +} diff --git a/src/Vapi.Net/Files/FilesClient.cs b/src/Vapi.Net/Files/FilesClient.cs index f550709..8bc4240 100644 --- a/src/Vapi.Net/Files/FilesClient.cs +++ b/src/Vapi.Net/Files/FilesClient.cs @@ -20,8 +20,8 @@ public async Task> ListAsync( ) { var response = await _client - .MakeRequestAsync( - new RawClient.JsonApiRequest + .SendRequestAsync( + new JsonRequest { BaseUrl = _client.Options.BaseUrl, Method = HttpMethod.Get, @@ -31,9 +31,9 @@ public async Task> ListAsync( cancellationToken ) .ConfigureAwait(false); - var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { + var responseBody = await response.Raw.Content.ReadAsStringAsync(); try { return JsonUtils.Deserialize>(responseBody)!; @@ -44,11 +44,14 @@ public async Task> ListAsync( } } - throw new VapiClientApiException( - $"Error with status code {response.StatusCode}", - response.StatusCode, - responseBody - ); + { + var responseBody = await response.Raw.Content.ReadAsStringAsync(); + throw new VapiClientApiException( + $"Error with status code {response.StatusCode}", + response.StatusCode, + responseBody + ); + } } public async Task CreateAsync( @@ -57,21 +60,20 @@ public async Task CreateAsync( CancellationToken cancellationToken = default ) { + var multipartFormRequest_ = new MultipartFormRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Post, + Path = "file", + Options = options, + }; + multipartFormRequest_.AddFileParameterPart("file", request.File); var response = await _client - .MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Post, - Path = "file", - Options = options, - }, - cancellationToken - ) + .SendRequestAsync(multipartFormRequest_, cancellationToken) .ConfigureAwait(false); - var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { + var responseBody = await response.Raw.Content.ReadAsStringAsync(); try { return JsonUtils.Deserialize(responseBody)!; @@ -82,23 +84,26 @@ public async Task CreateAsync( } } - try { - switch (response.StatusCode) + var responseBody = await response.Raw.Content.ReadAsStringAsync(); + try { - case 400: - throw new BadRequestError(JsonUtils.Deserialize(responseBody)); + switch (response.StatusCode) + { + case 400: + throw new BadRequestError(JsonUtils.Deserialize(responseBody)); + } } + catch (JsonException) + { + // unable to map error response, throwing generic error + } + throw new VapiClientApiException( + $"Error with status code {response.StatusCode}", + response.StatusCode, + responseBody + ); } - catch (JsonException) - { - // unable to map error response, throwing generic error - } - throw new VapiClientApiException( - $"Error with status code {response.StatusCode}", - response.StatusCode, - responseBody - ); } public async Task GetAsync( @@ -108,20 +113,20 @@ public async Task GetAsync( ) { var response = await _client - .MakeRequestAsync( - new RawClient.JsonApiRequest + .SendRequestAsync( + new JsonRequest { BaseUrl = _client.Options.BaseUrl, Method = HttpMethod.Get, - Path = $"file/{JsonUtils.SerializeAsString(id)}", + Path = string.Format("file/{0}", ValueConvert.ToPathParameterString(id)), Options = options, }, cancellationToken ) .ConfigureAwait(false); - var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { + var responseBody = await response.Raw.Content.ReadAsStringAsync(); try { return JsonUtils.Deserialize(responseBody)!; @@ -132,11 +137,14 @@ public async Task GetAsync( } } - throw new VapiClientApiException( - $"Error with status code {response.StatusCode}", - response.StatusCode, - responseBody - ); + { + var responseBody = await response.Raw.Content.ReadAsStringAsync(); + throw new VapiClientApiException( + $"Error with status code {response.StatusCode}", + response.StatusCode, + responseBody + ); + } } public async Task DeleteAsync( @@ -146,20 +154,20 @@ public async Task DeleteAsync( ) { var response = await _client - .MakeRequestAsync( - new RawClient.JsonApiRequest + .SendRequestAsync( + new JsonRequest { BaseUrl = _client.Options.BaseUrl, Method = HttpMethod.Delete, - Path = $"file/{JsonUtils.SerializeAsString(id)}", + Path = string.Format("file/{0}", ValueConvert.ToPathParameterString(id)), Options = options, }, cancellationToken ) .ConfigureAwait(false); - var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { + var responseBody = await response.Raw.Content.ReadAsStringAsync(); try { return JsonUtils.Deserialize(responseBody)!; @@ -170,11 +178,14 @@ public async Task DeleteAsync( } } - throw new VapiClientApiException( - $"Error with status code {response.StatusCode}", - response.StatusCode, - responseBody - ); + { + var responseBody = await response.Raw.Content.ReadAsStringAsync(); + throw new VapiClientApiException( + $"Error with status code {response.StatusCode}", + response.StatusCode, + responseBody + ); + } } public async Task UpdateAsync( @@ -185,12 +196,12 @@ public async Task UpdateAsync( ) { var response = await _client - .MakeRequestAsync( - new RawClient.JsonApiRequest + .SendRequestAsync( + new JsonRequest { BaseUrl = _client.Options.BaseUrl, Method = HttpMethodExtensions.Patch, - Path = $"file/{JsonUtils.SerializeAsString(id)}", + Path = string.Format("file/{0}", ValueConvert.ToPathParameterString(id)), Body = request, ContentType = "application/json", Options = options, @@ -198,9 +209,9 @@ public async Task UpdateAsync( cancellationToken ) .ConfigureAwait(false); - var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { + var responseBody = await response.Raw.Content.ReadAsStringAsync(); try { return JsonUtils.Deserialize(responseBody)!; @@ -211,10 +222,13 @@ public async Task UpdateAsync( } } - throw new VapiClientApiException( - $"Error with status code {response.StatusCode}", - response.StatusCode, - responseBody - ); + { + var responseBody = await response.Raw.Content.ReadAsStringAsync(); + throw new VapiClientApiException( + $"Error with status code {response.StatusCode}", + response.StatusCode, + responseBody + ); + } } } diff --git a/src/Vapi.Net/Files/Requests/CreateFileDto.cs b/src/Vapi.Net/Files/Requests/CreateFileDto.cs index e37f688..4378d6f 100644 --- a/src/Vapi.Net/Files/Requests/CreateFileDto.cs +++ b/src/Vapi.Net/Files/Requests/CreateFileDto.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; public record CreateFileDto { + public required FileParameter File { get; set; } + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Files/Requests/UpdateFileDto.cs b/src/Vapi.Net/Files/Requests/UpdateFileDto.cs index 6059e72..d15c930 100644 --- a/src/Vapi.Net/Files/Requests/UpdateFileDto.cs +++ b/src/Vapi.Net/Files/Requests/UpdateFileDto.cs @@ -11,6 +11,7 @@ public record UpdateFileDto [JsonPropertyName("name")] public string? Name { get; set; } + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/KnowledgeBases/KnowledgeBasesClient.cs b/src/Vapi.Net/KnowledgeBases/KnowledgeBasesClient.cs index cbd3915..54a69be 100644 --- a/src/Vapi.Net/KnowledgeBases/KnowledgeBasesClient.cs +++ b/src/Vapi.Net/KnowledgeBases/KnowledgeBasesClient.cs @@ -27,39 +27,39 @@ public async Task> ListAsync( } if (request.CreatedAtGt != null) { - _query["createdAtGt"] = request.CreatedAtGt.Value.ToString(Constants.DateTimeFormat); + _query["createdAtGt"] = request.CreatedAtGt.Value.ToString(); } if (request.CreatedAtLt != null) { - _query["createdAtLt"] = request.CreatedAtLt.Value.ToString(Constants.DateTimeFormat); + _query["createdAtLt"] = request.CreatedAtLt.Value.ToString(); } if (request.CreatedAtGe != null) { - _query["createdAtGe"] = request.CreatedAtGe.Value.ToString(Constants.DateTimeFormat); + _query["createdAtGe"] = request.CreatedAtGe.Value.ToString(); } if (request.CreatedAtLe != null) { - _query["createdAtLe"] = request.CreatedAtLe.Value.ToString(Constants.DateTimeFormat); + _query["createdAtLe"] = request.CreatedAtLe.Value.ToString(); } if (request.UpdatedAtGt != null) { - _query["updatedAtGt"] = request.UpdatedAtGt.Value.ToString(Constants.DateTimeFormat); + _query["updatedAtGt"] = request.UpdatedAtGt.Value.ToString(); } if (request.UpdatedAtLt != null) { - _query["updatedAtLt"] = request.UpdatedAtLt.Value.ToString(Constants.DateTimeFormat); + _query["updatedAtLt"] = request.UpdatedAtLt.Value.ToString(); } if (request.UpdatedAtGe != null) { - _query["updatedAtGe"] = request.UpdatedAtGe.Value.ToString(Constants.DateTimeFormat); + _query["updatedAtGe"] = request.UpdatedAtGe.Value.ToString(); } if (request.UpdatedAtLe != null) { - _query["updatedAtLe"] = request.UpdatedAtLe.Value.ToString(Constants.DateTimeFormat); + _query["updatedAtLe"] = request.UpdatedAtLe.Value.ToString(); } var response = await _client - .MakeRequestAsync( - new RawClient.JsonApiRequest + .SendRequestAsync( + new JsonRequest { BaseUrl = _client.Options.BaseUrl, Method = HttpMethod.Get, @@ -70,9 +70,9 @@ public async Task> ListAsync( cancellationToken ) .ConfigureAwait(false); - var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { + var responseBody = await response.Raw.Content.ReadAsStringAsync(); try { return JsonUtils.Deserialize>(responseBody)!; @@ -83,11 +83,14 @@ public async Task> ListAsync( } } - throw new VapiClientApiException( - $"Error with status code {response.StatusCode}", - response.StatusCode, - responseBody - ); + { + var responseBody = await response.Raw.Content.ReadAsStringAsync(); + throw new VapiClientApiException( + $"Error with status code {response.StatusCode}", + response.StatusCode, + responseBody + ); + } } public async Task CreateAsync( @@ -97,8 +100,8 @@ public async Task CreateAsync( ) { var response = await _client - .MakeRequestAsync( - new RawClient.JsonApiRequest + .SendRequestAsync( + new JsonRequest { BaseUrl = _client.Options.BaseUrl, Method = HttpMethod.Post, @@ -110,9 +113,9 @@ public async Task CreateAsync( cancellationToken ) .ConfigureAwait(false); - var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { + var responseBody = await response.Raw.Content.ReadAsStringAsync(); try { return JsonUtils.Deserialize(responseBody)!; @@ -123,11 +126,14 @@ public async Task CreateAsync( } } - throw new VapiClientApiException( - $"Error with status code {response.StatusCode}", - response.StatusCode, - responseBody - ); + { + var responseBody = await response.Raw.Content.ReadAsStringAsync(); + throw new VapiClientApiException( + $"Error with status code {response.StatusCode}", + response.StatusCode, + responseBody + ); + } } public async Task GetAsync( @@ -137,20 +143,23 @@ public async Task GetAsync( ) { var response = await _client - .MakeRequestAsync( - new RawClient.JsonApiRequest + .SendRequestAsync( + new JsonRequest { BaseUrl = _client.Options.BaseUrl, Method = HttpMethod.Get, - Path = $"knowledge-base/{JsonUtils.SerializeAsString(id)}", + Path = string.Format( + "knowledge-base/{0}", + ValueConvert.ToPathParameterString(id) + ), Options = options, }, cancellationToken ) .ConfigureAwait(false); - var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { + var responseBody = await response.Raw.Content.ReadAsStringAsync(); try { return JsonUtils.Deserialize(responseBody)!; @@ -161,11 +170,14 @@ public async Task GetAsync( } } - throw new VapiClientApiException( - $"Error with status code {response.StatusCode}", - response.StatusCode, - responseBody - ); + { + var responseBody = await response.Raw.Content.ReadAsStringAsync(); + throw new VapiClientApiException( + $"Error with status code {response.StatusCode}", + response.StatusCode, + responseBody + ); + } } public async Task DeleteAsync( @@ -175,20 +187,23 @@ public async Task DeleteAsync( ) { var response = await _client - .MakeRequestAsync( - new RawClient.JsonApiRequest + .SendRequestAsync( + new JsonRequest { BaseUrl = _client.Options.BaseUrl, Method = HttpMethod.Delete, - Path = $"knowledge-base/{JsonUtils.SerializeAsString(id)}", + Path = string.Format( + "knowledge-base/{0}", + ValueConvert.ToPathParameterString(id) + ), Options = options, }, cancellationToken ) .ConfigureAwait(false); - var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { + var responseBody = await response.Raw.Content.ReadAsStringAsync(); try { return JsonUtils.Deserialize(responseBody)!; @@ -199,11 +214,14 @@ public async Task DeleteAsync( } } - throw new VapiClientApiException( - $"Error with status code {response.StatusCode}", - response.StatusCode, - responseBody - ); + { + var responseBody = await response.Raw.Content.ReadAsStringAsync(); + throw new VapiClientApiException( + $"Error with status code {response.StatusCode}", + response.StatusCode, + responseBody + ); + } } public async Task UpdateAsync( @@ -214,12 +232,15 @@ public async Task UpdateAsync( ) { var response = await _client - .MakeRequestAsync( - new RawClient.JsonApiRequest + .SendRequestAsync( + new JsonRequest { BaseUrl = _client.Options.BaseUrl, Method = HttpMethodExtensions.Patch, - Path = $"knowledge-base/{JsonUtils.SerializeAsString(id)}", + Path = string.Format( + "knowledge-base/{0}", + ValueConvert.ToPathParameterString(id) + ), Body = request, ContentType = "application/json", Options = options, @@ -227,9 +248,9 @@ public async Task UpdateAsync( cancellationToken ) .ConfigureAwait(false); - var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { + var responseBody = await response.Raw.Content.ReadAsStringAsync(); try { return JsonUtils.Deserialize(responseBody)!; @@ -240,10 +261,13 @@ public async Task UpdateAsync( } } - throw new VapiClientApiException( - $"Error with status code {response.StatusCode}", - response.StatusCode, - responseBody - ); + { + var responseBody = await response.Raw.Content.ReadAsStringAsync(); + throw new VapiClientApiException( + $"Error with status code {response.StatusCode}", + response.StatusCode, + responseBody + ); + } } } diff --git a/src/Vapi.Net/KnowledgeBases/Requests/KnowledgeBasesListRequest.cs b/src/Vapi.Net/KnowledgeBases/Requests/KnowledgeBasesListRequest.cs index b5d4fc4..380cd9a 100644 --- a/src/Vapi.Net/KnowledgeBases/Requests/KnowledgeBasesListRequest.cs +++ b/src/Vapi.Net/KnowledgeBases/Requests/KnowledgeBasesListRequest.cs @@ -1,3 +1,4 @@ +using System.Text.Json.Serialization; using Vapi.Net.Core; namespace Vapi.Net; @@ -7,48 +8,58 @@ public record KnowledgeBasesListRequest /// /// This is the maximum number of items to return. Defaults to 100. /// + [JsonIgnore] public double? Limit { get; set; } /// /// This will return items where the createdAt is greater than the specified value. /// + [JsonIgnore] public DateTime? CreatedAtGt { get; set; } /// /// This will return items where the createdAt is less than the specified value. /// + [JsonIgnore] public DateTime? CreatedAtLt { get; set; } /// /// This will return items where the createdAt is greater than or equal to the specified value. /// + [JsonIgnore] public DateTime? CreatedAtGe { get; set; } /// /// This will return items where the createdAt is less than or equal to the specified value. /// + [JsonIgnore] public DateTime? CreatedAtLe { get; set; } /// /// This will return items where the updatedAt is greater than the specified value. /// + [JsonIgnore] public DateTime? UpdatedAtGt { get; set; } /// /// This will return items where the updatedAt is less than the specified value. /// + [JsonIgnore] public DateTime? UpdatedAtLt { get; set; } /// /// This will return items where the updatedAt is greater than or equal to the specified value. /// + [JsonIgnore] public DateTime? UpdatedAtGe { get; set; } /// /// This will return items where the updatedAt is less than or equal to the specified value. /// + [JsonIgnore] public DateTime? UpdatedAtLe { get; set; } + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Logs/LogsClient.cs b/src/Vapi.Net/Logs/LogsClient.cs index 191ae41..40a43a6 100644 --- a/src/Vapi.Net/Logs/LogsClient.cs +++ b/src/Vapi.Net/Logs/LogsClient.cs @@ -15,92 +15,7 @@ internal LogsClient(RawClient client) _client = client; } - public Pager GetAsync(LogsGetRequest request, RequestOptions? options = null) - { - if (request is not null) - { - request = request with { }; - } - var pager = new OffsetPager< - LogsGetRequest, - RequestOptions?, - LogsPaginatedResponse, - double?, - object, - Log - >( - request, - options, - GetAsync, - request => request?.Page ?? 0, - (request, offset) => - { - request.Page = offset; - }, - null, - response => response?.Results?.ToList(), - null - ); - return pager; - } - - public async global::System.Threading.Tasks.Task LoggingControllerLogsDeleteQueryAsync( - LoggingControllerLogsDeleteQueryRequest request, - RequestOptions? options = null, - CancellationToken cancellationToken = default - ) - { - var _query = new Dictionary(); - if (request.Type != null) - { - _query["type"] = request.Type.Value.Stringify(); - } - if (request.AssistantId != null) - { - _query["assistantId"] = request.AssistantId; - } - if (request.PhoneNumberId != null) - { - _query["phoneNumberId"] = request.PhoneNumberId; - } - if (request.CustomerId != null) - { - _query["customerId"] = request.CustomerId; - } - if (request.SquadId != null) - { - _query["squadId"] = request.SquadId; - } - if (request.CallId != null) - { - _query["callId"] = request.CallId; - } - var response = await _client - .MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Delete, - Path = "logs", - Query = _query, - Options = options, - }, - cancellationToken - ) - .ConfigureAwait(false); - if (response.StatusCode is >= 200 and < 400) - { - return; - } - var responseBody = await response.Raw.Content.ReadAsStringAsync(); - throw new VapiClientApiException( - $"Error with status code {response.StatusCode}", - response.StatusCode, - responseBody - ); - } - - private async Task GetAsync( + private async Task GetInternalAsync( LogsGetRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -109,7 +24,7 @@ private async Task GetAsync( var _query = new Dictionary(); if (request.Type != null) { - _query["type"] = request.Type.Value.Stringify(); + _query["type"] = request.Type.Value.ToString(); } if (request.WebhookType != null) { @@ -141,7 +56,7 @@ private async Task GetAsync( } if (request.SortOrder != null) { - _query["sortOrder"] = request.SortOrder.Value.Stringify(); + _query["sortOrder"] = request.SortOrder.Value.ToString(); } if (request.Limit != null) { @@ -149,39 +64,39 @@ private async Task GetAsync( } if (request.CreatedAtGt != null) { - _query["createdAtGt"] = request.CreatedAtGt.Value.ToString(Constants.DateTimeFormat); + _query["createdAtGt"] = request.CreatedAtGt.Value.ToString(); } if (request.CreatedAtLt != null) { - _query["createdAtLt"] = request.CreatedAtLt.Value.ToString(Constants.DateTimeFormat); + _query["createdAtLt"] = request.CreatedAtLt.Value.ToString(); } if (request.CreatedAtGe != null) { - _query["createdAtGe"] = request.CreatedAtGe.Value.ToString(Constants.DateTimeFormat); + _query["createdAtGe"] = request.CreatedAtGe.Value.ToString(); } if (request.CreatedAtLe != null) { - _query["createdAtLe"] = request.CreatedAtLe.Value.ToString(Constants.DateTimeFormat); + _query["createdAtLe"] = request.CreatedAtLe.Value.ToString(); } if (request.UpdatedAtGt != null) { - _query["updatedAtGt"] = request.UpdatedAtGt.Value.ToString(Constants.DateTimeFormat); + _query["updatedAtGt"] = request.UpdatedAtGt.Value.ToString(); } if (request.UpdatedAtLt != null) { - _query["updatedAtLt"] = request.UpdatedAtLt.Value.ToString(Constants.DateTimeFormat); + _query["updatedAtLt"] = request.UpdatedAtLt.Value.ToString(); } if (request.UpdatedAtGe != null) { - _query["updatedAtGe"] = request.UpdatedAtGe.Value.ToString(Constants.DateTimeFormat); + _query["updatedAtGe"] = request.UpdatedAtGe.Value.ToString(); } if (request.UpdatedAtLe != null) { - _query["updatedAtLe"] = request.UpdatedAtLe.Value.ToString(Constants.DateTimeFormat); + _query["updatedAtLe"] = request.UpdatedAtLe.Value.ToString(); } var response = await _client - .MakeRequestAsync( - new RawClient.JsonApiRequest + .SendRequestAsync( + new JsonRequest { BaseUrl = _client.Options.BaseUrl, Method = HttpMethod.Get, @@ -192,9 +107,9 @@ private async Task GetAsync( cancellationToken ) .ConfigureAwait(false); - var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { + var responseBody = await response.Raw.Content.ReadAsStringAsync(); try { return JsonUtils.Deserialize(responseBody)!; @@ -205,10 +120,107 @@ private async Task GetAsync( } } - throw new VapiClientApiException( - $"Error with status code {response.StatusCode}", - response.StatusCode, - responseBody - ); + { + var responseBody = await response.Raw.Content.ReadAsStringAsync(); + throw new VapiClientApiException( + $"Error with status code {response.StatusCode}", + response.StatusCode, + responseBody + ); + } + } + + public async Task> GetAsync( + LogsGetRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + if (request is not null) + { + request = request with { }; + } + var pager = await OffsetPager< + LogsGetRequest, + RequestOptions?, + LogsPaginatedResponse, + double?, + object, + Log + > + .CreateInstanceAsync( + request, + options, + GetInternalAsync, + request => request?.Page ?? 0, + (request, offset) => + { + request.Page = offset; + }, + null, + response => response?.Results?.ToList(), + null, + cancellationToken + ) + .ConfigureAwait(false); + return pager; + } + + public async global::System.Threading.Tasks.Task LoggingControllerLogsDeleteQueryAsync( + LoggingControllerLogsDeleteQueryRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + var _query = new Dictionary(); + if (request.Type != null) + { + _query["type"] = request.Type.Value.ToString(); + } + if (request.AssistantId != null) + { + _query["assistantId"] = request.AssistantId; + } + if (request.PhoneNumberId != null) + { + _query["phoneNumberId"] = request.PhoneNumberId; + } + if (request.CustomerId != null) + { + _query["customerId"] = request.CustomerId; + } + if (request.SquadId != null) + { + _query["squadId"] = request.SquadId; + } + if (request.CallId != null) + { + _query["callId"] = request.CallId; + } + var response = await _client + .SendRequestAsync( + new JsonRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Delete, + Path = "logs", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); + if (response.StatusCode is >= 200 and < 400) + { + return; + } + { + var responseBody = await response.Raw.Content.ReadAsStringAsync(); + throw new VapiClientApiException( + $"Error with status code {response.StatusCode}", + response.StatusCode, + responseBody + ); + } } } diff --git a/src/Vapi.Net/Logs/Requests/LoggingControllerLogsDeleteQueryRequest.cs b/src/Vapi.Net/Logs/Requests/LoggingControllerLogsDeleteQueryRequest.cs index d56e08c..611e0d9 100644 --- a/src/Vapi.Net/Logs/Requests/LoggingControllerLogsDeleteQueryRequest.cs +++ b/src/Vapi.Net/Logs/Requests/LoggingControllerLogsDeleteQueryRequest.cs @@ -1,3 +1,4 @@ +using System.Text.Json.Serialization; using Vapi.Net.Core; namespace Vapi.Net; @@ -7,30 +8,37 @@ public record LoggingControllerLogsDeleteQueryRequest /// /// This is the type of the log. /// + [JsonIgnore] public LoggingControllerLogsDeleteQueryRequestType? Type { get; set; } + [JsonIgnore] public string? AssistantId { get; set; } /// /// This is the ID of the phone number. /// + [JsonIgnore] public string? PhoneNumberId { get; set; } /// /// This is the ID of the customer. /// + [JsonIgnore] public string? CustomerId { get; set; } /// /// This is the ID of the squad. /// + [JsonIgnore] public string? SquadId { get; set; } /// /// This is the ID of the call. /// + [JsonIgnore] public string? CallId { get; set; } + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Logs/Requests/LogsGetRequest.cs b/src/Vapi.Net/Logs/Requests/LogsGetRequest.cs index 7682f75..f522fe2 100644 --- a/src/Vapi.Net/Logs/Requests/LogsGetRequest.cs +++ b/src/Vapi.Net/Logs/Requests/LogsGetRequest.cs @@ -1,3 +1,4 @@ +using System.Text.Json.Serialization; using Vapi.Net.Core; namespace Vapi.Net; @@ -7,93 +8,112 @@ public record LogsGetRequest /// /// This is the type of the log. /// + [JsonIgnore] public LogsGetRequestType? Type { get; set; } /// /// This is the type of the webhook, given the log is from a webhook. /// + [JsonIgnore] public string? WebhookType { get; set; } /// /// This is the ID of the assistant. /// + [JsonIgnore] public string? AssistantId { get; set; } /// /// This is the ID of the phone number. /// + [JsonIgnore] public string? PhoneNumberId { get; set; } /// /// This is the ID of the customer. /// + [JsonIgnore] public string? CustomerId { get; set; } /// /// This is the ID of the squad. /// + [JsonIgnore] public string? SquadId { get; set; } /// /// This is the ID of the call. /// + [JsonIgnore] public string? CallId { get; set; } /// /// This is the page number to return. Defaults to 1. /// + [JsonIgnore] public double? Page { get; set; } /// /// This is the sort order for pagination. Defaults to 'DESC'. /// + [JsonIgnore] public LogsGetRequestSortOrder? SortOrder { get; set; } /// /// This is the maximum number of items to return. Defaults to 100. /// + [JsonIgnore] public double? Limit { get; set; } /// /// This will return items where the createdAt is greater than the specified value. /// + [JsonIgnore] public DateTime? CreatedAtGt { get; set; } /// /// This will return items where the createdAt is less than the specified value. /// + [JsonIgnore] public DateTime? CreatedAtLt { get; set; } /// /// This will return items where the createdAt is greater than or equal to the specified value. /// + [JsonIgnore] public DateTime? CreatedAtGe { get; set; } /// /// This will return items where the createdAt is less than or equal to the specified value. /// + [JsonIgnore] public DateTime? CreatedAtLe { get; set; } /// /// This will return items where the updatedAt is greater than the specified value. /// + [JsonIgnore] public DateTime? UpdatedAtGt { get; set; } /// /// This will return items where the updatedAt is less than the specified value. /// + [JsonIgnore] public DateTime? UpdatedAtLt { get; set; } /// /// This will return items where the updatedAt is greater than or equal to the specified value. /// + [JsonIgnore] public DateTime? UpdatedAtGe { get; set; } /// /// This will return items where the updatedAt is less than or equal to the specified value. /// + [JsonIgnore] public DateTime? UpdatedAtLe { get; set; } + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/PhoneNumbers/PhoneNumbersClient.cs b/src/Vapi.Net/PhoneNumbers/PhoneNumbersClient.cs index 5e3d4e7..2412fca 100644 --- a/src/Vapi.Net/PhoneNumbers/PhoneNumbersClient.cs +++ b/src/Vapi.Net/PhoneNumbers/PhoneNumbersClient.cs @@ -27,39 +27,39 @@ public async Task> ListAsync( } if (request.CreatedAtGt != null) { - _query["createdAtGt"] = request.CreatedAtGt.Value.ToString(Constants.DateTimeFormat); + _query["createdAtGt"] = request.CreatedAtGt.Value.ToString(); } if (request.CreatedAtLt != null) { - _query["createdAtLt"] = request.CreatedAtLt.Value.ToString(Constants.DateTimeFormat); + _query["createdAtLt"] = request.CreatedAtLt.Value.ToString(); } if (request.CreatedAtGe != null) { - _query["createdAtGe"] = request.CreatedAtGe.Value.ToString(Constants.DateTimeFormat); + _query["createdAtGe"] = request.CreatedAtGe.Value.ToString(); } if (request.CreatedAtLe != null) { - _query["createdAtLe"] = request.CreatedAtLe.Value.ToString(Constants.DateTimeFormat); + _query["createdAtLe"] = request.CreatedAtLe.Value.ToString(); } if (request.UpdatedAtGt != null) { - _query["updatedAtGt"] = request.UpdatedAtGt.Value.ToString(Constants.DateTimeFormat); + _query["updatedAtGt"] = request.UpdatedAtGt.Value.ToString(); } if (request.UpdatedAtLt != null) { - _query["updatedAtLt"] = request.UpdatedAtLt.Value.ToString(Constants.DateTimeFormat); + _query["updatedAtLt"] = request.UpdatedAtLt.Value.ToString(); } if (request.UpdatedAtGe != null) { - _query["updatedAtGe"] = request.UpdatedAtGe.Value.ToString(Constants.DateTimeFormat); + _query["updatedAtGe"] = request.UpdatedAtGe.Value.ToString(); } if (request.UpdatedAtLe != null) { - _query["updatedAtLe"] = request.UpdatedAtLe.Value.ToString(Constants.DateTimeFormat); + _query["updatedAtLe"] = request.UpdatedAtLe.Value.ToString(); } var response = await _client - .MakeRequestAsync( - new RawClient.JsonApiRequest + .SendRequestAsync( + new JsonRequest { BaseUrl = _client.Options.BaseUrl, Method = HttpMethod.Get, @@ -70,9 +70,9 @@ public async Task> ListAsync( cancellationToken ) .ConfigureAwait(false); - var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { + var responseBody = await response.Raw.Content.ReadAsStringAsync(); try { return JsonUtils.Deserialize>(responseBody)!; @@ -83,11 +83,14 @@ public async Task> ListAsync( } } - throw new VapiClientApiException( - $"Error with status code {response.StatusCode}", - response.StatusCode, - responseBody - ); + { + var responseBody = await response.Raw.Content.ReadAsStringAsync(); + throw new VapiClientApiException( + $"Error with status code {response.StatusCode}", + response.StatusCode, + responseBody + ); + } } public async Task CreateAsync( @@ -97,8 +100,8 @@ public async Task CreateAsync( ) { var response = await _client - .MakeRequestAsync( - new RawClient.JsonApiRequest + .SendRequestAsync( + new JsonRequest { BaseUrl = _client.Options.BaseUrl, Method = HttpMethod.Post, @@ -110,9 +113,9 @@ public async Task CreateAsync( cancellationToken ) .ConfigureAwait(false); - var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { + var responseBody = await response.Raw.Content.ReadAsStringAsync(); try { return JsonUtils.Deserialize(responseBody)!; @@ -123,11 +126,14 @@ public async Task CreateAsync( } } - throw new VapiClientApiException( - $"Error with status code {response.StatusCode}", - response.StatusCode, - responseBody - ); + { + var responseBody = await response.Raw.Content.ReadAsStringAsync(); + throw new VapiClientApiException( + $"Error with status code {response.StatusCode}", + response.StatusCode, + responseBody + ); + } } public async Task GetAsync( @@ -137,20 +143,23 @@ public async Task GetAsync( ) { var response = await _client - .MakeRequestAsync( - new RawClient.JsonApiRequest + .SendRequestAsync( + new JsonRequest { BaseUrl = _client.Options.BaseUrl, Method = HttpMethod.Get, - Path = $"phone-number/{JsonUtils.SerializeAsString(id)}", + Path = string.Format( + "phone-number/{0}", + ValueConvert.ToPathParameterString(id) + ), Options = options, }, cancellationToken ) .ConfigureAwait(false); - var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { + var responseBody = await response.Raw.Content.ReadAsStringAsync(); try { return JsonUtils.Deserialize(responseBody)!; @@ -161,11 +170,14 @@ public async Task GetAsync( } } - throw new VapiClientApiException( - $"Error with status code {response.StatusCode}", - response.StatusCode, - responseBody - ); + { + var responseBody = await response.Raw.Content.ReadAsStringAsync(); + throw new VapiClientApiException( + $"Error with status code {response.StatusCode}", + response.StatusCode, + responseBody + ); + } } public async Task DeleteAsync( @@ -175,20 +187,23 @@ public async Task DeleteAsync( ) { var response = await _client - .MakeRequestAsync( - new RawClient.JsonApiRequest + .SendRequestAsync( + new JsonRequest { BaseUrl = _client.Options.BaseUrl, Method = HttpMethod.Delete, - Path = $"phone-number/{JsonUtils.SerializeAsString(id)}", + Path = string.Format( + "phone-number/{0}", + ValueConvert.ToPathParameterString(id) + ), Options = options, }, cancellationToken ) .ConfigureAwait(false); - var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { + var responseBody = await response.Raw.Content.ReadAsStringAsync(); try { return JsonUtils.Deserialize(responseBody)!; @@ -199,11 +214,14 @@ public async Task DeleteAsync( } } - throw new VapiClientApiException( - $"Error with status code {response.StatusCode}", - response.StatusCode, - responseBody - ); + { + var responseBody = await response.Raw.Content.ReadAsStringAsync(); + throw new VapiClientApiException( + $"Error with status code {response.StatusCode}", + response.StatusCode, + responseBody + ); + } } public async Task UpdateAsync( @@ -214,12 +232,15 @@ public async Task UpdateAsync( ) { var response = await _client - .MakeRequestAsync( - new RawClient.JsonApiRequest + .SendRequestAsync( + new JsonRequest { BaseUrl = _client.Options.BaseUrl, Method = HttpMethodExtensions.Patch, - Path = $"phone-number/{JsonUtils.SerializeAsString(id)}", + Path = string.Format( + "phone-number/{0}", + ValueConvert.ToPathParameterString(id) + ), Body = request, ContentType = "application/json", Options = options, @@ -227,9 +248,9 @@ public async Task UpdateAsync( cancellationToken ) .ConfigureAwait(false); - var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { + var responseBody = await response.Raw.Content.ReadAsStringAsync(); try { return JsonUtils.Deserialize(responseBody)!; @@ -240,10 +261,13 @@ public async Task UpdateAsync( } } - throw new VapiClientApiException( - $"Error with status code {response.StatusCode}", - response.StatusCode, - responseBody - ); + { + var responseBody = await response.Raw.Content.ReadAsStringAsync(); + throw new VapiClientApiException( + $"Error with status code {response.StatusCode}", + response.StatusCode, + responseBody + ); + } } } diff --git a/src/Vapi.Net/PhoneNumbers/Requests/PhoneNumbersListRequest.cs b/src/Vapi.Net/PhoneNumbers/Requests/PhoneNumbersListRequest.cs index 6d3cc6f..2b4998e 100644 --- a/src/Vapi.Net/PhoneNumbers/Requests/PhoneNumbersListRequest.cs +++ b/src/Vapi.Net/PhoneNumbers/Requests/PhoneNumbersListRequest.cs @@ -1,3 +1,4 @@ +using System.Text.Json.Serialization; using Vapi.Net.Core; namespace Vapi.Net; @@ -7,48 +8,58 @@ public record PhoneNumbersListRequest /// /// This is the maximum number of items to return. Defaults to 100. /// + [JsonIgnore] public double? Limit { get; set; } /// /// This will return items where the createdAt is greater than the specified value. /// + [JsonIgnore] public DateTime? CreatedAtGt { get; set; } /// /// This will return items where the createdAt is less than the specified value. /// + [JsonIgnore] public DateTime? CreatedAtLt { get; set; } /// /// This will return items where the createdAt is greater than or equal to the specified value. /// + [JsonIgnore] public DateTime? CreatedAtGe { get; set; } /// /// This will return items where the createdAt is less than or equal to the specified value. /// + [JsonIgnore] public DateTime? CreatedAtLe { get; set; } /// /// This will return items where the updatedAt is greater than the specified value. /// + [JsonIgnore] public DateTime? UpdatedAtGt { get; set; } /// /// This will return items where the updatedAt is less than the specified value. /// + [JsonIgnore] public DateTime? UpdatedAtLt { get; set; } /// /// This will return items where the updatedAt is greater than or equal to the specified value. /// + [JsonIgnore] public DateTime? UpdatedAtGe { get; set; } /// /// This will return items where the updatedAt is less than or equal to the specified value. /// + [JsonIgnore] public DateTime? UpdatedAtLe { get; set; } + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Squads/Requests/SquadsListRequest.cs b/src/Vapi.Net/Squads/Requests/SquadsListRequest.cs index 0a5c233..ab8837a 100644 --- a/src/Vapi.Net/Squads/Requests/SquadsListRequest.cs +++ b/src/Vapi.Net/Squads/Requests/SquadsListRequest.cs @@ -1,3 +1,4 @@ +using System.Text.Json.Serialization; using Vapi.Net.Core; namespace Vapi.Net; @@ -7,48 +8,58 @@ public record SquadsListRequest /// /// This is the maximum number of items to return. Defaults to 100. /// + [JsonIgnore] public double? Limit { get; set; } /// /// This will return items where the createdAt is greater than the specified value. /// + [JsonIgnore] public DateTime? CreatedAtGt { get; set; } /// /// This will return items where the createdAt is less than the specified value. /// + [JsonIgnore] public DateTime? CreatedAtLt { get; set; } /// /// This will return items where the createdAt is greater than or equal to the specified value. /// + [JsonIgnore] public DateTime? CreatedAtGe { get; set; } /// /// This will return items where the createdAt is less than or equal to the specified value. /// + [JsonIgnore] public DateTime? CreatedAtLe { get; set; } /// /// This will return items where the updatedAt is greater than the specified value. /// + [JsonIgnore] public DateTime? UpdatedAtGt { get; set; } /// /// This will return items where the updatedAt is less than the specified value. /// + [JsonIgnore] public DateTime? UpdatedAtLt { get; set; } /// /// This will return items where the updatedAt is greater than or equal to the specified value. /// + [JsonIgnore] public DateTime? UpdatedAtGe { get; set; } /// /// This will return items where the updatedAt is less than or equal to the specified value. /// + [JsonIgnore] public DateTime? UpdatedAtLe { get; set; } + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Squads/Requests/UpdateSquadDto.cs b/src/Vapi.Net/Squads/Requests/UpdateSquadDto.cs index dad0248..b93db7f 100644 --- a/src/Vapi.Net/Squads/Requests/UpdateSquadDto.cs +++ b/src/Vapi.Net/Squads/Requests/UpdateSquadDto.cs @@ -27,6 +27,7 @@ public record UpdateSquadDto [JsonPropertyName("membersOverrides")] public AssistantOverrides? MembersOverrides { get; set; } + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Squads/SquadsClient.cs b/src/Vapi.Net/Squads/SquadsClient.cs index b66a664..4da20cc 100644 --- a/src/Vapi.Net/Squads/SquadsClient.cs +++ b/src/Vapi.Net/Squads/SquadsClient.cs @@ -27,39 +27,39 @@ public async Task> ListAsync( } if (request.CreatedAtGt != null) { - _query["createdAtGt"] = request.CreatedAtGt.Value.ToString(Constants.DateTimeFormat); + _query["createdAtGt"] = request.CreatedAtGt.Value.ToString(); } if (request.CreatedAtLt != null) { - _query["createdAtLt"] = request.CreatedAtLt.Value.ToString(Constants.DateTimeFormat); + _query["createdAtLt"] = request.CreatedAtLt.Value.ToString(); } if (request.CreatedAtGe != null) { - _query["createdAtGe"] = request.CreatedAtGe.Value.ToString(Constants.DateTimeFormat); + _query["createdAtGe"] = request.CreatedAtGe.Value.ToString(); } if (request.CreatedAtLe != null) { - _query["createdAtLe"] = request.CreatedAtLe.Value.ToString(Constants.DateTimeFormat); + _query["createdAtLe"] = request.CreatedAtLe.Value.ToString(); } if (request.UpdatedAtGt != null) { - _query["updatedAtGt"] = request.UpdatedAtGt.Value.ToString(Constants.DateTimeFormat); + _query["updatedAtGt"] = request.UpdatedAtGt.Value.ToString(); } if (request.UpdatedAtLt != null) { - _query["updatedAtLt"] = request.UpdatedAtLt.Value.ToString(Constants.DateTimeFormat); + _query["updatedAtLt"] = request.UpdatedAtLt.Value.ToString(); } if (request.UpdatedAtGe != null) { - _query["updatedAtGe"] = request.UpdatedAtGe.Value.ToString(Constants.DateTimeFormat); + _query["updatedAtGe"] = request.UpdatedAtGe.Value.ToString(); } if (request.UpdatedAtLe != null) { - _query["updatedAtLe"] = request.UpdatedAtLe.Value.ToString(Constants.DateTimeFormat); + _query["updatedAtLe"] = request.UpdatedAtLe.Value.ToString(); } var response = await _client - .MakeRequestAsync( - new RawClient.JsonApiRequest + .SendRequestAsync( + new JsonRequest { BaseUrl = _client.Options.BaseUrl, Method = HttpMethod.Get, @@ -70,9 +70,9 @@ public async Task> ListAsync( cancellationToken ) .ConfigureAwait(false); - var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { + var responseBody = await response.Raw.Content.ReadAsStringAsync(); try { return JsonUtils.Deserialize>(responseBody)!; @@ -83,11 +83,14 @@ public async Task> ListAsync( } } - throw new VapiClientApiException( - $"Error with status code {response.StatusCode}", - response.StatusCode, - responseBody - ); + { + var responseBody = await response.Raw.Content.ReadAsStringAsync(); + throw new VapiClientApiException( + $"Error with status code {response.StatusCode}", + response.StatusCode, + responseBody + ); + } } public async Task CreateAsync( @@ -97,8 +100,8 @@ public async Task CreateAsync( ) { var response = await _client - .MakeRequestAsync( - new RawClient.JsonApiRequest + .SendRequestAsync( + new JsonRequest { BaseUrl = _client.Options.BaseUrl, Method = HttpMethod.Post, @@ -110,9 +113,9 @@ public async Task CreateAsync( cancellationToken ) .ConfigureAwait(false); - var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { + var responseBody = await response.Raw.Content.ReadAsStringAsync(); try { return JsonUtils.Deserialize(responseBody)!; @@ -123,11 +126,14 @@ public async Task CreateAsync( } } - throw new VapiClientApiException( - $"Error with status code {response.StatusCode}", - response.StatusCode, - responseBody - ); + { + var responseBody = await response.Raw.Content.ReadAsStringAsync(); + throw new VapiClientApiException( + $"Error with status code {response.StatusCode}", + response.StatusCode, + responseBody + ); + } } public async Task GetAsync( @@ -137,20 +143,20 @@ public async Task GetAsync( ) { var response = await _client - .MakeRequestAsync( - new RawClient.JsonApiRequest + .SendRequestAsync( + new JsonRequest { BaseUrl = _client.Options.BaseUrl, Method = HttpMethod.Get, - Path = $"squad/{JsonUtils.SerializeAsString(id)}", + Path = string.Format("squad/{0}", ValueConvert.ToPathParameterString(id)), Options = options, }, cancellationToken ) .ConfigureAwait(false); - var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { + var responseBody = await response.Raw.Content.ReadAsStringAsync(); try { return JsonUtils.Deserialize(responseBody)!; @@ -161,11 +167,14 @@ public async Task GetAsync( } } - throw new VapiClientApiException( - $"Error with status code {response.StatusCode}", - response.StatusCode, - responseBody - ); + { + var responseBody = await response.Raw.Content.ReadAsStringAsync(); + throw new VapiClientApiException( + $"Error with status code {response.StatusCode}", + response.StatusCode, + responseBody + ); + } } public async Task DeleteAsync( @@ -175,20 +184,20 @@ public async Task DeleteAsync( ) { var response = await _client - .MakeRequestAsync( - new RawClient.JsonApiRequest + .SendRequestAsync( + new JsonRequest { BaseUrl = _client.Options.BaseUrl, Method = HttpMethod.Delete, - Path = $"squad/{JsonUtils.SerializeAsString(id)}", + Path = string.Format("squad/{0}", ValueConvert.ToPathParameterString(id)), Options = options, }, cancellationToken ) .ConfigureAwait(false); - var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { + var responseBody = await response.Raw.Content.ReadAsStringAsync(); try { return JsonUtils.Deserialize(responseBody)!; @@ -199,11 +208,14 @@ public async Task DeleteAsync( } } - throw new VapiClientApiException( - $"Error with status code {response.StatusCode}", - response.StatusCode, - responseBody - ); + { + var responseBody = await response.Raw.Content.ReadAsStringAsync(); + throw new VapiClientApiException( + $"Error with status code {response.StatusCode}", + response.StatusCode, + responseBody + ); + } } public async Task UpdateAsync( @@ -214,12 +226,12 @@ public async Task UpdateAsync( ) { var response = await _client - .MakeRequestAsync( - new RawClient.JsonApiRequest + .SendRequestAsync( + new JsonRequest { BaseUrl = _client.Options.BaseUrl, Method = HttpMethodExtensions.Patch, - Path = $"squad/{JsonUtils.SerializeAsString(id)}", + Path = string.Format("squad/{0}", ValueConvert.ToPathParameterString(id)), Body = request, ContentType = "application/json", Options = options, @@ -227,9 +239,9 @@ public async Task UpdateAsync( cancellationToken ) .ConfigureAwait(false); - var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { + var responseBody = await response.Raw.Content.ReadAsStringAsync(); try { return JsonUtils.Deserialize(responseBody)!; @@ -240,10 +252,13 @@ public async Task UpdateAsync( } } - throw new VapiClientApiException( - $"Error with status code {response.StatusCode}", - response.StatusCode, - responseBody - ); + { + var responseBody = await response.Raw.Content.ReadAsStringAsync(); + throw new VapiClientApiException( + $"Error with status code {response.StatusCode}", + response.StatusCode, + responseBody + ); + } } } diff --git a/src/Vapi.Net/TestSuiteRuns/Requests/CreateTestSuiteRunDto.cs b/src/Vapi.Net/TestSuiteRuns/Requests/CreateTestSuiteRunDto.cs index 7d99d58..db5b091 100644 --- a/src/Vapi.Net/TestSuiteRuns/Requests/CreateTestSuiteRunDto.cs +++ b/src/Vapi.Net/TestSuiteRuns/Requests/CreateTestSuiteRunDto.cs @@ -11,6 +11,7 @@ public record CreateTestSuiteRunDto [JsonPropertyName("name")] public string? Name { get; set; } + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/TestSuiteRuns/Requests/TestSuiteRunControllerFindAllPaginatedRequest.cs b/src/Vapi.Net/TestSuiteRuns/Requests/TestSuiteRunControllerFindAllPaginatedRequest.cs index 1cbe3f4..b605c62 100644 --- a/src/Vapi.Net/TestSuiteRuns/Requests/TestSuiteRunControllerFindAllPaginatedRequest.cs +++ b/src/Vapi.Net/TestSuiteRuns/Requests/TestSuiteRunControllerFindAllPaginatedRequest.cs @@ -1,3 +1,4 @@ +using System.Text.Json.Serialization; using Vapi.Net.Core; namespace Vapi.Net; @@ -7,58 +8,70 @@ public record TestSuiteRunControllerFindAllPaginatedRequest /// /// This is the page number to return. Defaults to 1. /// + [JsonIgnore] public double? Page { get; set; } /// /// This is the sort order for pagination. Defaults to 'DESC'. /// + [JsonIgnore] public TestSuiteRunControllerFindAllPaginatedRequestSortOrder? SortOrder { get; set; } /// /// This is the maximum number of items to return. Defaults to 100. /// + [JsonIgnore] public double? Limit { get; set; } /// /// This will return items where the createdAt is greater than the specified value. /// + [JsonIgnore] public DateTime? CreatedAtGt { get; set; } /// /// This will return items where the createdAt is less than the specified value. /// + [JsonIgnore] public DateTime? CreatedAtLt { get; set; } /// /// This will return items where the createdAt is greater than or equal to the specified value. /// + [JsonIgnore] public DateTime? CreatedAtGe { get; set; } /// /// This will return items where the createdAt is less than or equal to the specified value. /// + [JsonIgnore] public DateTime? CreatedAtLe { get; set; } /// /// This will return items where the updatedAt is greater than the specified value. /// + [JsonIgnore] public DateTime? UpdatedAtGt { get; set; } /// /// This will return items where the updatedAt is less than the specified value. /// + [JsonIgnore] public DateTime? UpdatedAtLt { get; set; } /// /// This will return items where the updatedAt is greater than or equal to the specified value. /// + [JsonIgnore] public DateTime? UpdatedAtGe { get; set; } /// /// This will return items where the updatedAt is less than or equal to the specified value. /// + [JsonIgnore] public DateTime? UpdatedAtLe { get; set; } + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/TestSuiteRuns/Requests/UpdateTestSuiteRunDto.cs b/src/Vapi.Net/TestSuiteRuns/Requests/UpdateTestSuiteRunDto.cs index 86b0197..0f29640 100644 --- a/src/Vapi.Net/TestSuiteRuns/Requests/UpdateTestSuiteRunDto.cs +++ b/src/Vapi.Net/TestSuiteRuns/Requests/UpdateTestSuiteRunDto.cs @@ -11,6 +11,7 @@ public record UpdateTestSuiteRunDto [JsonPropertyName("name")] public string? Name { get; set; } + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/TestSuiteRuns/TestSuiteRunsClient.cs b/src/Vapi.Net/TestSuiteRuns/TestSuiteRunsClient.cs index ca7d5da..29fbc5b 100644 --- a/src/Vapi.Net/TestSuiteRuns/TestSuiteRunsClient.cs +++ b/src/Vapi.Net/TestSuiteRuns/TestSuiteRunsClient.cs @@ -28,7 +28,7 @@ public async Task TestSuiteRunControllerFindAllP } if (request.SortOrder != null) { - _query["sortOrder"] = request.SortOrder.Value.Stringify(); + _query["sortOrder"] = request.SortOrder.Value.ToString(); } if (request.Limit != null) { @@ -36,52 +36,55 @@ public async Task TestSuiteRunControllerFindAllP } if (request.CreatedAtGt != null) { - _query["createdAtGt"] = request.CreatedAtGt.Value.ToString(Constants.DateTimeFormat); + _query["createdAtGt"] = request.CreatedAtGt.Value.ToString(); } if (request.CreatedAtLt != null) { - _query["createdAtLt"] = request.CreatedAtLt.Value.ToString(Constants.DateTimeFormat); + _query["createdAtLt"] = request.CreatedAtLt.Value.ToString(); } if (request.CreatedAtGe != null) { - _query["createdAtGe"] = request.CreatedAtGe.Value.ToString(Constants.DateTimeFormat); + _query["createdAtGe"] = request.CreatedAtGe.Value.ToString(); } if (request.CreatedAtLe != null) { - _query["createdAtLe"] = request.CreatedAtLe.Value.ToString(Constants.DateTimeFormat); + _query["createdAtLe"] = request.CreatedAtLe.Value.ToString(); } if (request.UpdatedAtGt != null) { - _query["updatedAtGt"] = request.UpdatedAtGt.Value.ToString(Constants.DateTimeFormat); + _query["updatedAtGt"] = request.UpdatedAtGt.Value.ToString(); } if (request.UpdatedAtLt != null) { - _query["updatedAtLt"] = request.UpdatedAtLt.Value.ToString(Constants.DateTimeFormat); + _query["updatedAtLt"] = request.UpdatedAtLt.Value.ToString(); } if (request.UpdatedAtGe != null) { - _query["updatedAtGe"] = request.UpdatedAtGe.Value.ToString(Constants.DateTimeFormat); + _query["updatedAtGe"] = request.UpdatedAtGe.Value.ToString(); } if (request.UpdatedAtLe != null) { - _query["updatedAtLe"] = request.UpdatedAtLe.Value.ToString(Constants.DateTimeFormat); + _query["updatedAtLe"] = request.UpdatedAtLe.Value.ToString(); } var response = await _client - .MakeRequestAsync( - new RawClient.JsonApiRequest + .SendRequestAsync( + new JsonRequest { BaseUrl = _client.Options.BaseUrl, Method = HttpMethod.Get, - Path = $"test-suite/{JsonUtils.SerializeAsString(testSuiteId)}/run", + Path = string.Format( + "test-suite/{0}/run", + ValueConvert.ToPathParameterString(testSuiteId) + ), Query = _query, Options = options, }, cancellationToken ) .ConfigureAwait(false); - var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { + var responseBody = await response.Raw.Content.ReadAsStringAsync(); try { return JsonUtils.Deserialize(responseBody)!; @@ -92,11 +95,14 @@ public async Task TestSuiteRunControllerFindAllP } } - throw new VapiClientApiException( - $"Error with status code {response.StatusCode}", - response.StatusCode, - responseBody - ); + { + var responseBody = await response.Raw.Content.ReadAsStringAsync(); + throw new VapiClientApiException( + $"Error with status code {response.StatusCode}", + response.StatusCode, + responseBody + ); + } } public async Task TestSuiteRunControllerCreateAsync( @@ -107,12 +113,15 @@ public async Task TestSuiteRunControllerCreateAsync( ) { var response = await _client - .MakeRequestAsync( - new RawClient.JsonApiRequest + .SendRequestAsync( + new JsonRequest { BaseUrl = _client.Options.BaseUrl, Method = HttpMethod.Post, - Path = $"test-suite/{JsonUtils.SerializeAsString(testSuiteId)}/run", + Path = string.Format( + "test-suite/{0}/run", + ValueConvert.ToPathParameterString(testSuiteId) + ), Body = request, ContentType = "application/json", Options = options, @@ -120,9 +129,9 @@ public async Task TestSuiteRunControllerCreateAsync( cancellationToken ) .ConfigureAwait(false); - var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { + var responseBody = await response.Raw.Content.ReadAsStringAsync(); try { return JsonUtils.Deserialize(responseBody)!; @@ -133,11 +142,14 @@ public async Task TestSuiteRunControllerCreateAsync( } } - throw new VapiClientApiException( - $"Error with status code {response.StatusCode}", - response.StatusCode, - responseBody - ); + { + var responseBody = await response.Raw.Content.ReadAsStringAsync(); + throw new VapiClientApiException( + $"Error with status code {response.StatusCode}", + response.StatusCode, + responseBody + ); + } } public async Task TestSuiteRunControllerFindOneAsync( @@ -148,21 +160,24 @@ public async Task TestSuiteRunControllerFindOneAsync( ) { var response = await _client - .MakeRequestAsync( - new RawClient.JsonApiRequest + .SendRequestAsync( + new JsonRequest { BaseUrl = _client.Options.BaseUrl, Method = HttpMethod.Get, - Path = - $"test-suite/{JsonUtils.SerializeAsString(testSuiteId)}/run/{JsonUtils.SerializeAsString(id)}", + Path = string.Format( + "test-suite/{0}/run/{1}", + ValueConvert.ToPathParameterString(testSuiteId), + ValueConvert.ToPathParameterString(id) + ), Options = options, }, cancellationToken ) .ConfigureAwait(false); - var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { + var responseBody = await response.Raw.Content.ReadAsStringAsync(); try { return JsonUtils.Deserialize(responseBody)!; @@ -173,11 +188,14 @@ public async Task TestSuiteRunControllerFindOneAsync( } } - throw new VapiClientApiException( - $"Error with status code {response.StatusCode}", - response.StatusCode, - responseBody - ); + { + var responseBody = await response.Raw.Content.ReadAsStringAsync(); + throw new VapiClientApiException( + $"Error with status code {response.StatusCode}", + response.StatusCode, + responseBody + ); + } } public async Task TestSuiteRunControllerRemoveAsync( @@ -188,21 +206,24 @@ public async Task TestSuiteRunControllerRemoveAsync( ) { var response = await _client - .MakeRequestAsync( - new RawClient.JsonApiRequest + .SendRequestAsync( + new JsonRequest { BaseUrl = _client.Options.BaseUrl, Method = HttpMethod.Delete, - Path = - $"test-suite/{JsonUtils.SerializeAsString(testSuiteId)}/run/{JsonUtils.SerializeAsString(id)}", + Path = string.Format( + "test-suite/{0}/run/{1}", + ValueConvert.ToPathParameterString(testSuiteId), + ValueConvert.ToPathParameterString(id) + ), Options = options, }, cancellationToken ) .ConfigureAwait(false); - var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { + var responseBody = await response.Raw.Content.ReadAsStringAsync(); try { return JsonUtils.Deserialize(responseBody)!; @@ -213,11 +234,14 @@ public async Task TestSuiteRunControllerRemoveAsync( } } - throw new VapiClientApiException( - $"Error with status code {response.StatusCode}", - response.StatusCode, - responseBody - ); + { + var responseBody = await response.Raw.Content.ReadAsStringAsync(); + throw new VapiClientApiException( + $"Error with status code {response.StatusCode}", + response.StatusCode, + responseBody + ); + } } public async Task TestSuiteRunControllerUpdateAsync( @@ -229,13 +253,16 @@ public async Task TestSuiteRunControllerUpdateAsync( ) { var response = await _client - .MakeRequestAsync( - new RawClient.JsonApiRequest + .SendRequestAsync( + new JsonRequest { BaseUrl = _client.Options.BaseUrl, Method = HttpMethodExtensions.Patch, - Path = - $"test-suite/{JsonUtils.SerializeAsString(testSuiteId)}/run/{JsonUtils.SerializeAsString(id)}", + Path = string.Format( + "test-suite/{0}/run/{1}", + ValueConvert.ToPathParameterString(testSuiteId), + ValueConvert.ToPathParameterString(id) + ), Body = request, ContentType = "application/json", Options = options, @@ -243,9 +270,9 @@ public async Task TestSuiteRunControllerUpdateAsync( cancellationToken ) .ConfigureAwait(false); - var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { + var responseBody = await response.Raw.Content.ReadAsStringAsync(); try { return JsonUtils.Deserialize(responseBody)!; @@ -256,10 +283,13 @@ public async Task TestSuiteRunControllerUpdateAsync( } } - throw new VapiClientApiException( - $"Error with status code {response.StatusCode}", - response.StatusCode, - responseBody - ); + { + var responseBody = await response.Raw.Content.ReadAsStringAsync(); + throw new VapiClientApiException( + $"Error with status code {response.StatusCode}", + response.StatusCode, + responseBody + ); + } } } diff --git a/src/Vapi.Net/TestSuiteTests/Requests/TestSuiteTestControllerFindAllPaginatedRequest.cs b/src/Vapi.Net/TestSuiteTests/Requests/TestSuiteTestControllerFindAllPaginatedRequest.cs index 1d3ea7f..7c0bb00 100644 --- a/src/Vapi.Net/TestSuiteTests/Requests/TestSuiteTestControllerFindAllPaginatedRequest.cs +++ b/src/Vapi.Net/TestSuiteTests/Requests/TestSuiteTestControllerFindAllPaginatedRequest.cs @@ -1,3 +1,4 @@ +using System.Text.Json.Serialization; using Vapi.Net.Core; namespace Vapi.Net; @@ -7,58 +8,70 @@ public record TestSuiteTestControllerFindAllPaginatedRequest /// /// This is the page number to return. Defaults to 1. /// + [JsonIgnore] public double? Page { get; set; } /// /// This is the sort order for pagination. Defaults to 'DESC'. /// + [JsonIgnore] public TestSuiteTestControllerFindAllPaginatedRequestSortOrder? SortOrder { get; set; } /// /// This is the maximum number of items to return. Defaults to 100. /// + [JsonIgnore] public double? Limit { get; set; } /// /// This will return items where the createdAt is greater than the specified value. /// + [JsonIgnore] public DateTime? CreatedAtGt { get; set; } /// /// This will return items where the createdAt is less than the specified value. /// + [JsonIgnore] public DateTime? CreatedAtLt { get; set; } /// /// This will return items where the createdAt is greater than or equal to the specified value. /// + [JsonIgnore] public DateTime? CreatedAtGe { get; set; } /// /// This will return items where the createdAt is less than or equal to the specified value. /// + [JsonIgnore] public DateTime? CreatedAtLe { get; set; } /// /// This will return items where the updatedAt is greater than the specified value. /// + [JsonIgnore] public DateTime? UpdatedAtGt { get; set; } /// /// This will return items where the updatedAt is less than the specified value. /// + [JsonIgnore] public DateTime? UpdatedAtLt { get; set; } /// /// This will return items where the updatedAt is greater than or equal to the specified value. /// + [JsonIgnore] public DateTime? UpdatedAtGe { get; set; } /// /// This will return items where the updatedAt is less than or equal to the specified value. /// + [JsonIgnore] public DateTime? UpdatedAtLe { get; set; } + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/TestSuiteTests/TestSuiteTestsClient.cs b/src/Vapi.Net/TestSuiteTests/TestSuiteTestsClient.cs index ee32715..e92eaa2 100644 --- a/src/Vapi.Net/TestSuiteTests/TestSuiteTestsClient.cs +++ b/src/Vapi.Net/TestSuiteTests/TestSuiteTestsClient.cs @@ -28,7 +28,7 @@ public async Task TestSuiteTestControllerFindAl } if (request.SortOrder != null) { - _query["sortOrder"] = request.SortOrder.Value.Stringify(); + _query["sortOrder"] = request.SortOrder.Value.ToString(); } if (request.Limit != null) { @@ -36,52 +36,55 @@ public async Task TestSuiteTestControllerFindAl } if (request.CreatedAtGt != null) { - _query["createdAtGt"] = request.CreatedAtGt.Value.ToString(Constants.DateTimeFormat); + _query["createdAtGt"] = request.CreatedAtGt.Value.ToString(); } if (request.CreatedAtLt != null) { - _query["createdAtLt"] = request.CreatedAtLt.Value.ToString(Constants.DateTimeFormat); + _query["createdAtLt"] = request.CreatedAtLt.Value.ToString(); } if (request.CreatedAtGe != null) { - _query["createdAtGe"] = request.CreatedAtGe.Value.ToString(Constants.DateTimeFormat); + _query["createdAtGe"] = request.CreatedAtGe.Value.ToString(); } if (request.CreatedAtLe != null) { - _query["createdAtLe"] = request.CreatedAtLe.Value.ToString(Constants.DateTimeFormat); + _query["createdAtLe"] = request.CreatedAtLe.Value.ToString(); } if (request.UpdatedAtGt != null) { - _query["updatedAtGt"] = request.UpdatedAtGt.Value.ToString(Constants.DateTimeFormat); + _query["updatedAtGt"] = request.UpdatedAtGt.Value.ToString(); } if (request.UpdatedAtLt != null) { - _query["updatedAtLt"] = request.UpdatedAtLt.Value.ToString(Constants.DateTimeFormat); + _query["updatedAtLt"] = request.UpdatedAtLt.Value.ToString(); } if (request.UpdatedAtGe != null) { - _query["updatedAtGe"] = request.UpdatedAtGe.Value.ToString(Constants.DateTimeFormat); + _query["updatedAtGe"] = request.UpdatedAtGe.Value.ToString(); } if (request.UpdatedAtLe != null) { - _query["updatedAtLe"] = request.UpdatedAtLe.Value.ToString(Constants.DateTimeFormat); + _query["updatedAtLe"] = request.UpdatedAtLe.Value.ToString(); } var response = await _client - .MakeRequestAsync( - new RawClient.JsonApiRequest + .SendRequestAsync( + new JsonRequest { BaseUrl = _client.Options.BaseUrl, Method = HttpMethod.Get, - Path = $"test-suite/{JsonUtils.SerializeAsString(testSuiteId)}/test", + Path = string.Format( + "test-suite/{0}/test", + ValueConvert.ToPathParameterString(testSuiteId) + ), Query = _query, Options = options, }, cancellationToken ) .ConfigureAwait(false); - var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { + var responseBody = await response.Raw.Content.ReadAsStringAsync(); try { return JsonUtils.Deserialize(responseBody)!; @@ -92,14 +95,17 @@ public async Task TestSuiteTestControllerFindAl } } - throw new VapiClientApiException( - $"Error with status code {response.StatusCode}", - response.StatusCode, - responseBody - ); + { + var responseBody = await response.Raw.Content.ReadAsStringAsync(); + throw new VapiClientApiException( + $"Error with status code {response.StatusCode}", + response.StatusCode, + responseBody + ); + } } - public async Task TestSuiteTestControllerCreateAsync( + public async Task TestSuiteTestControllerCreateAsync( string testSuiteId, object request, RequestOptions? options = null, @@ -107,12 +113,15 @@ public async Task TestSuiteTestControllerCreateAsync( ) { var response = await _client - .MakeRequestAsync( - new RawClient.JsonApiRequest + .SendRequestAsync( + new JsonRequest { BaseUrl = _client.Options.BaseUrl, Method = HttpMethod.Post, - Path = $"test-suite/{JsonUtils.SerializeAsString(testSuiteId)}/test", + Path = string.Format( + "test-suite/{0}/test", + ValueConvert.ToPathParameterString(testSuiteId) + ), Body = request, ContentType = "application/json", Options = options, @@ -120,12 +129,12 @@ public async Task TestSuiteTestControllerCreateAsync( cancellationToken ) .ConfigureAwait(false); - var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { + var responseBody = await response.Raw.Content.ReadAsStringAsync(); try { - return JsonUtils.Deserialize(responseBody)!; + return JsonUtils.Deserialize(responseBody)!; } catch (JsonException e) { @@ -133,14 +142,17 @@ public async Task TestSuiteTestControllerCreateAsync( } } - throw new VapiClientApiException( - $"Error with status code {response.StatusCode}", - response.StatusCode, - responseBody - ); + { + var responseBody = await response.Raw.Content.ReadAsStringAsync(); + throw new VapiClientApiException( + $"Error with status code {response.StatusCode}", + response.StatusCode, + responseBody + ); + } } - public async Task TestSuiteTestControllerFindOneAsync( + public async Task TestSuiteTestControllerFindOneAsync( string testSuiteId, string id, RequestOptions? options = null, @@ -148,24 +160,27 @@ public async Task TestSuiteTestControllerFindOneAsync( ) { var response = await _client - .MakeRequestAsync( - new RawClient.JsonApiRequest + .SendRequestAsync( + new JsonRequest { BaseUrl = _client.Options.BaseUrl, Method = HttpMethod.Get, - Path = - $"test-suite/{JsonUtils.SerializeAsString(testSuiteId)}/test/{JsonUtils.SerializeAsString(id)}", + Path = string.Format( + "test-suite/{0}/test/{1}", + ValueConvert.ToPathParameterString(testSuiteId), + ValueConvert.ToPathParameterString(id) + ), Options = options, }, cancellationToken ) .ConfigureAwait(false); - var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { + var responseBody = await response.Raw.Content.ReadAsStringAsync(); try { - return JsonUtils.Deserialize(responseBody)!; + return JsonUtils.Deserialize(responseBody)!; } catch (JsonException e) { @@ -173,11 +188,14 @@ public async Task TestSuiteTestControllerFindOneAsync( } } - throw new VapiClientApiException( - $"Error with status code {response.StatusCode}", - response.StatusCode, - responseBody - ); + { + var responseBody = await response.Raw.Content.ReadAsStringAsync(); + throw new VapiClientApiException( + $"Error with status code {response.StatusCode}", + response.StatusCode, + responseBody + ); + } } public async Task TestSuiteTestControllerRemoveAsync( @@ -188,21 +206,24 @@ public async Task TestSuiteTestControllerRemoveAsync( ) { var response = await _client - .MakeRequestAsync( - new RawClient.JsonApiRequest + .SendRequestAsync( + new JsonRequest { BaseUrl = _client.Options.BaseUrl, Method = HttpMethod.Delete, - Path = - $"test-suite/{JsonUtils.SerializeAsString(testSuiteId)}/test/{JsonUtils.SerializeAsString(id)}", + Path = string.Format( + "test-suite/{0}/test/{1}", + ValueConvert.ToPathParameterString(testSuiteId), + ValueConvert.ToPathParameterString(id) + ), Options = options, }, cancellationToken ) .ConfigureAwait(false); - var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { + var responseBody = await response.Raw.Content.ReadAsStringAsync(); try { return JsonUtils.Deserialize(responseBody)!; @@ -213,14 +234,17 @@ public async Task TestSuiteTestControllerRemoveAsync( } } - throw new VapiClientApiException( - $"Error with status code {response.StatusCode}", - response.StatusCode, - responseBody - ); + { + var responseBody = await response.Raw.Content.ReadAsStringAsync(); + throw new VapiClientApiException( + $"Error with status code {response.StatusCode}", + response.StatusCode, + responseBody + ); + } } - public async Task TestSuiteTestControllerUpdateAsync( + public async Task TestSuiteTestControllerUpdateAsync( string testSuiteId, string id, object request, @@ -229,13 +253,16 @@ public async Task TestSuiteTestControllerUpdateAsync( ) { var response = await _client - .MakeRequestAsync( - new RawClient.JsonApiRequest + .SendRequestAsync( + new JsonRequest { BaseUrl = _client.Options.BaseUrl, Method = HttpMethodExtensions.Patch, - Path = - $"test-suite/{JsonUtils.SerializeAsString(testSuiteId)}/test/{JsonUtils.SerializeAsString(id)}", + Path = string.Format( + "test-suite/{0}/test/{1}", + ValueConvert.ToPathParameterString(testSuiteId), + ValueConvert.ToPathParameterString(id) + ), Body = request, ContentType = "application/json", Options = options, @@ -243,12 +270,12 @@ public async Task TestSuiteTestControllerUpdateAsync( cancellationToken ) .ConfigureAwait(false); - var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { + var responseBody = await response.Raw.Content.ReadAsStringAsync(); try { - return JsonUtils.Deserialize(responseBody)!; + return JsonUtils.Deserialize(responseBody)!; } catch (JsonException e) { @@ -256,10 +283,13 @@ public async Task TestSuiteTestControllerUpdateAsync( } } - throw new VapiClientApiException( - $"Error with status code {response.StatusCode}", - response.StatusCode, - responseBody - ); + { + var responseBody = await response.Raw.Content.ReadAsStringAsync(); + throw new VapiClientApiException( + $"Error with status code {response.StatusCode}", + response.StatusCode, + responseBody + ); + } } } diff --git a/src/Vapi.Net/TestSuites/Requests/CreateTestSuiteDto.cs b/src/Vapi.Net/TestSuites/Requests/CreateTestSuiteDto.cs index 652fa80..f4bb984 100644 --- a/src/Vapi.Net/TestSuites/Requests/CreateTestSuiteDto.cs +++ b/src/Vapi.Net/TestSuites/Requests/CreateTestSuiteDto.cs @@ -17,6 +17,21 @@ public record CreateTestSuiteDto [JsonPropertyName("phoneNumberId")] public string? PhoneNumberId { get; set; } + /// + /// Override the default tester plan by providing custom assistant configuration for the test agent. + /// + /// We recommend only using this if you are confident, as we have already set sensible defaults on the tester plan. + /// + [JsonPropertyName("testerPlan")] + public TesterPlan? TesterPlan { get; set; } + + /// + /// These are the configuration for the assistant / phone number that is being tested. + /// + [JsonPropertyName("targetPlan")] + public TargetPlan? TargetPlan { get; set; } + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/TestSuites/Requests/TestSuiteControllerFindAllPaginatedRequest.cs b/src/Vapi.Net/TestSuites/Requests/TestSuiteControllerFindAllPaginatedRequest.cs index e20c4e1..1a5e659 100644 --- a/src/Vapi.Net/TestSuites/Requests/TestSuiteControllerFindAllPaginatedRequest.cs +++ b/src/Vapi.Net/TestSuites/Requests/TestSuiteControllerFindAllPaginatedRequest.cs @@ -1,3 +1,4 @@ +using System.Text.Json.Serialization; using Vapi.Net.Core; namespace Vapi.Net; @@ -7,58 +8,70 @@ public record TestSuiteControllerFindAllPaginatedRequest /// /// This is the page number to return. Defaults to 1. /// + [JsonIgnore] public double? Page { get; set; } /// /// This is the sort order for pagination. Defaults to 'DESC'. /// + [JsonIgnore] public TestSuiteControllerFindAllPaginatedRequestSortOrder? SortOrder { get; set; } /// /// This is the maximum number of items to return. Defaults to 100. /// + [JsonIgnore] public double? Limit { get; set; } /// /// This will return items where the createdAt is greater than the specified value. /// + [JsonIgnore] public DateTime? CreatedAtGt { get; set; } /// /// This will return items where the createdAt is less than the specified value. /// + [JsonIgnore] public DateTime? CreatedAtLt { get; set; } /// /// This will return items where the createdAt is greater than or equal to the specified value. /// + [JsonIgnore] public DateTime? CreatedAtGe { get; set; } /// /// This will return items where the createdAt is less than or equal to the specified value. /// + [JsonIgnore] public DateTime? CreatedAtLe { get; set; } /// /// This will return items where the updatedAt is greater than the specified value. /// + [JsonIgnore] public DateTime? UpdatedAtGt { get; set; } /// /// This will return items where the updatedAt is less than the specified value. /// + [JsonIgnore] public DateTime? UpdatedAtLt { get; set; } /// /// This will return items where the updatedAt is greater than or equal to the specified value. /// + [JsonIgnore] public DateTime? UpdatedAtGe { get; set; } /// /// This will return items where the updatedAt is less than or equal to the specified value. /// + [JsonIgnore] public DateTime? UpdatedAtLe { get; set; } + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/TestSuites/Requests/UpdateTestSuiteDto.cs b/src/Vapi.Net/TestSuites/Requests/UpdateTestSuiteDto.cs index ff0c844..570b2d7 100644 --- a/src/Vapi.Net/TestSuites/Requests/UpdateTestSuiteDto.cs +++ b/src/Vapi.Net/TestSuites/Requests/UpdateTestSuiteDto.cs @@ -17,6 +17,21 @@ public record UpdateTestSuiteDto [JsonPropertyName("phoneNumberId")] public string? PhoneNumberId { get; set; } + /// + /// Override the default tester plan by providing custom assistant configuration for the test agent. + /// + /// We recommend only using this if you are confident, as we have already set sensible defaults on the tester plan. + /// + [JsonPropertyName("testerPlan")] + public TesterPlan? TesterPlan { get; set; } + + /// + /// These are the configuration for the assistant / phone number that is being tested. + /// + [JsonPropertyName("targetPlan")] + public TargetPlan? TargetPlan { get; set; } + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/TestSuites/TestSuitesClient.cs b/src/Vapi.Net/TestSuites/TestSuitesClient.cs index ed56823..634a8fa 100644 --- a/src/Vapi.Net/TestSuites/TestSuitesClient.cs +++ b/src/Vapi.Net/TestSuites/TestSuitesClient.cs @@ -27,7 +27,7 @@ public async Task TestSuiteControllerFindAllPaginat } if (request.SortOrder != null) { - _query["sortOrder"] = request.SortOrder.Value.Stringify(); + _query["sortOrder"] = request.SortOrder.Value.ToString(); } if (request.Limit != null) { @@ -35,39 +35,39 @@ public async Task TestSuiteControllerFindAllPaginat } if (request.CreatedAtGt != null) { - _query["createdAtGt"] = request.CreatedAtGt.Value.ToString(Constants.DateTimeFormat); + _query["createdAtGt"] = request.CreatedAtGt.Value.ToString(); } if (request.CreatedAtLt != null) { - _query["createdAtLt"] = request.CreatedAtLt.Value.ToString(Constants.DateTimeFormat); + _query["createdAtLt"] = request.CreatedAtLt.Value.ToString(); } if (request.CreatedAtGe != null) { - _query["createdAtGe"] = request.CreatedAtGe.Value.ToString(Constants.DateTimeFormat); + _query["createdAtGe"] = request.CreatedAtGe.Value.ToString(); } if (request.CreatedAtLe != null) { - _query["createdAtLe"] = request.CreatedAtLe.Value.ToString(Constants.DateTimeFormat); + _query["createdAtLe"] = request.CreatedAtLe.Value.ToString(); } if (request.UpdatedAtGt != null) { - _query["updatedAtGt"] = request.UpdatedAtGt.Value.ToString(Constants.DateTimeFormat); + _query["updatedAtGt"] = request.UpdatedAtGt.Value.ToString(); } if (request.UpdatedAtLt != null) { - _query["updatedAtLt"] = request.UpdatedAtLt.Value.ToString(Constants.DateTimeFormat); + _query["updatedAtLt"] = request.UpdatedAtLt.Value.ToString(); } if (request.UpdatedAtGe != null) { - _query["updatedAtGe"] = request.UpdatedAtGe.Value.ToString(Constants.DateTimeFormat); + _query["updatedAtGe"] = request.UpdatedAtGe.Value.ToString(); } if (request.UpdatedAtLe != null) { - _query["updatedAtLe"] = request.UpdatedAtLe.Value.ToString(Constants.DateTimeFormat); + _query["updatedAtLe"] = request.UpdatedAtLe.Value.ToString(); } var response = await _client - .MakeRequestAsync( - new RawClient.JsonApiRequest + .SendRequestAsync( + new JsonRequest { BaseUrl = _client.Options.BaseUrl, Method = HttpMethod.Get, @@ -78,9 +78,9 @@ public async Task TestSuiteControllerFindAllPaginat cancellationToken ) .ConfigureAwait(false); - var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { + var responseBody = await response.Raw.Content.ReadAsStringAsync(); try { return JsonUtils.Deserialize(responseBody)!; @@ -91,11 +91,14 @@ public async Task TestSuiteControllerFindAllPaginat } } - throw new VapiClientApiException( - $"Error with status code {response.StatusCode}", - response.StatusCode, - responseBody - ); + { + var responseBody = await response.Raw.Content.ReadAsStringAsync(); + throw new VapiClientApiException( + $"Error with status code {response.StatusCode}", + response.StatusCode, + responseBody + ); + } } public async Task TestSuiteControllerCreateAsync( @@ -105,8 +108,8 @@ public async Task TestSuiteControllerCreateAsync( ) { var response = await _client - .MakeRequestAsync( - new RawClient.JsonApiRequest + .SendRequestAsync( + new JsonRequest { BaseUrl = _client.Options.BaseUrl, Method = HttpMethod.Post, @@ -118,9 +121,9 @@ public async Task TestSuiteControllerCreateAsync( cancellationToken ) .ConfigureAwait(false); - var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { + var responseBody = await response.Raw.Content.ReadAsStringAsync(); try { return JsonUtils.Deserialize(responseBody)!; @@ -131,11 +134,14 @@ public async Task TestSuiteControllerCreateAsync( } } - throw new VapiClientApiException( - $"Error with status code {response.StatusCode}", - response.StatusCode, - responseBody - ); + { + var responseBody = await response.Raw.Content.ReadAsStringAsync(); + throw new VapiClientApiException( + $"Error with status code {response.StatusCode}", + response.StatusCode, + responseBody + ); + } } public async Task TestSuiteControllerFindOneAsync( @@ -145,20 +151,20 @@ public async Task TestSuiteControllerFindOneAsync( ) { var response = await _client - .MakeRequestAsync( - new RawClient.JsonApiRequest + .SendRequestAsync( + new JsonRequest { BaseUrl = _client.Options.BaseUrl, Method = HttpMethod.Get, - Path = $"test-suite/{JsonUtils.SerializeAsString(id)}", + Path = string.Format("test-suite/{0}", ValueConvert.ToPathParameterString(id)), Options = options, }, cancellationToken ) .ConfigureAwait(false); - var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { + var responseBody = await response.Raw.Content.ReadAsStringAsync(); try { return JsonUtils.Deserialize(responseBody)!; @@ -169,11 +175,14 @@ public async Task TestSuiteControllerFindOneAsync( } } - throw new VapiClientApiException( - $"Error with status code {response.StatusCode}", - response.StatusCode, - responseBody - ); + { + var responseBody = await response.Raw.Content.ReadAsStringAsync(); + throw new VapiClientApiException( + $"Error with status code {response.StatusCode}", + response.StatusCode, + responseBody + ); + } } public async Task TestSuiteControllerRemoveAsync( @@ -183,20 +192,20 @@ public async Task TestSuiteControllerRemoveAsync( ) { var response = await _client - .MakeRequestAsync( - new RawClient.JsonApiRequest + .SendRequestAsync( + new JsonRequest { BaseUrl = _client.Options.BaseUrl, Method = HttpMethod.Delete, - Path = $"test-suite/{JsonUtils.SerializeAsString(id)}", + Path = string.Format("test-suite/{0}", ValueConvert.ToPathParameterString(id)), Options = options, }, cancellationToken ) .ConfigureAwait(false); - var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { + var responseBody = await response.Raw.Content.ReadAsStringAsync(); try { return JsonUtils.Deserialize(responseBody)!; @@ -207,11 +216,14 @@ public async Task TestSuiteControllerRemoveAsync( } } - throw new VapiClientApiException( - $"Error with status code {response.StatusCode}", - response.StatusCode, - responseBody - ); + { + var responseBody = await response.Raw.Content.ReadAsStringAsync(); + throw new VapiClientApiException( + $"Error with status code {response.StatusCode}", + response.StatusCode, + responseBody + ); + } } public async Task TestSuiteControllerUpdateAsync( @@ -222,12 +234,12 @@ public async Task TestSuiteControllerUpdateAsync( ) { var response = await _client - .MakeRequestAsync( - new RawClient.JsonApiRequest + .SendRequestAsync( + new JsonRequest { BaseUrl = _client.Options.BaseUrl, Method = HttpMethodExtensions.Patch, - Path = $"test-suite/{JsonUtils.SerializeAsString(id)}", + Path = string.Format("test-suite/{0}", ValueConvert.ToPathParameterString(id)), Body = request, ContentType = "application/json", Options = options, @@ -235,9 +247,9 @@ public async Task TestSuiteControllerUpdateAsync( cancellationToken ) .ConfigureAwait(false); - var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { + var responseBody = await response.Raw.Content.ReadAsStringAsync(); try { return JsonUtils.Deserialize(responseBody)!; @@ -248,10 +260,13 @@ public async Task TestSuiteControllerUpdateAsync( } } - throw new VapiClientApiException( - $"Error with status code {response.StatusCode}", - response.StatusCode, - responseBody - ); + { + var responseBody = await response.Raw.Content.ReadAsStringAsync(); + throw new VapiClientApiException( + $"Error with status code {response.StatusCode}", + response.StatusCode, + responseBody + ); + } } } diff --git a/src/Vapi.Net/Tools/Requests/ToolsListRequest.cs b/src/Vapi.Net/Tools/Requests/ToolsListRequest.cs index 9457c90..f5ae5fb 100644 --- a/src/Vapi.Net/Tools/Requests/ToolsListRequest.cs +++ b/src/Vapi.Net/Tools/Requests/ToolsListRequest.cs @@ -1,3 +1,4 @@ +using System.Text.Json.Serialization; using Vapi.Net.Core; namespace Vapi.Net; @@ -7,48 +8,58 @@ public record ToolsListRequest /// /// This is the maximum number of items to return. Defaults to 100. /// + [JsonIgnore] public double? Limit { get; set; } /// /// This will return items where the createdAt is greater than the specified value. /// + [JsonIgnore] public DateTime? CreatedAtGt { get; set; } /// /// This will return items where the createdAt is less than the specified value. /// + [JsonIgnore] public DateTime? CreatedAtLt { get; set; } /// /// This will return items where the createdAt is greater than or equal to the specified value. /// + [JsonIgnore] public DateTime? CreatedAtGe { get; set; } /// /// This will return items where the createdAt is less than or equal to the specified value. /// + [JsonIgnore] public DateTime? CreatedAtLe { get; set; } /// /// This will return items where the updatedAt is greater than the specified value. /// + [JsonIgnore] public DateTime? UpdatedAtGt { get; set; } /// /// This will return items where the updatedAt is less than the specified value. /// + [JsonIgnore] public DateTime? UpdatedAtLt { get; set; } /// /// This will return items where the updatedAt is greater than or equal to the specified value. /// + [JsonIgnore] public DateTime? UpdatedAtGe { get; set; } /// /// This will return items where the updatedAt is less than or equal to the specified value. /// + [JsonIgnore] public DateTime? UpdatedAtLe { get; set; } + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Tools/ToolsClient.cs b/src/Vapi.Net/Tools/ToolsClient.cs index bd8d812..1ca0095 100644 --- a/src/Vapi.Net/Tools/ToolsClient.cs +++ b/src/Vapi.Net/Tools/ToolsClient.cs @@ -27,39 +27,39 @@ public async Task> ListAsync( } if (request.CreatedAtGt != null) { - _query["createdAtGt"] = request.CreatedAtGt.Value.ToString(Constants.DateTimeFormat); + _query["createdAtGt"] = request.CreatedAtGt.Value.ToString(); } if (request.CreatedAtLt != null) { - _query["createdAtLt"] = request.CreatedAtLt.Value.ToString(Constants.DateTimeFormat); + _query["createdAtLt"] = request.CreatedAtLt.Value.ToString(); } if (request.CreatedAtGe != null) { - _query["createdAtGe"] = request.CreatedAtGe.Value.ToString(Constants.DateTimeFormat); + _query["createdAtGe"] = request.CreatedAtGe.Value.ToString(); } if (request.CreatedAtLe != null) { - _query["createdAtLe"] = request.CreatedAtLe.Value.ToString(Constants.DateTimeFormat); + _query["createdAtLe"] = request.CreatedAtLe.Value.ToString(); } if (request.UpdatedAtGt != null) { - _query["updatedAtGt"] = request.UpdatedAtGt.Value.ToString(Constants.DateTimeFormat); + _query["updatedAtGt"] = request.UpdatedAtGt.Value.ToString(); } if (request.UpdatedAtLt != null) { - _query["updatedAtLt"] = request.UpdatedAtLt.Value.ToString(Constants.DateTimeFormat); + _query["updatedAtLt"] = request.UpdatedAtLt.Value.ToString(); } if (request.UpdatedAtGe != null) { - _query["updatedAtGe"] = request.UpdatedAtGe.Value.ToString(Constants.DateTimeFormat); + _query["updatedAtGe"] = request.UpdatedAtGe.Value.ToString(); } if (request.UpdatedAtLe != null) { - _query["updatedAtLe"] = request.UpdatedAtLe.Value.ToString(Constants.DateTimeFormat); + _query["updatedAtLe"] = request.UpdatedAtLe.Value.ToString(); } var response = await _client - .MakeRequestAsync( - new RawClient.JsonApiRequest + .SendRequestAsync( + new JsonRequest { BaseUrl = _client.Options.BaseUrl, Method = HttpMethod.Get, @@ -70,9 +70,9 @@ public async Task> ListAsync( cancellationToken ) .ConfigureAwait(false); - var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { + var responseBody = await response.Raw.Content.ReadAsStringAsync(); try { return JsonUtils.Deserialize>(responseBody)!; @@ -83,11 +83,14 @@ public async Task> ListAsync( } } - throw new VapiClientApiException( - $"Error with status code {response.StatusCode}", - response.StatusCode, - responseBody - ); + { + var responseBody = await response.Raw.Content.ReadAsStringAsync(); + throw new VapiClientApiException( + $"Error with status code {response.StatusCode}", + response.StatusCode, + responseBody + ); + } } public async Task CreateAsync( @@ -97,8 +100,8 @@ public async Task CreateAsync( ) { var response = await _client - .MakeRequestAsync( - new RawClient.JsonApiRequest + .SendRequestAsync( + new JsonRequest { BaseUrl = _client.Options.BaseUrl, Method = HttpMethod.Post, @@ -110,9 +113,9 @@ public async Task CreateAsync( cancellationToken ) .ConfigureAwait(false); - var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { + var responseBody = await response.Raw.Content.ReadAsStringAsync(); try { return JsonUtils.Deserialize(responseBody)!; @@ -123,11 +126,14 @@ public async Task CreateAsync( } } - throw new VapiClientApiException( - $"Error with status code {response.StatusCode}", - response.StatusCode, - responseBody - ); + { + var responseBody = await response.Raw.Content.ReadAsStringAsync(); + throw new VapiClientApiException( + $"Error with status code {response.StatusCode}", + response.StatusCode, + responseBody + ); + } } public async Task GetAsync( @@ -137,20 +143,20 @@ public async Task GetAsync( ) { var response = await _client - .MakeRequestAsync( - new RawClient.JsonApiRequest + .SendRequestAsync( + new JsonRequest { BaseUrl = _client.Options.BaseUrl, Method = HttpMethod.Get, - Path = $"tool/{JsonUtils.SerializeAsString(id)}", + Path = string.Format("tool/{0}", ValueConvert.ToPathParameterString(id)), Options = options, }, cancellationToken ) .ConfigureAwait(false); - var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { + var responseBody = await response.Raw.Content.ReadAsStringAsync(); try { return JsonUtils.Deserialize(responseBody)!; @@ -161,11 +167,14 @@ public async Task GetAsync( } } - throw new VapiClientApiException( - $"Error with status code {response.StatusCode}", - response.StatusCode, - responseBody - ); + { + var responseBody = await response.Raw.Content.ReadAsStringAsync(); + throw new VapiClientApiException( + $"Error with status code {response.StatusCode}", + response.StatusCode, + responseBody + ); + } } public async Task DeleteAsync( @@ -175,20 +184,20 @@ public async Task DeleteAsync( ) { var response = await _client - .MakeRequestAsync( - new RawClient.JsonApiRequest + .SendRequestAsync( + new JsonRequest { BaseUrl = _client.Options.BaseUrl, Method = HttpMethod.Delete, - Path = $"tool/{JsonUtils.SerializeAsString(id)}", + Path = string.Format("tool/{0}", ValueConvert.ToPathParameterString(id)), Options = options, }, cancellationToken ) .ConfigureAwait(false); - var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { + var responseBody = await response.Raw.Content.ReadAsStringAsync(); try { return JsonUtils.Deserialize(responseBody)!; @@ -199,11 +208,14 @@ public async Task DeleteAsync( } } - throw new VapiClientApiException( - $"Error with status code {response.StatusCode}", - response.StatusCode, - responseBody - ); + { + var responseBody = await response.Raw.Content.ReadAsStringAsync(); + throw new VapiClientApiException( + $"Error with status code {response.StatusCode}", + response.StatusCode, + responseBody + ); + } } public async Task UpdateAsync( @@ -214,12 +226,12 @@ public async Task UpdateAsync( ) { var response = await _client - .MakeRequestAsync( - new RawClient.JsonApiRequest + .SendRequestAsync( + new JsonRequest { BaseUrl = _client.Options.BaseUrl, Method = HttpMethodExtensions.Patch, - Path = $"tool/{JsonUtils.SerializeAsString(id)}", + Path = string.Format("tool/{0}", ValueConvert.ToPathParameterString(id)), Body = request, ContentType = "application/json", Options = options, @@ -227,9 +239,9 @@ public async Task UpdateAsync( cancellationToken ) .ConfigureAwait(false); - var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { + var responseBody = await response.Raw.Content.ReadAsStringAsync(); try { return JsonUtils.Deserialize(responseBody)!; @@ -240,10 +252,13 @@ public async Task UpdateAsync( } } - throw new VapiClientApiException( - $"Error with status code {response.StatusCode}", - response.StatusCode, - responseBody - ); + { + var responseBody = await response.Raw.Content.ReadAsStringAsync(); + throw new VapiClientApiException( + $"Error with status code {response.StatusCode}", + response.StatusCode, + responseBody + ); + } } } diff --git a/src/Vapi.Net/Types/AddVoiceToProviderDto.cs b/src/Vapi.Net/Types/AddVoiceToProviderDto.cs index e301b4c..3524ec4 100644 --- a/src/Vapi.Net/Types/AddVoiceToProviderDto.cs +++ b/src/Vapi.Net/Types/AddVoiceToProviderDto.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -23,6 +24,17 @@ public record AddVoiceToProviderDto [JsonPropertyName("name")] public required string Name { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/AiEdgeCondition.cs b/src/Vapi.Net/Types/AiEdgeCondition.cs index 109e435..2a78629 100644 --- a/src/Vapi.Net/Types/AiEdgeCondition.cs +++ b/src/Vapi.Net/Types/AiEdgeCondition.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -5,9 +6,23 @@ namespace Vapi.Net; public record AiEdgeCondition { - [JsonPropertyName("matches")] - public IEnumerable Matches { get; set; } = new List(); + /// + /// This is the prompt for the AI edge condition. It should evaluate to a boolean. + /// + [JsonPropertyName("prompt")] + public required string Prompt { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/Analysis.cs b/src/Vapi.Net/Types/Analysis.cs index 0b3afb3..3ab142b 100644 --- a/src/Vapi.Net/Types/Analysis.cs +++ b/src/Vapi.Net/Types/Analysis.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -17,12 +18,29 @@ public record Analysis [JsonPropertyName("structuredData")] public object? StructuredData { get; set; } + /// + /// This is the structured data catalog of the call. Customize by setting `assistant.analysisPlan.structuredDataMultiPlan`. + /// + [JsonPropertyName("structuredDataMulti")] + public IEnumerable? StructuredDataMulti { get; set; } + /// /// This is the evaluation of the call. Customize by setting `assistant.analysisPlan.successEvaluationPrompt` and/or `assistant.analysisPlan.successEvaluationRubric`. /// [JsonPropertyName("successEvaluation")] public string? SuccessEvaluation { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/AnalysisCost.cs b/src/Vapi.Net/Types/AnalysisCost.cs index a1c49be..25e0c20 100644 --- a/src/Vapi.Net/Types/AnalysisCost.cs +++ b/src/Vapi.Net/Types/AnalysisCost.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -35,6 +36,17 @@ public record AnalysisCost [JsonPropertyName("cost")] public required double Cost { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/AnalysisCostBreakdown.cs b/src/Vapi.Net/Types/AnalysisCostBreakdown.cs index 109aa49..919f1be 100644 --- a/src/Vapi.Net/Types/AnalysisCostBreakdown.cs +++ b/src/Vapi.Net/Types/AnalysisCostBreakdown.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -59,6 +60,17 @@ public record AnalysisCostBreakdown [JsonPropertyName("successEvaluationCompletionTokens")] public double? SuccessEvaluationCompletionTokens { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/AnalysisPlan.cs b/src/Vapi.Net/Types/AnalysisPlan.cs index 9c2fe93..311d9be 100644 --- a/src/Vapi.Net/Types/AnalysisPlan.cs +++ b/src/Vapi.Net/Types/AnalysisPlan.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -17,12 +18,29 @@ public record AnalysisPlan [JsonPropertyName("structuredDataPlan")] public StructuredDataPlan? StructuredDataPlan { get; set; } + /// + /// This is an array of structured data plan catalogs. Each entry includes a `key` and a `plan` for generating the structured data from the call. This outputs to `call.analysis.structuredDataMulti`. + /// + [JsonPropertyName("structuredDataMultiPlan")] + public IEnumerable? StructuredDataMultiPlan { get; set; } + /// /// This is the plan for generating the success evaluation of the call. This outputs to `call.analysis.successEvaluation`. /// [JsonPropertyName("successEvaluationPlan")] public SuccessEvaluationPlan? SuccessEvaluationPlan { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/AnalyticsOperation.cs b/src/Vapi.Net/Types/AnalyticsOperation.cs index 56416e0..841f618 100644 --- a/src/Vapi.Net/Types/AnalyticsOperation.cs +++ b/src/Vapi.Net/Types/AnalyticsOperation.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -23,6 +24,17 @@ public record AnalyticsOperation [JsonPropertyName("alias")] public string? Alias { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/AnalyticsOperationColumn.cs b/src/Vapi.Net/Types/AnalyticsOperationColumn.cs index d29cf7d..b1c345f 100644 --- a/src/Vapi.Net/Types/AnalyticsOperationColumn.cs +++ b/src/Vapi.Net/Types/AnalyticsOperationColumn.cs @@ -39,4 +39,7 @@ public enum AnalyticsOperationColumn [EnumMember(Value = "concurrency")] Concurrency, + + [EnumMember(Value = "minutesUsed")] + MinutesUsed, } diff --git a/src/Vapi.Net/Types/AnalyticsQuery.cs b/src/Vapi.Net/Types/AnalyticsQuery.cs index 97c1f13..1bb57e9 100644 --- a/src/Vapi.Net/Types/AnalyticsQuery.cs +++ b/src/Vapi.Net/Types/AnalyticsQuery.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -36,6 +37,17 @@ public record AnalyticsQuery public IEnumerable Operations { get; set; } = new List(); + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/AnalyticsQueryResult.cs b/src/Vapi.Net/Types/AnalyticsQueryResult.cs index 00e9d88..383997b 100644 --- a/src/Vapi.Net/Types/AnalyticsQueryResult.cs +++ b/src/Vapi.Net/Types/AnalyticsQueryResult.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -30,6 +31,17 @@ public record AnalyticsQueryResult [JsonPropertyName("result")] public IEnumerable Result { get; set; } = new List(); + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/AnthropicCredential.cs b/src/Vapi.Net/Types/AnthropicCredential.cs index 988f62e..38ea9a3 100644 --- a/src/Vapi.Net/Types/AnthropicCredential.cs +++ b/src/Vapi.Net/Types/AnthropicCredential.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -44,6 +45,17 @@ public record AnthropicCredential [JsonPropertyName("name")] public string? Name { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/AnthropicModel.cs b/src/Vapi.Net/Types/AnthropicModel.cs index adf8fc0..6cd163b 100644 --- a/src/Vapi.Net/Types/AnthropicModel.cs +++ b/src/Vapi.Net/Types/AnthropicModel.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -40,11 +41,19 @@ public record AnthropicModel public string? KnowledgeBaseId { get; set; } /// - /// This is the Anthropic/Claude models that will be used. + /// The specific Anthropic/Claude model that will be used. /// [JsonPropertyName("model")] public required AnthropicModelModel Model { get; set; } + /// + /// Optional configuration for Anthropic's thinking feature. + /// Only applicable for claude-3-7-sonnet-20250219 model. + /// If provided, maxTokens must be greater than thinking.budgetTokens. + /// + [JsonPropertyName("thinking")] + public AnthropicThinkingConfig? Thinking { get; set; } + /// /// This is the temperature that will be used for calls. Default is 0 to leverage caching for lower latency. /// @@ -77,6 +86,17 @@ public record AnthropicModel [JsonPropertyName("numFastTurns")] public double? NumFastTurns { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/AnthropicModelModel.cs b/src/Vapi.Net/Types/AnthropicModelModel.cs index 1750a8e..f3bbff7 100644 --- a/src/Vapi.Net/Types/AnthropicModelModel.cs +++ b/src/Vapi.Net/Types/AnthropicModelModel.cs @@ -24,4 +24,7 @@ public enum AnthropicModelModel [EnumMember(Value = "claude-3-5-haiku-20241022")] Claude35Haiku20241022, + + [EnumMember(Value = "claude-3-7-sonnet-20250219")] + Claude37Sonnet20250219, } diff --git a/src/Vapi.Net/Types/AnthropicThinkingConfig.cs b/src/Vapi.Net/Types/AnthropicThinkingConfig.cs new file mode 100644 index 0000000..18f9b48 --- /dev/null +++ b/src/Vapi.Net/Types/AnthropicThinkingConfig.cs @@ -0,0 +1,34 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record AnthropicThinkingConfig +{ + [JsonPropertyName("type")] + public string Type { get; set; } = "enabled"; + + /// + /// The maximum number of tokens to allocate for thinking. + /// Must be between 1024 and 100000 tokens. + /// + [JsonPropertyName("budgetTokens")] + public required double BudgetTokens { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/AnyscaleCredential.cs b/src/Vapi.Net/Types/AnyscaleCredential.cs index a2b6326..a865912 100644 --- a/src/Vapi.Net/Types/AnyscaleCredential.cs +++ b/src/Vapi.Net/Types/AnyscaleCredential.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -44,6 +45,17 @@ public record AnyscaleCredential [JsonPropertyName("name")] public string? Name { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/AnyscaleModel.cs b/src/Vapi.Net/Types/AnyscaleModel.cs index b28becf..1bae269 100644 --- a/src/Vapi.Net/Types/AnyscaleModel.cs +++ b/src/Vapi.Net/Types/AnyscaleModel.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -77,6 +78,17 @@ public record AnyscaleModel [JsonPropertyName("numFastTurns")] public double? NumFastTurns { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/ApiRequest.cs b/src/Vapi.Net/Types/ApiRequest.cs index 5c96887..480ae72 100644 --- a/src/Vapi.Net/Types/ApiRequest.cs +++ b/src/Vapi.Net/Types/ApiRequest.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -60,6 +61,17 @@ public record ApiRequest [JsonPropertyName("metadata")] public object? Metadata { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/Artifact.cs b/src/Vapi.Net/Types/Artifact.cs index 9287797..7106e19 100644 --- a/src/Vapi.Net/Types/Artifact.cs +++ b/src/Vapi.Net/Types/Artifact.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using OneOf; using Vapi.Net.Core; @@ -56,6 +57,17 @@ public IEnumerable< [JsonPropertyName("pcapUrl")] public string? PcapUrl { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/ArtifactPlan.cs b/src/Vapi.Net/Types/ArtifactPlan.cs index 5f3406b..238d40c 100644 --- a/src/Vapi.Net/Types/ArtifactPlan.cs +++ b/src/Vapi.Net/Types/ArtifactPlan.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -19,6 +20,14 @@ public record ArtifactPlan [JsonPropertyName("recordingEnabled")] public bool? RecordingEnabled { get; set; } + /// + /// This determines the format of the recording. Defaults to `wav;l16`. + /// + /// @default 'wav;l16' + /// + [JsonPropertyName("recordingFormat")] + public ArtifactPlanRecordingFormat? RecordingFormat { get; set; } + /// /// This determines whether the video is recorded during the call. Defaults to false. Only relevant for `webCall` type. /// @@ -73,6 +82,17 @@ public record ArtifactPlan [JsonPropertyName("recordingPath")] public string? RecordingPath { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/ArtifactPlanRecordingFormat.cs b/src/Vapi.Net/Types/ArtifactPlanRecordingFormat.cs new file mode 100644 index 0000000..796819e --- /dev/null +++ b/src/Vapi.Net/Types/ArtifactPlanRecordingFormat.cs @@ -0,0 +1,15 @@ +using System.Runtime.Serialization; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[JsonConverter(typeof(EnumSerializer))] +public enum ArtifactPlanRecordingFormat +{ + [EnumMember(Value = "wav;l16")] + WavL16, + + [EnumMember(Value = "mp3")] + Mp3, +} diff --git a/src/Vapi.Net/Types/AssemblyAiCredential.cs b/src/Vapi.Net/Types/AssemblyAiCredential.cs index aeeba1d..bd715b1 100644 --- a/src/Vapi.Net/Types/AssemblyAiCredential.cs +++ b/src/Vapi.Net/Types/AssemblyAiCredential.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -44,6 +45,17 @@ public record AssemblyAiCredential [JsonPropertyName("name")] public string? Name { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/AssemblyAiTranscriber.cs b/src/Vapi.Net/Types/AssemblyAiTranscriber.cs index 0b39336..2edf2a1 100644 --- a/src/Vapi.Net/Types/AssemblyAiTranscriber.cs +++ b/src/Vapi.Net/Types/AssemblyAiTranscriber.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -11,6 +12,14 @@ public record AssemblyAiTranscriber [JsonPropertyName("language")] public string? Language { get; set; } + /// + /// Transcripts below this confidence threshold will be discarded. + /// + /// @default 0.4 + /// + [JsonPropertyName("confidenceThreshold")] + public double? ConfidenceThreshold { get; set; } + /// /// The WebSocket URL that the transcriber connects to. /// @@ -36,6 +45,23 @@ public record AssemblyAiTranscriber [JsonPropertyName("disablePartialTranscripts")] public bool? DisablePartialTranscripts { get; set; } + /// + /// This is the plan for voice provider fallbacks in the event that the primary voice provider fails. + /// + [JsonPropertyName("fallbackPlan")] + public FallbackTranscriberPlan? FallbackPlan { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/AssignmentMutation.cs b/src/Vapi.Net/Types/AssignmentMutation.cs deleted file mode 100644 index 58bd1fb..0000000 --- a/src/Vapi.Net/Types/AssignmentMutation.cs +++ /dev/null @@ -1,74 +0,0 @@ -using System.Text.Json.Serialization; -using Vapi.Net.Core; - -namespace Vapi.Net; - -public record AssignmentMutation -{ - /// - /// This is an optional array of conditions that must be met for this mutation to be triggered. - /// - [JsonPropertyName("conditions")] - public IEnumerable? Conditions { get; set; } - - /// - /// This mutation assigns a new value to an existing or new variable. - /// - [JsonPropertyName("type")] - public string Type { get; set; } = "assignment"; - - /// - /// This is the variable to assign a new value to. - /// - /// You can reference any variable in the context of the current block execution (step): - /// - "output.your-property-name" for current step's output - /// - "your-step-name.output.your-property-name" for another step's output (in the same workflow; read caveat #1) - /// - "your-block-name.output.your-property-name" for another block's output (in the same workflow; read caveat #2) - /// - "global.your-property-name" for the global context - /// - /// This needs to be the key path of the variable. If you use {{}}, it'll dereference that to the value of the variable before assignment. This can be useful if the path is dynamic. Example: - /// - "global.{{my-tool-call-step.output.my-key-name}}" - /// - /// You can also string interpolate multiple variables to get the key name: - /// - "global.{{my-tool-call-step.output.my-key-name-suffix}}-{{my-tool-call-step.output.my-key-name}}" - /// - /// The path to the new variable is created if it doesn't exist. Example: - /// - "global.this-does-not-exist.neither-does-this" will create `this-does-not-exist` object with `neither-does-this` as a key - /// - /// Caveats: - /// 1. a workflow can execute a step multiple times. example, if a loop is used in the graph. {{stepName.output.propertyName}} will reference the latest usage of the step. - /// 2. a workflow can execute a block multiple times. example, if a step is called multiple times or if a block is used in multiple steps. {{blockName.output.propertyName}} will reference the latest usage of the block. this liquid variable is just provided for convenience when creating blocks outside of a workflow. - /// - [JsonPropertyName("variable")] - public required string Variable { get; set; } - - /// - /// The value to assign to the variable. - /// - /// You can reference any variable in the context of the current block execution (step): - /// - "{{output.your-property-name}}" for current step's output - /// - "{{your-step-name.output.your-property-name}}" for another step's output (in the same workflow; read caveat #1) - /// - "{{your-block-name.output.your-property-name}}" for another block's output (in the same workflow; read caveat #2) - /// - "{{global.your-property-name}}" for the global context - /// - /// Or, you can use a constant: - /// - "1" - /// - "text" - /// - "true" - /// - "false" - /// - /// Or, you can mix and match with string interpolation: - /// - "{{your-property-name}}-{{input.your-property-name-2}}-1" - /// - /// Caveats: - /// 1. a workflow can execute a step multiple times. example, if a loop is used in the graph. {{stepName.output.propertyName}} will reference the latest usage of the step. - /// 2. a workflow can execute a block multiple times. example, if a step is called multiple times or if a block is used in multiple steps. {{blockName.output.propertyName}} will reference the latest usage of the block. this liquid variable is just provided for convenience when creating blocks outside of a workflow. - /// - [JsonPropertyName("value")] - public required string Value { get; set; } - - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Vapi.Net/Types/Assistant.cs b/src/Vapi.Net/Types/Assistant.cs index 3418494..be7c904 100644 --- a/src/Vapi.Net/Types/Assistant.cs +++ b/src/Vapi.Net/Types/Assistant.cs @@ -1,4 +1,6 @@ +using System.Text.Json; using System.Text.Json.Serialization; +using OneOf; using Vapi.Net.Core; namespace Vapi.Net; @@ -31,6 +33,9 @@ public record Assistant [JsonPropertyName("firstMessage")] public string? FirstMessage { get; set; } + [JsonPropertyName("firstMessageInterruptionsEnabled")] + public bool? FirstMessageInterruptionsEnabled { get; set; } + /// /// This is the mode for the first message. Default is 'assistant-speaks-first'. /// @@ -45,7 +50,15 @@ public record Assistant public AssistantFirstMessageMode? FirstMessageMode { get; set; } /// - /// These are the messages that will be sent to your Client SDKs. Default is conversation-update,function-call,hang,model-output,speech-update,status-update,transfer-update,transcript,tool-calls,user-interrupted,voice-input. You can check the shape of the messages in ClientMessage schema. + /// These are the settings to configure or disable voicemail detection. Alternatively, voicemail detection can be configured using the model.tools=[VoicemailTool]. + /// This uses Twilio's built-in detection while the VoicemailTool relies on the model to detect if a voicemail was reached. + /// You can use neither of them, one of them, or both of them. By default, Twilio built-in detection is enabled while VoicemailTool is not. + /// + [JsonPropertyName("voicemailDetection")] + public object? VoicemailDetection { get; set; } + + /// + /// These are the messages that will be sent to your Client SDKs. Default is conversation-update,function-call,hang,model-output,speech-update,status-update,transfer-update,transcript,tool-calls,user-interrupted,voice-input,workflow.node.started. You can check the shape of the messages in ClientMessage schema. /// [JsonPropertyName("clientMessages")] public IEnumerable? ClientMessages { get; set; } @@ -74,9 +87,10 @@ public record Assistant /// /// This is the background sound in the call. Default for phone calls is 'office' and default for web calls is 'off'. + /// You can also provide a custom sound by providing a URL to an audio file. /// [JsonPropertyName("backgroundSound")] - public AssistantBackgroundSound? BackgroundSound { get; set; } + public OneOf? BackgroundSound { get; set; } /// /// This enables filtering of noise and background speech while the user is talking. @@ -104,6 +118,13 @@ public record Assistant [JsonPropertyName("transportConfigurations")] public IEnumerable? TransportConfigurations { get; set; } + /// + /// This is the plan for observability configuration of assistant's calls. + /// Currently supports Langfuse for tracing and monitoring. + /// + [JsonPropertyName("observabilityPlan")] + public LangfuseObservabilityPlan? ObservabilityPlan { get; set; } + /// /// These are dynamic credentials that will be used for the assistant calls. By default, all the credentials are available for use in the call but you can supplement an additional credentials using this. Dynamic credentials override existing credentials. /// @@ -118,14 +139,6 @@ public record Assistant [JsonPropertyName("name")] public string? Name { get; set; } - /// - /// These are the settings to configure or disable voicemail detection. Alternatively, voicemail detection can be configured using the model.tools=[VoicemailTool]. - /// This uses Twilio's built-in detection while the VoicemailTool relies on the model to detect if a voicemail was reached. - /// You can use neither of them, one of them, or both of them. By default, Twilio built-in detection is enabled while VoicemailTool is not. - /// - [JsonPropertyName("voicemailDetection")] - public TwilioVoicemailDetection? VoicemailDetection { get; set; } - /// /// This is the message that the assistant will say if the call is forwarded to voicemail. /// @@ -239,6 +252,9 @@ public record Assistant [JsonPropertyName("hooks")] public IEnumerable? Hooks { get; set; } + [JsonPropertyName("keypadInputPlan")] + public KeypadInputPlan? KeypadInputPlan { get; set; } + /// /// This is the unique identifier for the assistant. /// @@ -263,6 +279,17 @@ public record Assistant [JsonPropertyName("updatedAt")] public required DateTime UpdatedAt { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/AssistantBackgroundSound.cs b/src/Vapi.Net/Types/AssistantBackgroundSoundZero.cs similarity index 65% rename from src/Vapi.Net/Types/AssistantBackgroundSound.cs rename to src/Vapi.Net/Types/AssistantBackgroundSoundZero.cs index 4770c21..de7878f 100644 --- a/src/Vapi.Net/Types/AssistantBackgroundSound.cs +++ b/src/Vapi.Net/Types/AssistantBackgroundSoundZero.cs @@ -4,8 +4,8 @@ namespace Vapi.Net; -[JsonConverter(typeof(EnumSerializer))] -public enum AssistantBackgroundSound +[JsonConverter(typeof(EnumSerializer))] +public enum AssistantBackgroundSoundZero { [EnumMember(Value = "off")] Off, diff --git a/src/Vapi.Net/Types/AssistantClientMessagesItem.cs b/src/Vapi.Net/Types/AssistantClientMessagesItem.cs index 2defd0c..b35f522 100644 --- a/src/Vapi.Net/Types/AssistantClientMessagesItem.cs +++ b/src/Vapi.Net/Types/AssistantClientMessagesItem.cs @@ -51,4 +51,7 @@ public enum AssistantClientMessagesItem [EnumMember(Value = "voice-input")] VoiceInput, + + [EnumMember(Value = "workflow.node.started")] + WorkflowNodeStarted, } diff --git a/src/Vapi.Net/Types/AssistantCustomEndpointingRule.cs b/src/Vapi.Net/Types/AssistantCustomEndpointingRule.cs index 28afe6e..e3989b6 100644 --- a/src/Vapi.Net/Types/AssistantCustomEndpointingRule.cs +++ b/src/Vapi.Net/Types/AssistantCustomEndpointingRule.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -32,6 +33,17 @@ public record AssistantCustomEndpointingRule [JsonPropertyName("timeoutSeconds")] public required double TimeoutSeconds { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/AssistantHookActionBase.cs b/src/Vapi.Net/Types/AssistantHookActionBase.cs index d735791..83762f9 100644 --- a/src/Vapi.Net/Types/AssistantHookActionBase.cs +++ b/src/Vapi.Net/Types/AssistantHookActionBase.cs @@ -1,9 +1,22 @@ +using System.Text.Json; +using System.Text.Json.Serialization; using Vapi.Net.Core; namespace Vapi.Net; public record AssistantHookActionBase { + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/AssistantHookFilter.cs b/src/Vapi.Net/Types/AssistantHookFilter.cs index a9b3d75..451c6e0 100644 --- a/src/Vapi.Net/Types/AssistantHookFilter.cs +++ b/src/Vapi.Net/Types/AssistantHookFilter.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -23,6 +24,17 @@ public record AssistantHookFilter [JsonPropertyName("oneOf")] public IEnumerable OneOf { get; set; } = new List(); + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/AssistantHooks.cs b/src/Vapi.Net/Types/AssistantHooks.cs index dcca939..a93f232 100644 --- a/src/Vapi.Net/Types/AssistantHooks.cs +++ b/src/Vapi.Net/Types/AssistantHooks.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -24,6 +25,17 @@ public record AssistantHooks public IEnumerable Do { get; set; } = new List(); + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/AssistantOverrides.cs b/src/Vapi.Net/Types/AssistantOverrides.cs index 0fc0234..3635714 100644 --- a/src/Vapi.Net/Types/AssistantOverrides.cs +++ b/src/Vapi.Net/Types/AssistantOverrides.cs @@ -1,4 +1,6 @@ +using System.Text.Json; using System.Text.Json.Serialization; +using OneOf; using Vapi.Net.Core; namespace Vapi.Net; @@ -31,6 +33,9 @@ public record AssistantOverrides [JsonPropertyName("firstMessage")] public string? FirstMessage { get; set; } + [JsonPropertyName("firstMessageInterruptionsEnabled")] + public bool? FirstMessageInterruptionsEnabled { get; set; } + /// /// This is the mode for the first message. Default is 'assistant-speaks-first'. /// @@ -45,7 +50,15 @@ public record AssistantOverrides public AssistantOverridesFirstMessageMode? FirstMessageMode { get; set; } /// - /// These are the messages that will be sent to your Client SDKs. Default is conversation-update,function-call,hang,model-output,speech-update,status-update,transfer-update,transcript,tool-calls,user-interrupted,voice-input. You can check the shape of the messages in ClientMessage schema. + /// These are the settings to configure or disable voicemail detection. Alternatively, voicemail detection can be configured using the model.tools=[VoicemailTool]. + /// This uses Twilio's built-in detection while the VoicemailTool relies on the model to detect if a voicemail was reached. + /// You can use neither of them, one of them, or both of them. By default, Twilio built-in detection is enabled while VoicemailTool is not. + /// + [JsonPropertyName("voicemailDetection")] + public object? VoicemailDetection { get; set; } + + /// + /// These are the messages that will be sent to your Client SDKs. Default is conversation-update,function-call,hang,model-output,speech-update,status-update,transfer-update,transcript,tool-calls,user-interrupted,voice-input,workflow.node.started. You can check the shape of the messages in ClientMessage schema. /// [JsonPropertyName("clientMessages")] public IEnumerable? ClientMessages { get; set; } @@ -74,9 +87,10 @@ public record AssistantOverrides /// /// This is the background sound in the call. Default for phone calls is 'office' and default for web calls is 'off'. + /// You can also provide a custom sound by providing a URL to an audio file. /// [JsonPropertyName("backgroundSound")] - public AssistantOverridesBackgroundSound? BackgroundSound { get; set; } + public OneOf? BackgroundSound { get; set; } /// /// This enables filtering of noise and background speech while the user is talking. @@ -104,6 +118,13 @@ public record AssistantOverrides [JsonPropertyName("transportConfigurations")] public IEnumerable? TransportConfigurations { get; set; } + /// + /// This is the plan for observability configuration of assistant's calls. + /// Currently supports Langfuse for tracing and monitoring. + /// + [JsonPropertyName("observabilityPlan")] + public LangfuseObservabilityPlan? ObservabilityPlan { get; set; } + /// /// These are dynamic credentials that will be used for the assistant calls. By default, all the credentials are available for use in the call but you can supplement an additional credentials using this. Dynamic credentials override existing credentials. /// @@ -130,14 +151,6 @@ public record AssistantOverrides [JsonPropertyName("name")] public string? Name { get; set; } - /// - /// These are the settings to configure or disable voicemail detection. Alternatively, voicemail detection can be configured using the model.tools=[VoicemailTool]. - /// This uses Twilio's built-in detection while the VoicemailTool relies on the model to detect if a voicemail was reached. - /// You can use neither of them, one of them, or both of them. By default, Twilio built-in detection is enabled while VoicemailTool is not. - /// - [JsonPropertyName("voicemailDetection")] - public TwilioVoicemailDetection? VoicemailDetection { get; set; } - /// /// This is the message that the assistant will say if the call is forwarded to voicemail. /// @@ -251,6 +264,20 @@ public record AssistantOverrides [JsonPropertyName("hooks")] public IEnumerable? Hooks { get; set; } + [JsonPropertyName("keypadInputPlan")] + public KeypadInputPlan? KeypadInputPlan { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/AssistantOverridesBackgroundSound.cs b/src/Vapi.Net/Types/AssistantOverridesBackgroundSoundZero.cs similarity index 80% rename from src/Vapi.Net/Types/AssistantOverridesBackgroundSound.cs rename to src/Vapi.Net/Types/AssistantOverridesBackgroundSoundZero.cs index 63b54e2..e313562 100644 --- a/src/Vapi.Net/Types/AssistantOverridesBackgroundSound.cs +++ b/src/Vapi.Net/Types/AssistantOverridesBackgroundSoundZero.cs @@ -4,8 +4,8 @@ namespace Vapi.Net; -[JsonConverter(typeof(EnumSerializer))] -public enum AssistantOverridesBackgroundSound +[JsonConverter(typeof(EnumSerializer))] +public enum AssistantOverridesBackgroundSoundZero { [EnumMember(Value = "off")] Off, diff --git a/src/Vapi.Net/Types/AssistantOverridesClientMessagesItem.cs b/src/Vapi.Net/Types/AssistantOverridesClientMessagesItem.cs index 88ac777..9292b83 100644 --- a/src/Vapi.Net/Types/AssistantOverridesClientMessagesItem.cs +++ b/src/Vapi.Net/Types/AssistantOverridesClientMessagesItem.cs @@ -51,4 +51,7 @@ public enum AssistantOverridesClientMessagesItem [EnumMember(Value = "voice-input")] VoiceInput, + + [EnumMember(Value = "workflow.node.started")] + WorkflowNodeStarted, } diff --git a/src/Vapi.Net/Types/AssistantPaginatedResponse.cs b/src/Vapi.Net/Types/AssistantPaginatedResponse.cs new file mode 100644 index 0000000..83956af --- /dev/null +++ b/src/Vapi.Net/Types/AssistantPaginatedResponse.cs @@ -0,0 +1,30 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record AssistantPaginatedResponse +{ + [JsonPropertyName("results")] + public IEnumerable Results { get; set; } = new List(); + + [JsonPropertyName("metadata")] + public required PaginationMeta Metadata { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/AutoReloadPlan.cs b/src/Vapi.Net/Types/AutoReloadPlan.cs index 7808778..bf322f8 100644 --- a/src/Vapi.Net/Types/AutoReloadPlan.cs +++ b/src/Vapi.Net/Types/AutoReloadPlan.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -17,6 +18,17 @@ public record AutoReloadPlan [JsonPropertyName("threshold")] public required double Threshold { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/AzureBlobStorageBucketPlan.cs b/src/Vapi.Net/Types/AzureBlobStorageBucketPlan.cs index 8b2071d..af236c6 100644 --- a/src/Vapi.Net/Types/AzureBlobStorageBucketPlan.cs +++ b/src/Vapi.Net/Types/AzureBlobStorageBucketPlan.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -29,6 +30,17 @@ public record AzureBlobStorageBucketPlan [JsonPropertyName("path")] public string? Path { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/AzureCredential.cs b/src/Vapi.Net/Types/AzureCredential.cs index ca3509b..049bb5a 100644 --- a/src/Vapi.Net/Types/AzureCredential.cs +++ b/src/Vapi.Net/Types/AzureCredential.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -62,6 +63,17 @@ public record AzureCredential [JsonPropertyName("bucketPlan")] public AzureBlobStorageBucketPlan? BucketPlan { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/AzureOpenAiCredential.cs b/src/Vapi.Net/Types/AzureOpenAiCredential.cs index 6483152..f39116d 100644 --- a/src/Vapi.Net/Types/AzureOpenAiCredential.cs +++ b/src/Vapi.Net/Types/AzureOpenAiCredential.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -60,6 +61,17 @@ public record AzureOpenAiCredential [JsonPropertyName("openAIEndpoint")] public required string OpenAiEndpoint { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/AzureOpenAiCredentialModelsItem.cs b/src/Vapi.Net/Types/AzureOpenAiCredentialModelsItem.cs index 4f8e136..476520f 100644 --- a/src/Vapi.Net/Types/AzureOpenAiCredentialModelsItem.cs +++ b/src/Vapi.Net/Types/AzureOpenAiCredentialModelsItem.cs @@ -7,8 +7,8 @@ namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] public enum AzureOpenAiCredentialModelsItem { - [EnumMember(Value = "gpt-4o-2024-08-06-ptu")] - Gpt4O20240806Ptu, + [EnumMember(Value = "gpt-4o-2024-11-20")] + Gpt4O20241120, [EnumMember(Value = "gpt-4o-2024-08-06")] Gpt4O20240806, diff --git a/src/Vapi.Net/Types/AzureSpeechTranscriber.cs b/src/Vapi.Net/Types/AzureSpeechTranscriber.cs index d5a3489..64e71f0 100644 --- a/src/Vapi.Net/Types/AzureSpeechTranscriber.cs +++ b/src/Vapi.Net/Types/AzureSpeechTranscriber.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -11,6 +12,23 @@ public record AzureSpeechTranscriber [JsonPropertyName("language")] public AzureSpeechTranscriberLanguage? Language { get; set; } + /// + /// This is the plan for voice provider fallbacks in the event that the primary voice provider fails. + /// + [JsonPropertyName("fallbackPlan")] + public FallbackTranscriberPlan? FallbackPlan { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/AzureVoice.cs b/src/Vapi.Net/Types/AzureVoice.cs index 68fe35d..6a60345 100644 --- a/src/Vapi.Net/Types/AzureVoice.cs +++ b/src/Vapi.Net/Types/AzureVoice.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using OneOf; using Vapi.Net.Core; @@ -30,6 +31,17 @@ public record AzureVoice [JsonPropertyName("fallbackPlan")] public FallbackPlan? FallbackPlan { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/BackoffPlan.cs b/src/Vapi.Net/Types/BackoffPlan.cs index c0f3e7f..1e05539 100644 --- a/src/Vapi.Net/Types/BackoffPlan.cs +++ b/src/Vapi.Net/Types/BackoffPlan.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -27,6 +28,17 @@ public record BackoffPlan [JsonPropertyName("baseDelaySeconds")] public required double BaseDelaySeconds { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/BashTool.cs b/src/Vapi.Net/Types/BashTool.cs index 788e182..1f76524 100644 --- a/src/Vapi.Net/Types/BashTool.cs +++ b/src/Vapi.Net/Types/BashTool.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -81,6 +82,17 @@ public record BashTool [JsonPropertyName("name")] public string Name { get; set; } = "bash"; + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/BashToolWithToolCall.cs b/src/Vapi.Net/Types/BashToolWithToolCall.cs index c01013b..e865fde 100644 --- a/src/Vapi.Net/Types/BashToolWithToolCall.cs +++ b/src/Vapi.Net/Types/BashToolWithToolCall.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -60,6 +61,17 @@ public record BashToolWithToolCall [JsonPropertyName("server")] public Server? Server { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/BlockCompleteMessage.cs b/src/Vapi.Net/Types/BlockCompleteMessage.cs deleted file mode 100644 index 18e0c43..0000000 --- a/src/Vapi.Net/Types/BlockCompleteMessage.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Text.Json.Serialization; -using Vapi.Net.Core; - -namespace Vapi.Net; - -public record BlockCompleteMessage -{ - /// - /// This is an alternative to the `content` property. It allows to specify variants of the same content, one per language. - /// - /// Usage: - /// - If your assistants are multilingual, you can provide content for each language. - /// - If you don't provide content for a language, the first item in the array will be automatically translated to the active language at that moment. - /// - /// This will override the `content` property. - /// - [JsonPropertyName("contents")] - public IEnumerable? Contents { get; set; } - - /// - /// This is an optional array of conditions that must be met for this message to be triggered. - /// - [JsonPropertyName("conditions")] - public IEnumerable? Conditions { get; set; } - - /// - /// This is the content that the assistant will say when this message is triggered. - /// - [JsonPropertyName("content")] - public string? Content { get; set; } - - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Vapi.Net/Types/BlockStartMessage.cs b/src/Vapi.Net/Types/BlockStartMessage.cs deleted file mode 100644 index 8770077..0000000 --- a/src/Vapi.Net/Types/BlockStartMessage.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Text.Json.Serialization; -using Vapi.Net.Core; - -namespace Vapi.Net; - -public record BlockStartMessage -{ - /// - /// This is an alternative to the `content` property. It allows to specify variants of the same content, one per language. - /// - /// Usage: - /// - If your assistants are multilingual, you can provide content for each language. - /// - If you don't provide content for a language, the first item in the array will be automatically translated to the active language at that moment. - /// - /// This will override the `content` property. - /// - [JsonPropertyName("contents")] - public IEnumerable? Contents { get; set; } - - /// - /// This is an optional array of conditions that must be met for this message to be triggered. - /// - [JsonPropertyName("conditions")] - public IEnumerable? Conditions { get; set; } - - /// - /// This is the content that the assistant will say when this message is triggered. - /// - [JsonPropertyName("content")] - public string? Content { get; set; } - - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Vapi.Net/Types/BotMessage.cs b/src/Vapi.Net/Types/BotMessage.cs index 3b58ae9..f31dc67 100644 --- a/src/Vapi.Net/Types/BotMessage.cs +++ b/src/Vapi.Net/Types/BotMessage.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -47,6 +48,17 @@ public record BotMessage [JsonPropertyName("duration")] public double? Duration { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/BothCustomEndpointingRule.cs b/src/Vapi.Net/Types/BothCustomEndpointingRule.cs index 436f30b..ab5014f 100644 --- a/src/Vapi.Net/Types/BothCustomEndpointingRule.cs +++ b/src/Vapi.Net/Types/BothCustomEndpointingRule.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -43,6 +44,17 @@ public record BothCustomEndpointingRule [JsonPropertyName("timeoutSeconds")] public required double TimeoutSeconds { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/BucketPlan.cs b/src/Vapi.Net/Types/BucketPlan.cs index e275130..fd1c5a7 100644 --- a/src/Vapi.Net/Types/BucketPlan.cs +++ b/src/Vapi.Net/Types/BucketPlan.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -55,6 +56,17 @@ public record BucketPlan [JsonPropertyName("hmacSecret")] public string? HmacSecret { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/ByoPhoneNumber.cs b/src/Vapi.Net/Types/ByoPhoneNumber.cs index 095ff9a..70f9958 100644 --- a/src/Vapi.Net/Types/ByoPhoneNumber.cs +++ b/src/Vapi.Net/Types/ByoPhoneNumber.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -16,6 +17,12 @@ public record ByoPhoneNumber [JsonPropertyName("fallbackDestination")] public object? FallbackDestination { get; set; } + /// + /// This is the hooks that will be used for incoming calls to this phone number. + /// + [JsonPropertyName("hooks")] + public IEnumerable? Hooks { get; set; } + /// /// This is the flag to toggle the E164 check for the `number` field. This is an advanced property which should be used if you know your use case requires it. /// @@ -108,6 +115,17 @@ public record ByoPhoneNumber [JsonPropertyName("credentialId")] public required string CredentialId { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/ByoSipTrunkCredential.cs b/src/Vapi.Net/Types/ByoSipTrunkCredential.cs index 3c306a8..af354f4 100644 --- a/src/Vapi.Net/Types/ByoSipTrunkCredential.cs +++ b/src/Vapi.Net/Types/ByoSipTrunkCredential.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -82,6 +83,17 @@ public record ByoSipTrunkCredential [JsonPropertyName("sbcConfiguration")] public SbcConfiguration? SbcConfiguration { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/Call.cs b/src/Vapi.Net/Types/Call.cs index e2faa61..a791dd4 100644 --- a/src/Vapi.Net/Types/Call.cs +++ b/src/Vapi.Net/Types/Call.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using OneOf; using Vapi.Net.Core; @@ -130,13 +131,7 @@ public IEnumerable< public Artifact? Artifact { get; set; } /// - /// This is the transport used for the call. - /// - [JsonPropertyName("transport")] - public Transport? Transport { get; set; } - - /// - /// The ID of the call as provided by the phone number service. callSid in Twilio. conversationUuid in Vonage. + /// The ID of the call as provided by the phone number service. callSid in Twilio. conversationUuid in Vonage. callControlId in Telnyx. /// /// Only relevant for `outboundPhoneCall` and `inboundPhoneCall` type. /// @@ -211,6 +206,29 @@ public IEnumerable< [JsonPropertyName("name")] public string? Name { get; set; } + /// + /// This is the schedule plan of the call. + /// + [JsonPropertyName("schedulePlan")] + public SchedulePlan? SchedulePlan { get; set; } + + /// + /// This is the transport of the call. + /// + [JsonPropertyName("transport")] + public object? Transport { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/CallBatchError.cs b/src/Vapi.Net/Types/CallBatchError.cs new file mode 100644 index 0000000..adfb632 --- /dev/null +++ b/src/Vapi.Net/Types/CallBatchError.cs @@ -0,0 +1,30 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record CallBatchError +{ + [JsonPropertyName("customer")] + public required CreateCustomerDto Customer { get; set; } + + [JsonPropertyName("error")] + public required string Error { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/CallBatchResponse.cs b/src/Vapi.Net/Types/CallBatchResponse.cs new file mode 100644 index 0000000..5cd16e0 --- /dev/null +++ b/src/Vapi.Net/Types/CallBatchResponse.cs @@ -0,0 +1,36 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record CallBatchResponse +{ + /// + /// This is the list of calls that were created. + /// + [JsonPropertyName("results")] + public IEnumerable Results { get; set; } = new List(); + + /// + /// This is the list of calls that failed to be created. + /// + [JsonPropertyName("errors")] + public IEnumerable Errors { get; set; } = new List(); + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/CallEndedReason.cs b/src/Vapi.Net/Types/CallEndedReason.cs index b1d8c51..6d8911a 100644 --- a/src/Vapi.Net/Types/CallEndedReason.cs +++ b/src/Vapi.Net/Types/CallEndedReason.cs @@ -7,12 +7,6 @@ namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] public enum CallEndedReason { - [EnumMember(Value = "assistant-not-valid")] - AssistantNotValid, - - [EnumMember(Value = "assistant-not-provided")] - AssistantNotProvided, - [EnumMember(Value = "call-start-error-neither-assistant-nor-server-set")] CallStartErrorNeitherAssistantNorServerSet, @@ -34,54 +28,42 @@ public enum CallEndedReason [EnumMember(Value = "assistant-request-returned-forwarding-phone-number")] AssistantRequestReturnedForwardingPhoneNumber, - [EnumMember(Value = "assistant-ended-call")] - AssistantEndedCall, + [EnumMember(Value = "call.start.error-get-org")] + CallStartErrorGetOrg, - [EnumMember(Value = "assistant-said-end-call-phrase")] - AssistantSaidEndCallPhrase, + [EnumMember(Value = "call.start.error-get-subscription")] + CallStartErrorGetSubscription, - [EnumMember(Value = "assistant-ended-call-with-hangup-task")] - AssistantEndedCallWithHangupTask, + [EnumMember(Value = "call.start.error-get-assistant")] + CallStartErrorGetAssistant, - [EnumMember(Value = "assistant-forwarded-call")] - AssistantForwardedCall, - - [EnumMember(Value = "assistant-join-timed-out")] - AssistantJoinTimedOut, - - [EnumMember(Value = "customer-busy")] - CustomerBusy, - - [EnumMember(Value = "customer-ended-call")] - CustomerEndedCall, + [EnumMember(Value = "call.start.error-get-phone-number")] + CallStartErrorGetPhoneNumber, - [EnumMember(Value = "customer-did-not-answer")] - CustomerDidNotAnswer, + [EnumMember(Value = "call.start.error-get-customer")] + CallStartErrorGetCustomer, - [EnumMember(Value = "customer-did-not-give-microphone-permission")] - CustomerDidNotGiveMicrophonePermission, + [EnumMember(Value = "call.start.error-get-resources-validation")] + CallStartErrorGetResourcesValidation, - [EnumMember(Value = "assistant-said-message-with-end-call-enabled")] - AssistantSaidMessageWithEndCallEnabled, + [EnumMember(Value = "call.start.error-vapi-number-international")] + CallStartErrorVapiNumberInternational, - [EnumMember(Value = "exceeded-max-duration")] - ExceededMaxDuration, + [EnumMember(Value = "call.start.error-vapi-number-outbound-daily-limit")] + CallStartErrorVapiNumberOutboundDailyLimit, - [EnumMember(Value = "manually-canceled")] - ManuallyCanceled, + [EnumMember(Value = "call.start.error-get-transport")] + CallStartErrorGetTransport, - [EnumMember(Value = "phone-call-provider-closed-websocket")] - PhoneCallProviderClosedWebsocket, + [EnumMember(Value = "assistant-not-valid")] + AssistantNotValid, - [EnumMember(Value = "db-error")] - DbError, + [EnumMember(Value = "database-error")] + DatabaseError, [EnumMember(Value = "assistant-not-found")] AssistantNotFound, - [EnumMember(Value = "license-check-failed")] - LicenseCheckFailed, - [EnumMember(Value = "pipeline-error-openai-voice-failed")] PipelineErrorOpenaiVoiceFailed, @@ -106,32 +88,59 @@ public enum CallEndedReason [EnumMember(Value = "pipeline-error-rime-ai-voice-failed")] PipelineErrorRimeAiVoiceFailed, - [EnumMember(Value = "pipeline-error-neets-voice-failed")] - PipelineErrorNeetsVoiceFailed, - [EnumMember(Value = "pipeline-error-smallest-ai-voice-failed")] PipelineErrorSmallestAiVoiceFailed, [EnumMember(Value = "pipeline-error-neuphonic-voice-failed")] PipelineErrorNeuphonicVoiceFailed, - [EnumMember(Value = "pipeline-error-deepgram-transcriber-failed")] - PipelineErrorDeepgramTranscriberFailed, + [EnumMember(Value = "pipeline-error-hume-voice-failed")] + PipelineErrorHumeVoiceFailed, - [EnumMember(Value = "pipeline-error-gladia-transcriber-failed")] - PipelineErrorGladiaTranscriberFailed, + [EnumMember(Value = "pipeline-error-sesame-voice-failed")] + PipelineErrorSesameVoiceFailed, - [EnumMember(Value = "pipeline-error-speechmatics-transcriber-failed")] - PipelineErrorSpeechmaticsTranscriberFailed, + [EnumMember(Value = "pipeline-error-tavus-video-failed")] + PipelineErrorTavusVideoFailed, - [EnumMember(Value = "pipeline-error-assembly-ai-transcriber-failed")] - PipelineErrorAssemblyAiTranscriberFailed, + [EnumMember(Value = "call.in-progress.error-vapifault-openai-voice-failed")] + CallInProgressErrorVapifaultOpenaiVoiceFailed, - [EnumMember(Value = "pipeline-error-talkscriber-transcriber-failed")] - PipelineErrorTalkscriberTranscriberFailed, + [EnumMember(Value = "call.in-progress.error-vapifault-cartesia-voice-failed")] + CallInProgressErrorVapifaultCartesiaVoiceFailed, - [EnumMember(Value = "pipeline-error-azure-speech-transcriber-failed")] - PipelineErrorAzureSpeechTranscriberFailed, + [EnumMember(Value = "call.in-progress.error-vapifault-deepgram-voice-failed")] + CallInProgressErrorVapifaultDeepgramVoiceFailed, + + [EnumMember(Value = "call.in-progress.error-vapifault-eleven-labs-voice-failed")] + CallInProgressErrorVapifaultElevenLabsVoiceFailed, + + [EnumMember(Value = "call.in-progress.error-vapifault-playht-voice-failed")] + CallInProgressErrorVapifaultPlayhtVoiceFailed, + + [EnumMember(Value = "call.in-progress.error-vapifault-lmnt-voice-failed")] + CallInProgressErrorVapifaultLmntVoiceFailed, + + [EnumMember(Value = "call.in-progress.error-vapifault-azure-voice-failed")] + CallInProgressErrorVapifaultAzureVoiceFailed, + + [EnumMember(Value = "call.in-progress.error-vapifault-rime-ai-voice-failed")] + CallInProgressErrorVapifaultRimeAiVoiceFailed, + + [EnumMember(Value = "call.in-progress.error-vapifault-smallest-ai-voice-failed")] + CallInProgressErrorVapifaultSmallestAiVoiceFailed, + + [EnumMember(Value = "call.in-progress.error-vapifault-neuphonic-voice-failed")] + CallInProgressErrorVapifaultNeuphonicVoiceFailed, + + [EnumMember(Value = "call.in-progress.error-vapifault-hume-voice-failed")] + CallInProgressErrorVapifaultHumeVoiceFailed, + + [EnumMember(Value = "call.in-progress.error-vapifault-sesame-voice-failed")] + CallInProgressErrorVapifaultSesameVoiceFailed, + + [EnumMember(Value = "call.in-progress.error-vapifault-tavus-video-failed")] + CallInProgressErrorVapifaultTavusVideoFailed, [EnumMember(Value = "pipeline-error-vapi-llm-failed")] PipelineErrorVapiLlmFailed, @@ -151,8 +160,108 @@ public enum CallEndedReason [EnumMember(Value = "pipeline-error-vapi-500-server-error")] PipelineErrorVapi500ServerError, - [EnumMember(Value = "pipeline-no-available-model")] - PipelineNoAvailableModel, + [EnumMember(Value = "pipeline-error-vapi-503-server-overloaded-error")] + PipelineErrorVapi503ServerOverloadedError, + + [EnumMember(Value = "call.in-progress.error-vapifault-vapi-llm-failed")] + CallInProgressErrorVapifaultVapiLlmFailed, + + [EnumMember(Value = "call.in-progress.error-vapifault-vapi-400-bad-request-validation-failed")] + CallInProgressErrorVapifaultVapi400BadRequestValidationFailed, + + [EnumMember(Value = "call.in-progress.error-vapifault-vapi-401-unauthorized")] + CallInProgressErrorVapifaultVapi401Unauthorized, + + [EnumMember(Value = "call.in-progress.error-vapifault-vapi-403-model-access-denied")] + CallInProgressErrorVapifaultVapi403ModelAccessDenied, + + [EnumMember(Value = "call.in-progress.error-vapifault-vapi-429-exceeded-quota")] + CallInProgressErrorVapifaultVapi429ExceededQuota, + + [EnumMember(Value = "call.in-progress.error-providerfault-vapi-500-server-error")] + CallInProgressErrorProviderfaultVapi500ServerError, + + [EnumMember(Value = "call.in-progress.error-providerfault-vapi-503-server-overloaded-error")] + CallInProgressErrorProviderfaultVapi503ServerOverloadedError, + + [EnumMember(Value = "pipeline-error-deepgram-transcriber-failed")] + PipelineErrorDeepgramTranscriberFailed, + + [EnumMember(Value = "call.in-progress.error-vapifault-deepgram-transcriber-failed")] + CallInProgressErrorVapifaultDeepgramTranscriberFailed, + + [EnumMember(Value = "pipeline-error-gladia-transcriber-failed")] + PipelineErrorGladiaTranscriberFailed, + + [EnumMember(Value = "call.in-progress.error-vapifault-gladia-transcriber-failed")] + CallInProgressErrorVapifaultGladiaTranscriberFailed, + + [EnumMember(Value = "pipeline-error-speechmatics-transcriber-failed")] + PipelineErrorSpeechmaticsTranscriberFailed, + + [EnumMember(Value = "call.in-progress.error-vapifault-speechmatics-transcriber-failed")] + CallInProgressErrorVapifaultSpeechmaticsTranscriberFailed, + + [EnumMember(Value = "pipeline-error-assembly-ai-transcriber-failed")] + PipelineErrorAssemblyAiTranscriberFailed, + + [EnumMember(Value = "pipeline-error-assembly-ai-returning-400-insufficent-funds")] + PipelineErrorAssemblyAiReturning400InsufficentFunds, + + [EnumMember(Value = "pipeline-error-assembly-ai-returning-400-paid-only-feature")] + PipelineErrorAssemblyAiReturning400PaidOnlyFeature, + + [EnumMember(Value = "pipeline-error-assembly-ai-returning-401-invalid-credentials")] + PipelineErrorAssemblyAiReturning401InvalidCredentials, + + [EnumMember(Value = "pipeline-error-assembly-ai-returning-500-invalid-schema")] + PipelineErrorAssemblyAiReturning500InvalidSchema, + + [EnumMember(Value = "pipeline-error-assembly-ai-returning-500-word-boost-parsing-failed")] + PipelineErrorAssemblyAiReturning500WordBoostParsingFailed, + + [EnumMember(Value = "call.in-progress.error-vapifault-assembly-ai-transcriber-failed")] + CallInProgressErrorVapifaultAssemblyAiTranscriberFailed, + + [EnumMember( + Value = "call.in-progress.error-vapifault-assembly-ai-returning-400-insufficent-funds" + )] + CallInProgressErrorVapifaultAssemblyAiReturning400InsufficentFunds, + + [EnumMember( + Value = "call.in-progress.error-vapifault-assembly-ai-returning-400-paid-only-feature" + )] + CallInProgressErrorVapifaultAssemblyAiReturning400PaidOnlyFeature, + + [EnumMember( + Value = "call.in-progress.error-vapifault-assembly-ai-returning-401-invalid-credentials" + )] + CallInProgressErrorVapifaultAssemblyAiReturning401InvalidCredentials, + + [EnumMember( + Value = "call.in-progress.error-vapifault-assembly-ai-returning-500-invalid-schema" + )] + CallInProgressErrorVapifaultAssemblyAiReturning500InvalidSchema, + + [EnumMember( + Value = "call.in-progress.error-vapifault-assembly-ai-returning-500-word-boost-parsing-failed" + )] + CallInProgressErrorVapifaultAssemblyAiReturning500WordBoostParsingFailed, + + [EnumMember(Value = "pipeline-error-talkscriber-transcriber-failed")] + PipelineErrorTalkscriberTranscriberFailed, + + [EnumMember(Value = "call.in-progress.error-vapifault-talkscriber-transcriber-failed")] + CallInProgressErrorVapifaultTalkscriberTranscriberFailed, + + [EnumMember(Value = "pipeline-error-azure-speech-transcriber-failed")] + PipelineErrorAzureSpeechTranscriberFailed, + + [EnumMember(Value = "call.in-progress.error-vapifault-azure-speech-transcriber-failed")] + CallInProgressErrorVapifaultAzureSpeechTranscriberFailed, + + [EnumMember(Value = "call.in-progress.error-pipeline-no-available-llm-model")] + CallInProgressErrorPipelineNoAvailableLlmModel, [EnumMember(Value = "worker-shutdown")] WorkerShutdown, @@ -166,56 +275,49 @@ public enum CallEndedReason [EnumMember(Value = "vonage-failed-to-connect-call")] VonageFailedToConnectCall, + [EnumMember(Value = "vonage-completed")] + VonageCompleted, + [EnumMember(Value = "phone-call-provider-bypass-enabled-but-no-call-received")] PhoneCallProviderBypassEnabledButNoCallReceived, - [EnumMember(Value = "vapifault-phone-call-worker-setup-socket-error")] - VapifaultPhoneCallWorkerSetupSocketError, - - [EnumMember(Value = "vapifault-phone-call-worker-worker-setup-socket-timeout")] - VapifaultPhoneCallWorkerWorkerSetupSocketTimeout, - - [EnumMember(Value = "vapifault-phone-call-worker-could-not-find-call")] - VapifaultPhoneCallWorkerCouldNotFindCall, - - [EnumMember(Value = "vapifault-transport-never-connected")] - VapifaultTransportNeverConnected, - - [EnumMember(Value = "vapifault-web-call-worker-setup-failed")] - VapifaultWebCallWorkerSetupFailed, + [EnumMember(Value = "call.in-progress.error-vapifault-transport-never-connected")] + CallInProgressErrorVapifaultTransportNeverConnected, - [EnumMember(Value = "vapifault-transport-connected-but-call-not-active")] - VapifaultTransportConnectedButCallNotActive, + [EnumMember(Value = "call.in-progress.error-vapifault-transport-connected-but-call-not-active")] + CallInProgressErrorVapifaultTransportConnectedButCallNotActive, - [EnumMember(Value = "vapifault-call-started-but-connection-to-transport-missing")] - VapifaultCallStartedButConnectionToTransportMissing, + [EnumMember( + Value = "call.in-progress.error-vapifault-call-started-but-connection-to-transport-missing" + )] + CallInProgressErrorVapifaultCallStartedButConnectionToTransportMissing, - [EnumMember(Value = "pipeline-error-openai-llm-failed")] - PipelineErrorOpenaiLlmFailed, + [EnumMember(Value = "call.in-progress.error-vapifault-openai-llm-failed")] + CallInProgressErrorVapifaultOpenaiLlmFailed, - [EnumMember(Value = "pipeline-error-azure-openai-llm-failed")] - PipelineErrorAzureOpenaiLlmFailed, + [EnumMember(Value = "call.in-progress.error-vapifault-azure-openai-llm-failed")] + CallInProgressErrorVapifaultAzureOpenaiLlmFailed, - [EnumMember(Value = "pipeline-error-groq-llm-failed")] - PipelineErrorGroqLlmFailed, + [EnumMember(Value = "call.in-progress.error-vapifault-groq-llm-failed")] + CallInProgressErrorVapifaultGroqLlmFailed, - [EnumMember(Value = "pipeline-error-google-llm-failed")] - PipelineErrorGoogleLlmFailed, + [EnumMember(Value = "call.in-progress.error-vapifault-google-llm-failed")] + CallInProgressErrorVapifaultGoogleLlmFailed, - [EnumMember(Value = "pipeline-error-xai-llm-failed")] - PipelineErrorXaiLlmFailed, + [EnumMember(Value = "call.in-progress.error-vapifault-xai-llm-failed")] + CallInProgressErrorVapifaultXaiLlmFailed, - [EnumMember(Value = "pipeline-error-mistral-llm-failed")] - PipelineErrorMistralLlmFailed, + [EnumMember(Value = "call.in-progress.error-vapifault-mistral-llm-failed")] + CallInProgressErrorVapifaultMistralLlmFailed, - [EnumMember(Value = "pipeline-error-inflection-ai-llm-failed")] - PipelineErrorInflectionAiLlmFailed, + [EnumMember(Value = "call.in-progress.error-vapifault-inflection-ai-llm-failed")] + CallInProgressErrorVapifaultInflectionAiLlmFailed, - [EnumMember(Value = "pipeline-error-cerebras-llm-failed")] - PipelineErrorCerebrasLlmFailed, + [EnumMember(Value = "call.in-progress.error-vapifault-cerebras-llm-failed")] + CallInProgressErrorVapifaultCerebrasLlmFailed, - [EnumMember(Value = "pipeline-error-deep-seek-llm-failed")] - PipelineErrorDeepSeekLlmFailed, + [EnumMember(Value = "call.in-progress.error-vapifault-deep-seek-llm-failed")] + CallInProgressErrorVapifaultDeepSeekLlmFailed, [EnumMember(Value = "pipeline-error-openai-400-bad-request-validation-failed")] PipelineErrorOpenai400BadRequestValidationFailed, @@ -223,15 +325,102 @@ public enum CallEndedReason [EnumMember(Value = "pipeline-error-openai-401-unauthorized")] PipelineErrorOpenai401Unauthorized, + [EnumMember(Value = "pipeline-error-openai-401-incorrect-api-key")] + PipelineErrorOpenai401IncorrectApiKey, + + [EnumMember(Value = "pipeline-error-openai-401-account-not-in-organization")] + PipelineErrorOpenai401AccountNotInOrganization, + [EnumMember(Value = "pipeline-error-openai-403-model-access-denied")] PipelineErrorOpenai403ModelAccessDenied, [EnumMember(Value = "pipeline-error-openai-429-exceeded-quota")] PipelineErrorOpenai429ExceededQuota, + [EnumMember(Value = "pipeline-error-openai-429-rate-limit-reached")] + PipelineErrorOpenai429RateLimitReached, + [EnumMember(Value = "pipeline-error-openai-500-server-error")] PipelineErrorOpenai500ServerError, + [EnumMember(Value = "pipeline-error-openai-503-server-overloaded-error")] + PipelineErrorOpenai503ServerOverloadedError, + + [EnumMember(Value = "pipeline-error-openai-llm-failed")] + PipelineErrorOpenaiLlmFailed, + + [EnumMember( + Value = "call.in-progress.error-vapifault-openai-400-bad-request-validation-failed" + )] + CallInProgressErrorVapifaultOpenai400BadRequestValidationFailed, + + [EnumMember(Value = "call.in-progress.error-vapifault-openai-401-unauthorized")] + CallInProgressErrorVapifaultOpenai401Unauthorized, + + [EnumMember(Value = "call.in-progress.error-vapifault-openai-401-incorrect-api-key")] + CallInProgressErrorVapifaultOpenai401IncorrectApiKey, + + [EnumMember(Value = "call.in-progress.error-vapifault-openai-401-account-not-in-organization")] + CallInProgressErrorVapifaultOpenai401AccountNotInOrganization, + + [EnumMember(Value = "call.in-progress.error-vapifault-openai-403-model-access-denied")] + CallInProgressErrorVapifaultOpenai403ModelAccessDenied, + + [EnumMember(Value = "call.in-progress.error-vapifault-openai-429-exceeded-quota")] + CallInProgressErrorVapifaultOpenai429ExceededQuota, + + [EnumMember(Value = "call.in-progress.error-vapifault-openai-429-rate-limit-reached")] + CallInProgressErrorVapifaultOpenai429RateLimitReached, + + [EnumMember(Value = "call.in-progress.error-providerfault-openai-500-server-error")] + CallInProgressErrorProviderfaultOpenai500ServerError, + + [EnumMember(Value = "call.in-progress.error-providerfault-openai-503-server-overloaded-error")] + CallInProgressErrorProviderfaultOpenai503ServerOverloadedError, + + [EnumMember(Value = "pipeline-error-azure-openai-400-bad-request-validation-failed")] + PipelineErrorAzureOpenai400BadRequestValidationFailed, + + [EnumMember(Value = "pipeline-error-azure-openai-401-unauthorized")] + PipelineErrorAzureOpenai401Unauthorized, + + [EnumMember(Value = "pipeline-error-azure-openai-403-model-access-denied")] + PipelineErrorAzureOpenai403ModelAccessDenied, + + [EnumMember(Value = "pipeline-error-azure-openai-429-exceeded-quota")] + PipelineErrorAzureOpenai429ExceededQuota, + + [EnumMember(Value = "pipeline-error-azure-openai-500-server-error")] + PipelineErrorAzureOpenai500ServerError, + + [EnumMember(Value = "pipeline-error-azure-openai-503-server-overloaded-error")] + PipelineErrorAzureOpenai503ServerOverloadedError, + + [EnumMember(Value = "pipeline-error-azure-openai-llm-failed")] + PipelineErrorAzureOpenaiLlmFailed, + + [EnumMember( + Value = "call.in-progress.error-vapifault-azure-openai-400-bad-request-validation-failed" + )] + CallInProgressErrorVapifaultAzureOpenai400BadRequestValidationFailed, + + [EnumMember(Value = "call.in-progress.error-vapifault-azure-openai-401-unauthorized")] + CallInProgressErrorVapifaultAzureOpenai401Unauthorized, + + [EnumMember(Value = "call.in-progress.error-vapifault-azure-openai-403-model-access-denied")] + CallInProgressErrorVapifaultAzureOpenai403ModelAccessDenied, + + [EnumMember(Value = "call.in-progress.error-vapifault-azure-openai-429-exceeded-quota")] + CallInProgressErrorVapifaultAzureOpenai429ExceededQuota, + + [EnumMember(Value = "call.in-progress.error-providerfault-azure-openai-500-server-error")] + CallInProgressErrorProviderfaultAzureOpenai500ServerError, + + [EnumMember( + Value = "call.in-progress.error-providerfault-azure-openai-503-server-overloaded-error" + )] + CallInProgressErrorProviderfaultAzureOpenai503ServerOverloadedError, + [EnumMember(Value = "pipeline-error-google-400-bad-request-validation-failed")] PipelineErrorGoogle400BadRequestValidationFailed, @@ -247,6 +436,32 @@ public enum CallEndedReason [EnumMember(Value = "pipeline-error-google-500-server-error")] PipelineErrorGoogle500ServerError, + [EnumMember(Value = "pipeline-error-google-503-server-overloaded-error")] + PipelineErrorGoogle503ServerOverloadedError, + + [EnumMember(Value = "pipeline-error-google-llm-failed")] + PipelineErrorGoogleLlmFailed, + + [EnumMember( + Value = "call.in-progress.error-vapifault-google-400-bad-request-validation-failed" + )] + CallInProgressErrorVapifaultGoogle400BadRequestValidationFailed, + + [EnumMember(Value = "call.in-progress.error-vapifault-google-401-unauthorized")] + CallInProgressErrorVapifaultGoogle401Unauthorized, + + [EnumMember(Value = "call.in-progress.error-vapifault-google-403-model-access-denied")] + CallInProgressErrorVapifaultGoogle403ModelAccessDenied, + + [EnumMember(Value = "call.in-progress.error-vapifault-google-429-exceeded-quota")] + CallInProgressErrorVapifaultGoogle429ExceededQuota, + + [EnumMember(Value = "call.in-progress.error-providerfault-google-500-server-error")] + CallInProgressErrorProviderfaultGoogle500ServerError, + + [EnumMember(Value = "call.in-progress.error-providerfault-google-503-server-overloaded-error")] + CallInProgressErrorProviderfaultGoogle503ServerOverloadedError, + [EnumMember(Value = "pipeline-error-xai-400-bad-request-validation-failed")] PipelineErrorXai400BadRequestValidationFailed, @@ -262,6 +477,30 @@ public enum CallEndedReason [EnumMember(Value = "pipeline-error-xai-500-server-error")] PipelineErrorXai500ServerError, + [EnumMember(Value = "pipeline-error-xai-503-server-overloaded-error")] + PipelineErrorXai503ServerOverloadedError, + + [EnumMember(Value = "pipeline-error-xai-llm-failed")] + PipelineErrorXaiLlmFailed, + + [EnumMember(Value = "call.in-progress.error-vapifault-xai-400-bad-request-validation-failed")] + CallInProgressErrorVapifaultXai400BadRequestValidationFailed, + + [EnumMember(Value = "call.in-progress.error-vapifault-xai-401-unauthorized")] + CallInProgressErrorVapifaultXai401Unauthorized, + + [EnumMember(Value = "call.in-progress.error-vapifault-xai-403-model-access-denied")] + CallInProgressErrorVapifaultXai403ModelAccessDenied, + + [EnumMember(Value = "call.in-progress.error-vapifault-xai-429-exceeded-quota")] + CallInProgressErrorVapifaultXai429ExceededQuota, + + [EnumMember(Value = "call.in-progress.error-providerfault-xai-500-server-error")] + CallInProgressErrorProviderfaultXai500ServerError, + + [EnumMember(Value = "call.in-progress.error-providerfault-xai-503-server-overloaded-error")] + CallInProgressErrorProviderfaultXai503ServerOverloadedError, + [EnumMember(Value = "pipeline-error-mistral-400-bad-request-validation-failed")] PipelineErrorMistral400BadRequestValidationFailed, @@ -277,6 +516,32 @@ public enum CallEndedReason [EnumMember(Value = "pipeline-error-mistral-500-server-error")] PipelineErrorMistral500ServerError, + [EnumMember(Value = "pipeline-error-mistral-503-server-overloaded-error")] + PipelineErrorMistral503ServerOverloadedError, + + [EnumMember(Value = "pipeline-error-mistral-llm-failed")] + PipelineErrorMistralLlmFailed, + + [EnumMember( + Value = "call.in-progress.error-vapifault-mistral-400-bad-request-validation-failed" + )] + CallInProgressErrorVapifaultMistral400BadRequestValidationFailed, + + [EnumMember(Value = "call.in-progress.error-vapifault-mistral-401-unauthorized")] + CallInProgressErrorVapifaultMistral401Unauthorized, + + [EnumMember(Value = "call.in-progress.error-vapifault-mistral-403-model-access-denied")] + CallInProgressErrorVapifaultMistral403ModelAccessDenied, + + [EnumMember(Value = "call.in-progress.error-vapifault-mistral-429-exceeded-quota")] + CallInProgressErrorVapifaultMistral429ExceededQuota, + + [EnumMember(Value = "call.in-progress.error-providerfault-mistral-500-server-error")] + CallInProgressErrorProviderfaultMistral500ServerError, + + [EnumMember(Value = "call.in-progress.error-providerfault-mistral-503-server-overloaded-error")] + CallInProgressErrorProviderfaultMistral503ServerOverloadedError, + [EnumMember(Value = "pipeline-error-inflection-ai-400-bad-request-validation-failed")] PipelineErrorInflectionAi400BadRequestValidationFailed, @@ -292,6 +557,34 @@ public enum CallEndedReason [EnumMember(Value = "pipeline-error-inflection-ai-500-server-error")] PipelineErrorInflectionAi500ServerError, + [EnumMember(Value = "pipeline-error-inflection-ai-503-server-overloaded-error")] + PipelineErrorInflectionAi503ServerOverloadedError, + + [EnumMember(Value = "pipeline-error-inflection-ai-llm-failed")] + PipelineErrorInflectionAiLlmFailed, + + [EnumMember( + Value = "call.in-progress.error-vapifault-inflection-ai-400-bad-request-validation-failed" + )] + CallInProgressErrorVapifaultInflectionAi400BadRequestValidationFailed, + + [EnumMember(Value = "call.in-progress.error-vapifault-inflection-ai-401-unauthorized")] + CallInProgressErrorVapifaultInflectionAi401Unauthorized, + + [EnumMember(Value = "call.in-progress.error-vapifault-inflection-ai-403-model-access-denied")] + CallInProgressErrorVapifaultInflectionAi403ModelAccessDenied, + + [EnumMember(Value = "call.in-progress.error-vapifault-inflection-ai-429-exceeded-quota")] + CallInProgressErrorVapifaultInflectionAi429ExceededQuota, + + [EnumMember(Value = "call.in-progress.error-providerfault-inflection-ai-500-server-error")] + CallInProgressErrorProviderfaultInflectionAi500ServerError, + + [EnumMember( + Value = "call.in-progress.error-providerfault-inflection-ai-503-server-overloaded-error" + )] + CallInProgressErrorProviderfaultInflectionAi503ServerOverloadedError, + [EnumMember(Value = "pipeline-error-deep-seek-400-bad-request-validation-failed")] PipelineErrorDeepSeek400BadRequestValidationFailed, @@ -307,20 +600,33 @@ public enum CallEndedReason [EnumMember(Value = "pipeline-error-deep-seek-500-server-error")] PipelineErrorDeepSeek500ServerError, - [EnumMember(Value = "pipeline-error-azure-openai-400-bad-request-validation-failed")] - PipelineErrorAzureOpenai400BadRequestValidationFailed, + [EnumMember(Value = "pipeline-error-deep-seek-503-server-overloaded-error")] + PipelineErrorDeepSeek503ServerOverloadedError, - [EnumMember(Value = "pipeline-error-azure-openai-401-unauthorized")] - PipelineErrorAzureOpenai401Unauthorized, + [EnumMember(Value = "pipeline-error-deep-seek-llm-failed")] + PipelineErrorDeepSeekLlmFailed, - [EnumMember(Value = "pipeline-error-azure-openai-403-model-access-denied")] - PipelineErrorAzureOpenai403ModelAccessDenied, + [EnumMember( + Value = "call.in-progress.error-vapifault-deep-seek-400-bad-request-validation-failed" + )] + CallInProgressErrorVapifaultDeepSeek400BadRequestValidationFailed, - [EnumMember(Value = "pipeline-error-azure-openai-429-exceeded-quota")] - PipelineErrorAzureOpenai429ExceededQuota, + [EnumMember(Value = "call.in-progress.error-vapifault-deep-seek-401-unauthorized")] + CallInProgressErrorVapifaultDeepSeek401Unauthorized, - [EnumMember(Value = "pipeline-error-azure-openai-500-server-error")] - PipelineErrorAzureOpenai500ServerError, + [EnumMember(Value = "call.in-progress.error-vapifault-deep-seek-403-model-access-denied")] + CallInProgressErrorVapifaultDeepSeek403ModelAccessDenied, + + [EnumMember(Value = "call.in-progress.error-vapifault-deep-seek-429-exceeded-quota")] + CallInProgressErrorVapifaultDeepSeek429ExceededQuota, + + [EnumMember(Value = "call.in-progress.error-providerfault-deep-seek-500-server-error")] + CallInProgressErrorProviderfaultDeepSeek500ServerError, + + [EnumMember( + Value = "call.in-progress.error-providerfault-deep-seek-503-server-overloaded-error" + )] + CallInProgressErrorProviderfaultDeepSeek503ServerOverloadedError, [EnumMember(Value = "pipeline-error-groq-400-bad-request-validation-failed")] PipelineErrorGroq400BadRequestValidationFailed, @@ -337,6 +643,30 @@ public enum CallEndedReason [EnumMember(Value = "pipeline-error-groq-500-server-error")] PipelineErrorGroq500ServerError, + [EnumMember(Value = "pipeline-error-groq-503-server-overloaded-error")] + PipelineErrorGroq503ServerOverloadedError, + + [EnumMember(Value = "pipeline-error-groq-llm-failed")] + PipelineErrorGroqLlmFailed, + + [EnumMember(Value = "call.in-progress.error-vapifault-groq-400-bad-request-validation-failed")] + CallInProgressErrorVapifaultGroq400BadRequestValidationFailed, + + [EnumMember(Value = "call.in-progress.error-vapifault-groq-401-unauthorized")] + CallInProgressErrorVapifaultGroq401Unauthorized, + + [EnumMember(Value = "call.in-progress.error-vapifault-groq-403-model-access-denied")] + CallInProgressErrorVapifaultGroq403ModelAccessDenied, + + [EnumMember(Value = "call.in-progress.error-vapifault-groq-429-exceeded-quota")] + CallInProgressErrorVapifaultGroq429ExceededQuota, + + [EnumMember(Value = "call.in-progress.error-providerfault-groq-500-server-error")] + CallInProgressErrorProviderfaultGroq500ServerError, + + [EnumMember(Value = "call.in-progress.error-providerfault-groq-503-server-overloaded-error")] + CallInProgressErrorProviderfaultGroq503ServerOverloadedError, + [EnumMember(Value = "pipeline-error-cerebras-400-bad-request-validation-failed")] PipelineErrorCerebras400BadRequestValidationFailed, @@ -346,29 +676,181 @@ public enum CallEndedReason [EnumMember(Value = "pipeline-error-cerebras-403-model-access-denied")] PipelineErrorCerebras403ModelAccessDenied, - [EnumMember(Value = "pipeline-error-cerebras-429-exceeded-quota")] - PipelineErrorCerebras429ExceededQuota, + [EnumMember(Value = "pipeline-error-cerebras-429-exceeded-quota")] + PipelineErrorCerebras429ExceededQuota, + + [EnumMember(Value = "pipeline-error-cerebras-500-server-error")] + PipelineErrorCerebras500ServerError, + + [EnumMember(Value = "pipeline-error-cerebras-503-server-overloaded-error")] + PipelineErrorCerebras503ServerOverloadedError, + + [EnumMember(Value = "pipeline-error-cerebras-llm-failed")] + PipelineErrorCerebrasLlmFailed, + + [EnumMember( + Value = "call.in-progress.error-vapifault-cerebras-400-bad-request-validation-failed" + )] + CallInProgressErrorVapifaultCerebras400BadRequestValidationFailed, + + [EnumMember(Value = "call.in-progress.error-vapifault-cerebras-401-unauthorized")] + CallInProgressErrorVapifaultCerebras401Unauthorized, + + [EnumMember(Value = "call.in-progress.error-vapifault-cerebras-403-model-access-denied")] + CallInProgressErrorVapifaultCerebras403ModelAccessDenied, + + [EnumMember(Value = "call.in-progress.error-vapifault-cerebras-429-exceeded-quota")] + CallInProgressErrorVapifaultCerebras429ExceededQuota, + + [EnumMember(Value = "call.in-progress.error-providerfault-cerebras-500-server-error")] + CallInProgressErrorProviderfaultCerebras500ServerError, + + [EnumMember( + Value = "call.in-progress.error-providerfault-cerebras-503-server-overloaded-error" + )] + CallInProgressErrorProviderfaultCerebras503ServerOverloadedError, + + [EnumMember(Value = "pipeline-error-anthropic-400-bad-request-validation-failed")] + PipelineErrorAnthropic400BadRequestValidationFailed, + + [EnumMember(Value = "pipeline-error-anthropic-401-unauthorized")] + PipelineErrorAnthropic401Unauthorized, + + [EnumMember(Value = "pipeline-error-anthropic-403-model-access-denied")] + PipelineErrorAnthropic403ModelAccessDenied, + + [EnumMember(Value = "pipeline-error-anthropic-429-exceeded-quota")] + PipelineErrorAnthropic429ExceededQuota, + + [EnumMember(Value = "pipeline-error-anthropic-500-server-error")] + PipelineErrorAnthropic500ServerError, + + [EnumMember(Value = "pipeline-error-anthropic-503-server-overloaded-error")] + PipelineErrorAnthropic503ServerOverloadedError, + + [EnumMember(Value = "pipeline-error-anthropic-llm-failed")] + PipelineErrorAnthropicLlmFailed, + + [EnumMember(Value = "call.in-progress.error-vapifault-anthropic-llm-failed")] + CallInProgressErrorVapifaultAnthropicLlmFailed, + + [EnumMember( + Value = "call.in-progress.error-vapifault-anthropic-400-bad-request-validation-failed" + )] + CallInProgressErrorVapifaultAnthropic400BadRequestValidationFailed, + + [EnumMember(Value = "call.in-progress.error-vapifault-anthropic-401-unauthorized")] + CallInProgressErrorVapifaultAnthropic401Unauthorized, + + [EnumMember(Value = "call.in-progress.error-vapifault-anthropic-403-model-access-denied")] + CallInProgressErrorVapifaultAnthropic403ModelAccessDenied, + + [EnumMember(Value = "call.in-progress.error-vapifault-anthropic-429-exceeded-quota")] + CallInProgressErrorVapifaultAnthropic429ExceededQuota, + + [EnumMember(Value = "call.in-progress.error-providerfault-anthropic-500-server-error")] + CallInProgressErrorProviderfaultAnthropic500ServerError, + + [EnumMember( + Value = "call.in-progress.error-providerfault-anthropic-503-server-overloaded-error" + )] + CallInProgressErrorProviderfaultAnthropic503ServerOverloadedError, + + [EnumMember(Value = "pipeline-error-anthropic-bedrock-400-bad-request-validation-failed")] + PipelineErrorAnthropicBedrock400BadRequestValidationFailed, + + [EnumMember(Value = "pipeline-error-anthropic-bedrock-401-unauthorized")] + PipelineErrorAnthropicBedrock401Unauthorized, + + [EnumMember(Value = "pipeline-error-anthropic-bedrock-403-model-access-denied")] + PipelineErrorAnthropicBedrock403ModelAccessDenied, + + [EnumMember(Value = "pipeline-error-anthropic-bedrock-429-exceeded-quota")] + PipelineErrorAnthropicBedrock429ExceededQuota, + + [EnumMember(Value = "pipeline-error-anthropic-bedrock-500-server-error")] + PipelineErrorAnthropicBedrock500ServerError, + + [EnumMember(Value = "pipeline-error-anthropic-bedrock-503-server-overloaded-error")] + PipelineErrorAnthropicBedrock503ServerOverloadedError, + + [EnumMember(Value = "pipeline-error-anthropic-bedrock-llm-failed")] + PipelineErrorAnthropicBedrockLlmFailed, + + [EnumMember(Value = "call.in-progress.error-vapifault-anthropic-bedrock-llm-failed")] + CallInProgressErrorVapifaultAnthropicBedrockLlmFailed, + + [EnumMember( + Value = "call.in-progress.error-vapifault-anthropic-bedrock-400-bad-request-validation-failed" + )] + CallInProgressErrorVapifaultAnthropicBedrock400BadRequestValidationFailed, + + [EnumMember(Value = "call.in-progress.error-vapifault-anthropic-bedrock-401-unauthorized")] + CallInProgressErrorVapifaultAnthropicBedrock401Unauthorized, + + [EnumMember( + Value = "call.in-progress.error-vapifault-anthropic-bedrock-403-model-access-denied" + )] + CallInProgressErrorVapifaultAnthropicBedrock403ModelAccessDenied, + + [EnumMember(Value = "call.in-progress.error-vapifault-anthropic-bedrock-429-exceeded-quota")] + CallInProgressErrorVapifaultAnthropicBedrock429ExceededQuota, + + [EnumMember(Value = "call.in-progress.error-providerfault-anthropic-bedrock-500-server-error")] + CallInProgressErrorProviderfaultAnthropicBedrock500ServerError, + + [EnumMember( + Value = "call.in-progress.error-providerfault-anthropic-bedrock-503-server-overloaded-error" + )] + CallInProgressErrorProviderfaultAnthropicBedrock503ServerOverloadedError, + + [EnumMember(Value = "pipeline-error-anthropic-vertex-400-bad-request-validation-failed")] + PipelineErrorAnthropicVertex400BadRequestValidationFailed, + + [EnumMember(Value = "pipeline-error-anthropic-vertex-401-unauthorized")] + PipelineErrorAnthropicVertex401Unauthorized, + + [EnumMember(Value = "pipeline-error-anthropic-vertex-403-model-access-denied")] + PipelineErrorAnthropicVertex403ModelAccessDenied, + + [EnumMember(Value = "pipeline-error-anthropic-vertex-429-exceeded-quota")] + PipelineErrorAnthropicVertex429ExceededQuota, + + [EnumMember(Value = "pipeline-error-anthropic-vertex-500-server-error")] + PipelineErrorAnthropicVertex500ServerError, + + [EnumMember(Value = "pipeline-error-anthropic-vertex-503-server-overloaded-error")] + PipelineErrorAnthropicVertex503ServerOverloadedError, - [EnumMember(Value = "pipeline-error-cerebras-500-server-error")] - PipelineErrorCerebras500ServerError, + [EnumMember(Value = "pipeline-error-anthropic-vertex-llm-failed")] + PipelineErrorAnthropicVertexLlmFailed, - [EnumMember(Value = "pipeline-error-anthropic-400-bad-request-validation-failed")] - PipelineErrorAnthropic400BadRequestValidationFailed, + [EnumMember(Value = "call.in-progress.error-vapifault-anthropic-vertex-llm-failed")] + CallInProgressErrorVapifaultAnthropicVertexLlmFailed, - [EnumMember(Value = "pipeline-error-anthropic-401-unauthorized")] - PipelineErrorAnthropic401Unauthorized, + [EnumMember( + Value = "call.in-progress.error-vapifault-anthropic-vertex-400-bad-request-validation-failed" + )] + CallInProgressErrorVapifaultAnthropicVertex400BadRequestValidationFailed, - [EnumMember(Value = "pipeline-error-anthropic-403-model-access-denied")] - PipelineErrorAnthropic403ModelAccessDenied, + [EnumMember(Value = "call.in-progress.error-vapifault-anthropic-vertex-401-unauthorized")] + CallInProgressErrorVapifaultAnthropicVertex401Unauthorized, - [EnumMember(Value = "pipeline-error-anthropic-429-exceeded-quota")] - PipelineErrorAnthropic429ExceededQuota, + [EnumMember( + Value = "call.in-progress.error-vapifault-anthropic-vertex-403-model-access-denied" + )] + CallInProgressErrorVapifaultAnthropicVertex403ModelAccessDenied, - [EnumMember(Value = "pipeline-error-anthropic-500-server-error")] - PipelineErrorAnthropic500ServerError, + [EnumMember(Value = "call.in-progress.error-vapifault-anthropic-vertex-429-exceeded-quota")] + CallInProgressErrorVapifaultAnthropicVertex429ExceededQuota, - [EnumMember(Value = "pipeline-error-anthropic-llm-failed")] - PipelineErrorAnthropicLlmFailed, + [EnumMember(Value = "call.in-progress.error-providerfault-anthropic-vertex-500-server-error")] + CallInProgressErrorProviderfaultAnthropicVertex500ServerError, + + [EnumMember( + Value = "call.in-progress.error-providerfault-anthropic-vertex-503-server-overloaded-error" + )] + CallInProgressErrorProviderfaultAnthropicVertex503ServerOverloadedError, [EnumMember(Value = "pipeline-error-together-ai-400-bad-request-validation-failed")] PipelineErrorTogetherAi400BadRequestValidationFailed, @@ -385,9 +867,37 @@ public enum CallEndedReason [EnumMember(Value = "pipeline-error-together-ai-500-server-error")] PipelineErrorTogetherAi500ServerError, + [EnumMember(Value = "pipeline-error-together-ai-503-server-overloaded-error")] + PipelineErrorTogetherAi503ServerOverloadedError, + [EnumMember(Value = "pipeline-error-together-ai-llm-failed")] PipelineErrorTogetherAiLlmFailed, + [EnumMember(Value = "call.in-progress.error-vapifault-together-ai-llm-failed")] + CallInProgressErrorVapifaultTogetherAiLlmFailed, + + [EnumMember( + Value = "call.in-progress.error-vapifault-together-ai-400-bad-request-validation-failed" + )] + CallInProgressErrorVapifaultTogetherAi400BadRequestValidationFailed, + + [EnumMember(Value = "call.in-progress.error-vapifault-together-ai-401-unauthorized")] + CallInProgressErrorVapifaultTogetherAi401Unauthorized, + + [EnumMember(Value = "call.in-progress.error-vapifault-together-ai-403-model-access-denied")] + CallInProgressErrorVapifaultTogetherAi403ModelAccessDenied, + + [EnumMember(Value = "call.in-progress.error-vapifault-together-ai-429-exceeded-quota")] + CallInProgressErrorVapifaultTogetherAi429ExceededQuota, + + [EnumMember(Value = "call.in-progress.error-providerfault-together-ai-500-server-error")] + CallInProgressErrorProviderfaultTogetherAi500ServerError, + + [EnumMember( + Value = "call.in-progress.error-providerfault-together-ai-503-server-overloaded-error" + )] + CallInProgressErrorProviderfaultTogetherAi503ServerOverloadedError, + [EnumMember(Value = "pipeline-error-anyscale-400-bad-request-validation-failed")] PipelineErrorAnyscale400BadRequestValidationFailed, @@ -403,9 +913,37 @@ public enum CallEndedReason [EnumMember(Value = "pipeline-error-anyscale-500-server-error")] PipelineErrorAnyscale500ServerError, + [EnumMember(Value = "pipeline-error-anyscale-503-server-overloaded-error")] + PipelineErrorAnyscale503ServerOverloadedError, + [EnumMember(Value = "pipeline-error-anyscale-llm-failed")] PipelineErrorAnyscaleLlmFailed, + [EnumMember(Value = "call.in-progress.error-vapifault-anyscale-llm-failed")] + CallInProgressErrorVapifaultAnyscaleLlmFailed, + + [EnumMember( + Value = "call.in-progress.error-vapifault-anyscale-400-bad-request-validation-failed" + )] + CallInProgressErrorVapifaultAnyscale400BadRequestValidationFailed, + + [EnumMember(Value = "call.in-progress.error-vapifault-anyscale-401-unauthorized")] + CallInProgressErrorVapifaultAnyscale401Unauthorized, + + [EnumMember(Value = "call.in-progress.error-vapifault-anyscale-403-model-access-denied")] + CallInProgressErrorVapifaultAnyscale403ModelAccessDenied, + + [EnumMember(Value = "call.in-progress.error-vapifault-anyscale-429-exceeded-quota")] + CallInProgressErrorVapifaultAnyscale429ExceededQuota, + + [EnumMember(Value = "call.in-progress.error-providerfault-anyscale-500-server-error")] + CallInProgressErrorProviderfaultAnyscale500ServerError, + + [EnumMember( + Value = "call.in-progress.error-providerfault-anyscale-503-server-overloaded-error" + )] + CallInProgressErrorProviderfaultAnyscale503ServerOverloadedError, + [EnumMember(Value = "pipeline-error-openrouter-400-bad-request-validation-failed")] PipelineErrorOpenrouter400BadRequestValidationFailed, @@ -421,9 +959,37 @@ public enum CallEndedReason [EnumMember(Value = "pipeline-error-openrouter-500-server-error")] PipelineErrorOpenrouter500ServerError, + [EnumMember(Value = "pipeline-error-openrouter-503-server-overloaded-error")] + PipelineErrorOpenrouter503ServerOverloadedError, + [EnumMember(Value = "pipeline-error-openrouter-llm-failed")] PipelineErrorOpenrouterLlmFailed, + [EnumMember(Value = "call.in-progress.error-vapifault-openrouter-llm-failed")] + CallInProgressErrorVapifaultOpenrouterLlmFailed, + + [EnumMember( + Value = "call.in-progress.error-vapifault-openrouter-400-bad-request-validation-failed" + )] + CallInProgressErrorVapifaultOpenrouter400BadRequestValidationFailed, + + [EnumMember(Value = "call.in-progress.error-vapifault-openrouter-401-unauthorized")] + CallInProgressErrorVapifaultOpenrouter401Unauthorized, + + [EnumMember(Value = "call.in-progress.error-vapifault-openrouter-403-model-access-denied")] + CallInProgressErrorVapifaultOpenrouter403ModelAccessDenied, + + [EnumMember(Value = "call.in-progress.error-vapifault-openrouter-429-exceeded-quota")] + CallInProgressErrorVapifaultOpenrouter429ExceededQuota, + + [EnumMember(Value = "call.in-progress.error-providerfault-openrouter-500-server-error")] + CallInProgressErrorProviderfaultOpenrouter500ServerError, + + [EnumMember( + Value = "call.in-progress.error-providerfault-openrouter-503-server-overloaded-error" + )] + CallInProgressErrorProviderfaultOpenrouter503ServerOverloadedError, + [EnumMember(Value = "pipeline-error-perplexity-ai-400-bad-request-validation-failed")] PipelineErrorPerplexityAi400BadRequestValidationFailed, @@ -439,9 +1005,37 @@ public enum CallEndedReason [EnumMember(Value = "pipeline-error-perplexity-ai-500-server-error")] PipelineErrorPerplexityAi500ServerError, + [EnumMember(Value = "pipeline-error-perplexity-ai-503-server-overloaded-error")] + PipelineErrorPerplexityAi503ServerOverloadedError, + [EnumMember(Value = "pipeline-error-perplexity-ai-llm-failed")] PipelineErrorPerplexityAiLlmFailed, + [EnumMember(Value = "call.in-progress.error-vapifault-perplexity-ai-llm-failed")] + CallInProgressErrorVapifaultPerplexityAiLlmFailed, + + [EnumMember( + Value = "call.in-progress.error-vapifault-perplexity-ai-400-bad-request-validation-failed" + )] + CallInProgressErrorVapifaultPerplexityAi400BadRequestValidationFailed, + + [EnumMember(Value = "call.in-progress.error-vapifault-perplexity-ai-401-unauthorized")] + CallInProgressErrorVapifaultPerplexityAi401Unauthorized, + + [EnumMember(Value = "call.in-progress.error-vapifault-perplexity-ai-403-model-access-denied")] + CallInProgressErrorVapifaultPerplexityAi403ModelAccessDenied, + + [EnumMember(Value = "call.in-progress.error-vapifault-perplexity-ai-429-exceeded-quota")] + CallInProgressErrorVapifaultPerplexityAi429ExceededQuota, + + [EnumMember(Value = "call.in-progress.error-providerfault-perplexity-ai-500-server-error")] + CallInProgressErrorProviderfaultPerplexityAi500ServerError, + + [EnumMember( + Value = "call.in-progress.error-providerfault-perplexity-ai-503-server-overloaded-error" + )] + CallInProgressErrorProviderfaultPerplexityAi503ServerOverloadedError, + [EnumMember(Value = "pipeline-error-deepinfra-400-bad-request-validation-failed")] PipelineErrorDeepinfra400BadRequestValidationFailed, @@ -457,9 +1051,37 @@ public enum CallEndedReason [EnumMember(Value = "pipeline-error-deepinfra-500-server-error")] PipelineErrorDeepinfra500ServerError, + [EnumMember(Value = "pipeline-error-deepinfra-503-server-overloaded-error")] + PipelineErrorDeepinfra503ServerOverloadedError, + [EnumMember(Value = "pipeline-error-deepinfra-llm-failed")] PipelineErrorDeepinfraLlmFailed, + [EnumMember(Value = "call.in-progress.error-vapifault-deepinfra-llm-failed")] + CallInProgressErrorVapifaultDeepinfraLlmFailed, + + [EnumMember( + Value = "call.in-progress.error-vapifault-deepinfra-400-bad-request-validation-failed" + )] + CallInProgressErrorVapifaultDeepinfra400BadRequestValidationFailed, + + [EnumMember(Value = "call.in-progress.error-vapifault-deepinfra-401-unauthorized")] + CallInProgressErrorVapifaultDeepinfra401Unauthorized, + + [EnumMember(Value = "call.in-progress.error-vapifault-deepinfra-403-model-access-denied")] + CallInProgressErrorVapifaultDeepinfra403ModelAccessDenied, + + [EnumMember(Value = "call.in-progress.error-vapifault-deepinfra-429-exceeded-quota")] + CallInProgressErrorVapifaultDeepinfra429ExceededQuota, + + [EnumMember(Value = "call.in-progress.error-providerfault-deepinfra-500-server-error")] + CallInProgressErrorProviderfaultDeepinfra500ServerError, + + [EnumMember( + Value = "call.in-progress.error-providerfault-deepinfra-503-server-overloaded-error" + )] + CallInProgressErrorProviderfaultDeepinfra503ServerOverloadedError, + [EnumMember(Value = "pipeline-error-runpod-400-bad-request-validation-failed")] PipelineErrorRunpod400BadRequestValidationFailed, @@ -475,9 +1097,35 @@ public enum CallEndedReason [EnumMember(Value = "pipeline-error-runpod-500-server-error")] PipelineErrorRunpod500ServerError, + [EnumMember(Value = "pipeline-error-runpod-503-server-overloaded-error")] + PipelineErrorRunpod503ServerOverloadedError, + [EnumMember(Value = "pipeline-error-runpod-llm-failed")] PipelineErrorRunpodLlmFailed, + [EnumMember(Value = "call.in-progress.error-vapifault-runpod-llm-failed")] + CallInProgressErrorVapifaultRunpodLlmFailed, + + [EnumMember( + Value = "call.in-progress.error-vapifault-runpod-400-bad-request-validation-failed" + )] + CallInProgressErrorVapifaultRunpod400BadRequestValidationFailed, + + [EnumMember(Value = "call.in-progress.error-vapifault-runpod-401-unauthorized")] + CallInProgressErrorVapifaultRunpod401Unauthorized, + + [EnumMember(Value = "call.in-progress.error-vapifault-runpod-403-model-access-denied")] + CallInProgressErrorVapifaultRunpod403ModelAccessDenied, + + [EnumMember(Value = "call.in-progress.error-vapifault-runpod-429-exceeded-quota")] + CallInProgressErrorVapifaultRunpod429ExceededQuota, + + [EnumMember(Value = "call.in-progress.error-providerfault-runpod-500-server-error")] + CallInProgressErrorProviderfaultRunpod500ServerError, + + [EnumMember(Value = "call.in-progress.error-providerfault-runpod-503-server-overloaded-error")] + CallInProgressErrorProviderfaultRunpod503ServerOverloadedError, + [EnumMember(Value = "pipeline-error-custom-llm-400-bad-request-validation-failed")] PipelineErrorCustomLlm400BadRequestValidationFailed, @@ -493,9 +1141,37 @@ public enum CallEndedReason [EnumMember(Value = "pipeline-error-custom-llm-500-server-error")] PipelineErrorCustomLlm500ServerError, + [EnumMember(Value = "pipeline-error-custom-llm-503-server-overloaded-error")] + PipelineErrorCustomLlm503ServerOverloadedError, + [EnumMember(Value = "pipeline-error-custom-llm-llm-failed")] PipelineErrorCustomLlmLlmFailed, + [EnumMember(Value = "call.in-progress.error-vapifault-custom-llm-llm-failed")] + CallInProgressErrorVapifaultCustomLlmLlmFailed, + + [EnumMember( + Value = "call.in-progress.error-vapifault-custom-llm-400-bad-request-validation-failed" + )] + CallInProgressErrorVapifaultCustomLlm400BadRequestValidationFailed, + + [EnumMember(Value = "call.in-progress.error-vapifault-custom-llm-401-unauthorized")] + CallInProgressErrorVapifaultCustomLlm401Unauthorized, + + [EnumMember(Value = "call.in-progress.error-vapifault-custom-llm-403-model-access-denied")] + CallInProgressErrorVapifaultCustomLlm403ModelAccessDenied, + + [EnumMember(Value = "call.in-progress.error-vapifault-custom-llm-429-exceeded-quota")] + CallInProgressErrorVapifaultCustomLlm429ExceededQuota, + + [EnumMember(Value = "call.in-progress.error-providerfault-custom-llm-500-server-error")] + CallInProgressErrorProviderfaultCustomLlm500ServerError, + + [EnumMember( + Value = "call.in-progress.error-providerfault-custom-llm-503-server-overloaded-error" + )] + CallInProgressErrorProviderfaultCustomLlm503ServerOverloadedError, + [EnumMember(Value = "pipeline-error-custom-voice-failed")] PipelineErrorCustomVoiceFailed, @@ -514,6 +1190,21 @@ public enum CallEndedReason [EnumMember(Value = "pipeline-error-cartesia-522-server-error")] PipelineErrorCartesia522ServerError, + [EnumMember(Value = "call.in-progress.error-vapifault-cartesia-socket-hang-up")] + CallInProgressErrorVapifaultCartesiaSocketHangUp, + + [EnumMember(Value = "call.in-progress.error-vapifault-cartesia-requested-payment")] + CallInProgressErrorVapifaultCartesiaRequestedPayment, + + [EnumMember(Value = "call.in-progress.error-providerfault-cartesia-500-server-error")] + CallInProgressErrorProviderfaultCartesia500ServerError, + + [EnumMember(Value = "call.in-progress.error-providerfault-cartesia-503-server-error")] + CallInProgressErrorProviderfaultCartesia503ServerError, + + [EnumMember(Value = "call.in-progress.error-providerfault-cartesia-522-server-error")] + CallInProgressErrorProviderfaultCartesia522ServerError, + [EnumMember(Value = "pipeline-error-eleven-labs-voice-not-found")] PipelineErrorElevenLabsVoiceNotFound, @@ -572,9 +1263,6 @@ public enum CallEndedReason [EnumMember(Value = "pipeline-error-eleven-labs-voice-not-allowed-for-free-users")] PipelineErrorElevenLabsVoiceNotAllowedForFreeUsers, - [EnumMember(Value = "pipeline-error-eleven-labs-500-server-error")] - PipelineErrorElevenLabs500ServerError, - [EnumMember(Value = "pipeline-error-eleven-labs-max-character-limit-exceeded")] PipelineErrorElevenLabsMaxCharacterLimitExceeded, @@ -583,6 +1271,98 @@ public enum CallEndedReason )] PipelineErrorElevenLabsBlockedVoicePotentiallyAgainstTermsOfServiceAndAwaitingVerification, + [EnumMember(Value = "pipeline-error-eleven-labs-500-server-error")] + PipelineErrorElevenLabs500ServerError, + + [EnumMember(Value = "call.in-progress.error-vapifault-eleven-labs-voice-not-found")] + CallInProgressErrorVapifaultElevenLabsVoiceNotFound, + + [EnumMember(Value = "call.in-progress.error-vapifault-eleven-labs-quota-exceeded")] + CallInProgressErrorVapifaultElevenLabsQuotaExceeded, + + [EnumMember(Value = "call.in-progress.error-vapifault-eleven-labs-unauthorized-access")] + CallInProgressErrorVapifaultElevenLabsUnauthorizedAccess, + + [EnumMember( + Value = "call.in-progress.error-vapifault-eleven-labs-unauthorized-to-access-model" + )] + CallInProgressErrorVapifaultElevenLabsUnauthorizedToAccessModel, + + [EnumMember( + Value = "call.in-progress.error-vapifault-eleven-labs-professional-voices-only-for-creator-plus" + )] + CallInProgressErrorVapifaultElevenLabsProfessionalVoicesOnlyForCreatorPlus, + + [EnumMember( + Value = "call.in-progress.error-vapifault-eleven-labs-blocked-free-plan-and-requested-upgrade" + )] + CallInProgressErrorVapifaultElevenLabsBlockedFreePlanAndRequestedUpgrade, + + [EnumMember( + Value = "call.in-progress.error-vapifault-eleven-labs-blocked-concurrent-requests-and-requested-upgrade" + )] + CallInProgressErrorVapifaultElevenLabsBlockedConcurrentRequestsAndRequestedUpgrade, + + [EnumMember( + Value = "call.in-progress.error-vapifault-eleven-labs-blocked-using-instant-voice-clone-and-requested-upgrade" + )] + CallInProgressErrorVapifaultElevenLabsBlockedUsingInstantVoiceCloneAndRequestedUpgrade, + + [EnumMember( + Value = "call.in-progress.error-vapifault-eleven-labs-system-busy-and-requested-upgrade" + )] + CallInProgressErrorVapifaultElevenLabsSystemBusyAndRequestedUpgrade, + + [EnumMember(Value = "call.in-progress.error-vapifault-eleven-labs-voice-not-fine-tuned")] + CallInProgressErrorVapifaultElevenLabsVoiceNotFineTuned, + + [EnumMember(Value = "call.in-progress.error-vapifault-eleven-labs-invalid-api-key")] + CallInProgressErrorVapifaultElevenLabsInvalidApiKey, + + [EnumMember(Value = "call.in-progress.error-vapifault-eleven-labs-invalid-voice-samples")] + CallInProgressErrorVapifaultElevenLabsInvalidVoiceSamples, + + [EnumMember(Value = "call.in-progress.error-vapifault-eleven-labs-voice-disabled-by-owner")] + CallInProgressErrorVapifaultElevenLabsVoiceDisabledByOwner, + + [EnumMember( + Value = "call.in-progress.error-vapifault-eleven-labs-blocked-account-in-probation" + )] + CallInProgressErrorVapifaultElevenLabsBlockedAccountInProbation, + + [EnumMember( + Value = "call.in-progress.error-vapifault-eleven-labs-blocked-content-against-their-policy" + )] + CallInProgressErrorVapifaultElevenLabsBlockedContentAgainstTheirPolicy, + + [EnumMember( + Value = "call.in-progress.error-vapifault-eleven-labs-missing-samples-for-voice-clone" + )] + CallInProgressErrorVapifaultElevenLabsMissingSamplesForVoiceClone, + + [EnumMember( + Value = "call.in-progress.error-vapifault-eleven-labs-voice-not-fine-tuned-and-cannot-be-used" + )] + CallInProgressErrorVapifaultElevenLabsVoiceNotFineTunedAndCannotBeUsed, + + [EnumMember( + Value = "call.in-progress.error-vapifault-eleven-labs-voice-not-allowed-for-free-users" + )] + CallInProgressErrorVapifaultElevenLabsVoiceNotAllowedForFreeUsers, + + [EnumMember( + Value = "call.in-progress.error-vapifault-eleven-labs-max-character-limit-exceeded" + )] + CallInProgressErrorVapifaultElevenLabsMaxCharacterLimitExceeded, + + [EnumMember( + Value = "call.in-progress.error-vapifault-eleven-labs-blocked-voice-potentially-against-terms-of-service-and-awaiting-verification" + )] + CallInProgressErrorVapifaultElevenLabsBlockedVoicePotentiallyAgainstTermsOfServiceAndAwaitingVerification, + + [EnumMember(Value = "call.in-progress.error-providerfault-eleven-labs-500-server-error")] + CallInProgressErrorProviderfaultElevenLabs500ServerError, + [EnumMember(Value = "pipeline-error-playht-request-timed-out")] PipelineErrorPlayhtRequestTimedOut, @@ -619,26 +1399,72 @@ public enum CallEndedReason [EnumMember(Value = "pipeline-error-playht-504-gateway-error")] PipelineErrorPlayht504GatewayError, - [EnumMember(Value = "pipeline-error-tavus-video-failed")] - PipelineErrorTavusVideoFailed, + [EnumMember(Value = "call.in-progress.error-vapifault-playht-request-timed-out")] + CallInProgressErrorVapifaultPlayhtRequestTimedOut, + + [EnumMember(Value = "call.in-progress.error-vapifault-playht-invalid-voice")] + CallInProgressErrorVapifaultPlayhtInvalidVoice, + + [EnumMember(Value = "call.in-progress.error-vapifault-playht-unexpected-error")] + CallInProgressErrorVapifaultPlayhtUnexpectedError, + + [EnumMember(Value = "call.in-progress.error-vapifault-playht-out-of-credits")] + CallInProgressErrorVapifaultPlayhtOutOfCredits, + + [EnumMember(Value = "call.in-progress.error-vapifault-playht-invalid-emotion")] + CallInProgressErrorVapifaultPlayhtInvalidEmotion, + + [EnumMember( + Value = "call.in-progress.error-vapifault-playht-voice-must-be-a-valid-voice-manifest-uri" + )] + CallInProgressErrorVapifaultPlayhtVoiceMustBeAValidVoiceManifestUri, + + [EnumMember(Value = "call.in-progress.error-vapifault-playht-401-unauthorized")] + CallInProgressErrorVapifaultPlayht401Unauthorized, + + [EnumMember(Value = "call.in-progress.error-vapifault-playht-403-forbidden-out-of-characters")] + CallInProgressErrorVapifaultPlayht403ForbiddenOutOfCharacters, + + [EnumMember( + Value = "call.in-progress.error-vapifault-playht-403-forbidden-api-access-not-available" + )] + CallInProgressErrorVapifaultPlayht403ForbiddenApiAccessNotAvailable, + + [EnumMember(Value = "call.in-progress.error-vapifault-playht-429-exceeded-quota")] + CallInProgressErrorVapifaultPlayht429ExceededQuota, + + [EnumMember(Value = "call.in-progress.error-providerfault-playht-502-gateway-error")] + CallInProgressErrorProviderfaultPlayht502GatewayError, + + [EnumMember(Value = "call.in-progress.error-providerfault-playht-504-gateway-error")] + CallInProgressErrorProviderfaultPlayht504GatewayError, [EnumMember(Value = "pipeline-error-custom-transcriber-failed")] PipelineErrorCustomTranscriberFailed, - [EnumMember(Value = "pipeline-error-deepgram-returning-403-model-access-denied")] - PipelineErrorDeepgramReturning403ModelAccessDenied, + [EnumMember(Value = "call.in-progress.error-vapifault-custom-transcriber-failed")] + CallInProgressErrorVapifaultCustomTranscriberFailed, - [EnumMember(Value = "pipeline-error-deepgram-returning-401-invalid-credentials")] - PipelineErrorDeepgramReturning401InvalidCredentials, + [EnumMember(Value = "pipeline-error-eleven-labs-transcriber-failed")] + PipelineErrorElevenLabsTranscriberFailed, - [EnumMember(Value = "pipeline-error-deepgram-returning-404-not-found")] - PipelineErrorDeepgramReturning404NotFound, + [EnumMember(Value = "call.in-progress.error-vapifault-eleven-labs-transcriber-failed")] + CallInProgressErrorVapifaultElevenLabsTranscriberFailed, [EnumMember( Value = "pipeline-error-deepgram-returning-400-no-such-model-language-tier-combination" )] PipelineErrorDeepgramReturning400NoSuchModelLanguageTierCombination, + [EnumMember(Value = "pipeline-error-deepgram-returning-401-invalid-credentials")] + PipelineErrorDeepgramReturning401InvalidCredentials, + + [EnumMember(Value = "pipeline-error-deepgram-returning-403-model-access-denied")] + PipelineErrorDeepgramReturning403ModelAccessDenied, + + [EnumMember(Value = "pipeline-error-deepgram-returning-404-not-found")] + PipelineErrorDeepgramReturning404NotFound, + [EnumMember(Value = "pipeline-error-deepgram-returning-500-invalid-json")] PipelineErrorDeepgramReturning500InvalidJson, @@ -648,11 +1474,102 @@ public enum CallEndedReason [EnumMember(Value = "pipeline-error-deepgram-returning-502-bad-gateway-ehostunreach")] PipelineErrorDeepgramReturning502BadGatewayEhostunreach, + [EnumMember( + Value = "call.in-progress.error-vapifault-deepgram-returning-400-no-such-model-language-tier-combination" + )] + CallInProgressErrorVapifaultDeepgramReturning400NoSuchModelLanguageTierCombination, + + [EnumMember( + Value = "call.in-progress.error-vapifault-deepgram-returning-401-invalid-credentials" + )] + CallInProgressErrorVapifaultDeepgramReturning401InvalidCredentials, + + [EnumMember(Value = "call.in-progress.error-vapifault-deepgram-returning-404-not-found")] + CallInProgressErrorVapifaultDeepgramReturning404NotFound, + + [EnumMember( + Value = "call.in-progress.error-vapifault-deepgram-returning-403-model-access-denied" + )] + CallInProgressErrorVapifaultDeepgramReturning403ModelAccessDenied, + + [EnumMember(Value = "call.in-progress.error-providerfault-deepgram-returning-500-invalid-json")] + CallInProgressErrorProviderfaultDeepgramReturning500InvalidJson, + + [EnumMember( + Value = "call.in-progress.error-providerfault-deepgram-returning-502-network-error" + )] + CallInProgressErrorProviderfaultDeepgramReturning502NetworkError, + + [EnumMember( + Value = "call.in-progress.error-providerfault-deepgram-returning-502-bad-gateway-ehostunreach" + )] + CallInProgressErrorProviderfaultDeepgramReturning502BadGatewayEhostunreach, + + [EnumMember(Value = "pipeline-error-google-transcriber-failed")] + PipelineErrorGoogleTranscriberFailed, + + [EnumMember(Value = "call.in-progress.error-vapifault-google-transcriber-failed")] + CallInProgressErrorVapifaultGoogleTranscriberFailed, + + [EnumMember(Value = "pipeline-error-openai-transcriber-failed")] + PipelineErrorOpenaiTranscriberFailed, + + [EnumMember(Value = "call.in-progress.error-vapifault-openai-transcriber-failed")] + CallInProgressErrorVapifaultOpenaiTranscriberFailed, + + [EnumMember(Value = "assistant-ended-call")] + AssistantEndedCall, + + [EnumMember(Value = "assistant-said-end-call-phrase")] + AssistantSaidEndCallPhrase, + + [EnumMember(Value = "assistant-ended-call-with-hangup-task")] + AssistantEndedCallWithHangupTask, + + [EnumMember(Value = "assistant-ended-call-after-message-spoken")] + AssistantEndedCallAfterMessageSpoken, + + [EnumMember(Value = "assistant-forwarded-call")] + AssistantForwardedCall, + + [EnumMember(Value = "assistant-join-timed-out")] + AssistantJoinTimedOut, + + [EnumMember(Value = "call.in-progress.error-assistant-did-not-receive-customer-audio")] + CallInProgressErrorAssistantDidNotReceiveCustomerAudio, + + [EnumMember(Value = "customer-busy")] + CustomerBusy, + + [EnumMember(Value = "customer-ended-call")] + CustomerEndedCall, + + [EnumMember(Value = "customer-did-not-answer")] + CustomerDidNotAnswer, + + [EnumMember(Value = "customer-did-not-give-microphone-permission")] + CustomerDidNotGiveMicrophonePermission, + + [EnumMember(Value = "exceeded-max-duration")] + ExceededMaxDuration, + + [EnumMember(Value = "manually-canceled")] + ManuallyCanceled, + + [EnumMember(Value = "phone-call-provider-closed-websocket")] + PhoneCallProviderClosedWebsocket, + [EnumMember(Value = "silence-timed-out")] SilenceTimedOut, - [EnumMember(Value = "sip-gateway-failed-to-connect-call")] - SipGatewayFailedToConnectCall, + [EnumMember(Value = "call.in-progress.error-sip-telephony-provider-failed-to-connect-call")] + CallInProgressErrorSipTelephonyProviderFailedToConnectCall, + + [EnumMember(Value = "call.ringing.hook-executed-say")] + CallRingingHookExecutedSay, + + [EnumMember(Value = "call.ringing.hook-executed-transfer")] + CallRingingHookExecutedTransfer, [EnumMember(Value = "twilio-failed-to-connect-call")] TwilioFailedToConnectCall, diff --git a/src/Vapi.Net/Types/CallLogPrivileged.cs b/src/Vapi.Net/Types/CallLogPrivileged.cs index 05a1cfe..bbe07c3 100644 --- a/src/Vapi.Net/Types/CallLogPrivileged.cs +++ b/src/Vapi.Net/Types/CallLogPrivileged.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -35,6 +36,17 @@ public record CallLogPrivileged [JsonPropertyName("time")] public required DateTime Time { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/CallLogsPaginatedResponse.cs b/src/Vapi.Net/Types/CallLogsPaginatedResponse.cs index 326714d..a8c8c6e 100644 --- a/src/Vapi.Net/Types/CallLogsPaginatedResponse.cs +++ b/src/Vapi.Net/Types/CallLogsPaginatedResponse.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -11,6 +12,17 @@ public record CallLogsPaginatedResponse [JsonPropertyName("metadata")] public required PaginationMeta Metadata { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/CallPaginatedResponse.cs b/src/Vapi.Net/Types/CallPaginatedResponse.cs index fee03f7..22e9ce0 100644 --- a/src/Vapi.Net/Types/CallPaginatedResponse.cs +++ b/src/Vapi.Net/Types/CallPaginatedResponse.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -11,6 +12,17 @@ public record CallPaginatedResponse [JsonPropertyName("metadata")] public required PaginationMeta Metadata { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/CallPhoneCallProvider.cs b/src/Vapi.Net/Types/CallPhoneCallProvider.cs index 7d294a7..d4efbf2 100644 --- a/src/Vapi.Net/Types/CallPhoneCallProvider.cs +++ b/src/Vapi.Net/Types/CallPhoneCallProvider.cs @@ -15,4 +15,7 @@ public enum CallPhoneCallProvider [EnumMember(Value = "vapi")] Vapi, + + [EnumMember(Value = "telnyx")] + Telnyx, } diff --git a/src/Vapi.Net/Types/CallStatus.cs b/src/Vapi.Net/Types/CallStatus.cs index fcac4a7..5e7356c 100644 --- a/src/Vapi.Net/Types/CallStatus.cs +++ b/src/Vapi.Net/Types/CallStatus.cs @@ -7,6 +7,9 @@ namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] public enum CallStatus { + [EnumMember(Value = "scheduled")] + Scheduled, + [EnumMember(Value = "queued")] Queued, diff --git a/src/Vapi.Net/Types/CallType.cs b/src/Vapi.Net/Types/CallType.cs index 075f4f1..ec53b49 100644 --- a/src/Vapi.Net/Types/CallType.cs +++ b/src/Vapi.Net/Types/CallType.cs @@ -15,4 +15,7 @@ public enum CallType [EnumMember(Value = "webCall")] WebCall, + + [EnumMember(Value = "vapi.websocketCall")] + VapiWebsocketCall, } diff --git a/src/Vapi.Net/Types/CallbackStep.cs b/src/Vapi.Net/Types/CallbackStep.cs deleted file mode 100644 index f348169..0000000 --- a/src/Vapi.Net/Types/CallbackStep.cs +++ /dev/null @@ -1,89 +0,0 @@ -using System.Text.Json.Serialization; -using Vapi.Net.Core; - -namespace Vapi.Net; - -public record CallbackStep -{ - /// - /// This is the block to use. To use an existing block, use `blockId`. - /// - [JsonPropertyName("block")] - public object? Block { get; set; } - - /// - /// This is the mutations to apply to the context after the step is done. - /// - [JsonPropertyName("mutations")] - public IEnumerable? Mutations { get; set; } - - /// - /// This is the name of the step. - /// - [JsonPropertyName("name")] - public required string Name { get; set; } - - /// - /// This is the id of the block to use. To use a transient block, use `block`. - /// - [JsonPropertyName("blockId")] - public string? BlockId { get; set; } - - /// - /// This is the input to the block. You can use any key-value map as input to the block. - /// - /// Example: - /// { - /// "name": "John Doe", - /// "age": 20 - /// } - /// - /// You can reference any variable in the context of the current block: - /// - "{{your-step-name.output.your-property-name}}" for another step's output (in the same workflow; read caveat #1) - /// - "{{your-step-name.input.your-property-name}}" for another step's input (in the same workflow; read caveat #1) - /// - "{{your-block-name.output.your-property-name}}" for another block's output (in the same workflow; read caveat #2) - /// - "{{your-block-name.input.your-property-name}}" for another block's input (in the same workflow; read caveat #2) - /// - "{{workflow.input.your-property-name}}" for the current workflow's input - /// - "{{global.your-property-name}}" for the global context - /// - /// Example: - /// { - /// "name": "{{my-tool-call-step.output.name}}", - /// "age": "{{my-tool-call-step.input.age}}", - /// "date": "{{workflow.input.date}}" - /// } - /// - /// You can dynamically change the key name. - /// - /// Example: - /// { - /// "{{my-tool-call-step.output.key-name-for-name}}": "{{name}}", - /// "{{my-tool-call-step.input.key-name-for-age}}": "{{age}}", - /// "{{workflow.input.key-name-for-date}}": "{{date}}" - /// } - /// - /// You can represent the value as a string, number, boolean, array, or object. - /// - /// Example: - /// { - /// "name": "john", - /// "age": 20, - /// "date": "2021-01-01", - /// "metadata": { - /// "unique-key": "{{my-tool-call-step.output.unique-key}}" - /// }, - /// "array": ["A", "B", "C"], - /// } - /// - /// Caveats: - /// 1. a workflow can execute a step multiple times. example, if a loop is used in the graph. {{stepName.input/output.propertyName}} will reference the latest usage of the step. - /// 2. a workflow can execute a block multiple times. example, if a step is called multiple times or if a block is used in multiple steps. {{blockName.input/output.propertyName}} will reference the latest usage of the block. this liquid variable is just provided for convenience when creating blocks outside of a workflow. - /// - [JsonPropertyName("input")] - public object? Input { get; set; } - - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Vapi.Net/Types/CartesiaCredential.cs b/src/Vapi.Net/Types/CartesiaCredential.cs index 3a5cecf..225d4e4 100644 --- a/src/Vapi.Net/Types/CartesiaCredential.cs +++ b/src/Vapi.Net/Types/CartesiaCredential.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -44,6 +45,17 @@ public record CartesiaCredential [JsonPropertyName("name")] public string? Name { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/CartesiaExperimentalControls.cs b/src/Vapi.Net/Types/CartesiaExperimentalControls.cs index 46af830..378cc22 100644 --- a/src/Vapi.Net/Types/CartesiaExperimentalControls.cs +++ b/src/Vapi.Net/Types/CartesiaExperimentalControls.cs @@ -1,4 +1,6 @@ +using System.Text.Json; using System.Text.Json.Serialization; +using OneOf; using Vapi.Net.Core; namespace Vapi.Net; @@ -6,11 +8,22 @@ namespace Vapi.Net; public record CartesiaExperimentalControls { [JsonPropertyName("speed")] - public CartesiaExperimentalControlsSpeed? Speed { get; set; } + public OneOf? Speed { get; set; } [JsonPropertyName("emotion")] public CartesiaExperimentalControlsEmotion? Emotion { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/CartesiaVoice.cs b/src/Vapi.Net/Types/CartesiaVoice.cs index efeb27f..8e69f59 100644 --- a/src/Vapi.Net/Types/CartesiaVoice.cs +++ b/src/Vapi.Net/Types/CartesiaVoice.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -41,6 +42,17 @@ public record CartesiaVoice [JsonPropertyName("fallbackPlan")] public FallbackPlan? FallbackPlan { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/CartesiaVoiceModel.cs b/src/Vapi.Net/Types/CartesiaVoiceModel.cs index 413159c..a53aacc 100644 --- a/src/Vapi.Net/Types/CartesiaVoiceModel.cs +++ b/src/Vapi.Net/Types/CartesiaVoiceModel.cs @@ -7,6 +7,9 @@ namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] public enum CartesiaVoiceModel { + [EnumMember(Value = "sonic-2")] + Sonic2, + [EnumMember(Value = "sonic-english")] SonicEnglish, diff --git a/src/Vapi.Net/Types/CerebrasCredential.cs b/src/Vapi.Net/Types/CerebrasCredential.cs index de1dcae..dbff27c 100644 --- a/src/Vapi.Net/Types/CerebrasCredential.cs +++ b/src/Vapi.Net/Types/CerebrasCredential.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -44,6 +45,17 @@ public record CerebrasCredential [JsonPropertyName("name")] public string? Name { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/CerebrasModel.cs b/src/Vapi.Net/Types/CerebrasModel.cs new file mode 100644 index 0000000..1b9e592 --- /dev/null +++ b/src/Vapi.Net/Types/CerebrasModel.cs @@ -0,0 +1,96 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record CerebrasModel +{ + /// + /// This is the starting state for the conversation. + /// + [JsonPropertyName("messages")] + public IEnumerable? Messages { get; set; } + + /// + /// These are the tools that the assistant can use during the call. To use existing tools, use `toolIds`. + /// + /// Both `tools` and `toolIds` can be used together. + /// + [JsonPropertyName("tools")] + public IEnumerable? Tools { get; set; } + + /// + /// These are the tools that the assistant can use during the call. To use transient tools, use `tools`. + /// + /// Both `tools` and `toolIds` can be used together. + /// + [JsonPropertyName("toolIds")] + public IEnumerable? ToolIds { get; set; } + + /// + /// These are the options for the knowledge base. + /// + [JsonPropertyName("knowledgeBase")] + public CreateCustomKnowledgeBaseDto? KnowledgeBase { get; set; } + + /// + /// This is the ID of the knowledge base the model will use. + /// + [JsonPropertyName("knowledgeBaseId")] + public string? KnowledgeBaseId { get; set; } + + /// + /// This is the name of the model. Ex. cognitivecomputations/dolphin-mixtral-8x7b + /// + [JsonPropertyName("model")] + public required CerebrasModelModel Model { get; set; } + + /// + /// This is the temperature that will be used for calls. Default is 0 to leverage caching for lower latency. + /// + [JsonPropertyName("temperature")] + public double? Temperature { get; set; } + + /// + /// This is the max number of tokens that the assistant will be allowed to generate in each turn of the conversation. Default is 250. + /// + [JsonPropertyName("maxTokens")] + public double? MaxTokens { get; set; } + + /// + /// This determines whether we detect user's emotion while they speak and send it as an additional info to model. + /// + /// Default `false` because the model is usually are good at understanding the user's emotion from text. + /// + /// @default false + /// + [JsonPropertyName("emotionRecognitionEnabled")] + public bool? EmotionRecognitionEnabled { get; set; } + + /// + /// This sets how many turns at the start of the conversation to use a smaller, faster model from the same provider before switching to the primary model. Example, gpt-3.5-turbo if provider is openai. + /// + /// Default is 0. + /// + /// @default 0 + /// + [JsonPropertyName("numFastTurns")] + public double? NumFastTurns { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/CerebrasModelModel.cs b/src/Vapi.Net/Types/CerebrasModelModel.cs new file mode 100644 index 0000000..4236ac3 --- /dev/null +++ b/src/Vapi.Net/Types/CerebrasModelModel.cs @@ -0,0 +1,15 @@ +using System.Runtime.Serialization; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[JsonConverter(typeof(EnumSerializer))] +public enum CerebrasModelModel +{ + [EnumMember(Value = "llama3.1-8b")] + Llama318B, + + [EnumMember(Value = "llama-3.3-70b")] + Llama3370B, +} diff --git a/src/Vapi.Net/Types/ChatCompletionMessage.cs b/src/Vapi.Net/Types/ChatCompletionMessage.cs deleted file mode 100644 index 0686869..0000000 --- a/src/Vapi.Net/Types/ChatCompletionMessage.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System.Text.Json.Serialization; -using Vapi.Net.Core; - -namespace Vapi.Net; - -public record ChatCompletionMessage -{ - [JsonPropertyName("role")] - public object Role { get; set; } = new Dictionary(); - - [JsonPropertyName("content")] - public string? Content { get; set; } - - [JsonPropertyName("metadata")] - public ChatCompletionMessageMetadata? Metadata { get; set; } - - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Vapi.Net/Types/ChatCompletionMessageMetadata.cs b/src/Vapi.Net/Types/ChatCompletionMessageMetadata.cs index 66f234e..0a43fa0 100644 --- a/src/Vapi.Net/Types/ChatCompletionMessageMetadata.cs +++ b/src/Vapi.Net/Types/ChatCompletionMessageMetadata.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -20,6 +21,17 @@ public record ChatCompletionMessageMetadata [JsonPropertyName("nodeTrace")] public IEnumerable? NodeTrace { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/ChatCompletionMessageWorkflows.cs b/src/Vapi.Net/Types/ChatCompletionMessageWorkflows.cs new file mode 100644 index 0000000..ba3f538 --- /dev/null +++ b/src/Vapi.Net/Types/ChatCompletionMessageWorkflows.cs @@ -0,0 +1,33 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record ChatCompletionMessageWorkflows +{ + [JsonPropertyName("role")] + public object Role { get; set; } = new Dictionary(); + + [JsonPropertyName("content")] + public string? Content { get; set; } + + [JsonPropertyName("metadata")] + public ChatCompletionMessageMetadata? Metadata { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/ChatCompletionsDto.cs b/src/Vapi.Net/Types/ChatCompletionsDto.cs index 4271034..0fa0e27 100644 --- a/src/Vapi.Net/Types/ChatCompletionsDto.cs +++ b/src/Vapi.Net/Types/ChatCompletionsDto.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -6,8 +7,8 @@ namespace Vapi.Net; public record ChatCompletionsDto { [JsonPropertyName("messages")] - public IEnumerable Messages { get; set; } = - new List(); + public IEnumerable Messages { get; set; } = + new List(); [JsonPropertyName("workflowId")] public string? WorkflowId { get; set; } @@ -15,6 +16,17 @@ public record ChatCompletionsDto [JsonPropertyName("workflow")] public CreateWorkflowDto? Workflow { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/ChatDto.cs b/src/Vapi.Net/Types/ChatDto.cs deleted file mode 100644 index 3ea5c2c..0000000 --- a/src/Vapi.Net/Types/ChatDto.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System.Text.Json.Serialization; -using Vapi.Net.Core; - -namespace Vapi.Net; - -public record ChatDto -{ - [JsonPropertyName("messages")] - public IEnumerable Messages { get; set; } = new List(); - - [JsonPropertyName("assistantId")] - public string? AssistantId { get; set; } - - [JsonPropertyName("assistant")] - public CreateAssistantDto? Assistant { get; set; } - - [JsonPropertyName("assistantOverrides")] - public AssistantOverrides? AssistantOverrides { get; set; } - - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Vapi.Net/Types/ChatServiceResponse.cs b/src/Vapi.Net/Types/ChatServiceResponse.cs index 740c59a..7cd720f 100644 --- a/src/Vapi.Net/Types/ChatServiceResponse.cs +++ b/src/Vapi.Net/Types/ChatServiceResponse.cs @@ -1,9 +1,22 @@ +using System.Text.Json; +using System.Text.Json.Serialization; using Vapi.Net.Core; namespace Vapi.Net; public record ChatServiceResponse { + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/ChunkPlan.cs b/src/Vapi.Net/Types/ChunkPlan.cs index 9bb53d4..44c75dd 100644 --- a/src/Vapi.Net/Types/ChunkPlan.cs +++ b/src/Vapi.Net/Types/ChunkPlan.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -49,6 +50,17 @@ public record ChunkPlan [JsonPropertyName("formatPlan")] public FormatPlan? FormatPlan { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/ClientInboundMessage.cs b/src/Vapi.Net/Types/ClientInboundMessage.cs index 5c0edca..2b55e15 100644 --- a/src/Vapi.Net/Types/ClientInboundMessage.cs +++ b/src/Vapi.Net/Types/ClientInboundMessage.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -11,6 +12,17 @@ public record ClientInboundMessage [JsonPropertyName("message")] public required object Message { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/ClientInboundMessageAddMessage.cs b/src/Vapi.Net/Types/ClientInboundMessageAddMessage.cs index 42e9bad..a89a4d6 100644 --- a/src/Vapi.Net/Types/ClientInboundMessageAddMessage.cs +++ b/src/Vapi.Net/Types/ClientInboundMessageAddMessage.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -23,6 +24,17 @@ public record ClientInboundMessageAddMessage [JsonPropertyName("triggerResponseEnabled")] public bool? TriggerResponseEnabled { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/ClientInboundMessageControl.cs b/src/Vapi.Net/Types/ClientInboundMessageControl.cs index def89fe..c8ede55 100644 --- a/src/Vapi.Net/Types/ClientInboundMessageControl.cs +++ b/src/Vapi.Net/Types/ClientInboundMessageControl.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -11,6 +12,17 @@ public record ClientInboundMessageControl [JsonPropertyName("control")] public required ClientInboundMessageControlControl Control { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/ClientInboundMessageEndCall.cs b/src/Vapi.Net/Types/ClientInboundMessageEndCall.cs index d22f00e..c9d8391 100644 --- a/src/Vapi.Net/Types/ClientInboundMessageEndCall.cs +++ b/src/Vapi.Net/Types/ClientInboundMessageEndCall.cs @@ -1,9 +1,22 @@ +using System.Text.Json; +using System.Text.Json.Serialization; using Vapi.Net.Core; namespace Vapi.Net; public record ClientInboundMessageEndCall { + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/ClientInboundMessageSay.cs b/src/Vapi.Net/Types/ClientInboundMessageSay.cs index 1f85a2d..2937eff 100644 --- a/src/Vapi.Net/Types/ClientInboundMessageSay.cs +++ b/src/Vapi.Net/Types/ClientInboundMessageSay.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -17,6 +18,23 @@ public record ClientInboundMessageSay [JsonPropertyName("endCallAfterSpoken")] public bool? EndCallAfterSpoken { get; set; } + /// + /// This is the flag for whether the message is interruptible. + /// + [JsonPropertyName("interruptionsEnabled")] + public bool? InterruptionsEnabled { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/ClientInboundMessageTransfer.cs b/src/Vapi.Net/Types/ClientInboundMessageTransfer.cs index d3b6810..2c38cec 100644 --- a/src/Vapi.Net/Types/ClientInboundMessageTransfer.cs +++ b/src/Vapi.Net/Types/ClientInboundMessageTransfer.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -17,6 +18,17 @@ public record ClientInboundMessageTransfer [JsonPropertyName("content")] public string? Content { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/ClientMessage.cs b/src/Vapi.Net/Types/ClientMessage.cs index 003d720..a0c8ba3 100644 --- a/src/Vapi.Net/Types/ClientMessage.cs +++ b/src/Vapi.Net/Types/ClientMessage.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using OneOf; using Vapi.Net.Core; @@ -26,6 +27,17 @@ public required OneOf< ClientMessageVoiceInput > Message { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/ClientMessageConversationUpdate.cs b/src/Vapi.Net/Types/ClientMessageConversationUpdate.cs index 14dd670..7702046 100644 --- a/src/Vapi.Net/Types/ClientMessageConversationUpdate.cs +++ b/src/Vapi.Net/Types/ClientMessageConversationUpdate.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using OneOf; using Vapi.Net.Core; @@ -27,6 +28,17 @@ public IEnumerable< public IEnumerable MessagesOpenAiFormatted { get; set; } = new List(); + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/ClientMessageHang.cs b/src/Vapi.Net/Types/ClientMessageHang.cs index 7381e6e..af4a1c3 100644 --- a/src/Vapi.Net/Types/ClientMessageHang.cs +++ b/src/Vapi.Net/Types/ClientMessageHang.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -15,6 +16,17 @@ public record ClientMessageHang [JsonPropertyName("type")] public string Type { get; set; } = "hang"; + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/ClientMessageLanguageChangeDetected.cs b/src/Vapi.Net/Types/ClientMessageLanguageChangeDetected.cs index f4b4d85..7b8bd39 100644 --- a/src/Vapi.Net/Types/ClientMessageLanguageChangeDetected.cs +++ b/src/Vapi.Net/Types/ClientMessageLanguageChangeDetected.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -17,6 +18,17 @@ public record ClientMessageLanguageChangeDetected [JsonPropertyName("language")] public required string Language { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/ClientMessageMetadata.cs b/src/Vapi.Net/Types/ClientMessageMetadata.cs index c784091..bcf7ea7 100644 --- a/src/Vapi.Net/Types/ClientMessageMetadata.cs +++ b/src/Vapi.Net/Types/ClientMessageMetadata.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -17,6 +18,17 @@ public record ClientMessageMetadata [JsonPropertyName("metadata")] public required string Metadata { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/ClientMessageModelOutput.cs b/src/Vapi.Net/Types/ClientMessageModelOutput.cs index bcbf24e..97001a1 100644 --- a/src/Vapi.Net/Types/ClientMessageModelOutput.cs +++ b/src/Vapi.Net/Types/ClientMessageModelOutput.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -17,6 +18,17 @@ public record ClientMessageModelOutput [JsonPropertyName("output")] public object Output { get; set; } = new Dictionary(); + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/ClientMessageSpeechUpdate.cs b/src/Vapi.Net/Types/ClientMessageSpeechUpdate.cs index 72ad5ee..3026356 100644 --- a/src/Vapi.Net/Types/ClientMessageSpeechUpdate.cs +++ b/src/Vapi.Net/Types/ClientMessageSpeechUpdate.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -23,6 +24,23 @@ public record ClientMessageSpeechUpdate [JsonPropertyName("role")] public required ClientMessageSpeechUpdateRole Role { get; set; } + /// + /// This is the turn number of the speech update (0-indexed). + /// + [JsonPropertyName("turn")] + public double? Turn { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/ClientMessageToolCalls.cs b/src/Vapi.Net/Types/ClientMessageToolCalls.cs index 016ff10..1859422 100644 --- a/src/Vapi.Net/Types/ClientMessageToolCalls.cs +++ b/src/Vapi.Net/Types/ClientMessageToolCalls.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -23,6 +24,17 @@ public record ClientMessageToolCalls [JsonPropertyName("toolCallList")] public IEnumerable ToolCallList { get; set; } = new List(); + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/ClientMessageToolCallsResult.cs b/src/Vapi.Net/Types/ClientMessageToolCallsResult.cs index b43a44e..622ba7f 100644 --- a/src/Vapi.Net/Types/ClientMessageToolCallsResult.cs +++ b/src/Vapi.Net/Types/ClientMessageToolCallsResult.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -17,6 +18,17 @@ public record ClientMessageToolCallsResult [JsonPropertyName("toolCallResult")] public object ToolCallResult { get; set; } = new Dictionary(); + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/ClientMessageTranscript.cs b/src/Vapi.Net/Types/ClientMessageTranscript.cs index e915ca6..c2e87cf 100644 --- a/src/Vapi.Net/Types/ClientMessageTranscript.cs +++ b/src/Vapi.Net/Types/ClientMessageTranscript.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -29,6 +30,17 @@ public record ClientMessageTranscript [JsonPropertyName("transcript")] public required string Transcript { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/ClientMessageTransferUpdate.cs b/src/Vapi.Net/Types/ClientMessageTransferUpdate.cs index 79faa3d..fabe7fe 100644 --- a/src/Vapi.Net/Types/ClientMessageTransferUpdate.cs +++ b/src/Vapi.Net/Types/ClientMessageTransferUpdate.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -41,6 +42,17 @@ public record ClientMessageTransferUpdate [JsonPropertyName("fromStepRecord")] public object? FromStepRecord { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/ClientMessageUserInterrupted.cs b/src/Vapi.Net/Types/ClientMessageUserInterrupted.cs index 64dbf5d..320644e 100644 --- a/src/Vapi.Net/Types/ClientMessageUserInterrupted.cs +++ b/src/Vapi.Net/Types/ClientMessageUserInterrupted.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -11,6 +12,17 @@ public record ClientMessageUserInterrupted [JsonPropertyName("type")] public string Type { get; set; } = "user-interrupted"; + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/ClientMessageVoiceInput.cs b/src/Vapi.Net/Types/ClientMessageVoiceInput.cs index d63e8b1..4afb4e3 100644 --- a/src/Vapi.Net/Types/ClientMessageVoiceInput.cs +++ b/src/Vapi.Net/Types/ClientMessageVoiceInput.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -17,6 +18,17 @@ public record ClientMessageVoiceInput [JsonPropertyName("input")] public required string Input { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/ClientMessageWorkflowNodeStarted.cs b/src/Vapi.Net/Types/ClientMessageWorkflowNodeStarted.cs index 319452f..11f3d99 100644 --- a/src/Vapi.Net/Types/ClientMessageWorkflowNodeStarted.cs +++ b/src/Vapi.Net/Types/ClientMessageWorkflowNodeStarted.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -17,6 +18,17 @@ public record ClientMessageWorkflowNodeStarted [JsonPropertyName("node")] public object Node { get; set; } = new Dictionary(); + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/CloneVoiceDto.cs b/src/Vapi.Net/Types/CloneVoiceDto.cs index cd40066..2e0d77e 100644 --- a/src/Vapi.Net/Types/CloneVoiceDto.cs +++ b/src/Vapi.Net/Types/CloneVoiceDto.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -29,6 +30,17 @@ public record CloneVoiceDto [JsonPropertyName("files")] public IEnumerable Files { get; set; } = new List(); + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/CloudflareCredential.cs b/src/Vapi.Net/Types/CloudflareCredential.cs index 6374a69..b82cb31 100644 --- a/src/Vapi.Net/Types/CloudflareCredential.cs +++ b/src/Vapi.Net/Types/CloudflareCredential.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -65,6 +66,17 @@ public record CloudflareCredential [JsonPropertyName("bucketPlan")] public CloudflareR2BucketPlan? BucketPlan { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/CloudflareR2BucketPlan.cs b/src/Vapi.Net/Types/CloudflareR2BucketPlan.cs index a1ea76d..883281e 100644 --- a/src/Vapi.Net/Types/CloudflareR2BucketPlan.cs +++ b/src/Vapi.Net/Types/CloudflareR2BucketPlan.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -41,6 +42,17 @@ public record CloudflareR2BucketPlan [JsonPropertyName("path")] public string? Path { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/CompliancePlan.cs b/src/Vapi.Net/Types/CompliancePlan.cs index 64e379c..3b5904b 100644 --- a/src/Vapi.Net/Types/CompliancePlan.cs +++ b/src/Vapi.Net/Types/CompliancePlan.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -6,17 +7,30 @@ namespace Vapi.Net; public record CompliancePlan { /// - /// When this is enabled, no logs, recordings, or transcriptions will be stored. At the end of the call, you will still receive an end-of-call-report message to store on your server. Defaults to false. + /// When this is enabled, no logs, recordings, or transcriptions will be stored. + /// At the end of the call, you will still receive an end-of-call-report message to store on your server. Defaults to false. /// [JsonPropertyName("hipaaEnabled")] public bool? HipaaEnabled { get; set; } /// - /// When this is enabled, the user will be restricted to use PCI-compliant providers, and no logs or transcripts are stored. At the end of the call, you will receive an end-of-call-report message to store on your server. Defaults to false. + /// When this is enabled, the user will be restricted to use PCI-compliant providers, and no logs or transcripts are stored. + /// At the end of the call, you will receive an end-of-call-report message to store on your server. Defaults to false. /// [JsonPropertyName("pciEnabled")] public bool? PciEnabled { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/ComputerTool.cs b/src/Vapi.Net/Types/ComputerTool.cs index 864b8c7..80d8b76 100644 --- a/src/Vapi.Net/Types/ComputerTool.cs +++ b/src/Vapi.Net/Types/ComputerTool.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -99,6 +100,17 @@ public record ComputerTool [JsonPropertyName("displayNumber")] public double? DisplayNumber { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/ComputerToolWithToolCall.cs b/src/Vapi.Net/Types/ComputerToolWithToolCall.cs index 7e1d186..9577d22 100644 --- a/src/Vapi.Net/Types/ComputerToolWithToolCall.cs +++ b/src/Vapi.Net/Types/ComputerToolWithToolCall.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -78,6 +79,17 @@ public record ComputerToolWithToolCall [JsonPropertyName("server")] public Server? Server { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/Condition.cs b/src/Vapi.Net/Types/Condition.cs index 6b9c990..69e166f 100644 --- a/src/Vapi.Net/Types/Condition.cs +++ b/src/Vapi.Net/Types/Condition.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -23,6 +24,17 @@ public record Condition [JsonPropertyName("value")] public object Value { get; set; } = new Dictionary(); + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/ConversationBlock.cs b/src/Vapi.Net/Types/ConversationBlock.cs deleted file mode 100644 index 779e2a0..0000000 --- a/src/Vapi.Net/Types/ConversationBlock.cs +++ /dev/null @@ -1,97 +0,0 @@ -using System.Text.Json.Serialization; -using Vapi.Net.Core; - -namespace Vapi.Net; - -public record ConversationBlock -{ - /// - /// These are the pre-configured messages that will be spoken to the user while the block is running. - /// - [JsonPropertyName("messages")] - public IEnumerable? Messages { get; set; } - - /// - /// This is the input schema for the block. This is the input the block needs to run. It's given to the block as `steps[0].input` - /// - /// These are accessible as variables: - /// - ({{input.propertyName}}) in context of the block execution (step) - /// - ({{stepName.input.propertyName}}) in context of the workflow - /// - [JsonPropertyName("inputSchema")] - public JsonSchema? InputSchema { get; set; } - - /// - /// This is the output schema for the block. This is the output the block will return to the workflow (`{{stepName.output}}`). - /// - /// These are accessible as variables: - /// - ({{output.propertyName}}) in context of the block execution (step) - /// - ({{stepName.output.propertyName}}) in context of the workflow (read caveat #1) - /// - ({{blockName.output.propertyName}}) in context of the workflow (read caveat #2) - /// - /// Caveats: - /// 1. a workflow can execute a step multiple times. example, if a loop is used in the graph. {{stepName.output.propertyName}} will reference the latest usage of the step. - /// 2. a workflow can execute a block multiple times. example, if a step is called multiple times or if a block is used in multiple steps. {{blockName.output.propertyName}} will reference the latest usage of the block. this liquid variable is just provided for convenience when creating blocks outside of a workflow with steps. - /// - [JsonPropertyName("outputSchema")] - public JsonSchema? OutputSchema { get; set; } - - /// - /// This is the unique identifier for the block. - /// - [JsonPropertyName("id")] - public required string Id { get; set; } - - /// - /// This is the unique identifier for the organization that this block belongs to. - /// - [JsonPropertyName("orgId")] - public required string OrgId { get; set; } - - /// - /// This is the ISO 8601 date-time string of when the block was created. - /// - [JsonPropertyName("createdAt")] - public required DateTime CreatedAt { get; set; } - - /// - /// This is the ISO 8601 date-time string of when the block was last updated. - /// - [JsonPropertyName("updatedAt")] - public required DateTime UpdatedAt { get; set; } - - /// - /// This is the name of the block. This is just for your reference. - /// - [JsonPropertyName("name")] - public string? Name { get; set; } - - /// - /// This is the instruction to the model. - /// - /// You can reference any variable in the context of the current block execution (step): - /// - "{{input.your-property-name}}" for the current step's input - /// - "{{your-step-name.output.your-property-name}}" for another step's output (in the same workflow; read caveat #1) - /// - "{{your-step-name.input.your-property-name}}" for another step's input (in the same workflow; read caveat #1) - /// - "{{your-block-name.output.your-property-name}}" for another block's output (in the same workflow; read caveat #2) - /// - "{{your-block-name.input.your-property-name}}" for another block's input (in the same workflow; read caveat #2) - /// - "{{workflow.input.your-property-name}}" for the current workflow's input - /// - "{{global.your-property-name}}" for the global context - /// - /// This can be as simple or as complex as you want it to be. - /// - "say hello and ask the user about their day!" - /// - "collect the user's first and last name" - /// - "user is {{input.firstName}} {{input.lastName}}. their age is {{input.age}}. ask them about their salary and if they might be interested in buying a house. we offer {{input.offer}}" - /// - /// Caveats: - /// 1. a workflow can execute a step multiple times. example, if a loop is used in the graph. {{stepName.output/input.propertyName}} will reference the latest usage of the step. - /// 2. a workflow can execute a block multiple times. example, if a step is called multiple times or if a block is used in multiple steps. {{blockName.output/input.propertyName}} will reference the latest usage of the block. this liquid variable is just provided for convenience when creating blocks outside of a workflow with steps. - /// - [JsonPropertyName("instruction")] - public required string Instruction { get; set; } - - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Vapi.Net/Types/CostBreakdown.cs b/src/Vapi.Net/Types/CostBreakdown.cs index 400d99c..dc96dc0 100644 --- a/src/Vapi.Net/Types/CostBreakdown.cs +++ b/src/Vapi.Net/Types/CostBreakdown.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -65,6 +66,17 @@ public record CostBreakdown [JsonPropertyName("analysisCostBreakdown")] public AnalysisCostBreakdown? AnalysisCostBreakdown { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/CreateAnthropicCredentialDto.cs b/src/Vapi.Net/Types/CreateAnthropicCredentialDto.cs index a4ce31a..622dd79 100644 --- a/src/Vapi.Net/Types/CreateAnthropicCredentialDto.cs +++ b/src/Vapi.Net/Types/CreateAnthropicCredentialDto.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -17,6 +18,17 @@ public record CreateAnthropicCredentialDto [JsonPropertyName("name")] public string? Name { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/CreateAnyscaleCredentialDto.cs b/src/Vapi.Net/Types/CreateAnyscaleCredentialDto.cs index 4531088..905cf94 100644 --- a/src/Vapi.Net/Types/CreateAnyscaleCredentialDto.cs +++ b/src/Vapi.Net/Types/CreateAnyscaleCredentialDto.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -17,6 +18,17 @@ public record CreateAnyscaleCredentialDto [JsonPropertyName("name")] public string? Name { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/CreateAssemblyAiCredentialDto.cs b/src/Vapi.Net/Types/CreateAssemblyAiCredentialDto.cs index cf31936..3f1638b 100644 --- a/src/Vapi.Net/Types/CreateAssemblyAiCredentialDto.cs +++ b/src/Vapi.Net/Types/CreateAssemblyAiCredentialDto.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -17,6 +18,17 @@ public record CreateAssemblyAiCredentialDto [JsonPropertyName("name")] public string? Name { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/CreateAssistantDto.cs b/src/Vapi.Net/Types/CreateAssistantDto.cs index 7a07399..06a8c78 100644 --- a/src/Vapi.Net/Types/CreateAssistantDto.cs +++ b/src/Vapi.Net/Types/CreateAssistantDto.cs @@ -1,4 +1,6 @@ +using System.Text.Json; using System.Text.Json.Serialization; +using OneOf; using Vapi.Net.Core; namespace Vapi.Net; @@ -31,6 +33,9 @@ public record CreateAssistantDto [JsonPropertyName("firstMessage")] public string? FirstMessage { get; set; } + [JsonPropertyName("firstMessageInterruptionsEnabled")] + public bool? FirstMessageInterruptionsEnabled { get; set; } + /// /// This is the mode for the first message. Default is 'assistant-speaks-first'. /// @@ -45,7 +50,15 @@ public record CreateAssistantDto public CreateAssistantDtoFirstMessageMode? FirstMessageMode { get; set; } /// - /// These are the messages that will be sent to your Client SDKs. Default is conversation-update,function-call,hang,model-output,speech-update,status-update,transfer-update,transcript,tool-calls,user-interrupted,voice-input. You can check the shape of the messages in ClientMessage schema. + /// These are the settings to configure or disable voicemail detection. Alternatively, voicemail detection can be configured using the model.tools=[VoicemailTool]. + /// This uses Twilio's built-in detection while the VoicemailTool relies on the model to detect if a voicemail was reached. + /// You can use neither of them, one of them, or both of them. By default, Twilio built-in detection is enabled while VoicemailTool is not. + /// + [JsonPropertyName("voicemailDetection")] + public object? VoicemailDetection { get; set; } + + /// + /// These are the messages that will be sent to your Client SDKs. Default is conversation-update,function-call,hang,model-output,speech-update,status-update,transfer-update,transcript,tool-calls,user-interrupted,voice-input,workflow.node.started. You can check the shape of the messages in ClientMessage schema. /// [JsonPropertyName("clientMessages")] public IEnumerable? ClientMessages { get; set; } @@ -74,9 +87,10 @@ public record CreateAssistantDto /// /// This is the background sound in the call. Default for phone calls is 'office' and default for web calls is 'off'. + /// You can also provide a custom sound by providing a URL to an audio file. /// [JsonPropertyName("backgroundSound")] - public CreateAssistantDtoBackgroundSound? BackgroundSound { get; set; } + public OneOf? BackgroundSound { get; set; } /// /// This enables filtering of noise and background speech while the user is talking. @@ -104,6 +118,13 @@ public record CreateAssistantDto [JsonPropertyName("transportConfigurations")] public IEnumerable? TransportConfigurations { get; set; } + /// + /// This is the plan for observability configuration of assistant's calls. + /// Currently supports Langfuse for tracing and monitoring. + /// + [JsonPropertyName("observabilityPlan")] + public LangfuseObservabilityPlan? ObservabilityPlan { get; set; } + /// /// These are dynamic credentials that will be used for the assistant calls. By default, all the credentials are available for use in the call but you can supplement an additional credentials using this. Dynamic credentials override existing credentials. /// @@ -118,14 +139,6 @@ public record CreateAssistantDto [JsonPropertyName("name")] public string? Name { get; set; } - /// - /// These are the settings to configure or disable voicemail detection. Alternatively, voicemail detection can be configured using the model.tools=[VoicemailTool]. - /// This uses Twilio's built-in detection while the VoicemailTool relies on the model to detect if a voicemail was reached. - /// You can use neither of them, one of them, or both of them. By default, Twilio built-in detection is enabled while VoicemailTool is not. - /// - [JsonPropertyName("voicemailDetection")] - public TwilioVoicemailDetection? VoicemailDetection { get; set; } - /// /// This is the message that the assistant will say if the call is forwarded to voicemail. /// @@ -239,6 +252,20 @@ public record CreateAssistantDto [JsonPropertyName("hooks")] public IEnumerable? Hooks { get; set; } + [JsonPropertyName("keypadInputPlan")] + public KeypadInputPlan? KeypadInputPlan { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/CreateAssistantDtoBackgroundSound.cs b/src/Vapi.Net/Types/CreateAssistantDtoBackgroundSoundZero.cs similarity index 80% rename from src/Vapi.Net/Types/CreateAssistantDtoBackgroundSound.cs rename to src/Vapi.Net/Types/CreateAssistantDtoBackgroundSoundZero.cs index 41b7c2c..b78b64b 100644 --- a/src/Vapi.Net/Types/CreateAssistantDtoBackgroundSound.cs +++ b/src/Vapi.Net/Types/CreateAssistantDtoBackgroundSoundZero.cs @@ -4,8 +4,8 @@ namespace Vapi.Net; -[JsonConverter(typeof(EnumSerializer))] -public enum CreateAssistantDtoBackgroundSound +[JsonConverter(typeof(EnumSerializer))] +public enum CreateAssistantDtoBackgroundSoundZero { [EnumMember(Value = "off")] Off, diff --git a/src/Vapi.Net/Types/CreateAssistantDtoClientMessagesItem.cs b/src/Vapi.Net/Types/CreateAssistantDtoClientMessagesItem.cs index 2675dcc..2368081 100644 --- a/src/Vapi.Net/Types/CreateAssistantDtoClientMessagesItem.cs +++ b/src/Vapi.Net/Types/CreateAssistantDtoClientMessagesItem.cs @@ -51,4 +51,7 @@ public enum CreateAssistantDtoClientMessagesItem [EnumMember(Value = "voice-input")] VoiceInput, + + [EnumMember(Value = "workflow.node.started")] + WorkflowNodeStarted, } diff --git a/src/Vapi.Net/Types/CreateAzureCredentialDto.cs b/src/Vapi.Net/Types/CreateAzureCredentialDto.cs index db35325..7251bb2 100644 --- a/src/Vapi.Net/Types/CreateAzureCredentialDto.cs +++ b/src/Vapi.Net/Types/CreateAzureCredentialDto.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -35,6 +36,17 @@ public record CreateAzureCredentialDto [JsonPropertyName("name")] public string? Name { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/CreateAzureOpenAiCredentialDto.cs b/src/Vapi.Net/Types/CreateAzureOpenAiCredentialDto.cs index f337b99..ebed450 100644 --- a/src/Vapi.Net/Types/CreateAzureOpenAiCredentialDto.cs +++ b/src/Vapi.Net/Types/CreateAzureOpenAiCredentialDto.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -33,6 +34,17 @@ public record CreateAzureOpenAiCredentialDto [JsonPropertyName("name")] public string? Name { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/CreateAzureOpenAiCredentialDtoModelsItem.cs b/src/Vapi.Net/Types/CreateAzureOpenAiCredentialDtoModelsItem.cs index f75df62..72f1898 100644 --- a/src/Vapi.Net/Types/CreateAzureOpenAiCredentialDtoModelsItem.cs +++ b/src/Vapi.Net/Types/CreateAzureOpenAiCredentialDtoModelsItem.cs @@ -7,8 +7,8 @@ namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] public enum CreateAzureOpenAiCredentialDtoModelsItem { - [EnumMember(Value = "gpt-4o-2024-08-06-ptu")] - Gpt4O20240806Ptu, + [EnumMember(Value = "gpt-4o-2024-11-20")] + Gpt4O20241120, [EnumMember(Value = "gpt-4o-2024-08-06")] Gpt4O20240806, diff --git a/src/Vapi.Net/Types/CreateBashToolDto.cs b/src/Vapi.Net/Types/CreateBashToolDto.cs index fdafb64..8b3ffa7 100644 --- a/src/Vapi.Net/Types/CreateBashToolDto.cs +++ b/src/Vapi.Net/Types/CreateBashToolDto.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -57,6 +58,17 @@ public record CreateBashToolDto [JsonPropertyName("server")] public Server? Server { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/CreateByoPhoneNumberDto.cs b/src/Vapi.Net/Types/CreateByoPhoneNumberDto.cs index 4106cdd..023f9ad 100644 --- a/src/Vapi.Net/Types/CreateByoPhoneNumberDto.cs +++ b/src/Vapi.Net/Types/CreateByoPhoneNumberDto.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -16,6 +17,12 @@ public record CreateByoPhoneNumberDto [JsonPropertyName("fallbackDestination")] public object? FallbackDestination { get; set; } + /// + /// This is the hooks that will be used for incoming calls to this phone number. + /// + [JsonPropertyName("hooks")] + public IEnumerable? Hooks { get; set; } + /// /// This is the flag to toggle the E164 check for the `number` field. This is an advanced property which should be used if you know your use case requires it. /// @@ -78,6 +85,17 @@ public record CreateByoPhoneNumberDto [JsonPropertyName("server")] public Server? Server { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/CreateByoSipTrunkCredentialDto.cs b/src/Vapi.Net/Types/CreateByoSipTrunkCredentialDto.cs index db6c225..64e479a 100644 --- a/src/Vapi.Net/Types/CreateByoSipTrunkCredentialDto.cs +++ b/src/Vapi.Net/Types/CreateByoSipTrunkCredentialDto.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -52,6 +53,17 @@ public record CreateByoSipTrunkCredentialDto [JsonPropertyName("name")] public string? Name { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/CreateCartesiaCredentialDto.cs b/src/Vapi.Net/Types/CreateCartesiaCredentialDto.cs index 509f2af..c735af4 100644 --- a/src/Vapi.Net/Types/CreateCartesiaCredentialDto.cs +++ b/src/Vapi.Net/Types/CreateCartesiaCredentialDto.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -17,6 +18,17 @@ public record CreateCartesiaCredentialDto [JsonPropertyName("name")] public string? Name { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/CreateCerebrasCredentialDto.cs b/src/Vapi.Net/Types/CreateCerebrasCredentialDto.cs index 2622bd2..0a75312 100644 --- a/src/Vapi.Net/Types/CreateCerebrasCredentialDto.cs +++ b/src/Vapi.Net/Types/CreateCerebrasCredentialDto.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -5,9 +6,6 @@ namespace Vapi.Net; public record CreateCerebrasCredentialDto { - [JsonPropertyName("provider")] - public string Provider { get; set; } = "cerebras"; - /// /// This is not returned in the API. /// @@ -20,6 +18,17 @@ public record CreateCerebrasCredentialDto [JsonPropertyName("name")] public string? Name { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/CreateCloudflareCredentialDto.cs b/src/Vapi.Net/Types/CreateCloudflareCredentialDto.cs index 96d96ef..748cae4 100644 --- a/src/Vapi.Net/Types/CreateCloudflareCredentialDto.cs +++ b/src/Vapi.Net/Types/CreateCloudflareCredentialDto.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -35,6 +36,17 @@ public record CreateCloudflareCredentialDto [JsonPropertyName("name")] public string? Name { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/CreateComputerToolDto.cs b/src/Vapi.Net/Types/CreateComputerToolDto.cs index ff55557..313e1e0 100644 --- a/src/Vapi.Net/Types/CreateComputerToolDto.cs +++ b/src/Vapi.Net/Types/CreateComputerToolDto.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -75,6 +76,17 @@ public record CreateComputerToolDto [JsonPropertyName("server")] public Server? Server { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/CreateConversationBlockDto.cs b/src/Vapi.Net/Types/CreateConversationBlockDto.cs deleted file mode 100644 index a761c0b..0000000 --- a/src/Vapi.Net/Types/CreateConversationBlockDto.cs +++ /dev/null @@ -1,73 +0,0 @@ -using System.Text.Json.Serialization; -using Vapi.Net.Core; - -namespace Vapi.Net; - -public record CreateConversationBlockDto -{ - /// - /// These are the pre-configured messages that will be spoken to the user while the block is running. - /// - [JsonPropertyName("messages")] - public IEnumerable? Messages { get; set; } - - /// - /// This is the input schema for the block. This is the input the block needs to run. It's given to the block as `steps[0].input` - /// - /// These are accessible as variables: - /// - ({{input.propertyName}}) in context of the block execution (step) - /// - ({{stepName.input.propertyName}}) in context of the workflow - /// - [JsonPropertyName("inputSchema")] - public JsonSchema? InputSchema { get; set; } - - /// - /// This is the output schema for the block. This is the output the block will return to the workflow (`{{stepName.output}}`). - /// - /// These are accessible as variables: - /// - ({{output.propertyName}}) in context of the block execution (step) - /// - ({{stepName.output.propertyName}}) in context of the workflow (read caveat #1) - /// - ({{blockName.output.propertyName}}) in context of the workflow (read caveat #2) - /// - /// Caveats: - /// 1. a workflow can execute a step multiple times. example, if a loop is used in the graph. {{stepName.output.propertyName}} will reference the latest usage of the step. - /// 2. a workflow can execute a block multiple times. example, if a step is called multiple times or if a block is used in multiple steps. {{blockName.output.propertyName}} will reference the latest usage of the block. this liquid variable is just provided for convenience when creating blocks outside of a workflow with steps. - /// - [JsonPropertyName("outputSchema")] - public JsonSchema? OutputSchema { get; set; } - - /// - /// This is the instruction to the model. - /// - /// You can reference any variable in the context of the current block execution (step): - /// - "{{input.your-property-name}}" for the current step's input - /// - "{{your-step-name.output.your-property-name}}" for another step's output (in the same workflow; read caveat #1) - /// - "{{your-step-name.input.your-property-name}}" for another step's input (in the same workflow; read caveat #1) - /// - "{{your-block-name.output.your-property-name}}" for another block's output (in the same workflow; read caveat #2) - /// - "{{your-block-name.input.your-property-name}}" for another block's input (in the same workflow; read caveat #2) - /// - "{{workflow.input.your-property-name}}" for the current workflow's input - /// - "{{global.your-property-name}}" for the global context - /// - /// This can be as simple or as complex as you want it to be. - /// - "say hello and ask the user about their day!" - /// - "collect the user's first and last name" - /// - "user is {{input.firstName}} {{input.lastName}}. their age is {{input.age}}. ask them about their salary and if they might be interested in buying a house. we offer {{input.offer}}" - /// - /// Caveats: - /// 1. a workflow can execute a step multiple times. example, if a loop is used in the graph. {{stepName.output/input.propertyName}} will reference the latest usage of the step. - /// 2. a workflow can execute a block multiple times. example, if a step is called multiple times or if a block is used in multiple steps. {{blockName.output/input.propertyName}} will reference the latest usage of the block. this liquid variable is just provided for convenience when creating blocks outside of a workflow with steps. - /// - [JsonPropertyName("instruction")] - public required string Instruction { get; set; } - - /// - /// This is the name of the block. This is just for your reference. - /// - [JsonPropertyName("name")] - public string? Name { get; set; } - - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Vapi.Net/Types/CreateCustomKnowledgeBaseDto.cs b/src/Vapi.Net/Types/CreateCustomKnowledgeBaseDto.cs index f867b32..2cd731f 100644 --- a/src/Vapi.Net/Types/CreateCustomKnowledgeBaseDto.cs +++ b/src/Vapi.Net/Types/CreateCustomKnowledgeBaseDto.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -49,6 +50,17 @@ public record CreateCustomKnowledgeBaseDto [JsonPropertyName("server")] public required Server Server { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/CreateCustomLlmCredentialDto.cs b/src/Vapi.Net/Types/CreateCustomLlmCredentialDto.cs index ae8125e..a0ee313 100644 --- a/src/Vapi.Net/Types/CreateCustomLlmCredentialDto.cs +++ b/src/Vapi.Net/Types/CreateCustomLlmCredentialDto.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -23,6 +24,17 @@ public record CreateCustomLlmCredentialDto [JsonPropertyName("name")] public string? Name { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/CreateCustomerDto.cs b/src/Vapi.Net/Types/CreateCustomerDto.cs index de63652..0d4b71b 100644 --- a/src/Vapi.Net/Types/CreateCustomerDto.cs +++ b/src/Vapi.Net/Types/CreateCustomerDto.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -25,6 +26,13 @@ public record CreateCustomerDto [JsonPropertyName("extension")] public string? Extension { get; set; } + /// + /// These are the overrides for the assistant's settings and template variables specific to this customer. + /// This allows customization of the assistant's behavior for individual customers in batch calls. + /// + [JsonPropertyName("assistantOverrides")] + public AssistantOverrides? AssistantOverrides { get; set; } + /// /// This is the number of the customer. /// @@ -45,6 +53,17 @@ public record CreateCustomerDto [JsonPropertyName("name")] public string? Name { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/CreateDeepInfraCredentialDto.cs b/src/Vapi.Net/Types/CreateDeepInfraCredentialDto.cs index 9eb33fb..d4948a4 100644 --- a/src/Vapi.Net/Types/CreateDeepInfraCredentialDto.cs +++ b/src/Vapi.Net/Types/CreateDeepInfraCredentialDto.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -17,6 +18,17 @@ public record CreateDeepInfraCredentialDto [JsonPropertyName("name")] public string? Name { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/CreateDeepSeekCredentialDto.cs b/src/Vapi.Net/Types/CreateDeepSeekCredentialDto.cs index 7267d62..e48e2a0 100644 --- a/src/Vapi.Net/Types/CreateDeepSeekCredentialDto.cs +++ b/src/Vapi.Net/Types/CreateDeepSeekCredentialDto.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -17,6 +18,17 @@ public record CreateDeepSeekCredentialDto [JsonPropertyName("name")] public string? Name { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/CreateDeepgramCredentialDto.cs b/src/Vapi.Net/Types/CreateDeepgramCredentialDto.cs index 953cc79..9585fa9 100644 --- a/src/Vapi.Net/Types/CreateDeepgramCredentialDto.cs +++ b/src/Vapi.Net/Types/CreateDeepgramCredentialDto.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -23,6 +24,17 @@ public record CreateDeepgramCredentialDto [JsonPropertyName("name")] public string? Name { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/CreateDtmfToolDto.cs b/src/Vapi.Net/Types/CreateDtmfToolDto.cs index 5862675..ec4fd43 100644 --- a/src/Vapi.Net/Types/CreateDtmfToolDto.cs +++ b/src/Vapi.Net/Types/CreateDtmfToolDto.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -45,6 +46,17 @@ public record CreateDtmfToolDto [JsonPropertyName("server")] public Server? Server { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/CreateElevenLabsCredentialDto.cs b/src/Vapi.Net/Types/CreateElevenLabsCredentialDto.cs index 9441324..1a18c8d 100644 --- a/src/Vapi.Net/Types/CreateElevenLabsCredentialDto.cs +++ b/src/Vapi.Net/Types/CreateElevenLabsCredentialDto.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -17,6 +18,17 @@ public record CreateElevenLabsCredentialDto [JsonPropertyName("name")] public string? Name { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/CreateEndCallToolDto.cs b/src/Vapi.Net/Types/CreateEndCallToolDto.cs index 7de1e5d..2c538e3 100644 --- a/src/Vapi.Net/Types/CreateEndCallToolDto.cs +++ b/src/Vapi.Net/Types/CreateEndCallToolDto.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -45,6 +46,17 @@ public record CreateEndCallToolDto [JsonPropertyName("server")] public Server? Server { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/CreateFunctionToolDto.cs b/src/Vapi.Net/Types/CreateFunctionToolDto.cs index fbe5c7f..2c4e11a 100644 --- a/src/Vapi.Net/Types/CreateFunctionToolDto.cs +++ b/src/Vapi.Net/Types/CreateFunctionToolDto.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -45,6 +46,17 @@ public record CreateFunctionToolDto [JsonPropertyName("server")] public Server? Server { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/CreateGcpCredentialDto.cs b/src/Vapi.Net/Types/CreateGcpCredentialDto.cs index db4effe..78c19bf 100644 --- a/src/Vapi.Net/Types/CreateGcpCredentialDto.cs +++ b/src/Vapi.Net/Types/CreateGcpCredentialDto.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -25,6 +26,17 @@ public record CreateGcpCredentialDto [JsonPropertyName("name")] public string? Name { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/CreateGhlToolDto.cs b/src/Vapi.Net/Types/CreateGhlToolDto.cs index 94cc3f5..19e42bd 100644 --- a/src/Vapi.Net/Types/CreateGhlToolDto.cs +++ b/src/Vapi.Net/Types/CreateGhlToolDto.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -48,6 +49,17 @@ public record CreateGhlToolDto [JsonPropertyName("server")] public Server? Server { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/CreateGladiaCredentialDto.cs b/src/Vapi.Net/Types/CreateGladiaCredentialDto.cs index 637e1bc..c546e53 100644 --- a/src/Vapi.Net/Types/CreateGladiaCredentialDto.cs +++ b/src/Vapi.Net/Types/CreateGladiaCredentialDto.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -17,6 +18,17 @@ public record CreateGladiaCredentialDto [JsonPropertyName("name")] public string? Name { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/CreateGoHighLevelCredentialDto.cs b/src/Vapi.Net/Types/CreateGoHighLevelCredentialDto.cs index c35d295..2c09d90 100644 --- a/src/Vapi.Net/Types/CreateGoHighLevelCredentialDto.cs +++ b/src/Vapi.Net/Types/CreateGoHighLevelCredentialDto.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -17,6 +18,17 @@ public record CreateGoHighLevelCredentialDto [JsonPropertyName("name")] public string? Name { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/CreateGoogleCalendarCheckAvailabilityToolDto.cs b/src/Vapi.Net/Types/CreateGoogleCalendarCheckAvailabilityToolDto.cs new file mode 100644 index 0000000..177a9af --- /dev/null +++ b/src/Vapi.Net/Types/CreateGoogleCalendarCheckAvailabilityToolDto.cs @@ -0,0 +1,64 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record CreateGoogleCalendarCheckAvailabilityToolDto +{ + /// + /// This determines if the tool is async. + /// + /// If async, the assistant will move forward without waiting for your server to respond. This is useful if you just want to trigger something on your server. + /// + /// If sync, the assistant will wait for your server to respond. This is useful if want assistant to respond with the result from your server. + /// + /// Defaults to synchronous (`false`). + /// + [JsonPropertyName("async")] + public bool? Async { get; set; } + + /// + /// These are the messages that will be spoken to the user as the tool is running. + /// + /// For some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured. + /// + [JsonPropertyName("messages")] + public IEnumerable? Messages { get; set; } + + /// + /// This is the function definition of the tool. + /// + /// For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + /// + /// An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + /// + [JsonPropertyName("function")] + public OpenAiFunction? Function { get; set; } + + /// + /// This is the server that will be hit when this tool is requested by the model. + /// + /// All requests will be sent with the call object among other things. You can find more details in the Server URL documentation. + /// + /// This overrides the serverUrl set on the org and the phoneNumber. Order of precedence: highest tool.server.url, then assistant.serverUrl, then phoneNumber.serverUrl, then org.serverUrl. + /// + [JsonPropertyName("server")] + public Server? Server { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/CreateGoogleCalendarCreateEventToolDto.cs b/src/Vapi.Net/Types/CreateGoogleCalendarCreateEventToolDto.cs new file mode 100644 index 0000000..eda3c40 --- /dev/null +++ b/src/Vapi.Net/Types/CreateGoogleCalendarCreateEventToolDto.cs @@ -0,0 +1,64 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record CreateGoogleCalendarCreateEventToolDto +{ + /// + /// This determines if the tool is async. + /// + /// If async, the assistant will move forward without waiting for your server to respond. This is useful if you just want to trigger something on your server. + /// + /// If sync, the assistant will wait for your server to respond. This is useful if want assistant to respond with the result from your server. + /// + /// Defaults to synchronous (`false`). + /// + [JsonPropertyName("async")] + public bool? Async { get; set; } + + /// + /// These are the messages that will be spoken to the user as the tool is running. + /// + /// For some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured. + /// + [JsonPropertyName("messages")] + public IEnumerable? Messages { get; set; } + + /// + /// This is the function definition of the tool. + /// + /// For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + /// + /// An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + /// + [JsonPropertyName("function")] + public OpenAiFunction? Function { get; set; } + + /// + /// This is the server that will be hit when this tool is requested by the model. + /// + /// All requests will be sent with the call object among other things. You can find more details in the Server URL documentation. + /// + /// This overrides the serverUrl set on the org and the phoneNumber. Order of precedence: highest tool.server.url, then assistant.serverUrl, then phoneNumber.serverUrl, then org.serverUrl. + /// + [JsonPropertyName("server")] + public Server? Server { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/CreateGoogleCalendarOAuth2AuthorizationCredentialDto.cs b/src/Vapi.Net/Types/CreateGoogleCalendarOAuth2AuthorizationCredentialDto.cs new file mode 100644 index 0000000..0ebaee9 --- /dev/null +++ b/src/Vapi.Net/Types/CreateGoogleCalendarOAuth2AuthorizationCredentialDto.cs @@ -0,0 +1,36 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record CreateGoogleCalendarOAuth2AuthorizationCredentialDto +{ + /// + /// The authorization ID for the OAuth2 authorization + /// + [JsonPropertyName("authorizationId")] + public required string AuthorizationId { get; set; } + + /// + /// This is the name of credential. This is just for your reference. + /// + [JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/CreateGoogleCalendarOAuth2ClientCredentialDto.cs b/src/Vapi.Net/Types/CreateGoogleCalendarOAuth2ClientCredentialDto.cs new file mode 100644 index 0000000..ffcc1a0 --- /dev/null +++ b/src/Vapi.Net/Types/CreateGoogleCalendarOAuth2ClientCredentialDto.cs @@ -0,0 +1,30 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record CreateGoogleCalendarOAuth2ClientCredentialDto +{ + /// + /// This is the name of credential. This is just for your reference. + /// + [JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/CreateGoogleCredentialDto.cs b/src/Vapi.Net/Types/CreateGoogleCredentialDto.cs index e8c514b..357f17b 100644 --- a/src/Vapi.Net/Types/CreateGoogleCredentialDto.cs +++ b/src/Vapi.Net/Types/CreateGoogleCredentialDto.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -5,12 +6,6 @@ namespace Vapi.Net; public record CreateGoogleCredentialDto { - /// - /// This is the key for Gemini in Google AI Studio. Get it from here: https://aistudio.google.com/app/apikey - /// - [JsonPropertyName("provider")] - public string Provider { get; set; } = "google"; - /// /// This is not returned in the API. /// @@ -23,6 +18,17 @@ public record CreateGoogleCredentialDto [JsonPropertyName("name")] public string? Name { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/CreateGoogleSheetsOAuth2AuthorizationCredentialDto.cs b/src/Vapi.Net/Types/CreateGoogleSheetsOAuth2AuthorizationCredentialDto.cs new file mode 100644 index 0000000..e8ec7e6 --- /dev/null +++ b/src/Vapi.Net/Types/CreateGoogleSheetsOAuth2AuthorizationCredentialDto.cs @@ -0,0 +1,36 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record CreateGoogleSheetsOAuth2AuthorizationCredentialDto +{ + /// + /// The authorization ID for the OAuth2 authorization + /// + [JsonPropertyName("authorizationId")] + public required string AuthorizationId { get; set; } + + /// + /// This is the name of credential. This is just for your reference. + /// + [JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/CreateGoogleSheetsRowAppendToolDto.cs b/src/Vapi.Net/Types/CreateGoogleSheetsRowAppendToolDto.cs new file mode 100644 index 0000000..9da8fc3 --- /dev/null +++ b/src/Vapi.Net/Types/CreateGoogleSheetsRowAppendToolDto.cs @@ -0,0 +1,64 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record CreateGoogleSheetsRowAppendToolDto +{ + /// + /// This determines if the tool is async. + /// + /// If async, the assistant will move forward without waiting for your server to respond. This is useful if you just want to trigger something on your server. + /// + /// If sync, the assistant will wait for your server to respond. This is useful if want assistant to respond with the result from your server. + /// + /// Defaults to synchronous (`false`). + /// + [JsonPropertyName("async")] + public bool? Async { get; set; } + + /// + /// These are the messages that will be spoken to the user as the tool is running. + /// + /// For some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured. + /// + [JsonPropertyName("messages")] + public IEnumerable? Messages { get; set; } + + /// + /// This is the function definition of the tool. + /// + /// For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + /// + /// An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + /// + [JsonPropertyName("function")] + public OpenAiFunction? Function { get; set; } + + /// + /// This is the server that will be hit when this tool is requested by the model. + /// + /// All requests will be sent with the call object among other things. You can find more details in the Server URL documentation. + /// + /// This overrides the serverUrl set on the org and the phoneNumber. Order of precedence: highest tool.server.url, then assistant.serverUrl, then phoneNumber.serverUrl, then org.serverUrl. + /// + [JsonPropertyName("server")] + public Server? Server { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/CreateGroqCredentialDto.cs b/src/Vapi.Net/Types/CreateGroqCredentialDto.cs index 75ea8be..207bf87 100644 --- a/src/Vapi.Net/Types/CreateGroqCredentialDto.cs +++ b/src/Vapi.Net/Types/CreateGroqCredentialDto.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -17,6 +18,17 @@ public record CreateGroqCredentialDto [JsonPropertyName("name")] public string? Name { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/CreateHumeCredentialDto.cs b/src/Vapi.Net/Types/CreateHumeCredentialDto.cs new file mode 100644 index 0000000..372132a --- /dev/null +++ b/src/Vapi.Net/Types/CreateHumeCredentialDto.cs @@ -0,0 +1,36 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record CreateHumeCredentialDto +{ + /// + /// This is not returned in the API. + /// + [JsonPropertyName("apiKey")] + public required string ApiKey { get; set; } + + /// + /// This is the name of credential. This is just for your reference. + /// + [JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/CreateInflectionAiCredentialDto.cs b/src/Vapi.Net/Types/CreateInflectionAiCredentialDto.cs index 3324cf3..5f927a1 100644 --- a/src/Vapi.Net/Types/CreateInflectionAiCredentialDto.cs +++ b/src/Vapi.Net/Types/CreateInflectionAiCredentialDto.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -5,12 +6,6 @@ namespace Vapi.Net; public record CreateInflectionAiCredentialDto { - /// - /// This is the api key for Pi in InflectionAI's console. Get it from here: https://developers.inflection.ai/keys, billing will need to be setup - /// - [JsonPropertyName("provider")] - public string Provider { get; set; } = "inflection-ai"; - /// /// This is not returned in the API. /// @@ -23,6 +18,17 @@ public record CreateInflectionAiCredentialDto [JsonPropertyName("name")] public string? Name { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/CreateLangfuseCredentialDto.cs b/src/Vapi.Net/Types/CreateLangfuseCredentialDto.cs index d73b4dc..b5ea549 100644 --- a/src/Vapi.Net/Types/CreateLangfuseCredentialDto.cs +++ b/src/Vapi.Net/Types/CreateLangfuseCredentialDto.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -29,6 +30,17 @@ public record CreateLangfuseCredentialDto [JsonPropertyName("name")] public string? Name { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/CreateLmntCredentialDto.cs b/src/Vapi.Net/Types/CreateLmntCredentialDto.cs index 47dc050..f534abd 100644 --- a/src/Vapi.Net/Types/CreateLmntCredentialDto.cs +++ b/src/Vapi.Net/Types/CreateLmntCredentialDto.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -17,6 +18,17 @@ public record CreateLmntCredentialDto [JsonPropertyName("name")] public string? Name { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/CreateMakeCredentialDto.cs b/src/Vapi.Net/Types/CreateMakeCredentialDto.cs index fe57ce6..fd6d331 100644 --- a/src/Vapi.Net/Types/CreateMakeCredentialDto.cs +++ b/src/Vapi.Net/Types/CreateMakeCredentialDto.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -29,6 +30,17 @@ public record CreateMakeCredentialDto [JsonPropertyName("name")] public string? Name { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/CreateMakeToolDto.cs b/src/Vapi.Net/Types/CreateMakeToolDto.cs index f8eb6fc..29f0742 100644 --- a/src/Vapi.Net/Types/CreateMakeToolDto.cs +++ b/src/Vapi.Net/Types/CreateMakeToolDto.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -48,6 +49,17 @@ public record CreateMakeToolDto [JsonPropertyName("server")] public Server? Server { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/CreateMcpToolDto.cs b/src/Vapi.Net/Types/CreateMcpToolDto.cs new file mode 100644 index 0000000..4dea322 --- /dev/null +++ b/src/Vapi.Net/Types/CreateMcpToolDto.cs @@ -0,0 +1,64 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record CreateMcpToolDto +{ + /// + /// This determines if the tool is async. + /// + /// If async, the assistant will move forward without waiting for your server to respond. This is useful if you just want to trigger something on your server. + /// + /// If sync, the assistant will wait for your server to respond. This is useful if want assistant to respond with the result from your server. + /// + /// Defaults to synchronous (`false`). + /// + [JsonPropertyName("async")] + public bool? Async { get; set; } + + /// + /// These are the messages that will be spoken to the user as the tool is running. + /// + /// For some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured. + /// + [JsonPropertyName("messages")] + public IEnumerable? Messages { get; set; } + + /// + /// This is the function definition of the tool. + /// + /// For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + /// + /// An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + /// + [JsonPropertyName("function")] + public OpenAiFunction? Function { get; set; } + + /// + /// This is the server that will be hit when this tool is requested by the model. + /// + /// All requests will be sent with the call object among other things. You can find more details in the Server URL documentation. + /// + /// This overrides the serverUrl set on the org and the phoneNumber. Order of precedence: highest tool.server.url, then assistant.serverUrl, then phoneNumber.serverUrl, then org.serverUrl. + /// + [JsonPropertyName("server")] + public Server? Server { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/CreateMistralCredentialDto.cs b/src/Vapi.Net/Types/CreateMistralCredentialDto.cs new file mode 100644 index 0000000..3fa0c97 --- /dev/null +++ b/src/Vapi.Net/Types/CreateMistralCredentialDto.cs @@ -0,0 +1,36 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record CreateMistralCredentialDto +{ + /// + /// This is not returned in the API. + /// + [JsonPropertyName("apiKey")] + public required string ApiKey { get; set; } + + /// + /// This is the name of credential. This is just for your reference. + /// + [JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/CreateNeuphonicCredentialDto.cs b/src/Vapi.Net/Types/CreateNeuphonicCredentialDto.cs new file mode 100644 index 0000000..23eb540 --- /dev/null +++ b/src/Vapi.Net/Types/CreateNeuphonicCredentialDto.cs @@ -0,0 +1,36 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record CreateNeuphonicCredentialDto +{ + /// + /// This is not returned in the API. + /// + [JsonPropertyName("apiKey")] + public required string ApiKey { get; set; } + + /// + /// This is the name of credential. This is just for your reference. + /// + [JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/CreateOpenAiCredentialDto.cs b/src/Vapi.Net/Types/CreateOpenAiCredentialDto.cs index e00710c..464e3e6 100644 --- a/src/Vapi.Net/Types/CreateOpenAiCredentialDto.cs +++ b/src/Vapi.Net/Types/CreateOpenAiCredentialDto.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -17,6 +18,17 @@ public record CreateOpenAiCredentialDto [JsonPropertyName("name")] public string? Name { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/CreateOpenRouterCredentialDto.cs b/src/Vapi.Net/Types/CreateOpenRouterCredentialDto.cs index 64f6513..5517dc0 100644 --- a/src/Vapi.Net/Types/CreateOpenRouterCredentialDto.cs +++ b/src/Vapi.Net/Types/CreateOpenRouterCredentialDto.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -17,6 +18,17 @@ public record CreateOpenRouterCredentialDto [JsonPropertyName("name")] public string? Name { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/CreateOrgDto.cs b/src/Vapi.Net/Types/CreateOrgDto.cs index 10d6cc9..cf4308d 100644 --- a/src/Vapi.Net/Types/CreateOrgDto.cs +++ b/src/Vapi.Net/Types/CreateOrgDto.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -55,6 +56,28 @@ public record CreateOrgDto [JsonPropertyName("concurrencyLimit")] public double? ConcurrencyLimit { get; set; } + /// + /// Stores the information about the compliance plan enforced at the organization level. Currently pciEnabled is supported through this field. + /// When this is enabled, any logs, recordings, or transcriptions will be shipped to the customer endpoints if provided else lost. + /// At the end of the call, you will receive an end-of-call-report message to store on your server, if webhook is provided. + /// Defaults to false. + /// When PCI is enabled, only PCI-compliant Providers will be available for LLM, Voice and transcribers. + /// This is due to the compliance requirements of PCI. Other providers may not meet these requirements. + /// + [JsonPropertyName("compliancePlan")] + public CompliancePlan? CompliancePlan { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/CreateOutboundCallDto.cs b/src/Vapi.Net/Types/CreateOutboundCallDto.cs index 3e04d08..792bb54 100644 --- a/src/Vapi.Net/Types/CreateOutboundCallDto.cs +++ b/src/Vapi.Net/Types/CreateOutboundCallDto.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -5,12 +6,32 @@ namespace Vapi.Net; public record CreateOutboundCallDto { + /// + /// This is used to issue batch calls to multiple customers. + /// + /// Only relevant for `outboundPhoneCall`. To call a single customer, use `customer` instead. + /// + [JsonPropertyName("customers")] + public IEnumerable? Customers { get; set; } + /// /// This is the name of the call. This is just for your own reference. /// [JsonPropertyName("name")] public string? Name { get; set; } + /// + /// This is the schedule plan of the call. + /// + [JsonPropertyName("schedulePlan")] + public SchedulePlan? SchedulePlan { get; set; } + + /// + /// This is the transport of the call. + /// + [JsonPropertyName("transport")] + public object? Transport { get; set; } + /// /// This is the assistant that will be used for the call. To use a transient assistant, use `assistant` instead. /// @@ -73,6 +94,17 @@ public record CreateOutboundCallDto [JsonPropertyName("customer")] public CreateCustomerDto? Customer { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/CreateOutputToolDto.cs b/src/Vapi.Net/Types/CreateOutputToolDto.cs index e6fdf47..8e1f662 100644 --- a/src/Vapi.Net/Types/CreateOutputToolDto.cs +++ b/src/Vapi.Net/Types/CreateOutputToolDto.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -45,6 +46,17 @@ public record CreateOutputToolDto [JsonPropertyName("server")] public Server? Server { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/CreatePerplexityAiCredentialDto.cs b/src/Vapi.Net/Types/CreatePerplexityAiCredentialDto.cs index d4e9233..c5dd806 100644 --- a/src/Vapi.Net/Types/CreatePerplexityAiCredentialDto.cs +++ b/src/Vapi.Net/Types/CreatePerplexityAiCredentialDto.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -17,6 +18,17 @@ public record CreatePerplexityAiCredentialDto [JsonPropertyName("name")] public string? Name { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/CreatePlayHtCredentialDto.cs b/src/Vapi.Net/Types/CreatePlayHtCredentialDto.cs index 539ea51..22eb31e 100644 --- a/src/Vapi.Net/Types/CreatePlayHtCredentialDto.cs +++ b/src/Vapi.Net/Types/CreatePlayHtCredentialDto.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -20,6 +21,17 @@ public record CreatePlayHtCredentialDto [JsonPropertyName("name")] public string? Name { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/CreateQueryToolDto.cs b/src/Vapi.Net/Types/CreateQueryToolDto.cs new file mode 100644 index 0000000..19294bc --- /dev/null +++ b/src/Vapi.Net/Types/CreateQueryToolDto.cs @@ -0,0 +1,70 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record CreateQueryToolDto +{ + /// + /// This determines if the tool is async. + /// + /// If async, the assistant will move forward without waiting for your server to respond. This is useful if you just want to trigger something on your server. + /// + /// If sync, the assistant will wait for your server to respond. This is useful if want assistant to respond with the result from your server. + /// + /// Defaults to synchronous (`false`). + /// + [JsonPropertyName("async")] + public bool? Async { get; set; } + + /// + /// These are the messages that will be spoken to the user as the tool is running. + /// + /// For some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured. + /// + [JsonPropertyName("messages")] + public IEnumerable? Messages { get; set; } + + /// + /// The knowledge bases to query + /// + [JsonPropertyName("knowledgeBases")] + public IEnumerable? KnowledgeBases { get; set; } + + /// + /// This is the function definition of the tool. + /// + /// For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + /// + /// An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + /// + [JsonPropertyName("function")] + public OpenAiFunction? Function { get; set; } + + /// + /// This is the server that will be hit when this tool is requested by the model. + /// + /// All requests will be sent with the call object among other things. You can find more details in the Server URL documentation. + /// + /// This overrides the serverUrl set on the org and the phoneNumber. Order of precedence: highest tool.server.url, then assistant.serverUrl, then phoneNumber.serverUrl, then org.serverUrl. + /// + [JsonPropertyName("server")] + public Server? Server { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/CreateRimeAiCredentialDto.cs b/src/Vapi.Net/Types/CreateRimeAiCredentialDto.cs index 9efc006..64403c3 100644 --- a/src/Vapi.Net/Types/CreateRimeAiCredentialDto.cs +++ b/src/Vapi.Net/Types/CreateRimeAiCredentialDto.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -17,6 +18,17 @@ public record CreateRimeAiCredentialDto [JsonPropertyName("name")] public string? Name { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/CreateRunpodCredentialDto.cs b/src/Vapi.Net/Types/CreateRunpodCredentialDto.cs index 392857a..daa0c1a 100644 --- a/src/Vapi.Net/Types/CreateRunpodCredentialDto.cs +++ b/src/Vapi.Net/Types/CreateRunpodCredentialDto.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -17,6 +18,17 @@ public record CreateRunpodCredentialDto [JsonPropertyName("name")] public string? Name { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/CreateS3CredentialDto.cs b/src/Vapi.Net/Types/CreateS3CredentialDto.cs index d0797b1..1a9c932 100644 --- a/src/Vapi.Net/Types/CreateS3CredentialDto.cs +++ b/src/Vapi.Net/Types/CreateS3CredentialDto.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -41,6 +42,17 @@ public record CreateS3CredentialDto [JsonPropertyName("name")] public string? Name { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/CreateSlackOAuth2AuthorizationCredentialDto.cs b/src/Vapi.Net/Types/CreateSlackOAuth2AuthorizationCredentialDto.cs new file mode 100644 index 0000000..68ac823 --- /dev/null +++ b/src/Vapi.Net/Types/CreateSlackOAuth2AuthorizationCredentialDto.cs @@ -0,0 +1,36 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record CreateSlackOAuth2AuthorizationCredentialDto +{ + /// + /// The authorization ID for the OAuth2 authorization + /// + [JsonPropertyName("authorizationId")] + public required string AuthorizationId { get; set; } + + /// + /// This is the name of credential. This is just for your reference. + /// + [JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/CreateSlackSendMessageToolDto.cs b/src/Vapi.Net/Types/CreateSlackSendMessageToolDto.cs new file mode 100644 index 0000000..63c7464 --- /dev/null +++ b/src/Vapi.Net/Types/CreateSlackSendMessageToolDto.cs @@ -0,0 +1,64 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record CreateSlackSendMessageToolDto +{ + /// + /// This determines if the tool is async. + /// + /// If async, the assistant will move forward without waiting for your server to respond. This is useful if you just want to trigger something on your server. + /// + /// If sync, the assistant will wait for your server to respond. This is useful if want assistant to respond with the result from your server. + /// + /// Defaults to synchronous (`false`). + /// + [JsonPropertyName("async")] + public bool? Async { get; set; } + + /// + /// These are the messages that will be spoken to the user as the tool is running. + /// + /// For some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured. + /// + [JsonPropertyName("messages")] + public IEnumerable? Messages { get; set; } + + /// + /// This is the function definition of the tool. + /// + /// For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + /// + /// An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + /// + [JsonPropertyName("function")] + public OpenAiFunction? Function { get; set; } + + /// + /// This is the server that will be hit when this tool is requested by the model. + /// + /// All requests will be sent with the call object among other things. You can find more details in the Server URL documentation. + /// + /// This overrides the serverUrl set on the org and the phoneNumber. Order of precedence: highest tool.server.url, then assistant.serverUrl, then phoneNumber.serverUrl, then org.serverUrl. + /// + [JsonPropertyName("server")] + public Server? Server { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/CreateSmallestAiCredentialDto.cs b/src/Vapi.Net/Types/CreateSmallestAiCredentialDto.cs index 944901f..3221332 100644 --- a/src/Vapi.Net/Types/CreateSmallestAiCredentialDto.cs +++ b/src/Vapi.Net/Types/CreateSmallestAiCredentialDto.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -17,6 +18,17 @@ public record CreateSmallestAiCredentialDto [JsonPropertyName("name")] public string? Name { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/CreateSmsSendToolDto.cs b/src/Vapi.Net/Types/CreateSmsSendToolDto.cs new file mode 100644 index 0000000..f2fcb0d --- /dev/null +++ b/src/Vapi.Net/Types/CreateSmsSendToolDto.cs @@ -0,0 +1,64 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record CreateSmsSendToolDto +{ + /// + /// This determines if the tool is async. + /// + /// If async, the assistant will move forward without waiting for your server to respond. This is useful if you just want to trigger something on your server. + /// + /// If sync, the assistant will wait for your server to respond. This is useful if want assistant to respond with the result from your server. + /// + /// Defaults to synchronous (`false`). + /// + [JsonPropertyName("async")] + public bool? Async { get; set; } + + /// + /// These are the messages that will be spoken to the user as the tool is running. + /// + /// For some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured. + /// + [JsonPropertyName("messages")] + public IEnumerable? Messages { get; set; } + + /// + /// This is the function definition of the tool. + /// + /// For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + /// + /// An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + /// + [JsonPropertyName("function")] + public OpenAiFunction? Function { get; set; } + + /// + /// This is the server that will be hit when this tool is requested by the model. + /// + /// All requests will be sent with the call object among other things. You can find more details in the Server URL documentation. + /// + /// This overrides the serverUrl set on the org and the phoneNumber. Order of precedence: highest tool.server.url, then assistant.serverUrl, then phoneNumber.serverUrl, then org.serverUrl. + /// + [JsonPropertyName("server")] + public Server? Server { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/CreateSpeechmaticsCredentialDto.cs b/src/Vapi.Net/Types/CreateSpeechmaticsCredentialDto.cs new file mode 100644 index 0000000..d796820 --- /dev/null +++ b/src/Vapi.Net/Types/CreateSpeechmaticsCredentialDto.cs @@ -0,0 +1,36 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record CreateSpeechmaticsCredentialDto +{ + /// + /// This is not returned in the API. + /// + [JsonPropertyName("apiKey")] + public required string ApiKey { get; set; } + + /// + /// This is the name of credential. This is just for your reference. + /// + [JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/CreateSquadDto.cs b/src/Vapi.Net/Types/CreateSquadDto.cs index 9779694..b1ff99e 100644 --- a/src/Vapi.Net/Types/CreateSquadDto.cs +++ b/src/Vapi.Net/Types/CreateSquadDto.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -27,6 +28,17 @@ public record CreateSquadDto [JsonPropertyName("membersOverrides")] public AssistantOverrides? MembersOverrides { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/CreateSupabaseCredentialDto.cs b/src/Vapi.Net/Types/CreateSupabaseCredentialDto.cs new file mode 100644 index 0000000..031ae6b --- /dev/null +++ b/src/Vapi.Net/Types/CreateSupabaseCredentialDto.cs @@ -0,0 +1,33 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record CreateSupabaseCredentialDto +{ + [JsonPropertyName("bucketPlan")] + public SupabaseBucketPlan? BucketPlan { get; set; } + + /// + /// This is the name of credential. This is just for your reference. + /// + [JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/CreateTavusCredentialDto.cs b/src/Vapi.Net/Types/CreateTavusCredentialDto.cs index 2195e48..f797303 100644 --- a/src/Vapi.Net/Types/CreateTavusCredentialDto.cs +++ b/src/Vapi.Net/Types/CreateTavusCredentialDto.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -17,6 +18,17 @@ public record CreateTavusCredentialDto [JsonPropertyName("name")] public string? Name { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/CreateTelnyxPhoneNumberDto.cs b/src/Vapi.Net/Types/CreateTelnyxPhoneNumberDto.cs new file mode 100644 index 0000000..76660f5 --- /dev/null +++ b/src/Vapi.Net/Types/CreateTelnyxPhoneNumberDto.cs @@ -0,0 +1,87 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record CreateTelnyxPhoneNumberDto +{ + /// + /// This is the fallback destination an inbound call will be transferred to if: + /// 1. `assistantId` is not set + /// 2. `squadId` is not set + /// 3. and, `assistant-request` message to the `serverUrl` fails + /// + /// If this is not set and above conditions are met, the inbound call is hung up with an error message. + /// + [JsonPropertyName("fallbackDestination")] + public object? FallbackDestination { get; set; } + + /// + /// This is the hooks that will be used for incoming calls to this phone number. + /// + [JsonPropertyName("hooks")] + public IEnumerable? Hooks { get; set; } + + /// + /// These are the digits of the phone number you own on your Telnyx. + /// + [JsonPropertyName("number")] + public required string Number { get; set; } + + /// + /// This is the credential you added in dashboard.vapi.ai/keys. This is used to configure the number to send inbound calls to Vapi, make outbound calls and do live call updates like transfers and hangups. + /// + [JsonPropertyName("credentialId")] + public required string CredentialId { get; set; } + + /// + /// This is the name of the phone number. This is just for your own reference. + /// + [JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// This is the assistant that will be used for incoming calls to this phone number. + /// + /// If neither `assistantId` nor `squadId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected. + /// + [JsonPropertyName("assistantId")] + public string? AssistantId { get; set; } + + /// + /// This is the squad that will be used for incoming calls to this phone number. + /// + /// If neither `assistantId` nor `squadId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected. + /// + [JsonPropertyName("squadId")] + public string? SquadId { get; set; } + + /// + /// This is where Vapi will send webhooks. You can find all webhooks available along with their shape in ServerMessage schema. + /// + /// The order of precedence is: + /// + /// 1. assistant.server + /// 2. phoneNumber.server + /// 3. org.server + /// + [JsonPropertyName("server")] + public Server? Server { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/CreateTestSuiteTestChatDto.cs b/src/Vapi.Net/Types/CreateTestSuiteTestChatDto.cs new file mode 100644 index 0000000..24bb358 --- /dev/null +++ b/src/Vapi.Net/Types/CreateTestSuiteTestChatDto.cs @@ -0,0 +1,49 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record CreateTestSuiteTestChatDto +{ + /// + /// These are the scorers used to evaluate the test. + /// + [JsonPropertyName("scorers")] + public IEnumerable Scorers { get; set; } = + new List(); + + /// + /// This is the script to be used for the chat test. + /// + [JsonPropertyName("script")] + public required string Script { get; set; } + + /// + /// This is the number of attempts allowed for the test. + /// + [JsonPropertyName("numAttempts")] + public double? NumAttempts { get; set; } + + /// + /// This is the name of the test. + /// + [JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/CreateTestSuiteTestVoiceDto.cs b/src/Vapi.Net/Types/CreateTestSuiteTestVoiceDto.cs index be41ddc..0d01fd7 100644 --- a/src/Vapi.Net/Types/CreateTestSuiteTestVoiceDto.cs +++ b/src/Vapi.Net/Types/CreateTestSuiteTestVoiceDto.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -30,6 +31,17 @@ public record CreateTestSuiteTestVoiceDto [JsonPropertyName("name")] public string? Name { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/CreateTextEditorToolDto.cs b/src/Vapi.Net/Types/CreateTextEditorToolDto.cs index c2dfc88..bef8de0 100644 --- a/src/Vapi.Net/Types/CreateTextEditorToolDto.cs +++ b/src/Vapi.Net/Types/CreateTextEditorToolDto.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -57,6 +58,17 @@ public record CreateTextEditorToolDto [JsonPropertyName("server")] public Server? Server { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/CreateTogetherAiCredentialDto.cs b/src/Vapi.Net/Types/CreateTogetherAiCredentialDto.cs index 057d47e..c814091 100644 --- a/src/Vapi.Net/Types/CreateTogetherAiCredentialDto.cs +++ b/src/Vapi.Net/Types/CreateTogetherAiCredentialDto.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -17,6 +18,17 @@ public record CreateTogetherAiCredentialDto [JsonPropertyName("name")] public string? Name { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/CreateTokenDto.cs b/src/Vapi.Net/Types/CreateTokenDto.cs index 64280b8..3688345 100644 --- a/src/Vapi.Net/Types/CreateTokenDto.cs +++ b/src/Vapi.Net/Types/CreateTokenDto.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -23,6 +24,17 @@ public record CreateTokenDto [JsonPropertyName("restrictions")] public TokenRestrictions? Restrictions { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/CreateToolCallBlockDto.cs b/src/Vapi.Net/Types/CreateToolCallBlockDto.cs deleted file mode 100644 index 127e34a..0000000 --- a/src/Vapi.Net/Types/CreateToolCallBlockDto.cs +++ /dev/null @@ -1,61 +0,0 @@ -using System.Text.Json.Serialization; -using Vapi.Net.Core; - -namespace Vapi.Net; - -public record CreateToolCallBlockDto -{ - /// - /// These are the pre-configured messages that will be spoken to the user while the block is running. - /// - [JsonPropertyName("messages")] - public IEnumerable? Messages { get; set; } - - /// - /// This is the input schema for the block. This is the input the block needs to run. It's given to the block as `steps[0].input` - /// - /// These are accessible as variables: - /// - ({{input.propertyName}}) in context of the block execution (step) - /// - ({{stepName.input.propertyName}}) in context of the workflow - /// - [JsonPropertyName("inputSchema")] - public JsonSchema? InputSchema { get; set; } - - /// - /// This is the output schema for the block. This is the output the block will return to the workflow (`{{stepName.output}}`). - /// - /// These are accessible as variables: - /// - ({{output.propertyName}}) in context of the block execution (step) - /// - ({{stepName.output.propertyName}}) in context of the workflow (read caveat #1) - /// - ({{blockName.output.propertyName}}) in context of the workflow (read caveat #2) - /// - /// Caveats: - /// 1. a workflow can execute a step multiple times. example, if a loop is used in the graph. {{stepName.output.propertyName}} will reference the latest usage of the step. - /// 2. a workflow can execute a block multiple times. example, if a step is called multiple times or if a block is used in multiple steps. {{blockName.output.propertyName}} will reference the latest usage of the block. this liquid variable is just provided for convenience when creating blocks outside of a workflow with steps. - /// - [JsonPropertyName("outputSchema")] - public JsonSchema? OutputSchema { get; set; } - - /// - /// This is the tool that the block will call. To use an existing tool, use `toolId`. - /// - [JsonPropertyName("tool")] - public object? Tool { get; set; } - - /// - /// This is the id of the tool that the block will call. To use a transient tool, use `tool`. - /// - [JsonPropertyName("toolId")] - public string? ToolId { get; set; } - - /// - /// This is the name of the block. This is just for your reference. - /// - [JsonPropertyName("name")] - public string? Name { get; set; } - - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Vapi.Net/Types/CreateToolTemplateDto.cs b/src/Vapi.Net/Types/CreateToolTemplateDto.cs index 0fd5283..7f5ab60 100644 --- a/src/Vapi.Net/Types/CreateToolTemplateDto.cs +++ b/src/Vapi.Net/Types/CreateToolTemplateDto.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -29,6 +30,17 @@ public record CreateToolTemplateDto [JsonPropertyName("provider")] public CreateToolTemplateDtoProvider? Provider { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/CreateTransferCallToolDto.cs b/src/Vapi.Net/Types/CreateTransferCallToolDto.cs index c240357..b428460 100644 --- a/src/Vapi.Net/Types/CreateTransferCallToolDto.cs +++ b/src/Vapi.Net/Types/CreateTransferCallToolDto.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -51,6 +52,17 @@ public record CreateTransferCallToolDto [JsonPropertyName("server")] public Server? Server { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/CreateTrieveCredentialDto.cs b/src/Vapi.Net/Types/CreateTrieveCredentialDto.cs new file mode 100644 index 0000000..f43d3be --- /dev/null +++ b/src/Vapi.Net/Types/CreateTrieveCredentialDto.cs @@ -0,0 +1,36 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record CreateTrieveCredentialDto +{ + /// + /// This is not returned in the API. + /// + [JsonPropertyName("apiKey")] + public required string ApiKey { get; set; } + + /// + /// This is the name of credential. This is just for your reference. + /// + [JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/CreateTrieveKnowledgeBaseDto.cs b/src/Vapi.Net/Types/CreateTrieveKnowledgeBaseDto.cs index cac5501..5d035d6 100644 --- a/src/Vapi.Net/Types/CreateTrieveKnowledgeBaseDto.cs +++ b/src/Vapi.Net/Types/CreateTrieveKnowledgeBaseDto.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -25,8 +26,19 @@ public record CreateTrieveKnowledgeBaseDto /// This is the plan if you want us to create/import a new vector store using Trieve. /// [JsonPropertyName("createPlan")] - public object? CreatePlan { get; set; } + public TrieveKnowledgeBaseImport? CreatePlan { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/CreateTwilioCredentialDto.cs b/src/Vapi.Net/Types/CreateTwilioCredentialDto.cs index 11c3c62..c04af2e 100644 --- a/src/Vapi.Net/Types/CreateTwilioCredentialDto.cs +++ b/src/Vapi.Net/Types/CreateTwilioCredentialDto.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -20,6 +21,17 @@ public record CreateTwilioCredentialDto [JsonPropertyName("name")] public string? Name { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/CreateTwilioPhoneNumberDto.cs b/src/Vapi.Net/Types/CreateTwilioPhoneNumberDto.cs index b644792..6168a16 100644 --- a/src/Vapi.Net/Types/CreateTwilioPhoneNumberDto.cs +++ b/src/Vapi.Net/Types/CreateTwilioPhoneNumberDto.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -16,6 +17,12 @@ public record CreateTwilioPhoneNumberDto [JsonPropertyName("fallbackDestination")] public object? FallbackDestination { get; set; } + /// + /// This is the hooks that will be used for incoming calls to this phone number. + /// + [JsonPropertyName("hooks")] + public IEnumerable? Hooks { get; set; } + /// /// These are the digits of the phone number you own on your Twilio. /// @@ -68,6 +75,17 @@ public record CreateTwilioPhoneNumberDto [JsonPropertyName("server")] public Server? Server { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/CreateVapiPhoneNumberDto.cs b/src/Vapi.Net/Types/CreateVapiPhoneNumberDto.cs index 8604542..16cc19d 100644 --- a/src/Vapi.Net/Types/CreateVapiPhoneNumberDto.cs +++ b/src/Vapi.Net/Types/CreateVapiPhoneNumberDto.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -16,6 +17,12 @@ public record CreateVapiPhoneNumberDto [JsonPropertyName("fallbackDestination")] public object? FallbackDestination { get; set; } + /// + /// This is the hooks that will be used for incoming calls to this phone number. + /// + [JsonPropertyName("hooks")] + public IEnumerable? Hooks { get; set; } + /// /// This is the area code of the phone number to purchase. /// @@ -72,6 +79,17 @@ public record CreateVapiPhoneNumberDto [JsonPropertyName("server")] public Server? Server { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/CreateVoicemailToolDto.cs b/src/Vapi.Net/Types/CreateVoicemailToolDto.cs index 97fcf65..6cf830e 100644 --- a/src/Vapi.Net/Types/CreateVoicemailToolDto.cs +++ b/src/Vapi.Net/Types/CreateVoicemailToolDto.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -45,6 +46,17 @@ public record CreateVoicemailToolDto [JsonPropertyName("server")] public Server? Server { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/CreateVonageCredentialDto.cs b/src/Vapi.Net/Types/CreateVonageCredentialDto.cs index 9b97238..421f4e0 100644 --- a/src/Vapi.Net/Types/CreateVonageCredentialDto.cs +++ b/src/Vapi.Net/Types/CreateVonageCredentialDto.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -20,6 +21,17 @@ public record CreateVonageCredentialDto [JsonPropertyName("name")] public string? Name { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/CreateVonagePhoneNumberDto.cs b/src/Vapi.Net/Types/CreateVonagePhoneNumberDto.cs index fc91f00..1f02300 100644 --- a/src/Vapi.Net/Types/CreateVonagePhoneNumberDto.cs +++ b/src/Vapi.Net/Types/CreateVonagePhoneNumberDto.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -16,6 +17,12 @@ public record CreateVonagePhoneNumberDto [JsonPropertyName("fallbackDestination")] public object? FallbackDestination { get; set; } + /// + /// This is the hooks that will be used for incoming calls to this phone number. + /// + [JsonPropertyName("hooks")] + public IEnumerable? Hooks { get; set; } + /// /// These are the digits of the phone number you own on your Vonage. /// @@ -23,7 +30,7 @@ public record CreateVonagePhoneNumberDto public required string Number { get; set; } /// - /// This is the credential that is used to make outgoing calls, and do operations like call transfer and hang up. + /// This is the credential you added in dashboard.vapi.ai/keys. This is used to configure the number to send inbound calls to Vapi, make outbound calls and do live call updates like transfers and hangups. /// [JsonPropertyName("credentialId")] public required string CredentialId { get; set; } @@ -62,6 +69,17 @@ public record CreateVonagePhoneNumberDto [JsonPropertyName("server")] public Server? Server { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/CreateWebCallDto.cs b/src/Vapi.Net/Types/CreateWebCallDto.cs index c6290da..839b529 100644 --- a/src/Vapi.Net/Types/CreateWebCallDto.cs +++ b/src/Vapi.Net/Types/CreateWebCallDto.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -35,6 +36,17 @@ public record CreateWebCallDto [JsonPropertyName("squad")] public CreateSquadDto? Squad { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/CreateWebhookCredentialDto.cs b/src/Vapi.Net/Types/CreateWebhookCredentialDto.cs index cec7122..9315f8b 100644 --- a/src/Vapi.Net/Types/CreateWebhookCredentialDto.cs +++ b/src/Vapi.Net/Types/CreateWebhookCredentialDto.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -17,6 +18,17 @@ public record CreateWebhookCredentialDto [JsonPropertyName("name")] public string? Name { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/CreateWorkflowBlockDto.cs b/src/Vapi.Net/Types/CreateWorkflowBlockDto.cs deleted file mode 100644 index f4317f3..0000000 --- a/src/Vapi.Net/Types/CreateWorkflowBlockDto.cs +++ /dev/null @@ -1,55 +0,0 @@ -using System.Text.Json.Serialization; -using Vapi.Net.Core; - -namespace Vapi.Net; - -public record CreateWorkflowBlockDto -{ - /// - /// These are the pre-configured messages that will be spoken to the user while the block is running. - /// - [JsonPropertyName("messages")] - public IEnumerable? Messages { get; set; } - - /// - /// This is the input schema for the block. This is the input the block needs to run. It's given to the block as `steps[0].input` - /// - /// These are accessible as variables: - /// - ({{input.propertyName}}) in context of the block execution (step) - /// - ({{stepName.input.propertyName}}) in context of the workflow - /// - [JsonPropertyName("inputSchema")] - public JsonSchema? InputSchema { get; set; } - - /// - /// This is the output schema for the block. This is the output the block will return to the workflow (`{{stepName.output}}`). - /// - /// These are accessible as variables: - /// - ({{output.propertyName}}) in context of the block execution (step) - /// - ({{stepName.output.propertyName}}) in context of the workflow (read caveat #1) - /// - ({{blockName.output.propertyName}}) in context of the workflow (read caveat #2) - /// - /// Caveats: - /// 1. a workflow can execute a step multiple times. example, if a loop is used in the graph. {{stepName.output.propertyName}} will reference the latest usage of the step. - /// 2. a workflow can execute a block multiple times. example, if a step is called multiple times or if a block is used in multiple steps. {{blockName.output.propertyName}} will reference the latest usage of the block. this liquid variable is just provided for convenience when creating blocks outside of a workflow with steps. - /// - [JsonPropertyName("outputSchema")] - public JsonSchema? OutputSchema { get; set; } - - /// - /// These are the steps in the workflow. - /// - [JsonPropertyName("steps")] - public IEnumerable? Steps { get; set; } - - /// - /// This is the name of the block. This is just for your reference. - /// - [JsonPropertyName("name")] - public string? Name { get; set; } - - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Vapi.Net/Types/CreateWorkflowDto.cs b/src/Vapi.Net/Types/CreateWorkflowDto.cs index 68106b9..c0c729f 100644 --- a/src/Vapi.Net/Types/CreateWorkflowDto.cs +++ b/src/Vapi.Net/Types/CreateWorkflowDto.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -8,12 +9,29 @@ public record CreateWorkflowDto [JsonPropertyName("nodes")] public IEnumerable Nodes { get; set; } = new List(); + /// + /// These are the options for the workflow's LLM. + /// + [JsonPropertyName("model")] + public object? Model { get; set; } + [JsonPropertyName("name")] public required string Name { get; set; } [JsonPropertyName("edges")] public IEnumerable Edges { get; set; } = new List(); + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/CreateXAiCredentialDto.cs b/src/Vapi.Net/Types/CreateXAiCredentialDto.cs index da4de98..36c8fa3 100644 --- a/src/Vapi.Net/Types/CreateXAiCredentialDto.cs +++ b/src/Vapi.Net/Types/CreateXAiCredentialDto.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -17,6 +18,17 @@ public record CreateXAiCredentialDto [JsonPropertyName("name")] public string? Name { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/CredentialActionRequest.cs b/src/Vapi.Net/Types/CredentialActionRequest.cs new file mode 100644 index 0000000..b4a02b4 --- /dev/null +++ b/src/Vapi.Net/Types/CredentialActionRequest.cs @@ -0,0 +1,30 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record CredentialActionRequest +{ + [JsonPropertyName("action_name")] + public required string ActionName { get; set; } + + [JsonPropertyName("input")] + public object Input { get; set; } = new Dictionary(); + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/CredentialEndUser.cs b/src/Vapi.Net/Types/CredentialEndUser.cs new file mode 100644 index 0000000..18e4f10 --- /dev/null +++ b/src/Vapi.Net/Types/CredentialEndUser.cs @@ -0,0 +1,30 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record CredentialEndUser +{ + [JsonPropertyName("endUserId")] + public required string EndUserId { get; set; } + + [JsonPropertyName("organizationId")] + public required string OrganizationId { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/CredentialSessionDto.cs b/src/Vapi.Net/Types/CredentialSessionDto.cs new file mode 100644 index 0000000..560fe93 --- /dev/null +++ b/src/Vapi.Net/Types/CredentialSessionDto.cs @@ -0,0 +1,30 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record CredentialSessionDto +{ + /// + /// The type of credential to generate a session for. Only Nango user-facing providers are supported. + /// + [JsonPropertyName("provider")] + public required CredentialSessionDtoProvider Provider { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/CredentialSessionDtoProvider.cs b/src/Vapi.Net/Types/CredentialSessionDtoProvider.cs new file mode 100644 index 0000000..0f65b81 --- /dev/null +++ b/src/Vapi.Net/Types/CredentialSessionDtoProvider.cs @@ -0,0 +1,21 @@ +using System.Runtime.Serialization; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[JsonConverter(typeof(EnumSerializer))] +public enum CredentialSessionDtoProvider +{ + [EnumMember(Value = "google.calendar.oauth2-client")] + GoogleCalendarOauth2Client, + + [EnumMember(Value = "google.calendar.oauth2-authorization")] + GoogleCalendarOauth2Authorization, + + [EnumMember(Value = "google.sheets.oauth2-authorization")] + GoogleSheetsOauth2Authorization, + + [EnumMember(Value = "slack.oauth2-authorization")] + SlackOauth2Authorization, +} diff --git a/src/Vapi.Net/Types/CredentialSessionError.cs b/src/Vapi.Net/Types/CredentialSessionError.cs new file mode 100644 index 0000000..f351e77 --- /dev/null +++ b/src/Vapi.Net/Types/CredentialSessionError.cs @@ -0,0 +1,30 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record CredentialSessionError +{ + [JsonPropertyName("type")] + public required string Type { get; set; } + + [JsonPropertyName("description")] + public required string Description { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/CredentialSessionResponse.cs b/src/Vapi.Net/Types/CredentialSessionResponse.cs new file mode 100644 index 0000000..d4dcf31 --- /dev/null +++ b/src/Vapi.Net/Types/CredentialSessionResponse.cs @@ -0,0 +1,27 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record CredentialSessionResponse +{ + [JsonPropertyName("sessionToken")] + public required string SessionToken { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/CredentialWebhookDto.cs b/src/Vapi.Net/Types/CredentialWebhookDto.cs new file mode 100644 index 0000000..7840d90 --- /dev/null +++ b/src/Vapi.Net/Types/CredentialWebhookDto.cs @@ -0,0 +1,57 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record CredentialWebhookDto +{ + [JsonPropertyName("type")] + public required CredentialWebhookDtoType Type { get; set; } + + [JsonPropertyName("operation")] + public required CredentialWebhookDtoOperation Operation { get; set; } + + [JsonPropertyName("from")] + public required string From { get; set; } + + [JsonPropertyName("connectionId")] + public required string ConnectionId { get; set; } + + [JsonPropertyName("authMode")] + public required CredentialWebhookDtoAuthMode AuthMode { get; set; } + + [JsonPropertyName("providerConfigKey")] + public required string ProviderConfigKey { get; set; } + + [JsonPropertyName("provider")] + public required string Provider { get; set; } + + [JsonPropertyName("environment")] + public required string Environment { get; set; } + + [JsonPropertyName("success")] + public required bool Success { get; set; } + + [JsonPropertyName("endUser")] + public required CredentialEndUser EndUser { get; set; } + + [JsonPropertyName("error")] + public CredentialSessionError? Error { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/CredentialWebhookDtoAuthMode.cs b/src/Vapi.Net/Types/CredentialWebhookDtoAuthMode.cs new file mode 100644 index 0000000..5c29dbd --- /dev/null +++ b/src/Vapi.Net/Types/CredentialWebhookDtoAuthMode.cs @@ -0,0 +1,18 @@ +using System.Runtime.Serialization; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[JsonConverter(typeof(EnumSerializer))] +public enum CredentialWebhookDtoAuthMode +{ + [EnumMember(Value = "OAUTH2")] + Oauth2, + + [EnumMember(Value = "API_KEY")] + ApiKey, + + [EnumMember(Value = "BASIC")] + Basic, +} diff --git a/src/Vapi.Net/Types/CredentialWebhookDtoOperation.cs b/src/Vapi.Net/Types/CredentialWebhookDtoOperation.cs new file mode 100644 index 0000000..2feecd0 --- /dev/null +++ b/src/Vapi.Net/Types/CredentialWebhookDtoOperation.cs @@ -0,0 +1,18 @@ +using System.Runtime.Serialization; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[JsonConverter(typeof(EnumSerializer))] +public enum CredentialWebhookDtoOperation +{ + [EnumMember(Value = "creation")] + Creation, + + [EnumMember(Value = "override")] + Override, + + [EnumMember(Value = "refresh")] + Refresh, +} diff --git a/src/Vapi.Net/Types/CredentialWebhookDtoType.cs b/src/Vapi.Net/Types/CredentialWebhookDtoType.cs new file mode 100644 index 0000000..8a5eb7e --- /dev/null +++ b/src/Vapi.Net/Types/CredentialWebhookDtoType.cs @@ -0,0 +1,18 @@ +using System.Runtime.Serialization; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[JsonConverter(typeof(EnumSerializer))] +public enum CredentialWebhookDtoType +{ + [EnumMember(Value = "auth")] + Auth, + + [EnumMember(Value = "sync")] + Sync, + + [EnumMember(Value = "forward")] + Forward, +} diff --git a/src/Vapi.Net/Types/CustomKnowledgeBase.cs b/src/Vapi.Net/Types/CustomKnowledgeBase.cs index dc48540..134221a 100644 --- a/src/Vapi.Net/Types/CustomKnowledgeBase.cs +++ b/src/Vapi.Net/Types/CustomKnowledgeBase.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -61,6 +62,17 @@ public record CustomKnowledgeBase [JsonPropertyName("orgId")] public required string OrgId { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/CustomLlmCredential.cs b/src/Vapi.Net/Types/CustomLlmCredential.cs index 66c099b..c9b0c45 100644 --- a/src/Vapi.Net/Types/CustomLlmCredential.cs +++ b/src/Vapi.Net/Types/CustomLlmCredential.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -56,6 +57,17 @@ public record CustomLlmCredential [JsonPropertyName("name")] public string? Name { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/CustomLlmModel.cs b/src/Vapi.Net/Types/CustomLlmModel.cs index 54e7a6e..e626c3e 100644 --- a/src/Vapi.Net/Types/CustomLlmModel.cs +++ b/src/Vapi.Net/Types/CustomLlmModel.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -59,6 +60,12 @@ public record CustomLlmModel [JsonPropertyName("url")] public required string Url { get; set; } + /// + /// This sets the timeout for the connection to the custom provider without needing to stream any tokens back. Default is 20 seconds. + /// + [JsonPropertyName("timeoutSeconds")] + public double? TimeoutSeconds { get; set; } + /// /// This is the name of the model. Ex. cognitivecomputations/dolphin-mixtral-8x7b /// @@ -97,6 +104,17 @@ public record CustomLlmModel [JsonPropertyName("numFastTurns")] public double? NumFastTurns { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/CustomMessage.cs b/src/Vapi.Net/Types/CustomMessage.cs index f809ccc..bce1c7e 100644 --- a/src/Vapi.Net/Types/CustomMessage.cs +++ b/src/Vapi.Net/Types/CustomMessage.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -29,6 +30,17 @@ public record CustomMessage [JsonPropertyName("content")] public string? Content { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/CustomTranscriber.cs b/src/Vapi.Net/Types/CustomTranscriber.cs index f3a9485..95b7e68 100644 --- a/src/Vapi.Net/Types/CustomTranscriber.cs +++ b/src/Vapi.Net/Types/CustomTranscriber.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -48,6 +49,23 @@ public record CustomTranscriber [JsonPropertyName("server")] public required Server Server { get; set; } + /// + /// This is the plan for voice provider fallbacks in the event that the primary voice provider fails. + /// + [JsonPropertyName("fallbackPlan")] + public FallbackTranscriberPlan? FallbackPlan { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/CustomVoice.cs b/src/Vapi.Net/Types/CustomVoice.cs index fa45956..f6e06e3 100644 --- a/src/Vapi.Net/Types/CustomVoice.cs +++ b/src/Vapi.Net/Types/CustomVoice.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -44,6 +45,17 @@ public record CustomVoice [JsonPropertyName("fallbackPlan")] public FallbackPlan? FallbackPlan { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/CustomerCustomEndpointingRule.cs b/src/Vapi.Net/Types/CustomerCustomEndpointingRule.cs index 5c15ba6..cffe1ad 100644 --- a/src/Vapi.Net/Types/CustomerCustomEndpointingRule.cs +++ b/src/Vapi.Net/Types/CustomerCustomEndpointingRule.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -32,6 +33,17 @@ public record CustomerCustomEndpointingRule [JsonPropertyName("timeoutSeconds")] public required double TimeoutSeconds { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/DeepInfraCredential.cs b/src/Vapi.Net/Types/DeepInfraCredential.cs index 115211f..ec5c093 100644 --- a/src/Vapi.Net/Types/DeepInfraCredential.cs +++ b/src/Vapi.Net/Types/DeepInfraCredential.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -44,6 +45,17 @@ public record DeepInfraCredential [JsonPropertyName("name")] public string? Name { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/DeepInfraModel.cs b/src/Vapi.Net/Types/DeepInfraModel.cs index a4ad58a..8e1a104 100644 --- a/src/Vapi.Net/Types/DeepInfraModel.cs +++ b/src/Vapi.Net/Types/DeepInfraModel.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -77,6 +78,17 @@ public record DeepInfraModel [JsonPropertyName("numFastTurns")] public double? NumFastTurns { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/DeepSeekCredential.cs b/src/Vapi.Net/Types/DeepSeekCredential.cs index cfd0909..f685dda 100644 --- a/src/Vapi.Net/Types/DeepSeekCredential.cs +++ b/src/Vapi.Net/Types/DeepSeekCredential.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -44,6 +45,17 @@ public record DeepSeekCredential [JsonPropertyName("name")] public string? Name { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/DeepSeekModel.cs b/src/Vapi.Net/Types/DeepSeekModel.cs index dc64b0d..084bd9e 100644 --- a/src/Vapi.Net/Types/DeepSeekModel.cs +++ b/src/Vapi.Net/Types/DeepSeekModel.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -77,6 +78,17 @@ public record DeepSeekModel [JsonPropertyName("numFastTurns")] public double? NumFastTurns { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/DeepgramCredential.cs b/src/Vapi.Net/Types/DeepgramCredential.cs index 4d1f463..e7c2792 100644 --- a/src/Vapi.Net/Types/DeepgramCredential.cs +++ b/src/Vapi.Net/Types/DeepgramCredential.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -50,6 +51,17 @@ public record DeepgramCredential [JsonPropertyName("apiUrl")] public string? ApiUrl { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/DeepgramTranscriber.cs b/src/Vapi.Net/Types/DeepgramTranscriber.cs index 80a15d4..83efa3c 100644 --- a/src/Vapi.Net/Types/DeepgramTranscriber.cs +++ b/src/Vapi.Net/Types/DeepgramTranscriber.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -69,6 +70,22 @@ public record DeepgramTranscriber [JsonPropertyName("mipOptOut")] public bool? MipOptOut { get; set; } + /// + /// If set to true, this will cause deepgram to convert spoken numbers to literal numerals. For example, "my phone number is nine-seven-two..." would become "my phone number is 972..." + /// + /// @default false + /// + [JsonPropertyName("numerals")] + public bool? Numerals { get; set; } + + /// + /// Transcripts below this confidence threshold will be discarded. + /// + /// @default 0.4 + /// + [JsonPropertyName("confidenceThreshold")] + public double? ConfidenceThreshold { get; set; } + /// /// These keywords are passed to the transcription model to help it pick up use-case specific words. Anything that may not be a common word, like your company name, should be added here. /// @@ -94,6 +111,23 @@ public record DeepgramTranscriber [JsonPropertyName("endpointing")] public double? Endpointing { get; set; } + /// + /// This is the plan for voice provider fallbacks in the event that the primary voice provider fails. + /// + [JsonPropertyName("fallbackPlan")] + public FallbackTranscriberPlan? FallbackPlan { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/DeepgramTranscriberModel.cs b/src/Vapi.Net/Types/DeepgramTranscriberModel.cs index 9e17bae..86487b0 100644 --- a/src/Vapi.Net/Types/DeepgramTranscriberModel.cs +++ b/src/Vapi.Net/Types/DeepgramTranscriberModel.cs @@ -7,6 +7,15 @@ namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] public enum DeepgramTranscriberModel { + [EnumMember(Value = "nova-3")] + Nova3, + + [EnumMember(Value = "nova-3-general")] + Nova3General, + + [EnumMember(Value = "nova-3-medical")] + Nova3Medical, + [EnumMember(Value = "nova-2")] Nova2, diff --git a/src/Vapi.Net/Types/DeepgramVoice.cs b/src/Vapi.Net/Types/DeepgramVoice.cs index ac7e20a..b35266b 100644 --- a/src/Vapi.Net/Types/DeepgramVoice.cs +++ b/src/Vapi.Net/Types/DeepgramVoice.cs @@ -1,5 +1,5 @@ +using System.Text.Json; using System.Text.Json.Serialization; -using OneOf; using Vapi.Net.Core; namespace Vapi.Net; @@ -10,7 +10,13 @@ public record DeepgramVoice /// This is the provider-specific ID that will be used. /// [JsonPropertyName("voiceId")] - public required OneOf VoiceId { get; set; } + public required DeepgramVoiceId VoiceId { get; set; } + + /// + /// This is the model that will be used. Defaults to 'aura-2' when not specified. + /// + [JsonPropertyName("model")] + public DeepgramVoiceModel? Model { get; set; } /// /// If set to true, this will add mip_opt_out=true as a query parameter of all API requests. See https://developers.deepgram.com/docs/the-deepgram-model-improvement-partnership-program#want-to-opt-out @@ -34,6 +40,17 @@ public record DeepgramVoice [JsonPropertyName("fallbackPlan")] public FallbackPlan? FallbackPlan { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/DeepgramVoiceId.cs b/src/Vapi.Net/Types/DeepgramVoiceId.cs new file mode 100644 index 0000000..9d466d4 --- /dev/null +++ b/src/Vapi.Net/Types/DeepgramVoiceId.cs @@ -0,0 +1,144 @@ +using System.Runtime.Serialization; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[JsonConverter(typeof(EnumSerializer))] +public enum DeepgramVoiceId +{ + [EnumMember(Value = "asteria")] + Asteria, + + [EnumMember(Value = "luna")] + Luna, + + [EnumMember(Value = "stella")] + Stella, + + [EnumMember(Value = "athena")] + Athena, + + [EnumMember(Value = "hera")] + Hera, + + [EnumMember(Value = "orion")] + Orion, + + [EnumMember(Value = "arcas")] + Arcas, + + [EnumMember(Value = "perseus")] + Perseus, + + [EnumMember(Value = "angus")] + Angus, + + [EnumMember(Value = "orpheus")] + Orpheus, + + [EnumMember(Value = "helios")] + Helios, + + [EnumMember(Value = "zeus")] + Zeus, + + [EnumMember(Value = "thalia")] + Thalia, + + [EnumMember(Value = "andromeda")] + Andromeda, + + [EnumMember(Value = "helena")] + Helena, + + [EnumMember(Value = "apollo")] + Apollo, + + [EnumMember(Value = "aries")] + Aries, + + [EnumMember(Value = "amalthea")] + Amalthea, + + [EnumMember(Value = "atlas")] + Atlas, + + [EnumMember(Value = "aurora")] + Aurora, + + [EnumMember(Value = "callista")] + Callista, + + [EnumMember(Value = "cora")] + Cora, + + [EnumMember(Value = "cordelia")] + Cordelia, + + [EnumMember(Value = "delia")] + Delia, + + [EnumMember(Value = "draco")] + Draco, + + [EnumMember(Value = "electra")] + Electra, + + [EnumMember(Value = "harmonia")] + Harmonia, + + [EnumMember(Value = "hermes")] + Hermes, + + [EnumMember(Value = "hyperion")] + Hyperion, + + [EnumMember(Value = "iris")] + Iris, + + [EnumMember(Value = "janus")] + Janus, + + [EnumMember(Value = "juno")] + Juno, + + [EnumMember(Value = "jupiter")] + Jupiter, + + [EnumMember(Value = "mars")] + Mars, + + [EnumMember(Value = "minerva")] + Minerva, + + [EnumMember(Value = "neptune")] + Neptune, + + [EnumMember(Value = "odysseus")] + Odysseus, + + [EnumMember(Value = "ophelia")] + Ophelia, + + [EnumMember(Value = "pandora")] + Pandora, + + [EnumMember(Value = "phoebe")] + Phoebe, + + [EnumMember(Value = "pluto")] + Pluto, + + [EnumMember(Value = "saturn")] + Saturn, + + [EnumMember(Value = "selene")] + Selene, + + [EnumMember(Value = "theia")] + Theia, + + [EnumMember(Value = "vesta")] + Vesta, +} diff --git a/src/Vapi.Net/Types/DeepgramVoiceIdEnum.cs b/src/Vapi.Net/Types/DeepgramVoiceIdEnum.cs deleted file mode 100644 index 338e3c9..0000000 --- a/src/Vapi.Net/Types/DeepgramVoiceIdEnum.cs +++ /dev/null @@ -1,45 +0,0 @@ -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using Vapi.Net.Core; - -namespace Vapi.Net; - -[JsonConverter(typeof(EnumSerializer))] -public enum DeepgramVoiceIdEnum -{ - [EnumMember(Value = "asteria")] - Asteria, - - [EnumMember(Value = "luna")] - Luna, - - [EnumMember(Value = "stella")] - Stella, - - [EnumMember(Value = "athena")] - Athena, - - [EnumMember(Value = "hera")] - Hera, - - [EnumMember(Value = "orion")] - Orion, - - [EnumMember(Value = "arcas")] - Arcas, - - [EnumMember(Value = "perseus")] - Perseus, - - [EnumMember(Value = "angus")] - Angus, - - [EnumMember(Value = "orpheus")] - Orpheus, - - [EnumMember(Value = "helios")] - Helios, - - [EnumMember(Value = "zeus")] - Zeus, -} diff --git a/src/Vapi.Net/Types/DeepgramVoiceModel.cs b/src/Vapi.Net/Types/DeepgramVoiceModel.cs new file mode 100644 index 0000000..27255a1 --- /dev/null +++ b/src/Vapi.Net/Types/DeepgramVoiceModel.cs @@ -0,0 +1,15 @@ +using System.Runtime.Serialization; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[JsonConverter(typeof(EnumSerializer))] +public enum DeepgramVoiceModel +{ + [EnumMember(Value = "aura")] + Aura, + + [EnumMember(Value = "aura-2")] + Aura2, +} diff --git a/src/Vapi.Net/Types/DtmfTool.cs b/src/Vapi.Net/Types/DtmfTool.cs index 7c1d6eb..d870b0f 100644 --- a/src/Vapi.Net/Types/DtmfTool.cs +++ b/src/Vapi.Net/Types/DtmfTool.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -69,6 +70,17 @@ public record DtmfTool [JsonPropertyName("server")] public Server? Server { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/Edge.cs b/src/Vapi.Net/Types/Edge.cs index f9a0ff1..13413bc 100644 --- a/src/Vapi.Net/Types/Edge.cs +++ b/src/Vapi.Net/Types/Edge.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -20,6 +21,17 @@ public record Edge [JsonPropertyName("metadata")] public object? Metadata { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/ElevenLabsCredential.cs b/src/Vapi.Net/Types/ElevenLabsCredential.cs index 97b283b..29349d7 100644 --- a/src/Vapi.Net/Types/ElevenLabsCredential.cs +++ b/src/Vapi.Net/Types/ElevenLabsCredential.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -44,6 +45,17 @@ public record ElevenLabsCredential [JsonPropertyName("name")] public string? Name { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/ElevenLabsTranscriber.cs b/src/Vapi.Net/Types/ElevenLabsTranscriber.cs new file mode 100644 index 0000000..69c7227 --- /dev/null +++ b/src/Vapi.Net/Types/ElevenLabsTranscriber.cs @@ -0,0 +1,39 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record ElevenLabsTranscriber +{ + /// + /// This is the model that will be used for the transcription. + /// + [JsonPropertyName("model")] + public string? Model { get; set; } + + [JsonPropertyName("language")] + public ElevenLabsTranscriberLanguage? Language { get; set; } + + /// + /// This is the plan for voice provider fallbacks in the event that the primary voice provider fails. + /// + [JsonPropertyName("fallbackPlan")] + public FallbackTranscriberPlan? FallbackPlan { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/ElevenLabsTranscriberLanguage.cs b/src/Vapi.Net/Types/ElevenLabsTranscriberLanguage.cs new file mode 100644 index 0000000..eedf04c --- /dev/null +++ b/src/Vapi.Net/Types/ElevenLabsTranscriberLanguage.cs @@ -0,0 +1,564 @@ +using System.Runtime.Serialization; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[JsonConverter(typeof(EnumSerializer))] +public enum ElevenLabsTranscriberLanguage +{ + [EnumMember(Value = "aa")] + Aa, + + [EnumMember(Value = "ab")] + Ab, + + [EnumMember(Value = "ae")] + Ae, + + [EnumMember(Value = "af")] + Af, + + [EnumMember(Value = "ak")] + Ak, + + [EnumMember(Value = "am")] + Am, + + [EnumMember(Value = "an")] + An, + + [EnumMember(Value = "ar")] + Ar, + + [EnumMember(Value = "as")] + As, + + [EnumMember(Value = "av")] + Av, + + [EnumMember(Value = "ay")] + Ay, + + [EnumMember(Value = "az")] + Az, + + [EnumMember(Value = "ba")] + Ba, + + [EnumMember(Value = "be")] + Be, + + [EnumMember(Value = "bg")] + Bg, + + [EnumMember(Value = "bh")] + Bh, + + [EnumMember(Value = "bi")] + Bi, + + [EnumMember(Value = "bm")] + Bm, + + [EnumMember(Value = "bn")] + Bn, + + [EnumMember(Value = "bo")] + Bo, + + [EnumMember(Value = "br")] + Br, + + [EnumMember(Value = "bs")] + Bs, + + [EnumMember(Value = "ca")] + Ca, + + [EnumMember(Value = "ce")] + Ce, + + [EnumMember(Value = "ch")] + Ch, + + [EnumMember(Value = "co")] + Co, + + [EnumMember(Value = "cr")] + Cr, + + [EnumMember(Value = "cs")] + Cs, + + [EnumMember(Value = "cu")] + Cu, + + [EnumMember(Value = "cv")] + Cv, + + [EnumMember(Value = "cy")] + Cy, + + [EnumMember(Value = "da")] + Da, + + [EnumMember(Value = "de")] + De, + + [EnumMember(Value = "dv")] + Dv, + + [EnumMember(Value = "dz")] + Dz, + + [EnumMember(Value = "ee")] + Ee, + + [EnumMember(Value = "el")] + El, + + [EnumMember(Value = "en")] + En, + + [EnumMember(Value = "eo")] + Eo, + + [EnumMember(Value = "es")] + Es, + + [EnumMember(Value = "et")] + Et, + + [EnumMember(Value = "eu")] + Eu, + + [EnumMember(Value = "fa")] + Fa, + + [EnumMember(Value = "ff")] + Ff, + + [EnumMember(Value = "fi")] + Fi, + + [EnumMember(Value = "fj")] + Fj, + + [EnumMember(Value = "fo")] + Fo, + + [EnumMember(Value = "fr")] + Fr, + + [EnumMember(Value = "fy")] + Fy, + + [EnumMember(Value = "ga")] + Ga, + + [EnumMember(Value = "gd")] + Gd, + + [EnumMember(Value = "gl")] + Gl, + + [EnumMember(Value = "gn")] + Gn, + + [EnumMember(Value = "gu")] + Gu, + + [EnumMember(Value = "gv")] + Gv, + + [EnumMember(Value = "ha")] + Ha, + + [EnumMember(Value = "he")] + He, + + [EnumMember(Value = "hi")] + Hi, + + [EnumMember(Value = "ho")] + Ho, + + [EnumMember(Value = "hr")] + Hr, + + [EnumMember(Value = "ht")] + Ht, + + [EnumMember(Value = "hu")] + Hu, + + [EnumMember(Value = "hy")] + Hy, + + [EnumMember(Value = "hz")] + Hz, + + [EnumMember(Value = "ia")] + Ia, + + [EnumMember(Value = "id")] + Id, + + [EnumMember(Value = "ie")] + Ie, + + [EnumMember(Value = "ig")] + Ig, + + [EnumMember(Value = "ii")] + Ii, + + [EnumMember(Value = "ik")] + Ik, + + [EnumMember(Value = "io")] + Io, + + [EnumMember(Value = "is")] + Is, + + [EnumMember(Value = "it")] + It, + + [EnumMember(Value = "iu")] + Iu, + + [EnumMember(Value = "ja")] + Ja, + + [EnumMember(Value = "jv")] + Jv, + + [EnumMember(Value = "ka")] + Ka, + + [EnumMember(Value = "kg")] + Kg, + + [EnumMember(Value = "ki")] + Ki, + + [EnumMember(Value = "kj")] + Kj, + + [EnumMember(Value = "kk")] + Kk, + + [EnumMember(Value = "kl")] + Kl, + + [EnumMember(Value = "km")] + Km, + + [EnumMember(Value = "kn")] + Kn, + + [EnumMember(Value = "ko")] + Ko, + + [EnumMember(Value = "kr")] + Kr, + + [EnumMember(Value = "ks")] + Ks, + + [EnumMember(Value = "ku")] + Ku, + + [EnumMember(Value = "kv")] + Kv, + + [EnumMember(Value = "kw")] + Kw, + + [EnumMember(Value = "ky")] + Ky, + + [EnumMember(Value = "la")] + La, + + [EnumMember(Value = "lb")] + Lb, + + [EnumMember(Value = "lg")] + Lg, + + [EnumMember(Value = "li")] + Li, + + [EnumMember(Value = "ln")] + Ln, + + [EnumMember(Value = "lo")] + Lo, + + [EnumMember(Value = "lt")] + Lt, + + [EnumMember(Value = "lu")] + Lu, + + [EnumMember(Value = "lv")] + Lv, + + [EnumMember(Value = "mg")] + Mg, + + [EnumMember(Value = "mh")] + Mh, + + [EnumMember(Value = "mi")] + Mi, + + [EnumMember(Value = "mk")] + Mk, + + [EnumMember(Value = "ml")] + Ml, + + [EnumMember(Value = "mn")] + Mn, + + [EnumMember(Value = "mr")] + Mr, + + [EnumMember(Value = "ms")] + Ms, + + [EnumMember(Value = "mt")] + Mt, + + [EnumMember(Value = "my")] + My, + + [EnumMember(Value = "na")] + Na, + + [EnumMember(Value = "nb")] + Nb, + + [EnumMember(Value = "nd")] + Nd, + + [EnumMember(Value = "ne")] + Ne, + + [EnumMember(Value = "ng")] + Ng, + + [EnumMember(Value = "nl")] + Nl, + + [EnumMember(Value = "nn")] + Nn, + + [EnumMember(Value = "no")] + No, + + [EnumMember(Value = "nr")] + Nr, + + [EnumMember(Value = "nv")] + Nv, + + [EnumMember(Value = "ny")] + Ny, + + [EnumMember(Value = "oc")] + Oc, + + [EnumMember(Value = "oj")] + Oj, + + [EnumMember(Value = "om")] + Om, + + [EnumMember(Value = "or")] + Or, + + [EnumMember(Value = "os")] + Os, + + [EnumMember(Value = "pa")] + Pa, + + [EnumMember(Value = "pi")] + Pi, + + [EnumMember(Value = "pl")] + Pl, + + [EnumMember(Value = "ps")] + Ps, + + [EnumMember(Value = "pt")] + Pt, + + [EnumMember(Value = "qu")] + Qu, + + [EnumMember(Value = "rm")] + Rm, + + [EnumMember(Value = "rn")] + Rn, + + [EnumMember(Value = "ro")] + Ro, + + [EnumMember(Value = "ru")] + Ru, + + [EnumMember(Value = "rw")] + Rw, + + [EnumMember(Value = "sa")] + Sa, + + [EnumMember(Value = "sc")] + Sc, + + [EnumMember(Value = "sd")] + Sd, + + [EnumMember(Value = "se")] + Se, + + [EnumMember(Value = "sg")] + Sg, + + [EnumMember(Value = "si")] + Si, + + [EnumMember(Value = "sk")] + Sk, + + [EnumMember(Value = "sl")] + Sl, + + [EnumMember(Value = "sm")] + Sm, + + [EnumMember(Value = "sn")] + Sn, + + [EnumMember(Value = "so")] + So, + + [EnumMember(Value = "sq")] + Sq, + + [EnumMember(Value = "sr")] + Sr, + + [EnumMember(Value = "ss")] + Ss, + + [EnumMember(Value = "st")] + St, + + [EnumMember(Value = "su")] + Su, + + [EnumMember(Value = "sv")] + Sv, + + [EnumMember(Value = "sw")] + Sw, + + [EnumMember(Value = "ta")] + Ta, + + [EnumMember(Value = "te")] + Te, + + [EnumMember(Value = "tg")] + Tg, + + [EnumMember(Value = "th")] + Th, + + [EnumMember(Value = "ti")] + Ti, + + [EnumMember(Value = "tk")] + Tk, + + [EnumMember(Value = "tl")] + Tl, + + [EnumMember(Value = "tn")] + Tn, + + [EnumMember(Value = "to")] + To, + + [EnumMember(Value = "tr")] + Tr, + + [EnumMember(Value = "ts")] + Ts, + + [EnumMember(Value = "tt")] + Tt, + + [EnumMember(Value = "tw")] + Tw, + + [EnumMember(Value = "ty")] + Ty, + + [EnumMember(Value = "ug")] + Ug, + + [EnumMember(Value = "uk")] + Uk, + + [EnumMember(Value = "ur")] + Ur, + + [EnumMember(Value = "uz")] + Uz, + + [EnumMember(Value = "ve")] + Ve, + + [EnumMember(Value = "vi")] + Vi, + + [EnumMember(Value = "vo")] + Vo, + + [EnumMember(Value = "wa")] + Wa, + + [EnumMember(Value = "wo")] + Wo, + + [EnumMember(Value = "xh")] + Xh, + + [EnumMember(Value = "yi")] + Yi, + + [EnumMember(Value = "yue")] + Yue, + + [EnumMember(Value = "yo")] + Yo, + + [EnumMember(Value = "za")] + Za, + + [EnumMember(Value = "zh")] + Zh, + + [EnumMember(Value = "zu")] + Zu, +} diff --git a/src/Vapi.Net/Types/ElevenLabsVoice.cs b/src/Vapi.Net/Types/ElevenLabsVoice.cs index ac0e1ac..ae074a6 100644 --- a/src/Vapi.Net/Types/ElevenLabsVoice.cs +++ b/src/Vapi.Net/Types/ElevenLabsVoice.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using OneOf; using Vapi.Net.Core; @@ -36,6 +37,12 @@ public record ElevenLabsVoice [JsonPropertyName("useSpeakerBoost")] public bool? UseSpeakerBoost { get; set; } + /// + /// Defines the speed for voice settings. + /// + [JsonPropertyName("speed")] + public double? Speed { get; set; } + /// /// Defines the optimize streaming latency for voice settings. Defaults to 3. /// @@ -50,6 +57,12 @@ public record ElevenLabsVoice [JsonPropertyName("enableSsmlParsing")] public bool? EnableSsmlParsing { get; set; } + /// + /// Defines the auto mode for voice settings. Defaults to false. + /// + [JsonPropertyName("autoMode")] + public bool? AutoMode { get; set; } + /// /// This is the model that will be used. Defaults to 'eleven_turbo_v2' if not specified. /// @@ -74,6 +87,17 @@ public record ElevenLabsVoice [JsonPropertyName("fallbackPlan")] public FallbackPlan? FallbackPlan { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/EndCallTool.cs b/src/Vapi.Net/Types/EndCallTool.cs index b34270e..f9016d7 100644 --- a/src/Vapi.Net/Types/EndCallTool.cs +++ b/src/Vapi.Net/Types/EndCallTool.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -69,6 +70,17 @@ public record EndCallTool [JsonPropertyName("server")] public Server? Server { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/Error.cs b/src/Vapi.Net/Types/Error.cs index 4f9dfdb..d23bf23 100644 --- a/src/Vapi.Net/Types/Error.cs +++ b/src/Vapi.Net/Types/Error.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -8,6 +9,17 @@ public record Error [JsonPropertyName("message")] public required string Message { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/ExactReplacement.cs b/src/Vapi.Net/Types/ExactReplacement.cs index 8a7031e..33481d7 100644 --- a/src/Vapi.Net/Types/ExactReplacement.cs +++ b/src/Vapi.Net/Types/ExactReplacement.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -5,6 +6,16 @@ namespace Vapi.Net; public record ExactReplacement { + /// + /// This option let's you control whether to replace all instances of the key or only the first one. By default, it only replaces the first instance. + /// Examples: + /// - For { type: 'exact', key: 'hello', value: 'hi', replaceAllEnabled: false }. Before: "hello world, hello universe" | After: "hi world, hello universe" + /// - For { type: 'exact', key: 'hello', value: 'hi', replaceAllEnabled: true }. Before: "hello world, hello universe" | After: "hi world, hi universe" + /// @default false + /// + [JsonPropertyName("replaceAllEnabled")] + public bool? ReplaceAllEnabled { get; set; } + /// /// This is the key to replace. /// @@ -17,6 +28,17 @@ public record ExactReplacement [JsonPropertyName("value")] public required string Value { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/FailedEdgeCondition.cs b/src/Vapi.Net/Types/FailedEdgeCondition.cs index 603e214..18206af 100644 --- a/src/Vapi.Net/Types/FailedEdgeCondition.cs +++ b/src/Vapi.Net/Types/FailedEdgeCondition.cs @@ -1,9 +1,22 @@ +using System.Text.Json; +using System.Text.Json.Serialization; using Vapi.Net.Core; namespace Vapi.Net; public record FailedEdgeCondition { + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/FallbackAssemblyAiTranscriber.cs b/src/Vapi.Net/Types/FallbackAssemblyAiTranscriber.cs new file mode 100644 index 0000000..b3971a6 --- /dev/null +++ b/src/Vapi.Net/Types/FallbackAssemblyAiTranscriber.cs @@ -0,0 +1,63 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record FallbackAssemblyAiTranscriber +{ + /// + /// This is the language that will be set for the transcription. + /// + [JsonPropertyName("language")] + public string? Language { get; set; } + + /// + /// Transcripts below this confidence threshold will be discarded. + /// + /// @default 0.4 + /// + [JsonPropertyName("confidenceThreshold")] + public double? ConfidenceThreshold { get; set; } + + /// + /// The WebSocket URL that the transcriber connects to. + /// + [JsonPropertyName("realtimeUrl")] + public string? RealtimeUrl { get; set; } + + /// + /// Add up to 2500 characters of custom vocabulary. + /// + [JsonPropertyName("wordBoost")] + public IEnumerable? WordBoost { get; set; } + + /// + /// The duration of the end utterance silence threshold in milliseconds. + /// + [JsonPropertyName("endUtteranceSilenceThreshold")] + public double? EndUtteranceSilenceThreshold { get; set; } + + /// + /// Disable partial transcripts. + /// Set to `true` to not receive partial transcripts. Defaults to `false`. + /// + [JsonPropertyName("disablePartialTranscripts")] + public bool? DisablePartialTranscripts { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/FallbackAzureSpeechTranscriber.cs b/src/Vapi.Net/Types/FallbackAzureSpeechTranscriber.cs new file mode 100644 index 0000000..54aff62 --- /dev/null +++ b/src/Vapi.Net/Types/FallbackAzureSpeechTranscriber.cs @@ -0,0 +1,30 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record FallbackAzureSpeechTranscriber +{ + /// + /// This is the language that will be set for the transcription. The list of languages Azure supports can be found here: https://learn.microsoft.com/en-us/azure/ai-services/speech-service/language-support?tabs=stt + /// + [JsonPropertyName("language")] + public FallbackAzureSpeechTranscriberLanguage? Language { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/FallbackAzureSpeechTranscriberLanguage.cs b/src/Vapi.Net/Types/FallbackAzureSpeechTranscriberLanguage.cs new file mode 100644 index 0000000..76b3ad3 --- /dev/null +++ b/src/Vapi.Net/Types/FallbackAzureSpeechTranscriberLanguage.cs @@ -0,0 +1,438 @@ +using System.Runtime.Serialization; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[JsonConverter(typeof(EnumSerializer))] +public enum FallbackAzureSpeechTranscriberLanguage +{ + [EnumMember(Value = "af-ZA")] + AfZa, + + [EnumMember(Value = "am-ET")] + AmEt, + + [EnumMember(Value = "ar-AE")] + ArAe, + + [EnumMember(Value = "ar-BH")] + ArBh, + + [EnumMember(Value = "ar-DZ")] + ArDz, + + [EnumMember(Value = "ar-EG")] + ArEg, + + [EnumMember(Value = "ar-IL")] + ArIl, + + [EnumMember(Value = "ar-IQ")] + ArIq, + + [EnumMember(Value = "ar-JO")] + ArJo, + + [EnumMember(Value = "ar-KW")] + ArKw, + + [EnumMember(Value = "ar-LB")] + ArLb, + + [EnumMember(Value = "ar-LY")] + ArLy, + + [EnumMember(Value = "ar-MA")] + ArMa, + + [EnumMember(Value = "ar-OM")] + ArOm, + + [EnumMember(Value = "ar-PS")] + ArPs, + + [EnumMember(Value = "ar-QA")] + ArQa, + + [EnumMember(Value = "ar-SA")] + ArSa, + + [EnumMember(Value = "ar-SY")] + ArSy, + + [EnumMember(Value = "ar-TN")] + ArTn, + + [EnumMember(Value = "ar-YE")] + ArYe, + + [EnumMember(Value = "az-AZ")] + AzAz, + + [EnumMember(Value = "bg-BG")] + BgBg, + + [EnumMember(Value = "bn-IN")] + BnIn, + + [EnumMember(Value = "bs-BA")] + BsBa, + + [EnumMember(Value = "ca-ES")] + CaEs, + + [EnumMember(Value = "cs-CZ")] + CsCz, + + [EnumMember(Value = "cy-GB")] + CyGb, + + [EnumMember(Value = "da-DK")] + DaDk, + + [EnumMember(Value = "de-AT")] + DeAt, + + [EnumMember(Value = "de-CH")] + DeCh, + + [EnumMember(Value = "de-DE")] + DeDe, + + [EnumMember(Value = "el-GR")] + ElGr, + + [EnumMember(Value = "en-AU")] + EnAu, + + [EnumMember(Value = "en-CA")] + EnCa, + + [EnumMember(Value = "en-GB")] + EnGb, + + [EnumMember(Value = "en-GH")] + EnGh, + + [EnumMember(Value = "en-HK")] + EnHk, + + [EnumMember(Value = "en-IE")] + EnIe, + + [EnumMember(Value = "en-IN")] + EnIn, + + [EnumMember(Value = "en-KE")] + EnKe, + + [EnumMember(Value = "en-NG")] + EnNg, + + [EnumMember(Value = "en-NZ")] + EnNz, + + [EnumMember(Value = "en-PH")] + EnPh, + + [EnumMember(Value = "en-SG")] + EnSg, + + [EnumMember(Value = "en-TZ")] + EnTz, + + [EnumMember(Value = "en-US")] + EnUs, + + [EnumMember(Value = "en-ZA")] + EnZa, + + [EnumMember(Value = "es-AR")] + EsAr, + + [EnumMember(Value = "es-BO")] + EsBo, + + [EnumMember(Value = "es-CL")] + EsCl, + + [EnumMember(Value = "es-CO")] + EsCo, + + [EnumMember(Value = "es-CR")] + EsCr, + + [EnumMember(Value = "es-CU")] + EsCu, + + [EnumMember(Value = "es-DO")] + EsDo, + + [EnumMember(Value = "es-EC")] + EsEc, + + [EnumMember(Value = "es-ES")] + EsEs, + + [EnumMember(Value = "es-GQ")] + EsGq, + + [EnumMember(Value = "es-GT")] + EsGt, + + [EnumMember(Value = "es-HN")] + EsHn, + + [EnumMember(Value = "es-MX")] + EsMx, + + [EnumMember(Value = "es-NI")] + EsNi, + + [EnumMember(Value = "es-PA")] + EsPa, + + [EnumMember(Value = "es-PE")] + EsPe, + + [EnumMember(Value = "es-PR")] + EsPr, + + [EnumMember(Value = "es-PY")] + EsPy, + + [EnumMember(Value = "es-SV")] + EsSv, + + [EnumMember(Value = "es-US")] + EsUs, + + [EnumMember(Value = "es-UY")] + EsUy, + + [EnumMember(Value = "es-VE")] + EsVe, + + [EnumMember(Value = "et-EE")] + EtEe, + + [EnumMember(Value = "eu-ES")] + EuEs, + + [EnumMember(Value = "fa-IR")] + FaIr, + + [EnumMember(Value = "fi-FI")] + FiFi, + + [EnumMember(Value = "fil-PH")] + FilPh, + + [EnumMember(Value = "fr-BE")] + FrBe, + + [EnumMember(Value = "fr-CA")] + FrCa, + + [EnumMember(Value = "fr-CH")] + FrCh, + + [EnumMember(Value = "fr-FR")] + FrFr, + + [EnumMember(Value = "ga-IE")] + GaIe, + + [EnumMember(Value = "gl-ES")] + GlEs, + + [EnumMember(Value = "gu-IN")] + GuIn, + + [EnumMember(Value = "he-IL")] + HeIl, + + [EnumMember(Value = "hi-IN")] + HiIn, + + [EnumMember(Value = "hr-HR")] + HrHr, + + [EnumMember(Value = "hu-HU")] + HuHu, + + [EnumMember(Value = "hy-AM")] + HyAm, + + [EnumMember(Value = "id-ID")] + IdId, + + [EnumMember(Value = "is-IS")] + IsIs, + + [EnumMember(Value = "it-CH")] + ItCh, + + [EnumMember(Value = "it-IT")] + ItIt, + + [EnumMember(Value = "ja-JP")] + JaJp, + + [EnumMember(Value = "jv-ID")] + JvId, + + [EnumMember(Value = "ka-GE")] + KaGe, + + [EnumMember(Value = "kk-KZ")] + KkKz, + + [EnumMember(Value = "km-KH")] + KmKh, + + [EnumMember(Value = "kn-IN")] + KnIn, + + [EnumMember(Value = "ko-KR")] + KoKr, + + [EnumMember(Value = "lo-LA")] + LoLa, + + [EnumMember(Value = "lt-LT")] + LtLt, + + [EnumMember(Value = "lv-LV")] + LvLv, + + [EnumMember(Value = "mk-MK")] + MkMk, + + [EnumMember(Value = "ml-IN")] + MlIn, + + [EnumMember(Value = "mn-MN")] + MnMn, + + [EnumMember(Value = "mr-IN")] + MrIn, + + [EnumMember(Value = "ms-MY")] + MsMy, + + [EnumMember(Value = "mt-MT")] + MtMt, + + [EnumMember(Value = "my-MM")] + MyMm, + + [EnumMember(Value = "nb-NO")] + NbNo, + + [EnumMember(Value = "ne-NP")] + NeNp, + + [EnumMember(Value = "nl-BE")] + NlBe, + + [EnumMember(Value = "nl-NL")] + NlNl, + + [EnumMember(Value = "pa-IN")] + PaIn, + + [EnumMember(Value = "pl-PL")] + PlPl, + + [EnumMember(Value = "ps-AF")] + PsAf, + + [EnumMember(Value = "pt-BR")] + PtBr, + + [EnumMember(Value = "pt-PT")] + PtPt, + + [EnumMember(Value = "ro-RO")] + RoRo, + + [EnumMember(Value = "ru-RU")] + RuRu, + + [EnumMember(Value = "si-LK")] + SiLk, + + [EnumMember(Value = "sk-SK")] + SkSk, + + [EnumMember(Value = "sl-SI")] + SlSi, + + [EnumMember(Value = "so-SO")] + SoSo, + + [EnumMember(Value = "sq-AL")] + SqAl, + + [EnumMember(Value = "sr-RS")] + SrRs, + + [EnumMember(Value = "sv-SE")] + SvSe, + + [EnumMember(Value = "sw-KE")] + SwKe, + + [EnumMember(Value = "sw-TZ")] + SwTz, + + [EnumMember(Value = "ta-IN")] + TaIn, + + [EnumMember(Value = "te-IN")] + TeIn, + + [EnumMember(Value = "th-TH")] + ThTh, + + [EnumMember(Value = "tr-TR")] + TrTr, + + [EnumMember(Value = "uk-UA")] + UkUa, + + [EnumMember(Value = "ur-IN")] + UrIn, + + [EnumMember(Value = "uz-UZ")] + UzUz, + + [EnumMember(Value = "vi-VN")] + ViVn, + + [EnumMember(Value = "wuu-CN")] + WuuCn, + + [EnumMember(Value = "yue-CN")] + YueCn, + + [EnumMember(Value = "zh-CN")] + ZhCn, + + [EnumMember(Value = "zh-CN-shandong")] + ZhCnShandong, + + [EnumMember(Value = "zh-CN-sichuan")] + ZhCnSichuan, + + [EnumMember(Value = "zh-HK")] + ZhHk, + + [EnumMember(Value = "zh-TW")] + ZhTw, + + [EnumMember(Value = "zu-ZA")] + ZuZa, +} diff --git a/src/Vapi.Net/Types/FallbackAzureVoice.cs b/src/Vapi.Net/Types/FallbackAzureVoice.cs index 1d0f6c3..3d45d6b 100644 --- a/src/Vapi.Net/Types/FallbackAzureVoice.cs +++ b/src/Vapi.Net/Types/FallbackAzureVoice.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using OneOf; using Vapi.Net.Core; @@ -27,6 +28,17 @@ public record FallbackAzureVoice [JsonPropertyName("oneOf")] public object? OneOf { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/FallbackCartesiaVoice.cs b/src/Vapi.Net/Types/FallbackCartesiaVoice.cs index 77498b7..2dee560 100644 --- a/src/Vapi.Net/Types/FallbackCartesiaVoice.cs +++ b/src/Vapi.Net/Types/FallbackCartesiaVoice.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -35,6 +36,17 @@ public record FallbackCartesiaVoice [JsonPropertyName("chunkPlan")] public ChunkPlan? ChunkPlan { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/FallbackCartesiaVoiceModel.cs b/src/Vapi.Net/Types/FallbackCartesiaVoiceModel.cs index 0a31d2d..b56fca4 100644 --- a/src/Vapi.Net/Types/FallbackCartesiaVoiceModel.cs +++ b/src/Vapi.Net/Types/FallbackCartesiaVoiceModel.cs @@ -7,6 +7,9 @@ namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] public enum FallbackCartesiaVoiceModel { + [EnumMember(Value = "sonic-2")] + Sonic2, + [EnumMember(Value = "sonic-english")] SonicEnglish, diff --git a/src/Vapi.Net/Types/FallbackCustomTranscriber.cs b/src/Vapi.Net/Types/FallbackCustomTranscriber.cs new file mode 100644 index 0000000..bc897bf --- /dev/null +++ b/src/Vapi.Net/Types/FallbackCustomTranscriber.cs @@ -0,0 +1,67 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record FallbackCustomTranscriber +{ + /// + /// This is where the transcription request will be sent. + /// + /// Usage: + /// 1. Vapi will initiate a websocket connection with `server.url`. + /// + /// 2. Vapi will send an initial text frame with the sample rate. Format: + /// ``` + /// { + /// "type": "start", + /// "encoding": "linear16", // 16-bit raw PCM format + /// "container": "raw", + /// "sampleRate": {{sampleRate}}, + /// "channels": 2 // customer is channel 0, assistant is channel 1 + /// } + /// ``` + /// + /// 3. Vapi will send the audio data in 16-bit raw PCM format as binary frames. + /// + /// 4. You can read the messages something like this: + /// ``` + /// ws.on('message', (data, isBinary) => { + /// if (isBinary) { + /// pcmBuffer = Buffer.concat([pcmBuffer, data]); + /// console.log(`Received PCM data, buffer size: ${pcmBuffer.length}`); + /// } else { + /// console.log('Received message:', JSON.parse(data.toString())); + /// } + /// }); + /// ``` + /// + /// 5. You will respond with transcriptions as you have them. Format: + /// ``` + /// { + /// "type": "transcriber-response", + /// "transcription": "Hello, world!", + /// "channel": "customer" | "assistant" + /// } + /// ``` + /// + [JsonPropertyName("server")] + public required Server Server { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/FallbackCustomVoice.cs b/src/Vapi.Net/Types/FallbackCustomVoice.cs index 916b79f..3250599 100644 --- a/src/Vapi.Net/Types/FallbackCustomVoice.cs +++ b/src/Vapi.Net/Types/FallbackCustomVoice.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -38,6 +39,17 @@ public record FallbackCustomVoice [JsonPropertyName("chunkPlan")] public ChunkPlan? ChunkPlan { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/FallbackDeepgramTranscriber.cs b/src/Vapi.Net/Types/FallbackDeepgramTranscriber.cs new file mode 100644 index 0000000..bbb7331 --- /dev/null +++ b/src/Vapi.Net/Types/FallbackDeepgramTranscriber.cs @@ -0,0 +1,129 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record FallbackDeepgramTranscriber +{ + /// + /// This is the Deepgram model that will be used. A list of models can be found here: https://developers.deepgram.com/docs/models-languages-overview + /// + [JsonPropertyName("model")] + public DeepgramTranscriberModel? Model { get; set; } + + /// + /// This is the language that will be set for the transcription. The list of languages Deepgram supports can be found here: https://developers.deepgram.com/docs/models-languages-overview + /// + [JsonPropertyName("language")] + public DeepgramTranscriberLanguage? Language { get; set; } + + /// + /// This will be use smart format option provided by Deepgram. It's default disabled because it can sometimes format numbers as times but it's getting better. + /// + [JsonPropertyName("smartFormat")] + public bool? SmartFormat { get; set; } + + /// + /// This automatically switches the transcriber's language when the customer's language changes. Defaults to false. + /// + /// Usage: + /// - If your customers switch languages mid-call, you can set this to true. + /// + /// Note: + /// - To detect language changes, Vapi uses a custom trained model. Languages supported (X = limited support): + /// 1. Arabic + /// 2. Bengali + /// 3. Cantonese + /// 4. Chinese + /// 5. Chinese Simplified (X) + /// 6. Chinese Traditional (X) + /// 7. English + /// 8. Farsi (X) + /// 9. French + /// 10. German + /// 11. Haitian Creole (X) + /// 12. Hindi + /// 13. Italian + /// 14. Japanese + /// 15. Korean + /// 16. Portuguese + /// 17. Russian + /// 18. Spanish + /// 19. Thai + /// 20. Urdu + /// 21. Vietnamese + /// - To receive `language-change-detected` webhook events, add it to `assistant.serverMessages`. + /// + /// @default false + /// + [JsonPropertyName("codeSwitchingEnabled")] + public bool? CodeSwitchingEnabled { get; set; } + + /// + /// If set to true, this will add mip_opt_out=true as a query parameter of all API requests. See https://developers.deepgram.com/docs/the-deepgram-model-improvement-partnership-program#want-to-opt-out + /// + /// This will only be used if you are using your own Deepgram API key. + /// + /// @default false + /// + [JsonPropertyName("mipOptOut")] + public bool? MipOptOut { get; set; } + + /// + /// If set to true, this will cause deepgram to convert spoken numbers to literal numerals. For example, "my phone number is nine-seven-two..." would become "my phone number is 972..." + /// + /// @default false + /// + [JsonPropertyName("numerals")] + public bool? Numerals { get; set; } + + /// + /// Transcripts below this confidence threshold will be discarded. + /// + /// @default 0.4 + /// + [JsonPropertyName("confidenceThreshold")] + public double? ConfidenceThreshold { get; set; } + + /// + /// These keywords are passed to the transcription model to help it pick up use-case specific words. Anything that may not be a common word, like your company name, should be added here. + /// + [JsonPropertyName("keywords")] + public IEnumerable? Keywords { get; set; } + + /// + /// Keyterm Prompting allows you improve Keyword Recall Rate (KRR) for important keyterms or phrases up to 90%. + /// + [JsonPropertyName("keyterm")] + public IEnumerable? Keyterm { get; set; } + + /// + /// This is the timeout after which Deepgram will send transcription on user silence. You can read in-depth documentation here: https://developers.deepgram.com/docs/endpointing. + /// + /// Here are the most important bits: + /// - Defaults to 10. This is recommended for most use cases to optimize for latency. + /// - 10 can cause some missing transcriptions since because of the shorter context. This mostly happens for one-word utterances. For those uses cases, it's recommended to try 300. It will add a bit of latency but the quality and reliability of the experience will be better. + /// - If neither 10 nor 300 work, contact support@vapi.ai and we'll find another solution. + /// + /// @default 10 + /// + [JsonPropertyName("endpointing")] + public double? Endpointing { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/FallbackDeepgramTranscriberLanguage.cs b/src/Vapi.Net/Types/FallbackDeepgramTranscriberLanguage.cs new file mode 100644 index 0000000..098420b --- /dev/null +++ b/src/Vapi.Net/Types/FallbackDeepgramTranscriberLanguage.cs @@ -0,0 +1,177 @@ +using System.Runtime.Serialization; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[JsonConverter(typeof(EnumSerializer))] +public enum FallbackDeepgramTranscriberLanguage +{ + [EnumMember(Value = "bg")] + Bg, + + [EnumMember(Value = "ca")] + Ca, + + [EnumMember(Value = "cs")] + Cs, + + [EnumMember(Value = "da")] + Da, + + [EnumMember(Value = "da-DK")] + DaDk, + + [EnumMember(Value = "de")] + De, + + [EnumMember(Value = "de-CH")] + DeCh, + + [EnumMember(Value = "el")] + El, + + [EnumMember(Value = "en")] + En, + + [EnumMember(Value = "en-AU")] + EnAu, + + [EnumMember(Value = "en-GB")] + EnGb, + + [EnumMember(Value = "en-IN")] + EnIn, + + [EnumMember(Value = "en-NZ")] + EnNz, + + [EnumMember(Value = "en-US")] + EnUs, + + [EnumMember(Value = "es")] + Es, + + [EnumMember(Value = "es-419")] + Es419, + + [EnumMember(Value = "es-LATAM")] + EsLatam, + + [EnumMember(Value = "et")] + Et, + + [EnumMember(Value = "fi")] + Fi, + + [EnumMember(Value = "fr")] + Fr, + + [EnumMember(Value = "fr-CA")] + FrCa, + + [EnumMember(Value = "hi")] + Hi, + + [EnumMember(Value = "hi-Latn")] + HiLatn, + + [EnumMember(Value = "hu")] + Hu, + + [EnumMember(Value = "id")] + Id, + + [EnumMember(Value = "it")] + It, + + [EnumMember(Value = "ja")] + Ja, + + [EnumMember(Value = "ko")] + Ko, + + [EnumMember(Value = "ko-KR")] + KoKr, + + [EnumMember(Value = "lt")] + Lt, + + [EnumMember(Value = "lv")] + Lv, + + [EnumMember(Value = "ms")] + Ms, + + [EnumMember(Value = "multi")] + Multi, + + [EnumMember(Value = "nl")] + Nl, + + [EnumMember(Value = "nl-BE")] + NlBe, + + [EnumMember(Value = "no")] + No, + + [EnumMember(Value = "pl")] + Pl, + + [EnumMember(Value = "pt")] + Pt, + + [EnumMember(Value = "pt-BR")] + PtBr, + + [EnumMember(Value = "ro")] + Ro, + + [EnumMember(Value = "ru")] + Ru, + + [EnumMember(Value = "sk")] + Sk, + + [EnumMember(Value = "sv")] + Sv, + + [EnumMember(Value = "sv-SE")] + SvSe, + + [EnumMember(Value = "ta")] + Ta, + + [EnumMember(Value = "taq")] + Taq, + + [EnumMember(Value = "th")] + Th, + + [EnumMember(Value = "th-TH")] + ThTh, + + [EnumMember(Value = "tr")] + Tr, + + [EnumMember(Value = "uk")] + Uk, + + [EnumMember(Value = "vi")] + Vi, + + [EnumMember(Value = "zh")] + Zh, + + [EnumMember(Value = "zh-CN")] + ZhCn, + + [EnumMember(Value = "zh-Hans")] + ZhHans, + + [EnumMember(Value = "zh-Hant")] + ZhHant, + + [EnumMember(Value = "zh-TW")] + ZhTw, +} diff --git a/src/Vapi.Net/Types/FallbackDeepgramTranscriberModel.cs b/src/Vapi.Net/Types/FallbackDeepgramTranscriberModel.cs new file mode 100644 index 0000000..dd1e634 --- /dev/null +++ b/src/Vapi.Net/Types/FallbackDeepgramTranscriberModel.cs @@ -0,0 +1,102 @@ +using System.Runtime.Serialization; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[JsonConverter(typeof(EnumSerializer))] +public enum FallbackDeepgramTranscriberModel +{ + [EnumMember(Value = "nova-3")] + Nova3, + + [EnumMember(Value = "nova-3-general")] + Nova3General, + + [EnumMember(Value = "nova-3-medical")] + Nova3Medical, + + [EnumMember(Value = "nova-2")] + Nova2, + + [EnumMember(Value = "nova-2-general")] + Nova2General, + + [EnumMember(Value = "nova-2-meeting")] + Nova2Meeting, + + [EnumMember(Value = "nova-2-phonecall")] + Nova2Phonecall, + + [EnumMember(Value = "nova-2-finance")] + Nova2Finance, + + [EnumMember(Value = "nova-2-conversationalai")] + Nova2Conversationalai, + + [EnumMember(Value = "nova-2-voicemail")] + Nova2Voicemail, + + [EnumMember(Value = "nova-2-video")] + Nova2Video, + + [EnumMember(Value = "nova-2-medical")] + Nova2Medical, + + [EnumMember(Value = "nova-2-drivethru")] + Nova2Drivethru, + + [EnumMember(Value = "nova-2-automotive")] + Nova2Automotive, + + [EnumMember(Value = "nova")] + Nova, + + [EnumMember(Value = "nova-general")] + NovaGeneral, + + [EnumMember(Value = "nova-phonecall")] + NovaPhonecall, + + [EnumMember(Value = "nova-medical")] + NovaMedical, + + [EnumMember(Value = "enhanced")] + Enhanced, + + [EnumMember(Value = "enhanced-general")] + EnhancedGeneral, + + [EnumMember(Value = "enhanced-meeting")] + EnhancedMeeting, + + [EnumMember(Value = "enhanced-phonecall")] + EnhancedPhonecall, + + [EnumMember(Value = "enhanced-finance")] + EnhancedFinance, + + [EnumMember(Value = "base")] + Base, + + [EnumMember(Value = "base-general")] + BaseGeneral, + + [EnumMember(Value = "base-meeting")] + BaseMeeting, + + [EnumMember(Value = "base-phonecall")] + BasePhonecall, + + [EnumMember(Value = "base-finance")] + BaseFinance, + + [EnumMember(Value = "base-conversationalai")] + BaseConversationalai, + + [EnumMember(Value = "base-voicemail")] + BaseVoicemail, + + [EnumMember(Value = "base-video")] + BaseVideo, +} diff --git a/src/Vapi.Net/Types/FallbackDeepgramVoice.cs b/src/Vapi.Net/Types/FallbackDeepgramVoice.cs index 7bb3e7f..eda4712 100644 --- a/src/Vapi.Net/Types/FallbackDeepgramVoice.cs +++ b/src/Vapi.Net/Types/FallbackDeepgramVoice.cs @@ -1,5 +1,5 @@ +using System.Text.Json; using System.Text.Json.Serialization; -using OneOf; using Vapi.Net.Core; namespace Vapi.Net; @@ -10,7 +10,13 @@ public record FallbackDeepgramVoice /// This is the provider-specific ID that will be used. /// [JsonPropertyName("voiceId")] - public required OneOf VoiceId { get; set; } + public required FallbackDeepgramVoiceId VoiceId { get; set; } + + /// + /// This is the model that will be used. Defaults to 'aura-2' when not specified. + /// + [JsonPropertyName("model")] + public FallbackDeepgramVoiceModel? Model { get; set; } /// /// If set to true, this will add mip_opt_out=true as a query parameter of all API requests. See https://developers.deepgram.com/docs/the-deepgram-model-improvement-partnership-program#want-to-opt-out @@ -28,6 +34,17 @@ public record FallbackDeepgramVoice [JsonPropertyName("chunkPlan")] public ChunkPlan? ChunkPlan { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/FallbackDeepgramVoiceId.cs b/src/Vapi.Net/Types/FallbackDeepgramVoiceId.cs new file mode 100644 index 0000000..df72d80 --- /dev/null +++ b/src/Vapi.Net/Types/FallbackDeepgramVoiceId.cs @@ -0,0 +1,144 @@ +using System.Runtime.Serialization; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[JsonConverter(typeof(EnumSerializer))] +public enum FallbackDeepgramVoiceId +{ + [EnumMember(Value = "asteria")] + Asteria, + + [EnumMember(Value = "luna")] + Luna, + + [EnumMember(Value = "stella")] + Stella, + + [EnumMember(Value = "athena")] + Athena, + + [EnumMember(Value = "hera")] + Hera, + + [EnumMember(Value = "orion")] + Orion, + + [EnumMember(Value = "arcas")] + Arcas, + + [EnumMember(Value = "perseus")] + Perseus, + + [EnumMember(Value = "angus")] + Angus, + + [EnumMember(Value = "orpheus")] + Orpheus, + + [EnumMember(Value = "helios")] + Helios, + + [EnumMember(Value = "zeus")] + Zeus, + + [EnumMember(Value = "thalia")] + Thalia, + + [EnumMember(Value = "andromeda")] + Andromeda, + + [EnumMember(Value = "helena")] + Helena, + + [EnumMember(Value = "apollo")] + Apollo, + + [EnumMember(Value = "aries")] + Aries, + + [EnumMember(Value = "amalthea")] + Amalthea, + + [EnumMember(Value = "atlas")] + Atlas, + + [EnumMember(Value = "aurora")] + Aurora, + + [EnumMember(Value = "callista")] + Callista, + + [EnumMember(Value = "cora")] + Cora, + + [EnumMember(Value = "cordelia")] + Cordelia, + + [EnumMember(Value = "delia")] + Delia, + + [EnumMember(Value = "draco")] + Draco, + + [EnumMember(Value = "electra")] + Electra, + + [EnumMember(Value = "harmonia")] + Harmonia, + + [EnumMember(Value = "hermes")] + Hermes, + + [EnumMember(Value = "hyperion")] + Hyperion, + + [EnumMember(Value = "iris")] + Iris, + + [EnumMember(Value = "janus")] + Janus, + + [EnumMember(Value = "juno")] + Juno, + + [EnumMember(Value = "jupiter")] + Jupiter, + + [EnumMember(Value = "mars")] + Mars, + + [EnumMember(Value = "minerva")] + Minerva, + + [EnumMember(Value = "neptune")] + Neptune, + + [EnumMember(Value = "odysseus")] + Odysseus, + + [EnumMember(Value = "ophelia")] + Ophelia, + + [EnumMember(Value = "pandora")] + Pandora, + + [EnumMember(Value = "phoebe")] + Phoebe, + + [EnumMember(Value = "pluto")] + Pluto, + + [EnumMember(Value = "saturn")] + Saturn, + + [EnumMember(Value = "selene")] + Selene, + + [EnumMember(Value = "theia")] + Theia, + + [EnumMember(Value = "vesta")] + Vesta, +} diff --git a/src/Vapi.Net/Types/FallbackDeepgramVoiceIdEnum.cs b/src/Vapi.Net/Types/FallbackDeepgramVoiceIdEnum.cs deleted file mode 100644 index a4c773a..0000000 --- a/src/Vapi.Net/Types/FallbackDeepgramVoiceIdEnum.cs +++ /dev/null @@ -1,45 +0,0 @@ -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using Vapi.Net.Core; - -namespace Vapi.Net; - -[JsonConverter(typeof(EnumSerializer))] -public enum FallbackDeepgramVoiceIdEnum -{ - [EnumMember(Value = "asteria")] - Asteria, - - [EnumMember(Value = "luna")] - Luna, - - [EnumMember(Value = "stella")] - Stella, - - [EnumMember(Value = "athena")] - Athena, - - [EnumMember(Value = "hera")] - Hera, - - [EnumMember(Value = "orion")] - Orion, - - [EnumMember(Value = "arcas")] - Arcas, - - [EnumMember(Value = "perseus")] - Perseus, - - [EnumMember(Value = "angus")] - Angus, - - [EnumMember(Value = "orpheus")] - Orpheus, - - [EnumMember(Value = "helios")] - Helios, - - [EnumMember(Value = "zeus")] - Zeus, -} diff --git a/src/Vapi.Net/Types/FallbackDeepgramVoiceModel.cs b/src/Vapi.Net/Types/FallbackDeepgramVoiceModel.cs new file mode 100644 index 0000000..a0c753e --- /dev/null +++ b/src/Vapi.Net/Types/FallbackDeepgramVoiceModel.cs @@ -0,0 +1,15 @@ +using System.Runtime.Serialization; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[JsonConverter(typeof(EnumSerializer))] +public enum FallbackDeepgramVoiceModel +{ + [EnumMember(Value = "aura")] + Aura, + + [EnumMember(Value = "aura-2")] + Aura2, +} diff --git a/src/Vapi.Net/Types/FallbackElevenLabsTranscriber.cs b/src/Vapi.Net/Types/FallbackElevenLabsTranscriber.cs new file mode 100644 index 0000000..8590cb7 --- /dev/null +++ b/src/Vapi.Net/Types/FallbackElevenLabsTranscriber.cs @@ -0,0 +1,33 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record FallbackElevenLabsTranscriber +{ + /// + /// This is the model that will be used for the transcription. + /// + [JsonPropertyName("model")] + public string? Model { get; set; } + + [JsonPropertyName("language")] + public FallbackElevenLabsTranscriberLanguage? Language { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/FallbackElevenLabsTranscriberLanguage.cs b/src/Vapi.Net/Types/FallbackElevenLabsTranscriberLanguage.cs new file mode 100644 index 0000000..c55dba2 --- /dev/null +++ b/src/Vapi.Net/Types/FallbackElevenLabsTranscriberLanguage.cs @@ -0,0 +1,564 @@ +using System.Runtime.Serialization; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[JsonConverter(typeof(EnumSerializer))] +public enum FallbackElevenLabsTranscriberLanguage +{ + [EnumMember(Value = "aa")] + Aa, + + [EnumMember(Value = "ab")] + Ab, + + [EnumMember(Value = "ae")] + Ae, + + [EnumMember(Value = "af")] + Af, + + [EnumMember(Value = "ak")] + Ak, + + [EnumMember(Value = "am")] + Am, + + [EnumMember(Value = "an")] + An, + + [EnumMember(Value = "ar")] + Ar, + + [EnumMember(Value = "as")] + As, + + [EnumMember(Value = "av")] + Av, + + [EnumMember(Value = "ay")] + Ay, + + [EnumMember(Value = "az")] + Az, + + [EnumMember(Value = "ba")] + Ba, + + [EnumMember(Value = "be")] + Be, + + [EnumMember(Value = "bg")] + Bg, + + [EnumMember(Value = "bh")] + Bh, + + [EnumMember(Value = "bi")] + Bi, + + [EnumMember(Value = "bm")] + Bm, + + [EnumMember(Value = "bn")] + Bn, + + [EnumMember(Value = "bo")] + Bo, + + [EnumMember(Value = "br")] + Br, + + [EnumMember(Value = "bs")] + Bs, + + [EnumMember(Value = "ca")] + Ca, + + [EnumMember(Value = "ce")] + Ce, + + [EnumMember(Value = "ch")] + Ch, + + [EnumMember(Value = "co")] + Co, + + [EnumMember(Value = "cr")] + Cr, + + [EnumMember(Value = "cs")] + Cs, + + [EnumMember(Value = "cu")] + Cu, + + [EnumMember(Value = "cv")] + Cv, + + [EnumMember(Value = "cy")] + Cy, + + [EnumMember(Value = "da")] + Da, + + [EnumMember(Value = "de")] + De, + + [EnumMember(Value = "dv")] + Dv, + + [EnumMember(Value = "dz")] + Dz, + + [EnumMember(Value = "ee")] + Ee, + + [EnumMember(Value = "el")] + El, + + [EnumMember(Value = "en")] + En, + + [EnumMember(Value = "eo")] + Eo, + + [EnumMember(Value = "es")] + Es, + + [EnumMember(Value = "et")] + Et, + + [EnumMember(Value = "eu")] + Eu, + + [EnumMember(Value = "fa")] + Fa, + + [EnumMember(Value = "ff")] + Ff, + + [EnumMember(Value = "fi")] + Fi, + + [EnumMember(Value = "fj")] + Fj, + + [EnumMember(Value = "fo")] + Fo, + + [EnumMember(Value = "fr")] + Fr, + + [EnumMember(Value = "fy")] + Fy, + + [EnumMember(Value = "ga")] + Ga, + + [EnumMember(Value = "gd")] + Gd, + + [EnumMember(Value = "gl")] + Gl, + + [EnumMember(Value = "gn")] + Gn, + + [EnumMember(Value = "gu")] + Gu, + + [EnumMember(Value = "gv")] + Gv, + + [EnumMember(Value = "ha")] + Ha, + + [EnumMember(Value = "he")] + He, + + [EnumMember(Value = "hi")] + Hi, + + [EnumMember(Value = "ho")] + Ho, + + [EnumMember(Value = "hr")] + Hr, + + [EnumMember(Value = "ht")] + Ht, + + [EnumMember(Value = "hu")] + Hu, + + [EnumMember(Value = "hy")] + Hy, + + [EnumMember(Value = "hz")] + Hz, + + [EnumMember(Value = "ia")] + Ia, + + [EnumMember(Value = "id")] + Id, + + [EnumMember(Value = "ie")] + Ie, + + [EnumMember(Value = "ig")] + Ig, + + [EnumMember(Value = "ii")] + Ii, + + [EnumMember(Value = "ik")] + Ik, + + [EnumMember(Value = "io")] + Io, + + [EnumMember(Value = "is")] + Is, + + [EnumMember(Value = "it")] + It, + + [EnumMember(Value = "iu")] + Iu, + + [EnumMember(Value = "ja")] + Ja, + + [EnumMember(Value = "jv")] + Jv, + + [EnumMember(Value = "ka")] + Ka, + + [EnumMember(Value = "kg")] + Kg, + + [EnumMember(Value = "ki")] + Ki, + + [EnumMember(Value = "kj")] + Kj, + + [EnumMember(Value = "kk")] + Kk, + + [EnumMember(Value = "kl")] + Kl, + + [EnumMember(Value = "km")] + Km, + + [EnumMember(Value = "kn")] + Kn, + + [EnumMember(Value = "ko")] + Ko, + + [EnumMember(Value = "kr")] + Kr, + + [EnumMember(Value = "ks")] + Ks, + + [EnumMember(Value = "ku")] + Ku, + + [EnumMember(Value = "kv")] + Kv, + + [EnumMember(Value = "kw")] + Kw, + + [EnumMember(Value = "ky")] + Ky, + + [EnumMember(Value = "la")] + La, + + [EnumMember(Value = "lb")] + Lb, + + [EnumMember(Value = "lg")] + Lg, + + [EnumMember(Value = "li")] + Li, + + [EnumMember(Value = "ln")] + Ln, + + [EnumMember(Value = "lo")] + Lo, + + [EnumMember(Value = "lt")] + Lt, + + [EnumMember(Value = "lu")] + Lu, + + [EnumMember(Value = "lv")] + Lv, + + [EnumMember(Value = "mg")] + Mg, + + [EnumMember(Value = "mh")] + Mh, + + [EnumMember(Value = "mi")] + Mi, + + [EnumMember(Value = "mk")] + Mk, + + [EnumMember(Value = "ml")] + Ml, + + [EnumMember(Value = "mn")] + Mn, + + [EnumMember(Value = "mr")] + Mr, + + [EnumMember(Value = "ms")] + Ms, + + [EnumMember(Value = "mt")] + Mt, + + [EnumMember(Value = "my")] + My, + + [EnumMember(Value = "na")] + Na, + + [EnumMember(Value = "nb")] + Nb, + + [EnumMember(Value = "nd")] + Nd, + + [EnumMember(Value = "ne")] + Ne, + + [EnumMember(Value = "ng")] + Ng, + + [EnumMember(Value = "nl")] + Nl, + + [EnumMember(Value = "nn")] + Nn, + + [EnumMember(Value = "no")] + No, + + [EnumMember(Value = "nr")] + Nr, + + [EnumMember(Value = "nv")] + Nv, + + [EnumMember(Value = "ny")] + Ny, + + [EnumMember(Value = "oc")] + Oc, + + [EnumMember(Value = "oj")] + Oj, + + [EnumMember(Value = "om")] + Om, + + [EnumMember(Value = "or")] + Or, + + [EnumMember(Value = "os")] + Os, + + [EnumMember(Value = "pa")] + Pa, + + [EnumMember(Value = "pi")] + Pi, + + [EnumMember(Value = "pl")] + Pl, + + [EnumMember(Value = "ps")] + Ps, + + [EnumMember(Value = "pt")] + Pt, + + [EnumMember(Value = "qu")] + Qu, + + [EnumMember(Value = "rm")] + Rm, + + [EnumMember(Value = "rn")] + Rn, + + [EnumMember(Value = "ro")] + Ro, + + [EnumMember(Value = "ru")] + Ru, + + [EnumMember(Value = "rw")] + Rw, + + [EnumMember(Value = "sa")] + Sa, + + [EnumMember(Value = "sc")] + Sc, + + [EnumMember(Value = "sd")] + Sd, + + [EnumMember(Value = "se")] + Se, + + [EnumMember(Value = "sg")] + Sg, + + [EnumMember(Value = "si")] + Si, + + [EnumMember(Value = "sk")] + Sk, + + [EnumMember(Value = "sl")] + Sl, + + [EnumMember(Value = "sm")] + Sm, + + [EnumMember(Value = "sn")] + Sn, + + [EnumMember(Value = "so")] + So, + + [EnumMember(Value = "sq")] + Sq, + + [EnumMember(Value = "sr")] + Sr, + + [EnumMember(Value = "ss")] + Ss, + + [EnumMember(Value = "st")] + St, + + [EnumMember(Value = "su")] + Su, + + [EnumMember(Value = "sv")] + Sv, + + [EnumMember(Value = "sw")] + Sw, + + [EnumMember(Value = "ta")] + Ta, + + [EnumMember(Value = "te")] + Te, + + [EnumMember(Value = "tg")] + Tg, + + [EnumMember(Value = "th")] + Th, + + [EnumMember(Value = "ti")] + Ti, + + [EnumMember(Value = "tk")] + Tk, + + [EnumMember(Value = "tl")] + Tl, + + [EnumMember(Value = "tn")] + Tn, + + [EnumMember(Value = "to")] + To, + + [EnumMember(Value = "tr")] + Tr, + + [EnumMember(Value = "ts")] + Ts, + + [EnumMember(Value = "tt")] + Tt, + + [EnumMember(Value = "tw")] + Tw, + + [EnumMember(Value = "ty")] + Ty, + + [EnumMember(Value = "ug")] + Ug, + + [EnumMember(Value = "uk")] + Uk, + + [EnumMember(Value = "ur")] + Ur, + + [EnumMember(Value = "uz")] + Uz, + + [EnumMember(Value = "ve")] + Ve, + + [EnumMember(Value = "vi")] + Vi, + + [EnumMember(Value = "vo")] + Vo, + + [EnumMember(Value = "wa")] + Wa, + + [EnumMember(Value = "wo")] + Wo, + + [EnumMember(Value = "xh")] + Xh, + + [EnumMember(Value = "yi")] + Yi, + + [EnumMember(Value = "yue")] + Yue, + + [EnumMember(Value = "yo")] + Yo, + + [EnumMember(Value = "za")] + Za, + + [EnumMember(Value = "zh")] + Zh, + + [EnumMember(Value = "zu")] + Zu, +} diff --git a/src/Vapi.Net/Types/FallbackElevenLabsVoice.cs b/src/Vapi.Net/Types/FallbackElevenLabsVoice.cs index 47fa1e7..b50c2d7 100644 --- a/src/Vapi.Net/Types/FallbackElevenLabsVoice.cs +++ b/src/Vapi.Net/Types/FallbackElevenLabsVoice.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using OneOf; using Vapi.Net.Core; @@ -36,6 +37,12 @@ public record FallbackElevenLabsVoice [JsonPropertyName("useSpeakerBoost")] public bool? UseSpeakerBoost { get; set; } + /// + /// Defines the speed for voice settings. + /// + [JsonPropertyName("speed")] + public double? Speed { get; set; } + /// /// Defines the optimize streaming latency for voice settings. Defaults to 3. /// @@ -50,6 +57,12 @@ public record FallbackElevenLabsVoice [JsonPropertyName("enableSsmlParsing")] public bool? EnableSsmlParsing { get; set; } + /// + /// Defines the auto mode for voice settings. Defaults to false. + /// + [JsonPropertyName("autoMode")] + public bool? AutoMode { get; set; } + /// /// This is the model that will be used. Defaults to 'eleven_turbo_v2' if not specified. /// @@ -68,6 +81,17 @@ public record FallbackElevenLabsVoice [JsonPropertyName("chunkPlan")] public ChunkPlan? ChunkPlan { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/FallbackGladiaTranscriber.cs b/src/Vapi.Net/Types/FallbackGladiaTranscriber.cs new file mode 100644 index 0000000..e6de724 --- /dev/null +++ b/src/Vapi.Net/Types/FallbackGladiaTranscriber.cs @@ -0,0 +1,63 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record FallbackGladiaTranscriber +{ + [JsonPropertyName("model")] + public FallbackGladiaTranscriberModel? Model { get; set; } + + [JsonPropertyName("languageBehaviour")] + public FallbackGladiaTranscriberLanguageBehaviour? LanguageBehaviour { get; set; } + + /// + /// Defines the language to use for the transcription. Required when languageBehaviour is 'manual'. + /// + [JsonPropertyName("language")] + public FallbackGladiaTranscriberLanguage? Language { get; set; } + + /// + /// Provides a custom vocabulary to the model to improve accuracy of transcribing context specific words, technical terms, names, etc. If empty, this argument is ignored. + /// ⚠️ Warning ⚠️: Please be aware that the transcription_hint field has a character limit of 600. If you provide a transcription_hint longer than 600 characters, it will be automatically truncated to meet this limit. + /// + [JsonPropertyName("transcriptionHint")] + public string? TranscriptionHint { get; set; } + + /// + /// If prosody is true, you will get a transcription that can contain prosodies i.e. (laugh) (giggles) (malefic laugh) (toss) (music)… Default value is false. + /// + [JsonPropertyName("prosody")] + public bool? Prosody { get; set; } + + /// + /// If true, audio will be pre-processed to improve accuracy but latency will increase. Default value is false. + /// + [JsonPropertyName("audioEnhancer")] + public bool? AudioEnhancer { get; set; } + + /// + /// Transcripts below this confidence threshold will be discarded. + /// + /// @default 0.4 + /// + [JsonPropertyName("confidenceThreshold")] + public double? ConfidenceThreshold { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/FallbackGladiaTranscriberLanguage.cs b/src/Vapi.Net/Types/FallbackGladiaTranscriberLanguage.cs new file mode 100644 index 0000000..0cdb66a --- /dev/null +++ b/src/Vapi.Net/Types/FallbackGladiaTranscriberLanguage.cs @@ -0,0 +1,306 @@ +using System.Runtime.Serialization; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[JsonConverter(typeof(EnumSerializer))] +public enum FallbackGladiaTranscriberLanguage +{ + [EnumMember(Value = "af")] + Af, + + [EnumMember(Value = "sq")] + Sq, + + [EnumMember(Value = "am")] + Am, + + [EnumMember(Value = "ar")] + Ar, + + [EnumMember(Value = "hy")] + Hy, + + [EnumMember(Value = "as")] + As, + + [EnumMember(Value = "az")] + Az, + + [EnumMember(Value = "ba")] + Ba, + + [EnumMember(Value = "eu")] + Eu, + + [EnumMember(Value = "be")] + Be, + + [EnumMember(Value = "bn")] + Bn, + + [EnumMember(Value = "bs")] + Bs, + + [EnumMember(Value = "br")] + Br, + + [EnumMember(Value = "bg")] + Bg, + + [EnumMember(Value = "ca")] + Ca, + + [EnumMember(Value = "zh")] + Zh, + + [EnumMember(Value = "hr")] + Hr, + + [EnumMember(Value = "cs")] + Cs, + + [EnumMember(Value = "da")] + Da, + + [EnumMember(Value = "nl")] + Nl, + + [EnumMember(Value = "en")] + En, + + [EnumMember(Value = "et")] + Et, + + [EnumMember(Value = "fo")] + Fo, + + [EnumMember(Value = "fi")] + Fi, + + [EnumMember(Value = "fr")] + Fr, + + [EnumMember(Value = "gl")] + Gl, + + [EnumMember(Value = "ka")] + Ka, + + [EnumMember(Value = "de")] + De, + + [EnumMember(Value = "el")] + El, + + [EnumMember(Value = "gu")] + Gu, + + [EnumMember(Value = "ht")] + Ht, + + [EnumMember(Value = "ha")] + Ha, + + [EnumMember(Value = "haw")] + Haw, + + [EnumMember(Value = "he")] + He, + + [EnumMember(Value = "hi")] + Hi, + + [EnumMember(Value = "hu")] + Hu, + + [EnumMember(Value = "is")] + Is, + + [EnumMember(Value = "id")] + Id, + + [EnumMember(Value = "it")] + It, + + [EnumMember(Value = "ja")] + Ja, + + [EnumMember(Value = "jv")] + Jv, + + [EnumMember(Value = "kn")] + Kn, + + [EnumMember(Value = "kk")] + Kk, + + [EnumMember(Value = "km")] + Km, + + [EnumMember(Value = "ko")] + Ko, + + [EnumMember(Value = "lo")] + Lo, + + [EnumMember(Value = "la")] + La, + + [EnumMember(Value = "lv")] + Lv, + + [EnumMember(Value = "ln")] + Ln, + + [EnumMember(Value = "lt")] + Lt, + + [EnumMember(Value = "lb")] + Lb, + + [EnumMember(Value = "mk")] + Mk, + + [EnumMember(Value = "mg")] + Mg, + + [EnumMember(Value = "ms")] + Ms, + + [EnumMember(Value = "ml")] + Ml, + + [EnumMember(Value = "mt")] + Mt, + + [EnumMember(Value = "mi")] + Mi, + + [EnumMember(Value = "mr")] + Mr, + + [EnumMember(Value = "mn")] + Mn, + + [EnumMember(Value = "my")] + My, + + [EnumMember(Value = "ne")] + Ne, + + [EnumMember(Value = "no")] + No, + + [EnumMember(Value = "nn")] + Nn, + + [EnumMember(Value = "oc")] + Oc, + + [EnumMember(Value = "ps")] + Ps, + + [EnumMember(Value = "fa")] + Fa, + + [EnumMember(Value = "pl")] + Pl, + + [EnumMember(Value = "pt")] + Pt, + + [EnumMember(Value = "pa")] + Pa, + + [EnumMember(Value = "ro")] + Ro, + + [EnumMember(Value = "ru")] + Ru, + + [EnumMember(Value = "sa")] + Sa, + + [EnumMember(Value = "sr")] + Sr, + + [EnumMember(Value = "sn")] + Sn, + + [EnumMember(Value = "sd")] + Sd, + + [EnumMember(Value = "si")] + Si, + + [EnumMember(Value = "sk")] + Sk, + + [EnumMember(Value = "sl")] + Sl, + + [EnumMember(Value = "so")] + So, + + [EnumMember(Value = "es")] + Es, + + [EnumMember(Value = "su")] + Su, + + [EnumMember(Value = "sw")] + Sw, + + [EnumMember(Value = "sv")] + Sv, + + [EnumMember(Value = "tl")] + Tl, + + [EnumMember(Value = "tg")] + Tg, + + [EnumMember(Value = "ta")] + Ta, + + [EnumMember(Value = "tt")] + Tt, + + [EnumMember(Value = "te")] + Te, + + [EnumMember(Value = "th")] + Th, + + [EnumMember(Value = "bo")] + Bo, + + [EnumMember(Value = "tr")] + Tr, + + [EnumMember(Value = "tk")] + Tk, + + [EnumMember(Value = "uk")] + Uk, + + [EnumMember(Value = "ur")] + Ur, + + [EnumMember(Value = "uz")] + Uz, + + [EnumMember(Value = "vi")] + Vi, + + [EnumMember(Value = "cy")] + Cy, + + [EnumMember(Value = "yi")] + Yi, + + [EnumMember(Value = "yo")] + Yo, +} diff --git a/src/Vapi.Net/Types/FallbackGladiaTranscriberLanguageBehaviour.cs b/src/Vapi.Net/Types/FallbackGladiaTranscriberLanguageBehaviour.cs new file mode 100644 index 0000000..ccf392b --- /dev/null +++ b/src/Vapi.Net/Types/FallbackGladiaTranscriberLanguageBehaviour.cs @@ -0,0 +1,18 @@ +using System.Runtime.Serialization; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[JsonConverter(typeof(EnumSerializer))] +public enum FallbackGladiaTranscriberLanguageBehaviour +{ + [EnumMember(Value = "manual")] + Manual, + + [EnumMember(Value = "automatic single language")] + AutomaticSingleLanguage, + + [EnumMember(Value = "automatic multiple languages")] + AutomaticMultipleLanguages, +} diff --git a/src/Vapi.Net/Types/FallbackGladiaTranscriberModel.cs b/src/Vapi.Net/Types/FallbackGladiaTranscriberModel.cs new file mode 100644 index 0000000..d9db162 --- /dev/null +++ b/src/Vapi.Net/Types/FallbackGladiaTranscriberModel.cs @@ -0,0 +1,15 @@ +using System.Runtime.Serialization; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[JsonConverter(typeof(EnumSerializer))] +public enum FallbackGladiaTranscriberModel +{ + [EnumMember(Value = "fast")] + Fast, + + [EnumMember(Value = "accurate")] + Accurate, +} diff --git a/src/Vapi.Net/Types/FallbackGoogleTranscriber.cs b/src/Vapi.Net/Types/FallbackGoogleTranscriber.cs new file mode 100644 index 0000000..3b4b6fd --- /dev/null +++ b/src/Vapi.Net/Types/FallbackGoogleTranscriber.cs @@ -0,0 +1,36 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record FallbackGoogleTranscriber +{ + /// + /// This is the model that will be used for the transcription. + /// + [JsonPropertyName("model")] + public FallbackGoogleTranscriberModel? Model { get; set; } + + /// + /// This is the language that will be set for the transcription. + /// + [JsonPropertyName("language")] + public FallbackGoogleTranscriberLanguage? Language { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/FallbackGoogleTranscriberLanguage.cs b/src/Vapi.Net/Types/FallbackGoogleTranscriberLanguage.cs new file mode 100644 index 0000000..b5b9d58 --- /dev/null +++ b/src/Vapi.Net/Types/FallbackGoogleTranscriberLanguage.cs @@ -0,0 +1,126 @@ +using System.Runtime.Serialization; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[JsonConverter(typeof(EnumSerializer))] +public enum FallbackGoogleTranscriberLanguage +{ + [EnumMember(Value = "Multilingual")] + Multilingual, + + [EnumMember(Value = "Arabic")] + Arabic, + + [EnumMember(Value = "Bengali")] + Bengali, + + [EnumMember(Value = "Bulgarian")] + Bulgarian, + + [EnumMember(Value = "Chinese")] + Chinese, + + [EnumMember(Value = "Croatian")] + Croatian, + + [EnumMember(Value = "Czech")] + Czech, + + [EnumMember(Value = "Danish")] + Danish, + + [EnumMember(Value = "Dutch")] + Dutch, + + [EnumMember(Value = "English")] + English, + + [EnumMember(Value = "Estonian")] + Estonian, + + [EnumMember(Value = "Finnish")] + Finnish, + + [EnumMember(Value = "French")] + French, + + [EnumMember(Value = "German")] + German, + + [EnumMember(Value = "Greek")] + Greek, + + [EnumMember(Value = "Hebrew")] + Hebrew, + + [EnumMember(Value = "Hindi")] + Hindi, + + [EnumMember(Value = "Hungarian")] + Hungarian, + + [EnumMember(Value = "Indonesian")] + Indonesian, + + [EnumMember(Value = "Italian")] + Italian, + + [EnumMember(Value = "Japanese")] + Japanese, + + [EnumMember(Value = "Korean")] + Korean, + + [EnumMember(Value = "Latvian")] + Latvian, + + [EnumMember(Value = "Lithuanian")] + Lithuanian, + + [EnumMember(Value = "Norwegian")] + Norwegian, + + [EnumMember(Value = "Polish")] + Polish, + + [EnumMember(Value = "Portuguese")] + Portuguese, + + [EnumMember(Value = "Romanian")] + Romanian, + + [EnumMember(Value = "Russian")] + Russian, + + [EnumMember(Value = "Serbian")] + Serbian, + + [EnumMember(Value = "Slovak")] + Slovak, + + [EnumMember(Value = "Slovenian")] + Slovenian, + + [EnumMember(Value = "Spanish")] + Spanish, + + [EnumMember(Value = "Swahili")] + Swahili, + + [EnumMember(Value = "Swedish")] + Swedish, + + [EnumMember(Value = "Thai")] + Thai, + + [EnumMember(Value = "Turkish")] + Turkish, + + [EnumMember(Value = "Ukrainian")] + Ukrainian, + + [EnumMember(Value = "Vietnamese")] + Vietnamese, +} diff --git a/src/Vapi.Net/Types/FallbackGoogleTranscriberModel.cs b/src/Vapi.Net/Types/FallbackGoogleTranscriberModel.cs new file mode 100644 index 0000000..1bcdfcd --- /dev/null +++ b/src/Vapi.Net/Types/FallbackGoogleTranscriberModel.cs @@ -0,0 +1,45 @@ +using System.Runtime.Serialization; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[JsonConverter(typeof(EnumSerializer))] +public enum FallbackGoogleTranscriberModel +{ + [EnumMember(Value = "gemini-2.0-flash-thinking-exp")] + Gemini20FlashThinkingExp, + + [EnumMember(Value = "gemini-2.0-pro-exp-02-05")] + Gemini20ProExp0205, + + [EnumMember(Value = "gemini-2.0-flash")] + Gemini20Flash, + + [EnumMember(Value = "gemini-2.0-flash-lite")] + Gemini20FlashLite, + + [EnumMember(Value = "gemini-2.0-flash-lite-preview-02-05")] + Gemini20FlashLitePreview0205, + + [EnumMember(Value = "gemini-2.0-flash-exp")] + Gemini20FlashExp, + + [EnumMember(Value = "gemini-2.0-flash-realtime-exp")] + Gemini20FlashRealtimeExp, + + [EnumMember(Value = "gemini-1.5-flash")] + Gemini15Flash, + + [EnumMember(Value = "gemini-1.5-flash-002")] + Gemini15Flash002, + + [EnumMember(Value = "gemini-1.5-pro")] + Gemini15Pro, + + [EnumMember(Value = "gemini-1.5-pro-002")] + Gemini15Pro002, + + [EnumMember(Value = "gemini-1.0-pro")] + Gemini10Pro, +} diff --git a/src/Vapi.Net/Types/FallbackHumeVoice.cs b/src/Vapi.Net/Types/FallbackHumeVoice.cs new file mode 100644 index 0000000..95e101a --- /dev/null +++ b/src/Vapi.Net/Types/FallbackHumeVoice.cs @@ -0,0 +1,57 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record FallbackHumeVoice +{ + /// + /// This is the model that will be used. + /// + [JsonPropertyName("model")] + public string? Model { get; set; } + + /// + /// The ID of the particular voice you want to use. + /// + [JsonPropertyName("voiceId")] + public required string VoiceId { get; set; } + + /// + /// Indicates whether the chosen voice is a preset Hume AI voice or a custom voice. + /// + [JsonPropertyName("isCustomHumeVoice")] + public bool? IsCustomHumeVoice { get; set; } + + /// + /// Natural language instructions describing how the synthesized speech should sound, including but not limited to tone, intonation, pacing, and accent (e.g., 'a soft, gentle voice with a strong British accent'). + /// + /// If a Voice is specified in the request, this description serves as acting instructions. + /// If no Voice is specified, a new voice is generated based on this description. + /// + [JsonPropertyName("description")] + public string? Description { get; set; } + + /// + /// This is the plan for chunking the model output before it is sent to the voice provider. + /// + [JsonPropertyName("chunkPlan")] + public ChunkPlan? ChunkPlan { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/FallbackLmntVoice.cs b/src/Vapi.Net/Types/FallbackLmntVoice.cs index faa28b9..774c285 100644 --- a/src/Vapi.Net/Types/FallbackLmntVoice.cs +++ b/src/Vapi.Net/Types/FallbackLmntVoice.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using OneOf; using Vapi.Net.Core; @@ -24,6 +25,17 @@ public record FallbackLmntVoice [JsonPropertyName("chunkPlan")] public ChunkPlan? ChunkPlan { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/FallbackNeetsVoice.cs b/src/Vapi.Net/Types/FallbackNeetsVoice.cs index 845b236..faa7d8d 100644 --- a/src/Vapi.Net/Types/FallbackNeetsVoice.cs +++ b/src/Vapi.Net/Types/FallbackNeetsVoice.cs @@ -1,23 +1,25 @@ +using System.Text.Json; using System.Text.Json.Serialization; -using OneOf; using Vapi.Net.Core; namespace Vapi.Net; public record FallbackNeetsVoice { - /// - /// This is the provider-specific ID that will be used. - /// [JsonPropertyName("voiceId")] - public required OneOf VoiceId { get; set; } + public object? VoiceId { get; set; } /// - /// This is the plan for chunking the model output before it is sent to the voice provider. + /// Additional properties received from the response, if any. /// - [JsonPropertyName("chunkPlan")] - public ChunkPlan? ChunkPlan { get; set; } + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/FallbackNeetsVoiceIdEnum.cs b/src/Vapi.Net/Types/FallbackNeetsVoiceIdEnum.cs deleted file mode 100644 index 659f7cb..0000000 --- a/src/Vapi.Net/Types/FallbackNeetsVoiceIdEnum.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using Vapi.Net.Core; - -namespace Vapi.Net; - -[JsonConverter(typeof(EnumSerializer))] -public enum FallbackNeetsVoiceIdEnum -{ - [EnumMember(Value = "vits")] - Vits, -} diff --git a/src/Vapi.Net/Types/FallbackNeuphonicVoice.cs b/src/Vapi.Net/Types/FallbackNeuphonicVoice.cs new file mode 100644 index 0000000..fd6dd15 --- /dev/null +++ b/src/Vapi.Net/Types/FallbackNeuphonicVoice.cs @@ -0,0 +1,60 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record FallbackNeuphonicVoice +{ + /// + /// This is the voice provider that will be used. + /// + [JsonPropertyName("provider")] + public string Provider { get; set; } = "neuphonic"; + + /// + /// This is the provider-specific ID that will be used. + /// + [JsonPropertyName("voiceId")] + public required string VoiceId { get; set; } + + /// + /// This is the model that will be used. Defaults to 'neu_fast' if not specified. + /// + [JsonPropertyName("model")] + public FallbackNeuphonicVoiceModel? Model { get; set; } + + /// + /// This is the language (ISO 639-1) that is enforced for the model. + /// + [JsonPropertyName("language")] + public object Language { get; set; } = new Dictionary(); + + /// + /// This is the speed multiplier that will be used. + /// + [JsonPropertyName("speed")] + public double? Speed { get; set; } + + /// + /// This is the plan for chunking the model output before it is sent to the voice provider. + /// + [JsonPropertyName("chunkPlan")] + public ChunkPlan? ChunkPlan { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/FallbackNeuphonicVoiceModel.cs b/src/Vapi.Net/Types/FallbackNeuphonicVoiceModel.cs new file mode 100644 index 0000000..dcd7045 --- /dev/null +++ b/src/Vapi.Net/Types/FallbackNeuphonicVoiceModel.cs @@ -0,0 +1,15 @@ +using System.Runtime.Serialization; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[JsonConverter(typeof(EnumSerializer))] +public enum FallbackNeuphonicVoiceModel +{ + [EnumMember(Value = "neu_hq")] + NeuHq, + + [EnumMember(Value = "neu_fast")] + NeuFast, +} diff --git a/src/Vapi.Net/Types/FallbackOpenAiTranscriber.cs b/src/Vapi.Net/Types/FallbackOpenAiTranscriber.cs new file mode 100644 index 0000000..44a4568 --- /dev/null +++ b/src/Vapi.Net/Types/FallbackOpenAiTranscriber.cs @@ -0,0 +1,36 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record FallbackOpenAiTranscriber +{ + /// + /// This is the model that will be used for the transcription. + /// + [JsonPropertyName("model")] + public required FallbackOpenAiTranscriberModel Model { get; set; } + + /// + /// This is the language that will be set for the transcription. + /// + [JsonPropertyName("language")] + public FallbackOpenAiTranscriberLanguage? Language { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/FallbackOpenAiTranscriberLanguage.cs b/src/Vapi.Net/Types/FallbackOpenAiTranscriberLanguage.cs new file mode 100644 index 0000000..c5c1374 --- /dev/null +++ b/src/Vapi.Net/Types/FallbackOpenAiTranscriberLanguage.cs @@ -0,0 +1,180 @@ +using System.Runtime.Serialization; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[JsonConverter(typeof(EnumSerializer))] +public enum FallbackOpenAiTranscriberLanguage +{ + [EnumMember(Value = "af")] + Af, + + [EnumMember(Value = "ar")] + Ar, + + [EnumMember(Value = "hy")] + Hy, + + [EnumMember(Value = "az")] + Az, + + [EnumMember(Value = "be")] + Be, + + [EnumMember(Value = "bs")] + Bs, + + [EnumMember(Value = "bg")] + Bg, + + [EnumMember(Value = "ca")] + Ca, + + [EnumMember(Value = "zh")] + Zh, + + [EnumMember(Value = "hr")] + Hr, + + [EnumMember(Value = "cs")] + Cs, + + [EnumMember(Value = "da")] + Da, + + [EnumMember(Value = "nl")] + Nl, + + [EnumMember(Value = "en")] + En, + + [EnumMember(Value = "et")] + Et, + + [EnumMember(Value = "fi")] + Fi, + + [EnumMember(Value = "fr")] + Fr, + + [EnumMember(Value = "gl")] + Gl, + + [EnumMember(Value = "de")] + De, + + [EnumMember(Value = "el")] + El, + + [EnumMember(Value = "he")] + He, + + [EnumMember(Value = "hi")] + Hi, + + [EnumMember(Value = "hu")] + Hu, + + [EnumMember(Value = "is")] + Is, + + [EnumMember(Value = "id")] + Id, + + [EnumMember(Value = "it")] + It, + + [EnumMember(Value = "ja")] + Ja, + + [EnumMember(Value = "kn")] + Kn, + + [EnumMember(Value = "kk")] + Kk, + + [EnumMember(Value = "ko")] + Ko, + + [EnumMember(Value = "lv")] + Lv, + + [EnumMember(Value = "lt")] + Lt, + + [EnumMember(Value = "mk")] + Mk, + + [EnumMember(Value = "ms")] + Ms, + + [EnumMember(Value = "mr")] + Mr, + + [EnumMember(Value = "mi")] + Mi, + + [EnumMember(Value = "ne")] + Ne, + + [EnumMember(Value = "no")] + No, + + [EnumMember(Value = "fa")] + Fa, + + [EnumMember(Value = "pl")] + Pl, + + [EnumMember(Value = "pt")] + Pt, + + [EnumMember(Value = "ro")] + Ro, + + [EnumMember(Value = "ru")] + Ru, + + [EnumMember(Value = "sr")] + Sr, + + [EnumMember(Value = "sk")] + Sk, + + [EnumMember(Value = "sl")] + Sl, + + [EnumMember(Value = "es")] + Es, + + [EnumMember(Value = "sw")] + Sw, + + [EnumMember(Value = "sv")] + Sv, + + [EnumMember(Value = "tl")] + Tl, + + [EnumMember(Value = "ta")] + Ta, + + [EnumMember(Value = "th")] + Th, + + [EnumMember(Value = "tr")] + Tr, + + [EnumMember(Value = "uk")] + Uk, + + [EnumMember(Value = "ur")] + Ur, + + [EnumMember(Value = "vi")] + Vi, + + [EnumMember(Value = "cy")] + Cy, +} diff --git a/src/Vapi.Net/Types/FallbackOpenAiTranscriberModel.cs b/src/Vapi.Net/Types/FallbackOpenAiTranscriberModel.cs new file mode 100644 index 0000000..9b17e26 --- /dev/null +++ b/src/Vapi.Net/Types/FallbackOpenAiTranscriberModel.cs @@ -0,0 +1,15 @@ +using System.Runtime.Serialization; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[JsonConverter(typeof(EnumSerializer))] +public enum FallbackOpenAiTranscriberModel +{ + [EnumMember(Value = "gpt-4o-transcribe")] + Gpt4OTranscribe, + + [EnumMember(Value = "gpt-4o-mini-transcribe")] + Gpt4OMiniTranscribe, +} diff --git a/src/Vapi.Net/Types/FallbackOpenAiVoice.cs b/src/Vapi.Net/Types/FallbackOpenAiVoice.cs index 0d654e7..331c811 100644 --- a/src/Vapi.Net/Types/FallbackOpenAiVoice.cs +++ b/src/Vapi.Net/Types/FallbackOpenAiVoice.cs @@ -1,4 +1,6 @@ +using System.Text.Json; using System.Text.Json.Serialization; +using OneOf; using Vapi.Net.Core; namespace Vapi.Net; @@ -10,7 +12,20 @@ public record FallbackOpenAiVoice /// Please note that ash, ballad, coral, sage, and verse may only be used with realtime models. /// [JsonPropertyName("voiceId")] - public required FallbackOpenAiVoiceId VoiceId { get; set; } + public required OneOf VoiceId { get; set; } + + /// + /// This is the model that will be used for text-to-speech. + /// + [JsonPropertyName("model")] + public FallbackOpenAiVoiceModel? Model { get; set; } + + /// + /// This is a prompt that allows you to control the voice of your generated audio. + /// Does not work with 'tts-1' or 'tts-1-hd' models. + /// + [JsonPropertyName("instructions")] + public string? Instructions { get; set; } /// /// This is the speed multiplier that will be used. @@ -24,6 +39,17 @@ public record FallbackOpenAiVoice [JsonPropertyName("chunkPlan")] public ChunkPlan? ChunkPlan { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/OpenAiVoiceId.cs b/src/Vapi.Net/Types/FallbackOpenAiVoiceIdEnum.cs similarity index 56% rename from src/Vapi.Net/Types/OpenAiVoiceId.cs rename to src/Vapi.Net/Types/FallbackOpenAiVoiceIdEnum.cs index 7e0f044..e9fbf74 100644 --- a/src/Vapi.Net/Types/OpenAiVoiceId.cs +++ b/src/Vapi.Net/Types/FallbackOpenAiVoiceIdEnum.cs @@ -4,8 +4,8 @@ namespace Vapi.Net; -[JsonConverter(typeof(EnumSerializer))] -public enum OpenAiVoiceId +[JsonConverter(typeof(EnumSerializer))] +public enum FallbackOpenAiVoiceIdEnum { [EnumMember(Value = "alloy")] Alloy, @@ -24,19 +24,4 @@ public enum OpenAiVoiceId [EnumMember(Value = "shimmer")] Shimmer, - - [EnumMember(Value = "ash")] - Ash, - - [EnumMember(Value = "ballad")] - Ballad, - - [EnumMember(Value = "coral")] - Coral, - - [EnumMember(Value = "sage")] - Sage, - - [EnumMember(Value = "verse")] - Verse, } diff --git a/src/Vapi.Net/Types/FallbackOpenAiVoiceModel.cs b/src/Vapi.Net/Types/FallbackOpenAiVoiceModel.cs new file mode 100644 index 0000000..8bba8d2 --- /dev/null +++ b/src/Vapi.Net/Types/FallbackOpenAiVoiceModel.cs @@ -0,0 +1,18 @@ +using System.Runtime.Serialization; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[JsonConverter(typeof(EnumSerializer))] +public enum FallbackOpenAiVoiceModel +{ + [EnumMember(Value = "tts-1")] + Tts1, + + [EnumMember(Value = "tts-1-hd")] + Tts1Hd, + + [EnumMember(Value = "gpt-4o-mini-tts")] + Gpt4OMiniTts, +} diff --git a/src/Vapi.Net/Types/FallbackPlan.cs b/src/Vapi.Net/Types/FallbackPlan.cs index 90d7961..a01104d 100644 --- a/src/Vapi.Net/Types/FallbackPlan.cs +++ b/src/Vapi.Net/Types/FallbackPlan.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -11,6 +12,17 @@ public record FallbackPlan [JsonPropertyName("voices")] public IEnumerable Voices { get; set; } = new List(); + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/FallbackPlayHtVoice.cs b/src/Vapi.Net/Types/FallbackPlayHtVoice.cs index 0bac5e0..e808d23 100644 --- a/src/Vapi.Net/Types/FallbackPlayHtVoice.cs +++ b/src/Vapi.Net/Types/FallbackPlayHtVoice.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using OneOf; using Vapi.Net.Core; @@ -66,6 +67,17 @@ public record FallbackPlayHtVoice [JsonPropertyName("chunkPlan")] public ChunkPlan? ChunkPlan { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/FallbackRimeAiVoice.cs b/src/Vapi.Net/Types/FallbackRimeAiVoice.cs index 900730f..1b5d45b 100644 --- a/src/Vapi.Net/Types/FallbackRimeAiVoice.cs +++ b/src/Vapi.Net/Types/FallbackRimeAiVoice.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using OneOf; using Vapi.Net.Core; @@ -24,12 +25,47 @@ public record FallbackRimeAiVoice [JsonPropertyName("speed")] public double? Speed { get; set; } + /// + /// This is a flag that controls whether to add slight pauses using angle brackets. Example: “Hi. <200> I’d love to have a conversation with you.” adds a 200ms pause between the first and second sentences. + /// + [JsonPropertyName("pauseBetweenBrackets")] + public bool? PauseBetweenBrackets { get; set; } + + /// + /// This is a flag that controls whether text inside brackets should be phonemized (converted to phonetic pronunciation) - Example: "{h'El.o} World" will pronounce "Hello" as expected. + /// + [JsonPropertyName("phonemizeBetweenBrackets")] + public bool? PhonemizeBetweenBrackets { get; set; } + + /// + /// This is a flag that controls whether to optimize for reduced latency in streaming. https://docs.rime.ai/api-reference/endpoint/websockets#param-reduce-latency + /// + [JsonPropertyName("reduceLatency")] + public bool? ReduceLatency { get; set; } + + /// + /// This is a string that allows inline speed control using alpha notation. https://docs.rime.ai/api-reference/endpoint/websockets#param-inline-speed-alpha + /// + [JsonPropertyName("inlineSpeedAlpha")] + public string? InlineSpeedAlpha { get; set; } + /// /// This is the plan for chunking the model output before it is sent to the voice provider. /// [JsonPropertyName("chunkPlan")] public ChunkPlan? ChunkPlan { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/FallbackSmallestAiVoice.cs b/src/Vapi.Net/Types/FallbackSmallestAiVoice.cs index 109876d..8d32012 100644 --- a/src/Vapi.Net/Types/FallbackSmallestAiVoice.cs +++ b/src/Vapi.Net/Types/FallbackSmallestAiVoice.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using OneOf; using Vapi.Net.Core; @@ -30,6 +31,17 @@ public record FallbackSmallestAiVoice [JsonPropertyName("chunkPlan")] public ChunkPlan? ChunkPlan { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/FallbackSpeechmaticsTranscriber.cs b/src/Vapi.Net/Types/FallbackSpeechmaticsTranscriber.cs new file mode 100644 index 0000000..2f3609e --- /dev/null +++ b/src/Vapi.Net/Types/FallbackSpeechmaticsTranscriber.cs @@ -0,0 +1,33 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record FallbackSpeechmaticsTranscriber +{ + /// + /// This is the model that will be used for the transcription. + /// + [JsonPropertyName("model")] + public string? Model { get; set; } + + [JsonPropertyName("language")] + public FallbackSpeechmaticsTranscriberLanguage? Language { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/FallbackSpeechmaticsTranscriberLanguage.cs b/src/Vapi.Net/Types/FallbackSpeechmaticsTranscriberLanguage.cs new file mode 100644 index 0000000..0cea3e2 --- /dev/null +++ b/src/Vapi.Net/Types/FallbackSpeechmaticsTranscriberLanguage.cs @@ -0,0 +1,177 @@ +using System.Runtime.Serialization; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[JsonConverter(typeof(EnumSerializer))] +public enum FallbackSpeechmaticsTranscriberLanguage +{ + [EnumMember(Value = "auto")] + Auto, + + [EnumMember(Value = "ar")] + Ar, + + [EnumMember(Value = "ba")] + Ba, + + [EnumMember(Value = "eu")] + Eu, + + [EnumMember(Value = "be")] + Be, + + [EnumMember(Value = "bn")] + Bn, + + [EnumMember(Value = "bg")] + Bg, + + [EnumMember(Value = "yue")] + Yue, + + [EnumMember(Value = "ca")] + Ca, + + [EnumMember(Value = "hr")] + Hr, + + [EnumMember(Value = "cs")] + Cs, + + [EnumMember(Value = "da")] + Da, + + [EnumMember(Value = "nl")] + Nl, + + [EnumMember(Value = "en")] + En, + + [EnumMember(Value = "eo")] + Eo, + + [EnumMember(Value = "et")] + Et, + + [EnumMember(Value = "fi")] + Fi, + + [EnumMember(Value = "fr")] + Fr, + + [EnumMember(Value = "gl")] + Gl, + + [EnumMember(Value = "de")] + De, + + [EnumMember(Value = "el")] + El, + + [EnumMember(Value = "he")] + He, + + [EnumMember(Value = "hi")] + Hi, + + [EnumMember(Value = "hu")] + Hu, + + [EnumMember(Value = "id")] + Id, + + [EnumMember(Value = "ia")] + Ia, + + [EnumMember(Value = "ga")] + Ga, + + [EnumMember(Value = "it")] + It, + + [EnumMember(Value = "ja")] + Ja, + + [EnumMember(Value = "ko")] + Ko, + + [EnumMember(Value = "lv")] + Lv, + + [EnumMember(Value = "lt")] + Lt, + + [EnumMember(Value = "ms")] + Ms, + + [EnumMember(Value = "mt")] + Mt, + + [EnumMember(Value = "cmn")] + Cmn, + + [EnumMember(Value = "mr")] + Mr, + + [EnumMember(Value = "mn")] + Mn, + + [EnumMember(Value = "no")] + No, + + [EnumMember(Value = "fa")] + Fa, + + [EnumMember(Value = "pl")] + Pl, + + [EnumMember(Value = "pt")] + Pt, + + [EnumMember(Value = "ro")] + Ro, + + [EnumMember(Value = "ru")] + Ru, + + [EnumMember(Value = "sk")] + Sk, + + [EnumMember(Value = "sl")] + Sl, + + [EnumMember(Value = "es")] + Es, + + [EnumMember(Value = "sw")] + Sw, + + [EnumMember(Value = "sv")] + Sv, + + [EnumMember(Value = "ta")] + Ta, + + [EnumMember(Value = "th")] + Th, + + [EnumMember(Value = "tr")] + Tr, + + [EnumMember(Value = "uk")] + Uk, + + [EnumMember(Value = "ur")] + Ur, + + [EnumMember(Value = "ug")] + Ug, + + [EnumMember(Value = "vi")] + Vi, + + [EnumMember(Value = "cy")] + Cy, +} diff --git a/src/Vapi.Net/Types/FallbackTalkscriberTranscriber.cs b/src/Vapi.Net/Types/FallbackTalkscriberTranscriber.cs new file mode 100644 index 0000000..47ef837 --- /dev/null +++ b/src/Vapi.Net/Types/FallbackTalkscriberTranscriber.cs @@ -0,0 +1,36 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record FallbackTalkscriberTranscriber +{ + /// + /// This is the model that will be used for the transcription. + /// + [JsonPropertyName("model")] + public string? Model { get; set; } + + /// + /// This is the language that will be set for the transcription. The list of languages Whisper supports can be found here: https://github.com/openai/whisper/blob/main/whisper/tokenizer.py + /// + [JsonPropertyName("language")] + public FallbackTalkscriberTranscriberLanguage? Language { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/FallbackTalkscriberTranscriberLanguage.cs b/src/Vapi.Net/Types/FallbackTalkscriberTranscriberLanguage.cs new file mode 100644 index 0000000..36964ae --- /dev/null +++ b/src/Vapi.Net/Types/FallbackTalkscriberTranscriberLanguage.cs @@ -0,0 +1,309 @@ +using System.Runtime.Serialization; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[JsonConverter(typeof(EnumSerializer))] +public enum FallbackTalkscriberTranscriberLanguage +{ + [EnumMember(Value = "en")] + En, + + [EnumMember(Value = "zh")] + Zh, + + [EnumMember(Value = "de")] + De, + + [EnumMember(Value = "es")] + Es, + + [EnumMember(Value = "ru")] + Ru, + + [EnumMember(Value = "ko")] + Ko, + + [EnumMember(Value = "fr")] + Fr, + + [EnumMember(Value = "ja")] + Ja, + + [EnumMember(Value = "pt")] + Pt, + + [EnumMember(Value = "tr")] + Tr, + + [EnumMember(Value = "pl")] + Pl, + + [EnumMember(Value = "ca")] + Ca, + + [EnumMember(Value = "nl")] + Nl, + + [EnumMember(Value = "ar")] + Ar, + + [EnumMember(Value = "sv")] + Sv, + + [EnumMember(Value = "it")] + It, + + [EnumMember(Value = "id")] + Id, + + [EnumMember(Value = "hi")] + Hi, + + [EnumMember(Value = "fi")] + Fi, + + [EnumMember(Value = "vi")] + Vi, + + [EnumMember(Value = "he")] + He, + + [EnumMember(Value = "uk")] + Uk, + + [EnumMember(Value = "el")] + El, + + [EnumMember(Value = "ms")] + Ms, + + [EnumMember(Value = "cs")] + Cs, + + [EnumMember(Value = "ro")] + Ro, + + [EnumMember(Value = "da")] + Da, + + [EnumMember(Value = "hu")] + Hu, + + [EnumMember(Value = "ta")] + Ta, + + [EnumMember(Value = "no")] + No, + + [EnumMember(Value = "th")] + Th, + + [EnumMember(Value = "ur")] + Ur, + + [EnumMember(Value = "hr")] + Hr, + + [EnumMember(Value = "bg")] + Bg, + + [EnumMember(Value = "lt")] + Lt, + + [EnumMember(Value = "la")] + La, + + [EnumMember(Value = "mi")] + Mi, + + [EnumMember(Value = "ml")] + Ml, + + [EnumMember(Value = "cy")] + Cy, + + [EnumMember(Value = "sk")] + Sk, + + [EnumMember(Value = "te")] + Te, + + [EnumMember(Value = "fa")] + Fa, + + [EnumMember(Value = "lv")] + Lv, + + [EnumMember(Value = "bn")] + Bn, + + [EnumMember(Value = "sr")] + Sr, + + [EnumMember(Value = "az")] + Az, + + [EnumMember(Value = "sl")] + Sl, + + [EnumMember(Value = "kn")] + Kn, + + [EnumMember(Value = "et")] + Et, + + [EnumMember(Value = "mk")] + Mk, + + [EnumMember(Value = "br")] + Br, + + [EnumMember(Value = "eu")] + Eu, + + [EnumMember(Value = "is")] + Is, + + [EnumMember(Value = "hy")] + Hy, + + [EnumMember(Value = "ne")] + Ne, + + [EnumMember(Value = "mn")] + Mn, + + [EnumMember(Value = "bs")] + Bs, + + [EnumMember(Value = "kk")] + Kk, + + [EnumMember(Value = "sq")] + Sq, + + [EnumMember(Value = "sw")] + Sw, + + [EnumMember(Value = "gl")] + Gl, + + [EnumMember(Value = "mr")] + Mr, + + [EnumMember(Value = "pa")] + Pa, + + [EnumMember(Value = "si")] + Si, + + [EnumMember(Value = "km")] + Km, + + [EnumMember(Value = "sn")] + Sn, + + [EnumMember(Value = "yo")] + Yo, + + [EnumMember(Value = "so")] + So, + + [EnumMember(Value = "af")] + Af, + + [EnumMember(Value = "oc")] + Oc, + + [EnumMember(Value = "ka")] + Ka, + + [EnumMember(Value = "be")] + Be, + + [EnumMember(Value = "tg")] + Tg, + + [EnumMember(Value = "sd")] + Sd, + + [EnumMember(Value = "gu")] + Gu, + + [EnumMember(Value = "am")] + Am, + + [EnumMember(Value = "yi")] + Yi, + + [EnumMember(Value = "lo")] + Lo, + + [EnumMember(Value = "uz")] + Uz, + + [EnumMember(Value = "fo")] + Fo, + + [EnumMember(Value = "ht")] + Ht, + + [EnumMember(Value = "ps")] + Ps, + + [EnumMember(Value = "tk")] + Tk, + + [EnumMember(Value = "nn")] + Nn, + + [EnumMember(Value = "mt")] + Mt, + + [EnumMember(Value = "sa")] + Sa, + + [EnumMember(Value = "lb")] + Lb, + + [EnumMember(Value = "my")] + My, + + [EnumMember(Value = "bo")] + Bo, + + [EnumMember(Value = "tl")] + Tl, + + [EnumMember(Value = "mg")] + Mg, + + [EnumMember(Value = "as")] + As, + + [EnumMember(Value = "tt")] + Tt, + + [EnumMember(Value = "haw")] + Haw, + + [EnumMember(Value = "ln")] + Ln, + + [EnumMember(Value = "ha")] + Ha, + + [EnumMember(Value = "ba")] + Ba, + + [EnumMember(Value = "jw")] + Jw, + + [EnumMember(Value = "su")] + Su, + + [EnumMember(Value = "yue")] + Yue, +} diff --git a/src/Vapi.Net/Types/FallbackTavusVoice.cs b/src/Vapi.Net/Types/FallbackTavusVoice.cs index 125fd73..02e580c 100644 --- a/src/Vapi.Net/Types/FallbackTavusVoice.cs +++ b/src/Vapi.Net/Types/FallbackTavusVoice.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using OneOf; using Vapi.Net.Core; @@ -54,6 +55,17 @@ public record FallbackTavusVoice [JsonPropertyName("chunkPlan")] public ChunkPlan? ChunkPlan { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/FallbackTranscriberPlan.cs b/src/Vapi.Net/Types/FallbackTranscriberPlan.cs new file mode 100644 index 0000000..e2a30b8 --- /dev/null +++ b/src/Vapi.Net/Types/FallbackTranscriberPlan.cs @@ -0,0 +1,27 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record FallbackTranscriberPlan +{ + [JsonPropertyName("transcribers")] + public IEnumerable Transcribers { get; set; } = new List(); + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/FallbackVapiVoice.cs b/src/Vapi.Net/Types/FallbackVapiVoice.cs new file mode 100644 index 0000000..b8be6e9 --- /dev/null +++ b/src/Vapi.Net/Types/FallbackVapiVoice.cs @@ -0,0 +1,52 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record FallbackVapiVoice +{ + /// + /// The voices provided by Vapi + /// + [JsonPropertyName("voiceId")] + public required FallbackVapiVoiceVoiceId VoiceId { get; set; } + + /// + /// This is the speed multiplier that will be used. + /// + /// @default 1 + /// + [JsonPropertyName("speed")] + public double? Speed { get; set; } + + /// + /// This is the language code (ISO 639-1) that will be used. + /// + /// @default 'en-US' + /// + [JsonPropertyName("language")] + public FallbackVapiVoiceLanguage? Language { get; set; } + + /// + /// This is the plan for chunking the model output before it is sent to the voice provider. + /// + [JsonPropertyName("chunkPlan")] + public ChunkPlan? ChunkPlan { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/FallbackVapiVoiceLanguage.cs b/src/Vapi.Net/Types/FallbackVapiVoiceLanguage.cs new file mode 100644 index 0000000..6d82e01 --- /dev/null +++ b/src/Vapi.Net/Types/FallbackVapiVoiceLanguage.cs @@ -0,0 +1,126 @@ +using System.Runtime.Serialization; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[JsonConverter(typeof(EnumSerializer))] +public enum FallbackVapiVoiceLanguage +{ + [EnumMember(Value = "en-US")] + EnUs, + + [EnumMember(Value = "en-GB")] + EnGb, + + [EnumMember(Value = "en-AU")] + EnAu, + + [EnumMember(Value = "en-CA")] + EnCa, + + [EnumMember(Value = "ja")] + Ja, + + [EnumMember(Value = "zh")] + Zh, + + [EnumMember(Value = "de")] + De, + + [EnumMember(Value = "hi")] + Hi, + + [EnumMember(Value = "fr-FR")] + FrFr, + + [EnumMember(Value = "fr-CA")] + FrCa, + + [EnumMember(Value = "ko")] + Ko, + + [EnumMember(Value = "pt-BR")] + PtBr, + + [EnumMember(Value = "pt-PT")] + PtPt, + + [EnumMember(Value = "it")] + It, + + [EnumMember(Value = "es-ES")] + EsEs, + + [EnumMember(Value = "es-MX")] + EsMx, + + [EnumMember(Value = "id")] + Id, + + [EnumMember(Value = "nl")] + Nl, + + [EnumMember(Value = "tr")] + Tr, + + [EnumMember(Value = "fil")] + Fil, + + [EnumMember(Value = "pl")] + Pl, + + [EnumMember(Value = "sv")] + Sv, + + [EnumMember(Value = "bg")] + Bg, + + [EnumMember(Value = "ro")] + Ro, + + [EnumMember(Value = "ar-SA")] + ArSa, + + [EnumMember(Value = "ar-AE")] + ArAe, + + [EnumMember(Value = "cs")] + Cs, + + [EnumMember(Value = "el")] + El, + + [EnumMember(Value = "fi")] + Fi, + + [EnumMember(Value = "hr")] + Hr, + + [EnumMember(Value = "ms")] + Ms, + + [EnumMember(Value = "sk")] + Sk, + + [EnumMember(Value = "da")] + Da, + + [EnumMember(Value = "ta")] + Ta, + + [EnumMember(Value = "uk")] + Uk, + + [EnumMember(Value = "ru")] + Ru, + + [EnumMember(Value = "hu")] + Hu, + + [EnumMember(Value = "no")] + No, + + [EnumMember(Value = "vi")] + Vi, +} diff --git a/src/Vapi.Net/Types/FallbackVapiVoiceVoiceId.cs b/src/Vapi.Net/Types/FallbackVapiVoiceVoiceId.cs new file mode 100644 index 0000000..7a9f489 --- /dev/null +++ b/src/Vapi.Net/Types/FallbackVapiVoiceVoiceId.cs @@ -0,0 +1,39 @@ +using System.Runtime.Serialization; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[JsonConverter(typeof(EnumSerializer))] +public enum FallbackVapiVoiceVoiceId +{ + [EnumMember(Value = "Elliot")] + Elliot, + + [EnumMember(Value = "Rohan")] + Rohan, + + [EnumMember(Value = "Lily")] + Lily, + + [EnumMember(Value = "Savannah")] + Savannah, + + [EnumMember(Value = "Hana")] + Hana, + + [EnumMember(Value = "Neha")] + Neha, + + [EnumMember(Value = "Cole")] + Cole, + + [EnumMember(Value = "Harry")] + Harry, + + [EnumMember(Value = "Paige")] + Paige, + + [EnumMember(Value = "Spencer")] + Spencer, +} diff --git a/src/Vapi.Net/Types/File.cs b/src/Vapi.Net/Types/File.cs index c44b608..c8f3ff0 100644 --- a/src/Vapi.Net/Types/File.cs +++ b/src/Vapi.Net/Types/File.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -41,6 +42,12 @@ public record File [JsonPropertyName("url")] public string? Url { get; set; } + [JsonPropertyName("parsedTextUrl")] + public string? ParsedTextUrl { get; set; } + + [JsonPropertyName("parsedTextBytes")] + public double? ParsedTextBytes { get; set; } + [JsonPropertyName("metadata")] public object? Metadata { get; set; } @@ -68,6 +75,17 @@ public record File [JsonPropertyName("updatedAt")] public required DateTime UpdatedAt { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/FileStatus.cs b/src/Vapi.Net/Types/FileStatus.cs index b67f7bb..845a4fd 100644 --- a/src/Vapi.Net/Types/FileStatus.cs +++ b/src/Vapi.Net/Types/FileStatus.cs @@ -7,9 +7,12 @@ namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] public enum FileStatus { - [EnumMember(Value = "indexed")] - Indexed, + [EnumMember(Value = "processing")] + Processing, - [EnumMember(Value = "not_indexed")] - NotIndexed, + [EnumMember(Value = "done")] + Done, + + [EnumMember(Value = "failed")] + Failed, } diff --git a/src/Vapi.Net/Types/FormatPlan.cs b/src/Vapi.Net/Types/FormatPlan.cs index fd21d06..6940068 100644 --- a/src/Vapi.Net/Types/FormatPlan.cs +++ b/src/Vapi.Net/Types/FormatPlan.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -54,6 +55,17 @@ public record FormatPlan [JsonPropertyName("formattersEnabled")] public IEnumerable? FormattersEnabled { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/FunctionTool.cs b/src/Vapi.Net/Types/FunctionTool.cs index ecdcf1f..a184b18 100644 --- a/src/Vapi.Net/Types/FunctionTool.cs +++ b/src/Vapi.Net/Types/FunctionTool.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -69,6 +70,17 @@ public record FunctionTool [JsonPropertyName("server")] public Server? Server { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/FunctionToolProviderDetails.cs b/src/Vapi.Net/Types/FunctionToolProviderDetails.cs index 363ec5f..74b8300 100644 --- a/src/Vapi.Net/Types/FunctionToolProviderDetails.cs +++ b/src/Vapi.Net/Types/FunctionToolProviderDetails.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -14,6 +15,17 @@ public record FunctionToolProviderDetails [JsonPropertyName("setupInstructions")] public IEnumerable? SetupInstructions { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/FunctionToolWithToolCall.cs b/src/Vapi.Net/Types/FunctionToolWithToolCall.cs index 4e2afee..2c08c58 100644 --- a/src/Vapi.Net/Types/FunctionToolWithToolCall.cs +++ b/src/Vapi.Net/Types/FunctionToolWithToolCall.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -48,6 +49,17 @@ public record FunctionToolWithToolCall [JsonPropertyName("server")] public Server? Server { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/Gather.cs b/src/Vapi.Net/Types/Gather.cs index f713f17..8840ebe 100644 --- a/src/Vapi.Net/Types/Gather.cs +++ b/src/Vapi.Net/Types/Gather.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -43,6 +44,17 @@ public record Gather [JsonPropertyName("metadata")] public object? Metadata { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/GcpCredential.cs b/src/Vapi.Net/Types/GcpCredential.cs index 0f7c133..52e8f57 100644 --- a/src/Vapi.Net/Types/GcpCredential.cs +++ b/src/Vapi.Net/Types/GcpCredential.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -52,6 +53,17 @@ public record GcpCredential [JsonPropertyName("bucketPlan")] public BucketPlan? BucketPlan { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/GcpKey.cs b/src/Vapi.Net/Types/GcpKey.cs index cc5fade..6df603f 100644 --- a/src/Vapi.Net/Types/GcpKey.cs +++ b/src/Vapi.Net/Types/GcpKey.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -73,6 +74,17 @@ public record GcpKey [JsonPropertyName("universeDomain")] public required string UniverseDomain { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/GeminiMultimodalLivePrebuiltVoiceConfig.cs b/src/Vapi.Net/Types/GeminiMultimodalLivePrebuiltVoiceConfig.cs index a8c848b..6ef2ae4 100644 --- a/src/Vapi.Net/Types/GeminiMultimodalLivePrebuiltVoiceConfig.cs +++ b/src/Vapi.Net/Types/GeminiMultimodalLivePrebuiltVoiceConfig.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -8,6 +9,17 @@ public record GeminiMultimodalLivePrebuiltVoiceConfig [JsonPropertyName("voiceName")] public required GeminiMultimodalLivePrebuiltVoiceConfigVoiceName VoiceName { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/GeminiMultimodalLiveSpeechConfig.cs b/src/Vapi.Net/Types/GeminiMultimodalLiveSpeechConfig.cs index cfdcc8f..65c3348 100644 --- a/src/Vapi.Net/Types/GeminiMultimodalLiveSpeechConfig.cs +++ b/src/Vapi.Net/Types/GeminiMultimodalLiveSpeechConfig.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -8,6 +9,17 @@ public record GeminiMultimodalLiveSpeechConfig [JsonPropertyName("voiceConfig")] public required GeminiMultimodalLiveVoiceConfig VoiceConfig { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/GeminiMultimodalLiveVoiceConfig.cs b/src/Vapi.Net/Types/GeminiMultimodalLiveVoiceConfig.cs index 1b65d99..8a57813 100644 --- a/src/Vapi.Net/Types/GeminiMultimodalLiveVoiceConfig.cs +++ b/src/Vapi.Net/Types/GeminiMultimodalLiveVoiceConfig.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -8,6 +9,17 @@ public record GeminiMultimodalLiveVoiceConfig [JsonPropertyName("prebuiltVoiceConfig")] public required GeminiMultimodalLivePrebuiltVoiceConfig PrebuiltVoiceConfig { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/GhlTool.cs b/src/Vapi.Net/Types/GhlTool.cs index d8d2a91..b04e06e 100644 --- a/src/Vapi.Net/Types/GhlTool.cs +++ b/src/Vapi.Net/Types/GhlTool.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -72,6 +73,17 @@ public record GhlTool [JsonPropertyName("metadata")] public required GhlToolMetadata Metadata { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/GhlToolMetadata.cs b/src/Vapi.Net/Types/GhlToolMetadata.cs index bf50f66..02de75c 100644 --- a/src/Vapi.Net/Types/GhlToolMetadata.cs +++ b/src/Vapi.Net/Types/GhlToolMetadata.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -11,6 +12,17 @@ public record GhlToolMetadata [JsonPropertyName("locationId")] public string? LocationId { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/GhlToolProviderDetails.cs b/src/Vapi.Net/Types/GhlToolProviderDetails.cs index 43cb647..0fed692 100644 --- a/src/Vapi.Net/Types/GhlToolProviderDetails.cs +++ b/src/Vapi.Net/Types/GhlToolProviderDetails.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -29,6 +30,17 @@ public record GhlToolProviderDetails [JsonPropertyName("locationId")] public string? LocationId { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/GhlToolWithToolCall.cs b/src/Vapi.Net/Types/GhlToolWithToolCall.cs index 596ee0d..e09ed77 100644 --- a/src/Vapi.Net/Types/GhlToolWithToolCall.cs +++ b/src/Vapi.Net/Types/GhlToolWithToolCall.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -51,6 +52,17 @@ public record GhlToolWithToolCall [JsonPropertyName("server")] public Server? Server { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/GladiaCredential.cs b/src/Vapi.Net/Types/GladiaCredential.cs index fc4f316..03efd5b 100644 --- a/src/Vapi.Net/Types/GladiaCredential.cs +++ b/src/Vapi.Net/Types/GladiaCredential.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -44,6 +45,17 @@ public record GladiaCredential [JsonPropertyName("name")] public string? Name { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/GladiaTranscriber.cs b/src/Vapi.Net/Types/GladiaTranscriber.cs index 0f1527c..25f341c 100644 --- a/src/Vapi.Net/Types/GladiaTranscriber.cs +++ b/src/Vapi.Net/Types/GladiaTranscriber.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -36,6 +37,31 @@ public record GladiaTranscriber [JsonPropertyName("audioEnhancer")] public bool? AudioEnhancer { get; set; } + /// + /// Transcripts below this confidence threshold will be discarded. + /// + /// @default 0.4 + /// + [JsonPropertyName("confidenceThreshold")] + public double? ConfidenceThreshold { get; set; } + + /// + /// This is the plan for voice provider fallbacks in the event that the primary voice provider fails. + /// + [JsonPropertyName("fallbackPlan")] + public FallbackTranscriberPlan? FallbackPlan { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/GladiaTranscriberLanguage.cs b/src/Vapi.Net/Types/GladiaTranscriberLanguage.cs index c76c61a..6e10782 100644 --- a/src/Vapi.Net/Types/GladiaTranscriberLanguage.cs +++ b/src/Vapi.Net/Types/GladiaTranscriberLanguage.cs @@ -127,9 +127,6 @@ public enum GladiaTranscriberLanguage [EnumMember(Value = "ja")] Ja, - [EnumMember(Value = "jp")] - Jp, - [EnumMember(Value = "jv")] Jv, @@ -187,8 +184,8 @@ public enum GladiaTranscriberLanguage [EnumMember(Value = "mn")] Mn, - [EnumMember(Value = "mymr")] - Mymr, + [EnumMember(Value = "my")] + My, [EnumMember(Value = "ne")] Ne, diff --git a/src/Vapi.Net/Types/GoHighLevelCredential.cs b/src/Vapi.Net/Types/GoHighLevelCredential.cs index 414655c..b8a40ff 100644 --- a/src/Vapi.Net/Types/GoHighLevelCredential.cs +++ b/src/Vapi.Net/Types/GoHighLevelCredential.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -44,6 +45,17 @@ public record GoHighLevelCredential [JsonPropertyName("name")] public string? Name { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/GoogleCalendarCheckAvailabilityTool.cs b/src/Vapi.Net/Types/GoogleCalendarCheckAvailabilityTool.cs new file mode 100644 index 0000000..2bab01e --- /dev/null +++ b/src/Vapi.Net/Types/GoogleCalendarCheckAvailabilityTool.cs @@ -0,0 +1,88 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record GoogleCalendarCheckAvailabilityTool +{ + /// + /// This determines if the tool is async. + /// + /// If async, the assistant will move forward without waiting for your server to respond. This is useful if you just want to trigger something on your server. + /// + /// If sync, the assistant will wait for your server to respond. This is useful if want assistant to respond with the result from your server. + /// + /// Defaults to synchronous (`false`). + /// + [JsonPropertyName("async")] + public bool? Async { get; set; } + + /// + /// These are the messages that will be spoken to the user as the tool is running. + /// + /// For some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured. + /// + [JsonPropertyName("messages")] + public IEnumerable? Messages { get; set; } + + /// + /// This is the unique identifier for the tool. + /// + [JsonPropertyName("id")] + public required string Id { get; set; } + + /// + /// This is the unique identifier for the organization that this tool belongs to. + /// + [JsonPropertyName("orgId")] + public required string OrgId { get; set; } + + /// + /// This is the ISO 8601 date-time string of when the tool was created. + /// + [JsonPropertyName("createdAt")] + public required DateTime CreatedAt { get; set; } + + /// + /// This is the ISO 8601 date-time string of when the tool was last updated. + /// + [JsonPropertyName("updatedAt")] + public required DateTime UpdatedAt { get; set; } + + /// + /// This is the function definition of the tool. + /// + /// For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + /// + /// An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + /// + [JsonPropertyName("function")] + public OpenAiFunction? Function { get; set; } + + /// + /// This is the server that will be hit when this tool is requested by the model. + /// + /// All requests will be sent with the call object among other things. You can find more details in the Server URL documentation. + /// + /// This overrides the serverUrl set on the org and the phoneNumber. Order of precedence: highest tool.server.url, then assistant.serverUrl, then phoneNumber.serverUrl, then org.serverUrl. + /// + [JsonPropertyName("server")] + public Server? Server { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/GoogleCalendarCreateEventTool.cs b/src/Vapi.Net/Types/GoogleCalendarCreateEventTool.cs new file mode 100644 index 0000000..a6c2cf8 --- /dev/null +++ b/src/Vapi.Net/Types/GoogleCalendarCreateEventTool.cs @@ -0,0 +1,88 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record GoogleCalendarCreateEventTool +{ + /// + /// This determines if the tool is async. + /// + /// If async, the assistant will move forward without waiting for your server to respond. This is useful if you just want to trigger something on your server. + /// + /// If sync, the assistant will wait for your server to respond. This is useful if want assistant to respond with the result from your server. + /// + /// Defaults to synchronous (`false`). + /// + [JsonPropertyName("async")] + public bool? Async { get; set; } + + /// + /// These are the messages that will be spoken to the user as the tool is running. + /// + /// For some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured. + /// + [JsonPropertyName("messages")] + public IEnumerable? Messages { get; set; } + + /// + /// This is the unique identifier for the tool. + /// + [JsonPropertyName("id")] + public required string Id { get; set; } + + /// + /// This is the unique identifier for the organization that this tool belongs to. + /// + [JsonPropertyName("orgId")] + public required string OrgId { get; set; } + + /// + /// This is the ISO 8601 date-time string of when the tool was created. + /// + [JsonPropertyName("createdAt")] + public required DateTime CreatedAt { get; set; } + + /// + /// This is the ISO 8601 date-time string of when the tool was last updated. + /// + [JsonPropertyName("updatedAt")] + public required DateTime UpdatedAt { get; set; } + + /// + /// This is the function definition of the tool. + /// + /// For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + /// + /// An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + /// + [JsonPropertyName("function")] + public OpenAiFunction? Function { get; set; } + + /// + /// This is the server that will be hit when this tool is requested by the model. + /// + /// All requests will be sent with the call object among other things. You can find more details in the Server URL documentation. + /// + /// This overrides the serverUrl set on the org and the phoneNumber. Order of precedence: highest tool.server.url, then assistant.serverUrl, then phoneNumber.serverUrl, then org.serverUrl. + /// + [JsonPropertyName("server")] + public Server? Server { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/GoogleCalendarCreateEventToolProviderDetails.cs b/src/Vapi.Net/Types/GoogleCalendarCreateEventToolProviderDetails.cs new file mode 100644 index 0000000..7d50dfe --- /dev/null +++ b/src/Vapi.Net/Types/GoogleCalendarCreateEventToolProviderDetails.cs @@ -0,0 +1,33 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record GoogleCalendarCreateEventToolProviderDetails +{ + /// + /// This is the Template URL or the Snapshot URL corresponding to the Template. + /// + [JsonPropertyName("templateUrl")] + public string? TemplateUrl { get; set; } + + [JsonPropertyName("setupInstructions")] + public IEnumerable? SetupInstructions { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/GoogleCalendarCreateEventToolWithToolCall.cs b/src/Vapi.Net/Types/GoogleCalendarCreateEventToolWithToolCall.cs new file mode 100644 index 0000000..5fadc7c --- /dev/null +++ b/src/Vapi.Net/Types/GoogleCalendarCreateEventToolWithToolCall.cs @@ -0,0 +1,67 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record GoogleCalendarCreateEventToolWithToolCall +{ + /// + /// This determines if the tool is async. + /// + /// If async, the assistant will move forward without waiting for your server to respond. This is useful if you just want to trigger something on your server. + /// + /// If sync, the assistant will wait for your server to respond. This is useful if want assistant to respond with the result from your server. + /// + /// Defaults to synchronous (`false`). + /// + [JsonPropertyName("async")] + public bool? Async { get; set; } + + /// + /// These are the messages that will be spoken to the user as the tool is running. + /// + /// For some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured. + /// + [JsonPropertyName("messages")] + public IEnumerable? Messages { get; set; } + + [JsonPropertyName("toolCall")] + public required ToolCall ToolCall { get; set; } + + /// + /// This is the function definition of the tool. + /// + /// For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + /// + /// An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + /// + [JsonPropertyName("function")] + public OpenAiFunction? Function { get; set; } + + /// + /// This is the server that will be hit when this tool is requested by the model. + /// + /// All requests will be sent with the call object among other things. You can find more details in the Server URL documentation. + /// + /// This overrides the serverUrl set on the org and the phoneNumber. Order of precedence: highest tool.server.url, then assistant.serverUrl, then phoneNumber.serverUrl, then org.serverUrl. + /// + [JsonPropertyName("server")] + public Server? Server { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/GoogleCalendarOAuth2AuthorizationCredential.cs b/src/Vapi.Net/Types/GoogleCalendarOAuth2AuthorizationCredential.cs new file mode 100644 index 0000000..402c7b6 --- /dev/null +++ b/src/Vapi.Net/Types/GoogleCalendarOAuth2AuthorizationCredential.cs @@ -0,0 +1,63 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record GoogleCalendarOAuth2AuthorizationCredential +{ + [JsonPropertyName("provider")] + public string Provider { get; set; } = "google.calendar.oauth2-authorization"; + + /// + /// The authorization ID for the OAuth2 authorization + /// + [JsonPropertyName("authorizationId")] + public required string AuthorizationId { get; set; } + + /// + /// This is the unique identifier for the credential. + /// + [JsonPropertyName("id")] + public required string Id { get; set; } + + /// + /// This is the unique identifier for the org that this credential belongs to. + /// + [JsonPropertyName("orgId")] + public required string OrgId { get; set; } + + /// + /// This is the ISO 8601 date-time string of when the credential was created. + /// + [JsonPropertyName("createdAt")] + public required DateTime CreatedAt { get; set; } + + /// + /// This is the ISO 8601 date-time string of when the assistant was last updated. + /// + [JsonPropertyName("updatedAt")] + public required DateTime UpdatedAt { get; set; } + + /// + /// This is the name of credential. This is just for your reference. + /// + [JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/GoogleCalendarOAuth2ClientCredential.cs b/src/Vapi.Net/Types/GoogleCalendarOAuth2ClientCredential.cs new file mode 100644 index 0000000..72cb6cf --- /dev/null +++ b/src/Vapi.Net/Types/GoogleCalendarOAuth2ClientCredential.cs @@ -0,0 +1,57 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record GoogleCalendarOAuth2ClientCredential +{ + [JsonPropertyName("provider")] + public string Provider { get; set; } = "google.calendar.oauth2-client"; + + /// + /// This is the unique identifier for the credential. + /// + [JsonPropertyName("id")] + public required string Id { get; set; } + + /// + /// This is the unique identifier for the org that this credential belongs to. + /// + [JsonPropertyName("orgId")] + public required string OrgId { get; set; } + + /// + /// This is the ISO 8601 date-time string of when the credential was created. + /// + [JsonPropertyName("createdAt")] + public required DateTime CreatedAt { get; set; } + + /// + /// This is the ISO 8601 date-time string of when the assistant was last updated. + /// + [JsonPropertyName("updatedAt")] + public required DateTime UpdatedAt { get; set; } + + /// + /// This is the name of credential. This is just for your reference. + /// + [JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/GoogleCredential.cs b/src/Vapi.Net/Types/GoogleCredential.cs index c5751af..2b7eb4c 100644 --- a/src/Vapi.Net/Types/GoogleCredential.cs +++ b/src/Vapi.Net/Types/GoogleCredential.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -47,6 +48,17 @@ public record GoogleCredential [JsonPropertyName("name")] public string? Name { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/GoogleModel.cs b/src/Vapi.Net/Types/GoogleModel.cs index 2a80acd..0bc4c11 100644 --- a/src/Vapi.Net/Types/GoogleModel.cs +++ b/src/Vapi.Net/Types/GoogleModel.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -84,6 +85,17 @@ public record GoogleModel [JsonPropertyName("numFastTurns")] public double? NumFastTurns { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/GoogleModelModel.cs b/src/Vapi.Net/Types/GoogleModelModel.cs index f93e652..7b8771c 100644 --- a/src/Vapi.Net/Types/GoogleModelModel.cs +++ b/src/Vapi.Net/Types/GoogleModelModel.cs @@ -16,6 +16,9 @@ public enum GoogleModelModel [EnumMember(Value = "gemini-2.0-flash")] Gemini20Flash, + [EnumMember(Value = "gemini-2.0-flash-lite")] + Gemini20FlashLite, + [EnumMember(Value = "gemini-2.0-flash-lite-preview-02-05")] Gemini20FlashLitePreview0205, diff --git a/src/Vapi.Net/Types/GoogleRealtimeConfig.cs b/src/Vapi.Net/Types/GoogleRealtimeConfig.cs index e1315ba..85ace98 100644 --- a/src/Vapi.Net/Types/GoogleRealtimeConfig.cs +++ b/src/Vapi.Net/Types/GoogleRealtimeConfig.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -40,6 +41,17 @@ public record GoogleRealtimeConfig [JsonPropertyName("speechConfig")] public GeminiMultimodalLiveSpeechConfig? SpeechConfig { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/GoogleSheetsOAuth2AuthorizationCredential.cs b/src/Vapi.Net/Types/GoogleSheetsOAuth2AuthorizationCredential.cs new file mode 100644 index 0000000..86501d7 --- /dev/null +++ b/src/Vapi.Net/Types/GoogleSheetsOAuth2AuthorizationCredential.cs @@ -0,0 +1,63 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record GoogleSheetsOAuth2AuthorizationCredential +{ + [JsonPropertyName("provider")] + public string Provider { get; set; } = "google.sheets.oauth2-authorization"; + + /// + /// The authorization ID for the OAuth2 authorization + /// + [JsonPropertyName("authorizationId")] + public required string AuthorizationId { get; set; } + + /// + /// This is the unique identifier for the credential. + /// + [JsonPropertyName("id")] + public required string Id { get; set; } + + /// + /// This is the unique identifier for the org that this credential belongs to. + /// + [JsonPropertyName("orgId")] + public required string OrgId { get; set; } + + /// + /// This is the ISO 8601 date-time string of when the credential was created. + /// + [JsonPropertyName("createdAt")] + public required DateTime CreatedAt { get; set; } + + /// + /// This is the ISO 8601 date-time string of when the assistant was last updated. + /// + [JsonPropertyName("updatedAt")] + public required DateTime UpdatedAt { get; set; } + + /// + /// This is the name of credential. This is just for your reference. + /// + [JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/GoogleSheetsRowAppendTool.cs b/src/Vapi.Net/Types/GoogleSheetsRowAppendTool.cs new file mode 100644 index 0000000..285eef2 --- /dev/null +++ b/src/Vapi.Net/Types/GoogleSheetsRowAppendTool.cs @@ -0,0 +1,88 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record GoogleSheetsRowAppendTool +{ + /// + /// This determines if the tool is async. + /// + /// If async, the assistant will move forward without waiting for your server to respond. This is useful if you just want to trigger something on your server. + /// + /// If sync, the assistant will wait for your server to respond. This is useful if want assistant to respond with the result from your server. + /// + /// Defaults to synchronous (`false`). + /// + [JsonPropertyName("async")] + public bool? Async { get; set; } + + /// + /// These are the messages that will be spoken to the user as the tool is running. + /// + /// For some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured. + /// + [JsonPropertyName("messages")] + public IEnumerable? Messages { get; set; } + + /// + /// This is the unique identifier for the tool. + /// + [JsonPropertyName("id")] + public required string Id { get; set; } + + /// + /// This is the unique identifier for the organization that this tool belongs to. + /// + [JsonPropertyName("orgId")] + public required string OrgId { get; set; } + + /// + /// This is the ISO 8601 date-time string of when the tool was created. + /// + [JsonPropertyName("createdAt")] + public required DateTime CreatedAt { get; set; } + + /// + /// This is the ISO 8601 date-time string of when the tool was last updated. + /// + [JsonPropertyName("updatedAt")] + public required DateTime UpdatedAt { get; set; } + + /// + /// This is the function definition of the tool. + /// + /// For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + /// + /// An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + /// + [JsonPropertyName("function")] + public OpenAiFunction? Function { get; set; } + + /// + /// This is the server that will be hit when this tool is requested by the model. + /// + /// All requests will be sent with the call object among other things. You can find more details in the Server URL documentation. + /// + /// This overrides the serverUrl set on the org and the phoneNumber. Order of precedence: highest tool.server.url, then assistant.serverUrl, then phoneNumber.serverUrl, then org.serverUrl. + /// + [JsonPropertyName("server")] + public Server? Server { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/GoogleSheetsRowAppendToolProviderDetails.cs b/src/Vapi.Net/Types/GoogleSheetsRowAppendToolProviderDetails.cs new file mode 100644 index 0000000..87f69d7 --- /dev/null +++ b/src/Vapi.Net/Types/GoogleSheetsRowAppendToolProviderDetails.cs @@ -0,0 +1,33 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record GoogleSheetsRowAppendToolProviderDetails +{ + /// + /// This is the Template URL or the Snapshot URL corresponding to the Template. + /// + [JsonPropertyName("templateUrl")] + public string? TemplateUrl { get; set; } + + [JsonPropertyName("setupInstructions")] + public IEnumerable? SetupInstructions { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/GoogleSheetsRowAppendToolWithToolCall.cs b/src/Vapi.Net/Types/GoogleSheetsRowAppendToolWithToolCall.cs new file mode 100644 index 0000000..b7fd686 --- /dev/null +++ b/src/Vapi.Net/Types/GoogleSheetsRowAppendToolWithToolCall.cs @@ -0,0 +1,73 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record GoogleSheetsRowAppendToolWithToolCall +{ + /// + /// This determines if the tool is async. + /// + /// If async, the assistant will move forward without waiting for your server to respond. This is useful if you just want to trigger something on your server. + /// + /// If sync, the assistant will wait for your server to respond. This is useful if want assistant to respond with the result from your server. + /// + /// Defaults to synchronous (`false`). + /// + [JsonPropertyName("async")] + public bool? Async { get; set; } + + /// + /// These are the messages that will be spoken to the user as the tool is running. + /// + /// For some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured. + /// + [JsonPropertyName("messages")] + public IEnumerable? Messages { get; set; } + + /// + /// The type of tool. "google.sheets.row.append" for Google Sheets tool. + /// + [JsonPropertyName("type")] + public string Type { get; set; } = "google.sheets.row.append"; + + [JsonPropertyName("toolCall")] + public required ToolCall ToolCall { get; set; } + + /// + /// This is the function definition of the tool. + /// + /// For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + /// + /// An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + /// + [JsonPropertyName("function")] + public OpenAiFunction? Function { get; set; } + + /// + /// This is the server that will be hit when this tool is requested by the model. + /// + /// All requests will be sent with the call object among other things. You can find more details in the Server URL documentation. + /// + /// This overrides the serverUrl set on the org and the phoneNumber. Order of precedence: highest tool.server.url, then assistant.serverUrl, then phoneNumber.serverUrl, then org.serverUrl. + /// + [JsonPropertyName("server")] + public Server? Server { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/GoogleTranscriber.cs b/src/Vapi.Net/Types/GoogleTranscriber.cs new file mode 100644 index 0000000..f55f310 --- /dev/null +++ b/src/Vapi.Net/Types/GoogleTranscriber.cs @@ -0,0 +1,42 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record GoogleTranscriber +{ + /// + /// This is the model that will be used for the transcription. + /// + [JsonPropertyName("model")] + public GoogleTranscriberModel? Model { get; set; } + + /// + /// This is the language that will be set for the transcription. + /// + [JsonPropertyName("language")] + public GoogleTranscriberLanguage? Language { get; set; } + + /// + /// This is the plan for voice provider fallbacks in the event that the primary voice provider fails. + /// + [JsonPropertyName("fallbackPlan")] + public FallbackTranscriberPlan? FallbackPlan { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/GoogleTranscriberLanguage.cs b/src/Vapi.Net/Types/GoogleTranscriberLanguage.cs new file mode 100644 index 0000000..6f99288 --- /dev/null +++ b/src/Vapi.Net/Types/GoogleTranscriberLanguage.cs @@ -0,0 +1,126 @@ +using System.Runtime.Serialization; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[JsonConverter(typeof(EnumSerializer))] +public enum GoogleTranscriberLanguage +{ + [EnumMember(Value = "Multilingual")] + Multilingual, + + [EnumMember(Value = "Arabic")] + Arabic, + + [EnumMember(Value = "Bengali")] + Bengali, + + [EnumMember(Value = "Bulgarian")] + Bulgarian, + + [EnumMember(Value = "Chinese")] + Chinese, + + [EnumMember(Value = "Croatian")] + Croatian, + + [EnumMember(Value = "Czech")] + Czech, + + [EnumMember(Value = "Danish")] + Danish, + + [EnumMember(Value = "Dutch")] + Dutch, + + [EnumMember(Value = "English")] + English, + + [EnumMember(Value = "Estonian")] + Estonian, + + [EnumMember(Value = "Finnish")] + Finnish, + + [EnumMember(Value = "French")] + French, + + [EnumMember(Value = "German")] + German, + + [EnumMember(Value = "Greek")] + Greek, + + [EnumMember(Value = "Hebrew")] + Hebrew, + + [EnumMember(Value = "Hindi")] + Hindi, + + [EnumMember(Value = "Hungarian")] + Hungarian, + + [EnumMember(Value = "Indonesian")] + Indonesian, + + [EnumMember(Value = "Italian")] + Italian, + + [EnumMember(Value = "Japanese")] + Japanese, + + [EnumMember(Value = "Korean")] + Korean, + + [EnumMember(Value = "Latvian")] + Latvian, + + [EnumMember(Value = "Lithuanian")] + Lithuanian, + + [EnumMember(Value = "Norwegian")] + Norwegian, + + [EnumMember(Value = "Polish")] + Polish, + + [EnumMember(Value = "Portuguese")] + Portuguese, + + [EnumMember(Value = "Romanian")] + Romanian, + + [EnumMember(Value = "Russian")] + Russian, + + [EnumMember(Value = "Serbian")] + Serbian, + + [EnumMember(Value = "Slovak")] + Slovak, + + [EnumMember(Value = "Slovenian")] + Slovenian, + + [EnumMember(Value = "Spanish")] + Spanish, + + [EnumMember(Value = "Swahili")] + Swahili, + + [EnumMember(Value = "Swedish")] + Swedish, + + [EnumMember(Value = "Thai")] + Thai, + + [EnumMember(Value = "Turkish")] + Turkish, + + [EnumMember(Value = "Ukrainian")] + Ukrainian, + + [EnumMember(Value = "Vietnamese")] + Vietnamese, +} diff --git a/src/Vapi.Net/Types/GoogleTranscriberModel.cs b/src/Vapi.Net/Types/GoogleTranscriberModel.cs new file mode 100644 index 0000000..db833f7 --- /dev/null +++ b/src/Vapi.Net/Types/GoogleTranscriberModel.cs @@ -0,0 +1,45 @@ +using System.Runtime.Serialization; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[JsonConverter(typeof(EnumSerializer))] +public enum GoogleTranscriberModel +{ + [EnumMember(Value = "gemini-2.0-flash-thinking-exp")] + Gemini20FlashThinkingExp, + + [EnumMember(Value = "gemini-2.0-pro-exp-02-05")] + Gemini20ProExp0205, + + [EnumMember(Value = "gemini-2.0-flash")] + Gemini20Flash, + + [EnumMember(Value = "gemini-2.0-flash-lite")] + Gemini20FlashLite, + + [EnumMember(Value = "gemini-2.0-flash-lite-preview-02-05")] + Gemini20FlashLitePreview0205, + + [EnumMember(Value = "gemini-2.0-flash-exp")] + Gemini20FlashExp, + + [EnumMember(Value = "gemini-2.0-flash-realtime-exp")] + Gemini20FlashRealtimeExp, + + [EnumMember(Value = "gemini-1.5-flash")] + Gemini15Flash, + + [EnumMember(Value = "gemini-1.5-flash-002")] + Gemini15Flash002, + + [EnumMember(Value = "gemini-1.5-pro")] + Gemini15Pro, + + [EnumMember(Value = "gemini-1.5-pro-002")] + Gemini15Pro002, + + [EnumMember(Value = "gemini-1.0-pro")] + Gemini10Pro, +} diff --git a/src/Vapi.Net/Types/GoogleVoicemailDetectionPlan.cs b/src/Vapi.Net/Types/GoogleVoicemailDetectionPlan.cs new file mode 100644 index 0000000..7b7f2ab --- /dev/null +++ b/src/Vapi.Net/Types/GoogleVoicemailDetectionPlan.cs @@ -0,0 +1,32 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record GoogleVoicemailDetectionPlan +{ + /// + /// This is how long should we listen in order to determine if we were sent to voicemail or not? + /// + /// @default 15 + /// + [JsonPropertyName("voicemailExpectedDurationSeconds")] + public required double VoicemailExpectedDurationSeconds { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/GroqCredential.cs b/src/Vapi.Net/Types/GroqCredential.cs index 75e7a17..e807915 100644 --- a/src/Vapi.Net/Types/GroqCredential.cs +++ b/src/Vapi.Net/Types/GroqCredential.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -44,6 +45,17 @@ public record GroqCredential [JsonPropertyName("name")] public string? Name { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/GroqModel.cs b/src/Vapi.Net/Types/GroqModel.cs index 9b10ce1..8113d78 100644 --- a/src/Vapi.Net/Types/GroqModel.cs +++ b/src/Vapi.Net/Types/GroqModel.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -77,6 +78,17 @@ public record GroqModel [JsonPropertyName("numFastTurns")] public double? NumFastTurns { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/HandoffStep.cs b/src/Vapi.Net/Types/HandoffStep.cs deleted file mode 100644 index 58bfb99..0000000 --- a/src/Vapi.Net/Types/HandoffStep.cs +++ /dev/null @@ -1,89 +0,0 @@ -using System.Text.Json.Serialization; -using Vapi.Net.Core; - -namespace Vapi.Net; - -public record HandoffStep -{ - /// - /// This is the block to use. To use an existing block, use `blockId`. - /// - [JsonPropertyName("block")] - public object? Block { get; set; } - - /// - /// These are the destinations that the step can go to after it's done. - /// - [JsonPropertyName("destinations")] - public IEnumerable? Destinations { get; set; } - - /// - /// This is the name of the step. - /// - [JsonPropertyName("name")] - public required string Name { get; set; } - - /// - /// This is the id of the block to use. To use a transient block, use `block`. - /// - [JsonPropertyName("blockId")] - public string? BlockId { get; set; } - - /// - /// This is the input to the block. You can use any key-value map as input to the block. - /// - /// Example: - /// { - /// "name": "John Doe", - /// "age": 20 - /// } - /// - /// You can reference any variable in the context of the current block: - /// - "{{your-step-name.output.your-property-name}}" for another step's output (in the same workflow; read caveat #1) - /// - "{{your-step-name.input.your-property-name}}" for another step's input (in the same workflow; read caveat #1) - /// - "{{your-block-name.output.your-property-name}}" for another block's output (in the same workflow; read caveat #2) - /// - "{{your-block-name.input.your-property-name}}" for another block's input (in the same workflow; read caveat #2) - /// - "{{workflow.input.your-property-name}}" for the current workflow's input - /// - "{{global.your-property-name}}" for the global context - /// - /// Example: - /// { - /// "name": "{{my-tool-call-step.output.name}}", - /// "age": "{{my-tool-call-step.input.age}}", - /// "date": "{{workflow.input.date}}" - /// } - /// - /// You can dynamically change the key name. - /// - /// Example: - /// { - /// "{{my-tool-call-step.output.key-name-for-name}}": "{{name}}", - /// "{{my-tool-call-step.input.key-name-for-age}}": "{{age}}", - /// "{{workflow.input.key-name-for-date}}": "{{date}}" - /// } - /// - /// You can represent the value as a string, number, boolean, array, or object. - /// - /// Example: - /// { - /// "name": "john", - /// "age": 20, - /// "date": "2021-01-01", - /// "metadata": { - /// "unique-key": "{{my-tool-call-step.output.unique-key}}" - /// }, - /// "array": ["A", "B", "C"], - /// } - /// - /// Caveats: - /// 1. a workflow can execute a step multiple times. example, if a loop is used in the graph. {{stepName.input/output.propertyName}} will reference the latest usage of the step. - /// 2. a workflow can execute a block multiple times. example, if a step is called multiple times or if a block is used in multiple steps. {{blockName.input/output.propertyName}} will reference the latest usage of the block. this liquid variable is just provided for convenience when creating blocks outside of a workflow. - /// - [JsonPropertyName("input")] - public object? Input { get; set; } - - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Vapi.Net/Types/Hangup.cs b/src/Vapi.Net/Types/Hangup.cs index a309e48..9d3dcab 100644 --- a/src/Vapi.Net/Types/Hangup.cs +++ b/src/Vapi.Net/Types/Hangup.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -14,6 +15,17 @@ public record Hangup [JsonPropertyName("metadata")] public object? Metadata { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/Hook.cs b/src/Vapi.Net/Types/Hook.cs index 1fada66..adc82e5 100644 --- a/src/Vapi.Net/Types/Hook.cs +++ b/src/Vapi.Net/Types/Hook.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -11,6 +12,17 @@ public record Hook [JsonPropertyName("do")] public IEnumerable Do { get; set; } = new List(); + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/HumeCredential.cs b/src/Vapi.Net/Types/HumeCredential.cs new file mode 100644 index 0000000..7cf1467 --- /dev/null +++ b/src/Vapi.Net/Types/HumeCredential.cs @@ -0,0 +1,63 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record HumeCredential +{ + [JsonPropertyName("provider")] + public string Provider { get; set; } = "hume"; + + /// + /// This is not returned in the API. + /// + [JsonPropertyName("apiKey")] + public required string ApiKey { get; set; } + + /// + /// This is the unique identifier for the credential. + /// + [JsonPropertyName("id")] + public required string Id { get; set; } + + /// + /// This is the unique identifier for the org that this credential belongs to. + /// + [JsonPropertyName("orgId")] + public required string OrgId { get; set; } + + /// + /// This is the ISO 8601 date-time string of when the credential was created. + /// + [JsonPropertyName("createdAt")] + public required DateTime CreatedAt { get; set; } + + /// + /// This is the ISO 8601 date-time string of when the assistant was last updated. + /// + [JsonPropertyName("updatedAt")] + public required DateTime UpdatedAt { get; set; } + + /// + /// This is the name of credential. This is just for your reference. + /// + [JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/HumeVoice.cs b/src/Vapi.Net/Types/HumeVoice.cs new file mode 100644 index 0000000..3a133e6 --- /dev/null +++ b/src/Vapi.Net/Types/HumeVoice.cs @@ -0,0 +1,63 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record HumeVoice +{ + /// + /// This is the model that will be used. + /// + [JsonPropertyName("model")] + public string? Model { get; set; } + + /// + /// The ID of the particular voice you want to use. + /// + [JsonPropertyName("voiceId")] + public required string VoiceId { get; set; } + + /// + /// Indicates whether the chosen voice is a preset Hume AI voice or a custom voice. + /// + [JsonPropertyName("isCustomHumeVoice")] + public bool? IsCustomHumeVoice { get; set; } + + /// + /// This is the plan for chunking the model output before it is sent to the voice provider. + /// + [JsonPropertyName("chunkPlan")] + public ChunkPlan? ChunkPlan { get; set; } + + /// + /// Natural language instructions describing how the synthesized speech should sound, including but not limited to tone, intonation, pacing, and accent (e.g., 'a soft, gentle voice with a strong British accent'). + /// + /// If a Voice is specified in the request, this description serves as acting instructions. + /// If no Voice is specified, a new voice is generated based on this description. + /// + [JsonPropertyName("description")] + public string? Description { get; set; } + + /// + /// This is the plan for voice provider fallbacks in the event that the primary voice provider fails. + /// + [JsonPropertyName("fallbackPlan")] + public FallbackPlan? FallbackPlan { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/ImportTwilioPhoneNumberDto.cs b/src/Vapi.Net/Types/ImportTwilioPhoneNumberDto.cs index 5a9c23d..7345548 100644 --- a/src/Vapi.Net/Types/ImportTwilioPhoneNumberDto.cs +++ b/src/Vapi.Net/Types/ImportTwilioPhoneNumberDto.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -16,6 +17,12 @@ public record ImportTwilioPhoneNumberDto [JsonPropertyName("fallbackDestination")] public object? FallbackDestination { get; set; } + /// + /// This is the hooks that will be used for incoming calls to this phone number. + /// + [JsonPropertyName("hooks")] + public IEnumerable? Hooks { get; set; } + /// /// These are the digits of the phone number you own on your Twilio. /// @@ -68,6 +75,17 @@ public record ImportTwilioPhoneNumberDto [JsonPropertyName("server")] public Server? Server { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/ImportVonagePhoneNumberDto.cs b/src/Vapi.Net/Types/ImportVonagePhoneNumberDto.cs index ce3d6c7..d9e56f9 100644 --- a/src/Vapi.Net/Types/ImportVonagePhoneNumberDto.cs +++ b/src/Vapi.Net/Types/ImportVonagePhoneNumberDto.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -16,6 +17,12 @@ public record ImportVonagePhoneNumberDto [JsonPropertyName("fallbackDestination")] public object? FallbackDestination { get; set; } + /// + /// This is the hooks that will be used for incoming calls to this phone number. + /// + [JsonPropertyName("hooks")] + public IEnumerable? Hooks { get; set; } + /// /// These are the digits of the phone number you own on your Vonage. /// @@ -23,9 +30,7 @@ public record ImportVonagePhoneNumberDto public required string VonagePhoneNumber { get; set; } /// - /// This is the credential that is used to make outgoing calls, and do operations like call transfer and hang up. - /// - /// You can add the Vonage Credential in the Provider Credentials page on the dashboard to get the credentialId. + /// This is the credential you added in dashboard.vapi.ai/keys. This is used to configure the number to send inbound calls to Vapi, make outbound calls and do live call updates like transfers and hangups. /// [JsonPropertyName("credentialId")] public required string CredentialId { get; set; } @@ -64,6 +69,17 @@ public record ImportVonagePhoneNumberDto [JsonPropertyName("server")] public Server? Server { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/InflectionAiCredential.cs b/src/Vapi.Net/Types/InflectionAiCredential.cs index bd114e1..3e86e37 100644 --- a/src/Vapi.Net/Types/InflectionAiCredential.cs +++ b/src/Vapi.Net/Types/InflectionAiCredential.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -47,6 +48,17 @@ public record InflectionAiCredential [JsonPropertyName("name")] public string? Name { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/InflectionAiModel.cs b/src/Vapi.Net/Types/InflectionAiModel.cs index b0dab8c..c6b4196 100644 --- a/src/Vapi.Net/Types/InflectionAiModel.cs +++ b/src/Vapi.Net/Types/InflectionAiModel.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -77,6 +78,17 @@ public record InflectionAiModel [JsonPropertyName("numFastTurns")] public double? NumFastTurns { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/InviteUserDto.cs b/src/Vapi.Net/Types/InviteUserDto.cs index 5d34539..fae5e64 100644 --- a/src/Vapi.Net/Types/InviteUserDto.cs +++ b/src/Vapi.Net/Types/InviteUserDto.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -14,6 +15,17 @@ public record InviteUserDto [JsonPropertyName("redirectTo")] public string? RedirectTo { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/InvoicePlan.cs b/src/Vapi.Net/Types/InvoicePlan.cs new file mode 100644 index 0000000..32fbe87 --- /dev/null +++ b/src/Vapi.Net/Types/InvoicePlan.cs @@ -0,0 +1,48 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record InvoicePlan +{ + /// + /// This is the name of the company. + /// + [JsonPropertyName("companyName")] + public string? CompanyName { get; set; } + + /// + /// This is the address of the company. + /// + [JsonPropertyName("companyAddress")] + public string? CompanyAddress { get; set; } + + /// + /// This is the tax ID of the company. + /// + [JsonPropertyName("companyTaxId")] + public string? CompanyTaxId { get; set; } + + /// + /// This is the preferred invoicing email of the company. If not specified, defaults to the subscription's email. + /// + [JsonPropertyName("companyEmail")] + public string? CompanyEmail { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/JsonSchema.cs b/src/Vapi.Net/Types/JsonSchema.cs index a70c9c7..5c48b07 100644 --- a/src/Vapi.Net/Types/JsonSchema.cs +++ b/src/Vapi.Net/Types/JsonSchema.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -73,6 +74,17 @@ public record JsonSchema [JsonPropertyName("enum")] public IEnumerable? Enum { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/KeypadInputPlan.cs b/src/Vapi.Net/Types/KeypadInputPlan.cs new file mode 100644 index 0000000..c3b09f7 --- /dev/null +++ b/src/Vapi.Net/Types/KeypadInputPlan.cs @@ -0,0 +1,50 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record KeypadInputPlan +{ + /// + /// This keeps track of whether the user has enabled keypad input. + /// By default, it is off. + /// + /// @default false + /// + [JsonPropertyName("enabled")] + public bool? Enabled { get; set; } + + /// + /// This is the time in seconds to wait before processing the input. + /// If the input is not received within this time, the input will be ignored. + /// If set to "off", the input will be processed when the user enters a delimiter or immediately if no delimiter is used. + /// + /// @default 2 + /// + [JsonPropertyName("timeoutSeconds")] + public double? TimeoutSeconds { get; set; } + + /// + /// This is the delimiter(s) that will be used to process the input. + /// Can be '#', '*', or an empty array. + /// + [JsonPropertyName("delimiters")] + public KeypadInputPlanDelimiters? Delimiters { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/KeypadInputPlanDelimiters.cs b/src/Vapi.Net/Types/KeypadInputPlanDelimiters.cs new file mode 100644 index 0000000..5a93ebc --- /dev/null +++ b/src/Vapi.Net/Types/KeypadInputPlanDelimiters.cs @@ -0,0 +1,18 @@ +using System.Runtime.Serialization; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[JsonConverter(typeof(EnumSerializer))] +public enum KeypadInputPlanDelimiters +{ + [EnumMember(Value = "#")] + Hash, + + [EnumMember(Value = "*")] + Asterisk, + + [EnumMember(Value = "")] + Empty, +} diff --git a/src/Vapi.Net/Types/KnowledgeBase.cs b/src/Vapi.Net/Types/KnowledgeBase.cs new file mode 100644 index 0000000..8fda8d3 --- /dev/null +++ b/src/Vapi.Net/Types/KnowledgeBase.cs @@ -0,0 +1,54 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record KnowledgeBase +{ + /// + /// The name of the knowledge base + /// + [JsonPropertyName("name")] + public required string Name { get; set; } + + /// + /// The provider of the knowledge base + /// + [JsonPropertyName("provider")] + public string Provider { get; set; } = "google"; + + /// + /// The model to use for the knowledge base + /// + [JsonPropertyName("model")] + public KnowledgeBaseModel? Model { get; set; } + + /// + /// A description of the knowledge base + /// + [JsonPropertyName("description")] + public required string Description { get; set; } + + /// + /// The file IDs associated with this knowledge base + /// + [JsonPropertyName("fileIds")] + public IEnumerable FileIds { get; set; } = new List(); + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/KnowledgeBaseModel.cs b/src/Vapi.Net/Types/KnowledgeBaseModel.cs new file mode 100644 index 0000000..6a061cb --- /dev/null +++ b/src/Vapi.Net/Types/KnowledgeBaseModel.cs @@ -0,0 +1,45 @@ +using System.Runtime.Serialization; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[JsonConverter(typeof(EnumSerializer))] +public enum KnowledgeBaseModel +{ + [EnumMember(Value = "gemini-2.0-flash-thinking-exp")] + Gemini20FlashThinkingExp, + + [EnumMember(Value = "gemini-2.0-pro-exp-02-05")] + Gemini20ProExp0205, + + [EnumMember(Value = "gemini-2.0-flash")] + Gemini20Flash, + + [EnumMember(Value = "gemini-2.0-flash-lite")] + Gemini20FlashLite, + + [EnumMember(Value = "gemini-2.0-flash-lite-preview-02-05")] + Gemini20FlashLitePreview0205, + + [EnumMember(Value = "gemini-2.0-flash-exp")] + Gemini20FlashExp, + + [EnumMember(Value = "gemini-2.0-flash-realtime-exp")] + Gemini20FlashRealtimeExp, + + [EnumMember(Value = "gemini-1.5-flash")] + Gemini15Flash, + + [EnumMember(Value = "gemini-1.5-flash-002")] + Gemini15Flash002, + + [EnumMember(Value = "gemini-1.5-pro")] + Gemini15Pro, + + [EnumMember(Value = "gemini-1.5-pro-002")] + Gemini15Pro002, + + [EnumMember(Value = "gemini-1.0-pro")] + Gemini10Pro, +} diff --git a/src/Vapi.Net/Types/KnowledgeBaseResponseDocument.cs b/src/Vapi.Net/Types/KnowledgeBaseResponseDocument.cs index 73e2075..e7a2fb4 100644 --- a/src/Vapi.Net/Types/KnowledgeBaseResponseDocument.cs +++ b/src/Vapi.Net/Types/KnowledgeBaseResponseDocument.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -23,6 +24,17 @@ public record KnowledgeBaseResponseDocument [JsonPropertyName("uuid")] public string? Uuid { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/LangfuseCredential.cs b/src/Vapi.Net/Types/LangfuseCredential.cs index a2d24a7..1290cae 100644 --- a/src/Vapi.Net/Types/LangfuseCredential.cs +++ b/src/Vapi.Net/Types/LangfuseCredential.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -56,6 +57,17 @@ public record LangfuseCredential [JsonPropertyName("name")] public string? Name { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/LangfuseObservabilityPlan.cs b/src/Vapi.Net/Types/LangfuseObservabilityPlan.cs new file mode 100644 index 0000000..ec08225 --- /dev/null +++ b/src/Vapi.Net/Types/LangfuseObservabilityPlan.cs @@ -0,0 +1,40 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record LangfuseObservabilityPlan +{ + [JsonPropertyName("provider")] + public string Provider { get; set; } = "langfuse"; + + /// + /// This is an array of tags to be added to the Langfuse trace. Tags allow you to categorize and filter traces. https://langfuse.com/docs/tracing-features/tags + /// + [JsonPropertyName("tags")] + public IEnumerable Tags { get; set; } = new List(); + + /// + /// This is a JSON object that will be added to the Langfuse trace. Traces can be enriched with metadata to better understand your users, application, and experiments. https://langfuse.com/docs/tracing-features/metadata + /// By default it includes the call metadata, assistant metadata, and assistant overrides. + /// + [JsonPropertyName("metadata")] + public object? Metadata { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/LivekitSmartEndpointingPlan.cs b/src/Vapi.Net/Types/LivekitSmartEndpointingPlan.cs new file mode 100644 index 0000000..f6e182b --- /dev/null +++ b/src/Vapi.Net/Types/LivekitSmartEndpointingPlan.cs @@ -0,0 +1,44 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record LivekitSmartEndpointingPlan +{ + /// + /// This is the provider for the smart endpointing plan. + /// + [JsonPropertyName("provider")] + public required LivekitSmartEndpointingPlanProvider Provider { get; set; } + + /// + /// This expression describes how long the bot will wait to start speaking based on the likelihood that the user has reached an endpoint. + /// + /// This is a millisecond valued function. It maps probabilities (real numbers on [0,1]) to milliseconds that the bot should wait before speaking ([0, \infty]). Any negative values that are returned are set to zero (the bot can't start talking in the past). + /// + /// A probability of zero represents very high confidence that the caller has stopped speaking, and would like the bot to speak to them. A probability of one represents very high confidence that the caller is still speaking. + /// + /// Under the hood, this is parsed into a mathjs expression. Whatever you use to write your expression needs to be valid with respect to mathjs + /// + /// @default "70 + 4000 * x" + /// + [JsonPropertyName("waitFunction")] + public string? WaitFunction { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/LivekitSmartEndpointingPlanProvider.cs b/src/Vapi.Net/Types/LivekitSmartEndpointingPlanProvider.cs new file mode 100644 index 0000000..380337b --- /dev/null +++ b/src/Vapi.Net/Types/LivekitSmartEndpointingPlanProvider.cs @@ -0,0 +1,15 @@ +using System.Runtime.Serialization; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[JsonConverter(typeof(EnumSerializer))] +public enum LivekitSmartEndpointingPlanProvider +{ + [EnumMember(Value = "vapi")] + Vapi, + + [EnumMember(Value = "livekit")] + Livekit, +} diff --git a/src/Vapi.Net/Types/LmntCredential.cs b/src/Vapi.Net/Types/LmntCredential.cs index 85dfeb2..10032e1 100644 --- a/src/Vapi.Net/Types/LmntCredential.cs +++ b/src/Vapi.Net/Types/LmntCredential.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -44,6 +45,17 @@ public record LmntCredential [JsonPropertyName("name")] public string? Name { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/LmntVoice.cs b/src/Vapi.Net/Types/LmntVoice.cs index 383b1b0..e69b51d 100644 --- a/src/Vapi.Net/Types/LmntVoice.cs +++ b/src/Vapi.Net/Types/LmntVoice.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using OneOf; using Vapi.Net.Core; @@ -30,6 +31,17 @@ public record LmntVoice [JsonPropertyName("fallbackPlan")] public FallbackPlan? FallbackPlan { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/Log.cs b/src/Vapi.Net/Types/Log.cs index e87fd28..5d1ddb7 100644 --- a/src/Vapi.Net/Types/Log.cs +++ b/src/Vapi.Net/Types/Log.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -149,6 +150,17 @@ public record Log [JsonPropertyName("callId")] public string? CallId { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/LogicEdgeCondition.cs b/src/Vapi.Net/Types/LogicEdgeCondition.cs index 6f51997..cc0eb7b 100644 --- a/src/Vapi.Net/Types/LogicEdgeCondition.cs +++ b/src/Vapi.Net/Types/LogicEdgeCondition.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -8,6 +9,17 @@ public record LogicEdgeCondition [JsonPropertyName("liquid")] public required string Liquid { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/LogsPaginatedResponse.cs b/src/Vapi.Net/Types/LogsPaginatedResponse.cs index a978e7d..5f9f425 100644 --- a/src/Vapi.Net/Types/LogsPaginatedResponse.cs +++ b/src/Vapi.Net/Types/LogsPaginatedResponse.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -11,6 +12,17 @@ public record LogsPaginatedResponse [JsonPropertyName("metadata")] public required PaginationMeta Metadata { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/MakeCredential.cs b/src/Vapi.Net/Types/MakeCredential.cs index 3fd66ad..8f47f9c 100644 --- a/src/Vapi.Net/Types/MakeCredential.cs +++ b/src/Vapi.Net/Types/MakeCredential.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -56,6 +57,17 @@ public record MakeCredential [JsonPropertyName("name")] public string? Name { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/MakeTool.cs b/src/Vapi.Net/Types/MakeTool.cs index a570731..e7732cb 100644 --- a/src/Vapi.Net/Types/MakeTool.cs +++ b/src/Vapi.Net/Types/MakeTool.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -72,6 +73,17 @@ public record MakeTool [JsonPropertyName("metadata")] public required MakeToolMetadata Metadata { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/MakeToolMetadata.cs b/src/Vapi.Net/Types/MakeToolMetadata.cs index e7a2420..29aecb0 100644 --- a/src/Vapi.Net/Types/MakeToolMetadata.cs +++ b/src/Vapi.Net/Types/MakeToolMetadata.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -11,6 +12,17 @@ public record MakeToolMetadata [JsonPropertyName("triggerHookId")] public double? TriggerHookId { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/MakeToolProviderDetails.cs b/src/Vapi.Net/Types/MakeToolProviderDetails.cs index 1ccc87e..5cf2f54 100644 --- a/src/Vapi.Net/Types/MakeToolProviderDetails.cs +++ b/src/Vapi.Net/Types/MakeToolProviderDetails.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -26,6 +27,17 @@ public record MakeToolProviderDetails [JsonPropertyName("triggerHookName")] public string? TriggerHookName { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/MakeToolWithToolCall.cs b/src/Vapi.Net/Types/MakeToolWithToolCall.cs index 24227d8..1a9cb7c 100644 --- a/src/Vapi.Net/Types/MakeToolWithToolCall.cs +++ b/src/Vapi.Net/Types/MakeToolWithToolCall.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -51,6 +52,17 @@ public record MakeToolWithToolCall [JsonPropertyName("server")] public Server? Server { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/McpTool.cs b/src/Vapi.Net/Types/McpTool.cs new file mode 100644 index 0000000..3ab33ba --- /dev/null +++ b/src/Vapi.Net/Types/McpTool.cs @@ -0,0 +1,88 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record McpTool +{ + /// + /// This determines if the tool is async. + /// + /// If async, the assistant will move forward without waiting for your server to respond. This is useful if you just want to trigger something on your server. + /// + /// If sync, the assistant will wait for your server to respond. This is useful if want assistant to respond with the result from your server. + /// + /// Defaults to synchronous (`false`). + /// + [JsonPropertyName("async")] + public bool? Async { get; set; } + + /// + /// These are the messages that will be spoken to the user as the tool is running. + /// + /// For some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured. + /// + [JsonPropertyName("messages")] + public IEnumerable? Messages { get; set; } + + /// + /// This is the unique identifier for the tool. + /// + [JsonPropertyName("id")] + public required string Id { get; set; } + + /// + /// This is the unique identifier for the organization that this tool belongs to. + /// + [JsonPropertyName("orgId")] + public required string OrgId { get; set; } + + /// + /// This is the ISO 8601 date-time string of when the tool was created. + /// + [JsonPropertyName("createdAt")] + public required DateTime CreatedAt { get; set; } + + /// + /// This is the ISO 8601 date-time string of when the tool was last updated. + /// + [JsonPropertyName("updatedAt")] + public required DateTime UpdatedAt { get; set; } + + /// + /// This is the function definition of the tool. + /// + /// For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + /// + /// An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + /// + [JsonPropertyName("function")] + public OpenAiFunction? Function { get; set; } + + /// + /// This is the server that will be hit when this tool is requested by the model. + /// + /// All requests will be sent with the call object among other things. You can find more details in the Server URL documentation. + /// + /// This overrides the serverUrl set on the org and the phoneNumber. Order of precedence: highest tool.server.url, then assistant.serverUrl, then phoneNumber.serverUrl, then org.serverUrl. + /// + [JsonPropertyName("server")] + public Server? Server { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/MessagePlan.cs b/src/Vapi.Net/Types/MessagePlan.cs index b5a3bec..e2b95d4 100644 --- a/src/Vapi.Net/Types/MessagePlan.cs +++ b/src/Vapi.Net/Types/MessagePlan.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -25,6 +26,14 @@ public record MessagePlan [JsonPropertyName("idleMessageMaxSpokenCount")] public double? IdleMessageMaxSpokenCount { get; set; } + /// + /// This determines whether the idle message count is reset whenever the user speaks. + /// + /// @default false + /// + [JsonPropertyName("idleMessageResetCountOnUserSpeechEnabled")] + public bool? IdleMessageResetCountOnUserSpeechEnabled { get; set; } + /// /// This is the timeout in seconds before a message from `idleMessages` is spoken. The clock starts when the assistant finishes speaking and remains active until the user speaks. /// @@ -41,6 +50,17 @@ public record MessagePlan [JsonPropertyName("silenceTimeoutMessage")] public string? SilenceTimeoutMessage { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/Metrics.cs b/src/Vapi.Net/Types/Metrics.cs index d2a4d87..dad27da 100644 --- a/src/Vapi.Net/Types/Metrics.cs +++ b/src/Vapi.Net/Types/Metrics.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -48,6 +49,17 @@ public record Metrics [JsonPropertyName("callCountDailyBreakdown")] public object CallCountDailyBreakdown { get; set; } = new Dictionary(); + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/MistralCredential.cs b/src/Vapi.Net/Types/MistralCredential.cs new file mode 100644 index 0000000..cac8459 --- /dev/null +++ b/src/Vapi.Net/Types/MistralCredential.cs @@ -0,0 +1,63 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record MistralCredential +{ + [JsonPropertyName("provider")] + public string Provider { get; set; } = "mistral"; + + /// + /// This is not returned in the API. + /// + [JsonPropertyName("apiKey")] + public required string ApiKey { get; set; } + + /// + /// This is the unique identifier for the credential. + /// + [JsonPropertyName("id")] + public required string Id { get; set; } + + /// + /// This is the unique identifier for the org that this credential belongs to. + /// + [JsonPropertyName("orgId")] + public required string OrgId { get; set; } + + /// + /// This is the ISO 8601 date-time string of when the credential was created. + /// + [JsonPropertyName("createdAt")] + public required DateTime CreatedAt { get; set; } + + /// + /// This is the ISO 8601 date-time string of when the assistant was last updated. + /// + [JsonPropertyName("updatedAt")] + public required DateTime UpdatedAt { get; set; } + + /// + /// This is the name of credential. This is just for your reference. + /// + [JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/ModelBasedCondition.cs b/src/Vapi.Net/Types/ModelBasedCondition.cs deleted file mode 100644 index 2ff6911..0000000 --- a/src/Vapi.Net/Types/ModelBasedCondition.cs +++ /dev/null @@ -1,41 +0,0 @@ -using System.Text.Json.Serialization; -using Vapi.Net.Core; - -namespace Vapi.Net; - -public record ModelBasedCondition -{ - /// - /// This is the instruction which should output a boolean value when passed to a model. - /// - /// You can reference any variable in the context of the current block execution (step): - /// - "{{output.your-property-name}}" for current step's output - /// - "{{input.your-property-name}}" for current step's input - /// - "{{your-step-name.output.your-property-name}}" for another step's output (in the same workflow; read caveat #1) - /// - "{{your-step-name.input.your-property-name}}" for another step's input (in the same workflow; read caveat #1) - /// - "{{your-block-name.output.your-property-name}}" for another block's output (in the same workflow; read caveat #2) - /// - "{{your-block-name.input.your-property-name}}" for another block's input (in the same workflow; read caveat #2) - /// - "{{workflow.input.your-property-name}}" for the current workflow's input - /// - "{{global.your-property-name}}" for the global context - /// - /// You can also talk about the current step's output or input directly: - /// - "{{output.your-property-name}} is greater than 10" - /// - "{{input.your-property-name}} is greater than 10" - /// - /// Examples: - /// - "{{input.age}} is greater than 10" - /// - "{{input.age}} is greater than {{input.age2}}" - /// - "{{output.age}} is greater than 10" - /// - /// Caveats: - /// 1. a workflow can execute a step multiple times. example, if a loop is used in the graph. {{stepName.input/output.propertyName}} will reference the latest usage of the step. - /// 2. a workflow can execute a block multiple times. example, if a step is called multiple times or if a block is used in multiple steps. {{blockName.input/output.propertyName}} will reference the latest usage of the block. this liquid variable is just provided for convenience when creating blocks outside of a workflow with steps. - /// - [JsonPropertyName("instruction")] - public required string Instruction { get; set; } - - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Vapi.Net/Types/ModelCost.cs b/src/Vapi.Net/Types/ModelCost.cs index 7020467..5ce002d 100644 --- a/src/Vapi.Net/Types/ModelCost.cs +++ b/src/Vapi.Net/Types/ModelCost.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -37,6 +38,17 @@ public record ModelCost [JsonPropertyName("cost")] public required double Cost { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/Monitor.cs b/src/Vapi.Net/Types/Monitor.cs index 584de46..39b25bd 100644 --- a/src/Vapi.Net/Types/Monitor.cs +++ b/src/Vapi.Net/Types/Monitor.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -17,6 +18,17 @@ public record Monitor [JsonPropertyName("controlUrl")] public string? ControlUrl { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/MonitorPlan.cs b/src/Vapi.Net/Types/MonitorPlan.cs index 45501d6..8247a97 100644 --- a/src/Vapi.Net/Types/MonitorPlan.cs +++ b/src/Vapi.Net/Types/MonitorPlan.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -27,6 +28,17 @@ public record MonitorPlan [JsonPropertyName("controlEnabled")] public bool? ControlEnabled { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/NeetsVoice.cs b/src/Vapi.Net/Types/NeetsVoice.cs index 06c8aa4..84f4c45 100644 --- a/src/Vapi.Net/Types/NeetsVoice.cs +++ b/src/Vapi.Net/Types/NeetsVoice.cs @@ -1,29 +1,25 @@ +using System.Text.Json; using System.Text.Json.Serialization; -using OneOf; using Vapi.Net.Core; namespace Vapi.Net; public record NeetsVoice { - /// - /// This is the provider-specific ID that will be used. - /// [JsonPropertyName("voiceId")] - public required OneOf VoiceId { get; set; } - - /// - /// This is the plan for chunking the model output before it is sent to the voice provider. - /// - [JsonPropertyName("chunkPlan")] - public ChunkPlan? ChunkPlan { get; set; } + public object? VoiceId { get; set; } /// - /// This is the plan for voice provider fallbacks in the event that the primary voice provider fails. + /// Additional properties received from the response, if any. /// - [JsonPropertyName("fallbackPlan")] - public FallbackPlan? FallbackPlan { get; set; } + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/NeetsVoiceIdEnum.cs b/src/Vapi.Net/Types/NeetsVoiceIdEnum.cs deleted file mode 100644 index bdbc791..0000000 --- a/src/Vapi.Net/Types/NeetsVoiceIdEnum.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using Vapi.Net.Core; - -namespace Vapi.Net; - -[JsonConverter(typeof(EnumSerializer))] -public enum NeetsVoiceIdEnum -{ - [EnumMember(Value = "vits")] - Vits, -} diff --git a/src/Vapi.Net/Types/NeuphonicCredential.cs b/src/Vapi.Net/Types/NeuphonicCredential.cs new file mode 100644 index 0000000..02cf2ce --- /dev/null +++ b/src/Vapi.Net/Types/NeuphonicCredential.cs @@ -0,0 +1,63 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record NeuphonicCredential +{ + [JsonPropertyName("provider")] + public string Provider { get; set; } = "neuphonic"; + + /// + /// This is not returned in the API. + /// + [JsonPropertyName("apiKey")] + public required string ApiKey { get; set; } + + /// + /// This is the unique identifier for the credential. + /// + [JsonPropertyName("id")] + public required string Id { get; set; } + + /// + /// This is the unique identifier for the org that this credential belongs to. + /// + [JsonPropertyName("orgId")] + public required string OrgId { get; set; } + + /// + /// This is the ISO 8601 date-time string of when the credential was created. + /// + [JsonPropertyName("createdAt")] + public required DateTime CreatedAt { get; set; } + + /// + /// This is the ISO 8601 date-time string of when the assistant was last updated. + /// + [JsonPropertyName("updatedAt")] + public required DateTime UpdatedAt { get; set; } + + /// + /// This is the name of credential. This is just for your reference. + /// + [JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/NeuphonicVoice.cs b/src/Vapi.Net/Types/NeuphonicVoice.cs new file mode 100644 index 0000000..b9ff9de --- /dev/null +++ b/src/Vapi.Net/Types/NeuphonicVoice.cs @@ -0,0 +1,60 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record NeuphonicVoice +{ + /// + /// This is the provider-specific ID that will be used. + /// + [JsonPropertyName("voiceId")] + public required string VoiceId { get; set; } + + /// + /// This is the model that will be used. Defaults to 'neu_fast' if not specified. + /// + [JsonPropertyName("model")] + public NeuphonicVoiceModel? Model { get; set; } + + /// + /// This is the language (ISO 639-1) that is enforced for the model. + /// + [JsonPropertyName("language")] + public object Language { get; set; } = new Dictionary(); + + /// + /// This is the speed multiplier that will be used. + /// + [JsonPropertyName("speed")] + public double? Speed { get; set; } + + /// + /// This is the plan for chunking the model output before it is sent to the voice provider. + /// + [JsonPropertyName("chunkPlan")] + public ChunkPlan? ChunkPlan { get; set; } + + /// + /// This is the plan for voice provider fallbacks in the event that the primary voice provider fails. + /// + [JsonPropertyName("fallbackPlan")] + public FallbackPlan? FallbackPlan { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/NeuphonicVoiceModel.cs b/src/Vapi.Net/Types/NeuphonicVoiceModel.cs new file mode 100644 index 0000000..eb89898 --- /dev/null +++ b/src/Vapi.Net/Types/NeuphonicVoiceModel.cs @@ -0,0 +1,15 @@ +using System.Runtime.Serialization; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[JsonConverter(typeof(EnumSerializer))] +public enum NeuphonicVoiceModel +{ + [EnumMember(Value = "neu_hq")] + NeuHq, + + [EnumMember(Value = "neu_fast")] + NeuFast, +} diff --git a/src/Vapi.Net/Types/OAuth2AuthenticationPlan.cs b/src/Vapi.Net/Types/OAuth2AuthenticationPlan.cs index 99345bf..2d5c62a 100644 --- a/src/Vapi.Net/Types/OAuth2AuthenticationPlan.cs +++ b/src/Vapi.Net/Types/OAuth2AuthenticationPlan.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -26,6 +27,23 @@ public record OAuth2AuthenticationPlan [JsonPropertyName("clientSecret")] public required string ClientSecret { get; set; } + /// + /// This is the scope of the OAuth2 token. + /// + [JsonPropertyName("scope")] + public string? Scope { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/Oauth2AuthenticationSession.cs b/src/Vapi.Net/Types/Oauth2AuthenticationSession.cs index 63f0d40..a9e8203 100644 --- a/src/Vapi.Net/Types/Oauth2AuthenticationSession.cs +++ b/src/Vapi.Net/Types/Oauth2AuthenticationSession.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -17,6 +18,17 @@ public record Oauth2AuthenticationSession [JsonPropertyName("expiresAt")] public DateTime? ExpiresAt { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/OpenAiCredential.cs b/src/Vapi.Net/Types/OpenAiCredential.cs index 6683ec7..fae894e 100644 --- a/src/Vapi.Net/Types/OpenAiCredential.cs +++ b/src/Vapi.Net/Types/OpenAiCredential.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -44,6 +45,17 @@ public record OpenAiCredential [JsonPropertyName("name")] public string? Name { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/OpenAiFunction.cs b/src/Vapi.Net/Types/OpenAiFunction.cs index efb5432..b436c5f 100644 --- a/src/Vapi.Net/Types/OpenAiFunction.cs +++ b/src/Vapi.Net/Types/OpenAiFunction.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -37,6 +38,17 @@ public record OpenAiFunction [JsonPropertyName("parameters")] public OpenAiFunctionParameters? Parameters { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/OpenAiFunctionParameters.cs b/src/Vapi.Net/Types/OpenAiFunctionParameters.cs index 55198c7..71002ff 100644 --- a/src/Vapi.Net/Types/OpenAiFunctionParameters.cs +++ b/src/Vapi.Net/Types/OpenAiFunctionParameters.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -26,6 +27,17 @@ public record OpenAiFunctionParameters [JsonPropertyName("required")] public IEnumerable? Required { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/OpenAiMessage.cs b/src/Vapi.Net/Types/OpenAiMessage.cs index bee7d3e..230fa36 100644 --- a/src/Vapi.Net/Types/OpenAiMessage.cs +++ b/src/Vapi.Net/Types/OpenAiMessage.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -11,6 +12,17 @@ public record OpenAiMessage [JsonPropertyName("role")] public required OpenAiMessageRole Role { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/OpenAiModel.cs b/src/Vapi.Net/Types/OpenAiModel.cs index db97e2f..d3b8a6a 100644 --- a/src/Vapi.Net/Types/OpenAiModel.cs +++ b/src/Vapi.Net/Types/OpenAiModel.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -83,6 +84,17 @@ public record OpenAiModel [JsonPropertyName("numFastTurns")] public double? NumFastTurns { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/OpenAiModelFallbackModelsItem.cs b/src/Vapi.Net/Types/OpenAiModelFallbackModelsItem.cs index 12c6df0..c34ad69 100644 --- a/src/Vapi.Net/Types/OpenAiModelFallbackModelsItem.cs +++ b/src/Vapi.Net/Types/OpenAiModelFallbackModelsItem.cs @@ -7,6 +7,18 @@ namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] public enum OpenAiModelFallbackModelsItem { + [EnumMember(Value = "gpt-4.1")] + Gpt41, + + [EnumMember(Value = "gpt-4.1-mini")] + Gpt41Mini, + + [EnumMember(Value = "gpt-4.1-nano")] + Gpt41Nano, + + [EnumMember(Value = "gpt-4.5-preview")] + Gpt45Preview, + [EnumMember(Value = "chatgpt-4o-latest")] Chatgpt4OLatest, @@ -34,12 +46,12 @@ public enum OpenAiModelFallbackModelsItem [EnumMember(Value = "gpt-4o-mini-realtime-preview-2024-12-17")] Gpt4OMiniRealtimePreview20241217, - [EnumMember(Value = "gpt-4o-mini")] - Gpt4OMini, - [EnumMember(Value = "gpt-4o-mini-2024-07-18")] Gpt4OMini20240718, + [EnumMember(Value = "gpt-4o-mini")] + Gpt4OMini, + [EnumMember(Value = "gpt-4o")] Gpt4O, diff --git a/src/Vapi.Net/Types/OpenAiModelModel.cs b/src/Vapi.Net/Types/OpenAiModelModel.cs index 87618cc..95e165d 100644 --- a/src/Vapi.Net/Types/OpenAiModelModel.cs +++ b/src/Vapi.Net/Types/OpenAiModelModel.cs @@ -7,6 +7,18 @@ namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] public enum OpenAiModelModel { + [EnumMember(Value = "gpt-4.1")] + Gpt41, + + [EnumMember(Value = "gpt-4.1-mini")] + Gpt41Mini, + + [EnumMember(Value = "gpt-4.1-nano")] + Gpt41Nano, + + [EnumMember(Value = "gpt-4.5-preview")] + Gpt45Preview, + [EnumMember(Value = "chatgpt-4o-latest")] Chatgpt4OLatest, @@ -34,12 +46,12 @@ public enum OpenAiModelModel [EnumMember(Value = "gpt-4o-mini-realtime-preview-2024-12-17")] Gpt4OMiniRealtimePreview20241217, - [EnumMember(Value = "gpt-4o-mini")] - Gpt4OMini, - [EnumMember(Value = "gpt-4o-mini-2024-07-18")] Gpt4OMini20240718, + [EnumMember(Value = "gpt-4o-mini")] + Gpt4OMini, + [EnumMember(Value = "gpt-4o")] Gpt4O, diff --git a/src/Vapi.Net/Types/OpenAiTranscriber.cs b/src/Vapi.Net/Types/OpenAiTranscriber.cs new file mode 100644 index 0000000..3f2a2cf --- /dev/null +++ b/src/Vapi.Net/Types/OpenAiTranscriber.cs @@ -0,0 +1,42 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record OpenAiTranscriber +{ + /// + /// This is the model that will be used for the transcription. + /// + [JsonPropertyName("model")] + public required OpenAiTranscriberModel Model { get; set; } + + /// + /// This is the language that will be set for the transcription. + /// + [JsonPropertyName("language")] + public OpenAiTranscriberLanguage? Language { get; set; } + + /// + /// This is the plan for voice provider fallbacks in the event that the primary voice provider fails. + /// + [JsonPropertyName("fallbackPlan")] + public FallbackTranscriberPlan? FallbackPlan { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/OpenAiTranscriberLanguage.cs b/src/Vapi.Net/Types/OpenAiTranscriberLanguage.cs new file mode 100644 index 0000000..6100b63 --- /dev/null +++ b/src/Vapi.Net/Types/OpenAiTranscriberLanguage.cs @@ -0,0 +1,180 @@ +using System.Runtime.Serialization; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[JsonConverter(typeof(EnumSerializer))] +public enum OpenAiTranscriberLanguage +{ + [EnumMember(Value = "af")] + Af, + + [EnumMember(Value = "ar")] + Ar, + + [EnumMember(Value = "hy")] + Hy, + + [EnumMember(Value = "az")] + Az, + + [EnumMember(Value = "be")] + Be, + + [EnumMember(Value = "bs")] + Bs, + + [EnumMember(Value = "bg")] + Bg, + + [EnumMember(Value = "ca")] + Ca, + + [EnumMember(Value = "zh")] + Zh, + + [EnumMember(Value = "hr")] + Hr, + + [EnumMember(Value = "cs")] + Cs, + + [EnumMember(Value = "da")] + Da, + + [EnumMember(Value = "nl")] + Nl, + + [EnumMember(Value = "en")] + En, + + [EnumMember(Value = "et")] + Et, + + [EnumMember(Value = "fi")] + Fi, + + [EnumMember(Value = "fr")] + Fr, + + [EnumMember(Value = "gl")] + Gl, + + [EnumMember(Value = "de")] + De, + + [EnumMember(Value = "el")] + El, + + [EnumMember(Value = "he")] + He, + + [EnumMember(Value = "hi")] + Hi, + + [EnumMember(Value = "hu")] + Hu, + + [EnumMember(Value = "is")] + Is, + + [EnumMember(Value = "id")] + Id, + + [EnumMember(Value = "it")] + It, + + [EnumMember(Value = "ja")] + Ja, + + [EnumMember(Value = "kn")] + Kn, + + [EnumMember(Value = "kk")] + Kk, + + [EnumMember(Value = "ko")] + Ko, + + [EnumMember(Value = "lv")] + Lv, + + [EnumMember(Value = "lt")] + Lt, + + [EnumMember(Value = "mk")] + Mk, + + [EnumMember(Value = "ms")] + Ms, + + [EnumMember(Value = "mr")] + Mr, + + [EnumMember(Value = "mi")] + Mi, + + [EnumMember(Value = "ne")] + Ne, + + [EnumMember(Value = "no")] + No, + + [EnumMember(Value = "fa")] + Fa, + + [EnumMember(Value = "pl")] + Pl, + + [EnumMember(Value = "pt")] + Pt, + + [EnumMember(Value = "ro")] + Ro, + + [EnumMember(Value = "ru")] + Ru, + + [EnumMember(Value = "sr")] + Sr, + + [EnumMember(Value = "sk")] + Sk, + + [EnumMember(Value = "sl")] + Sl, + + [EnumMember(Value = "es")] + Es, + + [EnumMember(Value = "sw")] + Sw, + + [EnumMember(Value = "sv")] + Sv, + + [EnumMember(Value = "tl")] + Tl, + + [EnumMember(Value = "ta")] + Ta, + + [EnumMember(Value = "th")] + Th, + + [EnumMember(Value = "tr")] + Tr, + + [EnumMember(Value = "uk")] + Uk, + + [EnumMember(Value = "ur")] + Ur, + + [EnumMember(Value = "vi")] + Vi, + + [EnumMember(Value = "cy")] + Cy, +} diff --git a/src/Vapi.Net/Types/OpenAiTranscriberModel.cs b/src/Vapi.Net/Types/OpenAiTranscriberModel.cs new file mode 100644 index 0000000..7da8411 --- /dev/null +++ b/src/Vapi.Net/Types/OpenAiTranscriberModel.cs @@ -0,0 +1,15 @@ +using System.Runtime.Serialization; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[JsonConverter(typeof(EnumSerializer))] +public enum OpenAiTranscriberModel +{ + [EnumMember(Value = "gpt-4o-transcribe")] + Gpt4OTranscribe, + + [EnumMember(Value = "gpt-4o-mini-transcribe")] + Gpt4OMiniTranscribe, +} diff --git a/src/Vapi.Net/Types/OpenAiVoice.cs b/src/Vapi.Net/Types/OpenAiVoice.cs index c7dc260..63ec597 100644 --- a/src/Vapi.Net/Types/OpenAiVoice.cs +++ b/src/Vapi.Net/Types/OpenAiVoice.cs @@ -1,4 +1,6 @@ +using System.Text.Json; using System.Text.Json.Serialization; +using OneOf; using Vapi.Net.Core; namespace Vapi.Net; @@ -10,7 +12,20 @@ public record OpenAiVoice /// Please note that ash, ballad, coral, sage, and verse may only be used with realtime models. /// [JsonPropertyName("voiceId")] - public required OpenAiVoiceId VoiceId { get; set; } + public required OneOf VoiceId { get; set; } + + /// + /// This is the model that will be used for text-to-speech. + /// + [JsonPropertyName("model")] + public OpenAiVoiceModel? Model { get; set; } + + /// + /// This is a prompt that allows you to control the voice of your generated audio. + /// Does not work with 'tts-1' or 'tts-1-hd' models. + /// + [JsonPropertyName("instructions")] + public string? Instructions { get; set; } /// /// This is the speed multiplier that will be used. @@ -30,6 +45,17 @@ public record OpenAiVoice [JsonPropertyName("fallbackPlan")] public FallbackPlan? FallbackPlan { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/FallbackOpenAiVoiceId.cs b/src/Vapi.Net/Types/OpenAiVoiceIdEnum.cs similarity index 54% rename from src/Vapi.Net/Types/FallbackOpenAiVoiceId.cs rename to src/Vapi.Net/Types/OpenAiVoiceIdEnum.cs index 863a67b..eaf2027 100644 --- a/src/Vapi.Net/Types/FallbackOpenAiVoiceId.cs +++ b/src/Vapi.Net/Types/OpenAiVoiceIdEnum.cs @@ -4,8 +4,8 @@ namespace Vapi.Net; -[JsonConverter(typeof(EnumSerializer))] -public enum FallbackOpenAiVoiceId +[JsonConverter(typeof(EnumSerializer))] +public enum OpenAiVoiceIdEnum { [EnumMember(Value = "alloy")] Alloy, @@ -24,19 +24,4 @@ public enum FallbackOpenAiVoiceId [EnumMember(Value = "shimmer")] Shimmer, - - [EnumMember(Value = "ash")] - Ash, - - [EnumMember(Value = "ballad")] - Ballad, - - [EnumMember(Value = "coral")] - Coral, - - [EnumMember(Value = "sage")] - Sage, - - [EnumMember(Value = "verse")] - Verse, } diff --git a/src/Vapi.Net/Types/OpenAiVoiceModel.cs b/src/Vapi.Net/Types/OpenAiVoiceModel.cs new file mode 100644 index 0000000..da6a7bc --- /dev/null +++ b/src/Vapi.Net/Types/OpenAiVoiceModel.cs @@ -0,0 +1,18 @@ +using System.Runtime.Serialization; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[JsonConverter(typeof(EnumSerializer))] +public enum OpenAiVoiceModel +{ + [EnumMember(Value = "tts-1")] + Tts1, + + [EnumMember(Value = "tts-1-hd")] + Tts1Hd, + + [EnumMember(Value = "gpt-4o-mini-tts")] + Gpt4OMiniTts, +} diff --git a/src/Vapi.Net/Types/OpenAiVoicemailDetectionPlan.cs b/src/Vapi.Net/Types/OpenAiVoicemailDetectionPlan.cs new file mode 100644 index 0000000..ad22b76 --- /dev/null +++ b/src/Vapi.Net/Types/OpenAiVoicemailDetectionPlan.cs @@ -0,0 +1,32 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record OpenAiVoicemailDetectionPlan +{ + /// + /// This is how long should we listen in order to determine if we were sent to voicemail or not? + /// + /// @default 15 + /// + [JsonPropertyName("voicemailExpectedDurationSeconds")] + public required double VoicemailExpectedDurationSeconds { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/OpenRouterCredential.cs b/src/Vapi.Net/Types/OpenRouterCredential.cs index 82974fd..eafe9be 100644 --- a/src/Vapi.Net/Types/OpenRouterCredential.cs +++ b/src/Vapi.Net/Types/OpenRouterCredential.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -44,6 +45,17 @@ public record OpenRouterCredential [JsonPropertyName("name")] public string? Name { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/OpenRouterModel.cs b/src/Vapi.Net/Types/OpenRouterModel.cs index 5f6faac..23d7e20 100644 --- a/src/Vapi.Net/Types/OpenRouterModel.cs +++ b/src/Vapi.Net/Types/OpenRouterModel.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -77,6 +78,17 @@ public record OpenRouterModel [JsonPropertyName("numFastTurns")] public double? NumFastTurns { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/Org.cs b/src/Vapi.Net/Types/Org.cs index 676abe8..027ccfb 100644 --- a/src/Vapi.Net/Types/Org.cs +++ b/src/Vapi.Net/Types/Org.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -112,6 +113,28 @@ public record Org [JsonPropertyName("concurrencyLimit")] public double? ConcurrencyLimit { get; set; } + /// + /// Stores the information about the compliance plan enforced at the organization level. Currently pciEnabled is supported through this field. + /// When this is enabled, any logs, recordings, or transcriptions will be shipped to the customer endpoints if provided else lost. + /// At the end of the call, you will receive an end-of-call-report message to store on your server, if webhook is provided. + /// Defaults to false. + /// When PCI is enabled, only PCI-compliant Providers will be available for LLM, Voice and transcribers. + /// This is due to the compliance requirements of PCI. Other providers may not meet these requirements. + /// + [JsonPropertyName("compliancePlan")] + public CompliancePlan? CompliancePlan { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/OrgPlan.cs b/src/Vapi.Net/Types/OrgPlan.cs index 84c6549..cab61bb 100644 --- a/src/Vapi.Net/Types/OrgPlan.cs +++ b/src/Vapi.Net/Types/OrgPlan.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -14,6 +15,17 @@ public record OrgPlan [JsonPropertyName("costPerOverageMinute")] public double? CostPerOverageMinute { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/OutputTool.cs b/src/Vapi.Net/Types/OutputTool.cs index 6c52246..509fc1e 100644 --- a/src/Vapi.Net/Types/OutputTool.cs +++ b/src/Vapi.Net/Types/OutputTool.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -69,6 +70,17 @@ public record OutputTool [JsonPropertyName("server")] public Server? Server { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/PaginationMeta.cs b/src/Vapi.Net/Types/PaginationMeta.cs index 1413435..05b54f7 100644 --- a/src/Vapi.Net/Types/PaginationMeta.cs +++ b/src/Vapi.Net/Types/PaginationMeta.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -14,6 +15,17 @@ public record PaginationMeta [JsonPropertyName("currentPage")] public required double CurrentPage { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/PerplexityAiCredential.cs b/src/Vapi.Net/Types/PerplexityAiCredential.cs index c6a8d0e..d395597 100644 --- a/src/Vapi.Net/Types/PerplexityAiCredential.cs +++ b/src/Vapi.Net/Types/PerplexityAiCredential.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -44,6 +45,17 @@ public record PerplexityAiCredential [JsonPropertyName("name")] public string? Name { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/PerplexityAiModel.cs b/src/Vapi.Net/Types/PerplexityAiModel.cs index 948196c..8c1616b 100644 --- a/src/Vapi.Net/Types/PerplexityAiModel.cs +++ b/src/Vapi.Net/Types/PerplexityAiModel.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -77,6 +78,17 @@ public record PerplexityAiModel [JsonPropertyName("numFastTurns")] public double? NumFastTurns { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/PhoneNumberHookCallRinging.cs b/src/Vapi.Net/Types/PhoneNumberHookCallRinging.cs new file mode 100644 index 0000000..edebc09 --- /dev/null +++ b/src/Vapi.Net/Types/PhoneNumberHookCallRinging.cs @@ -0,0 +1,37 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using OneOf; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record PhoneNumberHookCallRinging +{ + /// + /// This is the event to trigger the hook on + /// + [JsonPropertyName("on")] + public string On { get; set; } = "call.ringing"; + + /// + /// This is the set of actions to perform when the hook triggers + /// + [JsonPropertyName("do")] + public IEnumerable> Do { get; set; } = new List>(); + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/PhoneNumberPaginatedResponse.cs b/src/Vapi.Net/Types/PhoneNumberPaginatedResponse.cs index 1f1f522..a6efe23 100644 --- a/src/Vapi.Net/Types/PhoneNumberPaginatedResponse.cs +++ b/src/Vapi.Net/Types/PhoneNumberPaginatedResponse.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -17,6 +18,17 @@ public record PhoneNumberPaginatedResponse [JsonPropertyName("metadata")] public required PaginationMeta Metadata { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/PlayHtCredential.cs b/src/Vapi.Net/Types/PlayHtCredential.cs index c929440..543391f 100644 --- a/src/Vapi.Net/Types/PlayHtCredential.cs +++ b/src/Vapi.Net/Types/PlayHtCredential.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -47,6 +48,17 @@ public record PlayHtCredential [JsonPropertyName("userId")] public required string UserId { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/PlayHtVoice.cs b/src/Vapi.Net/Types/PlayHtVoice.cs index 8e561fc..a6c9ad6 100644 --- a/src/Vapi.Net/Types/PlayHtVoice.cs +++ b/src/Vapi.Net/Types/PlayHtVoice.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using OneOf; using Vapi.Net.Core; @@ -72,6 +73,17 @@ public record PlayHtVoice [JsonPropertyName("fallbackPlan")] public FallbackPlan? FallbackPlan { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/QueryTool.cs b/src/Vapi.Net/Types/QueryTool.cs new file mode 100644 index 0000000..fdd4a77 --- /dev/null +++ b/src/Vapi.Net/Types/QueryTool.cs @@ -0,0 +1,94 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record QueryTool +{ + /// + /// This determines if the tool is async. + /// + /// If async, the assistant will move forward without waiting for your server to respond. This is useful if you just want to trigger something on your server. + /// + /// If sync, the assistant will wait for your server to respond. This is useful if want assistant to respond with the result from your server. + /// + /// Defaults to synchronous (`false`). + /// + [JsonPropertyName("async")] + public bool? Async { get; set; } + + /// + /// These are the messages that will be spoken to the user as the tool is running. + /// + /// For some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured. + /// + [JsonPropertyName("messages")] + public IEnumerable? Messages { get; set; } + + /// + /// The knowledge bases to query + /// + [JsonPropertyName("knowledgeBases")] + public IEnumerable? KnowledgeBases { get; set; } + + /// + /// This is the unique identifier for the tool. + /// + [JsonPropertyName("id")] + public required string Id { get; set; } + + /// + /// This is the unique identifier for the organization that this tool belongs to. + /// + [JsonPropertyName("orgId")] + public required string OrgId { get; set; } + + /// + /// This is the ISO 8601 date-time string of when the tool was created. + /// + [JsonPropertyName("createdAt")] + public required DateTime CreatedAt { get; set; } + + /// + /// This is the ISO 8601 date-time string of when the tool was last updated. + /// + [JsonPropertyName("updatedAt")] + public required DateTime UpdatedAt { get; set; } + + /// + /// This is the function definition of the tool. + /// + /// For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + /// + /// An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + /// + [JsonPropertyName("function")] + public OpenAiFunction? Function { get; set; } + + /// + /// This is the server that will be hit when this tool is requested by the model. + /// + /// All requests will be sent with the call object among other things. You can find more details in the Server URL documentation. + /// + /// This overrides the serverUrl set on the org and the phoneNumber. Order of precedence: highest tool.server.url, then assistant.serverUrl, then phoneNumber.serverUrl, then org.serverUrl. + /// + [JsonPropertyName("server")] + public Server? Server { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/RegexOption.cs b/src/Vapi.Net/Types/RegexOption.cs index 82377dd..40e5dcf 100644 --- a/src/Vapi.Net/Types/RegexOption.cs +++ b/src/Vapi.Net/Types/RegexOption.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -22,6 +23,17 @@ public record RegexOption [JsonPropertyName("enabled")] public required bool Enabled { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/RegexReplacement.cs b/src/Vapi.Net/Types/RegexReplacement.cs index e1938c2..1743c26 100644 --- a/src/Vapi.Net/Types/RegexReplacement.cs +++ b/src/Vapi.Net/Types/RegexReplacement.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -31,6 +32,17 @@ public record RegexReplacement [JsonPropertyName("value")] public required string Value { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/RimeAiCredential.cs b/src/Vapi.Net/Types/RimeAiCredential.cs index 96e12ff..c475ba0 100644 --- a/src/Vapi.Net/Types/RimeAiCredential.cs +++ b/src/Vapi.Net/Types/RimeAiCredential.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -44,6 +45,17 @@ public record RimeAiCredential [JsonPropertyName("name")] public string? Name { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/RimeAiVoice.cs b/src/Vapi.Net/Types/RimeAiVoice.cs index 312f0e5..0cf7122 100644 --- a/src/Vapi.Net/Types/RimeAiVoice.cs +++ b/src/Vapi.Net/Types/RimeAiVoice.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using OneOf; using Vapi.Net.Core; @@ -24,6 +25,30 @@ public record RimeAiVoice [JsonPropertyName("speed")] public double? Speed { get; set; } + /// + /// This is a flag that controls whether to add slight pauses using angle brackets. Example: “Hi. <200> I’d love to have a conversation with you.” adds a 200ms pause between the first and second sentences. + /// + [JsonPropertyName("pauseBetweenBrackets")] + public bool? PauseBetweenBrackets { get; set; } + + /// + /// This is a flag that controls whether text inside brackets should be phonemized (converted to phonetic pronunciation) - Example: "{h'El.o} World" will pronounce "Hello" as expected. + /// + [JsonPropertyName("phonemizeBetweenBrackets")] + public bool? PhonemizeBetweenBrackets { get; set; } + + /// + /// This is a flag that controls whether to optimize for reduced latency in streaming. https://docs.rime.ai/api-reference/endpoint/websockets#param-reduce-latency + /// + [JsonPropertyName("reduceLatency")] + public bool? ReduceLatency { get; set; } + + /// + /// This is a string that allows inline speed control using alpha notation. https://docs.rime.ai/api-reference/endpoint/websockets#param-inline-speed-alpha + /// + [JsonPropertyName("inlineSpeedAlpha")] + public string? InlineSpeedAlpha { get; set; } + /// /// This is the plan for chunking the model output before it is sent to the voice provider. /// @@ -36,6 +61,17 @@ public record RimeAiVoice [JsonPropertyName("fallbackPlan")] public FallbackPlan? FallbackPlan { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/RuleBasedCondition.cs b/src/Vapi.Net/Types/RuleBasedCondition.cs deleted file mode 100644 index b124abb..0000000 --- a/src/Vapi.Net/Types/RuleBasedCondition.cs +++ /dev/null @@ -1,78 +0,0 @@ -using System.Text.Json.Serialization; -using Vapi.Net.Core; - -namespace Vapi.Net; - -public record RuleBasedCondition -{ - /// - /// This is the operator you want to use to compare the left side and right side. - /// - /// The operation becomes `(leftSide) operator (rightSide)`. - /// - [JsonPropertyName("operator")] - public required RuleBasedConditionOperator Operator { get; set; } - - /// - /// This is the left side of the operation. - /// - /// You can reference any variable in the context of the current block execution (step): - /// - "{{output.your-property-name}}" for current step's output - /// - "{{input.your-property-name}}" for current step's input - /// - "{{your-step-name.output.your-property-name}}" for another step's output (in the same workflow; read caveat #1) - /// - "{{your-step-name.input.your-property-name}}" for another step's input (in the same workflow; read caveat #1) - /// - "{{your-block-name.output.your-property-name}}" for another block's output (in the same workflow; read caveat #2) - /// - "{{your-block-name.input.your-property-name}}" for another block's input (in the same workflow; read caveat #2) - /// - "{{workflow.input.your-property-name}}" for the current workflow's input - /// - "{{global.your-property-name}}" for the global context - /// - /// Or, you can use a constant: - /// - "1" - /// - "text" - /// - "true" - /// - "false" - /// - /// Or, you can mix and match with string interpolation: - /// - "{{your-property-name}}-{{input.your-property-name-2}}-1" - /// - /// Caveats: - /// 1. a workflow can execute a step multiple times. example, if a loop is used in the graph. {{stepName.input/output.propertyName}} will reference the latest usage of the step. - /// 2. a workflow can execute a block multiple times. example, if a step is called multiple times or if a block is used in multiple steps. {{blockName.input/output.propertyName}} will reference the latest usage of the block. this liquid variable is just provided for convenience when creating blocks outside of a workflow with steps. - /// - [JsonPropertyName("leftSide")] - public required string LeftSide { get; set; } - - /// - /// This is the right side of the operation. - /// - /// You can reference any variable in the context of the current block execution (step): - /// - "{{output.your-property-name}}" for current step's output - /// - "{{input.your-property-name}}" for current step's input - /// - "{{your-step-name.output.your-property-name}}" for another step's output (in the same workflow; read caveat #1) - /// - "{{your-step-name.input.your-property-name}}" for another step's input (in the same workflow; read caveat #1) - /// - "{{your-block-name.output.your-property-name}}" for another block's output (in the same workflow; read caveat #2) - /// - "{{your-block-name.input.your-property-name}}" for another block's input (in the same workflow; read caveat #2) - /// - "{{workflow.input.your-property-name}}" for the current workflow's input - /// - "{{global.your-property-name}}" for the global context - /// - /// Or, you can use a constant: - /// - "1" - /// - "text" - /// - "true" - /// - "false" - /// - /// Or, you can mix and match with string interpolation: - /// - "{{your-property-name}}-{{input.your-property-name-2}}-1" - /// - /// Caveats: - /// 1. a workflow can execute a step multiple times. example, if a loop is used in the graph. {{stepName.input/output.propertyName}} will reference the latest usage of the step. - /// 2. a workflow can execute a block multiple times. example, if a step is called multiple times or if a block is used in multiple steps. {{blockName.input/output.propertyName}} will reference the latest usage of the block. this liquid variable is just provided for convenience when creating blocks outside of a workflow with steps. - /// - [JsonPropertyName("rightSide")] - public required string RightSide { get; set; } - - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Vapi.Net/Types/RuleBasedConditionOperator.cs b/src/Vapi.Net/Types/RuleBasedConditionOperator.cs deleted file mode 100644 index 51322ae..0000000 --- a/src/Vapi.Net/Types/RuleBasedConditionOperator.cs +++ /dev/null @@ -1,27 +0,0 @@ -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using Vapi.Net.Core; - -namespace Vapi.Net; - -[JsonConverter(typeof(EnumSerializer))] -public enum RuleBasedConditionOperator -{ - [EnumMember(Value = "eq")] - Eq, - - [EnumMember(Value = "neq")] - Neq, - - [EnumMember(Value = "gt")] - Gt, - - [EnumMember(Value = "gte")] - Gte, - - [EnumMember(Value = "lt")] - Lt, - - [EnumMember(Value = "lte")] - Lte, -} diff --git a/src/Vapi.Net/Types/RunpodCredential.cs b/src/Vapi.Net/Types/RunpodCredential.cs index 0391d8e..d730c22 100644 --- a/src/Vapi.Net/Types/RunpodCredential.cs +++ b/src/Vapi.Net/Types/RunpodCredential.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -44,6 +45,17 @@ public record RunpodCredential [JsonPropertyName("name")] public string? Name { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/S3Credential.cs b/src/Vapi.Net/Types/S3Credential.cs index 1cdf0cd..eae4d96 100644 --- a/src/Vapi.Net/Types/S3Credential.cs +++ b/src/Vapi.Net/Types/S3Credential.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -71,6 +72,17 @@ public record S3Credential [JsonPropertyName("name")] public string? Name { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/Say.cs b/src/Vapi.Net/Types/Say.cs index 411114f..011d35f 100644 --- a/src/Vapi.Net/Types/Say.cs +++ b/src/Vapi.Net/Types/Say.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -20,6 +21,17 @@ public record Say [JsonPropertyName("metadata")] public object? Metadata { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/SayHook.cs b/src/Vapi.Net/Types/SayHook.cs index 3a87fb9..2524c4e 100644 --- a/src/Vapi.Net/Types/SayHook.cs +++ b/src/Vapi.Net/Types/SayHook.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -20,6 +21,17 @@ public record SayHook [JsonPropertyName("prompt")] public string? Prompt { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/SbcConfiguration.cs b/src/Vapi.Net/Types/SbcConfiguration.cs index 18ca377..76be93d 100644 --- a/src/Vapi.Net/Types/SbcConfiguration.cs +++ b/src/Vapi.Net/Types/SbcConfiguration.cs @@ -1,9 +1,22 @@ +using System.Text.Json; +using System.Text.Json.Serialization; using Vapi.Net.Core; namespace Vapi.Net; public record SbcConfiguration { + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/SchedulePlan.cs b/src/Vapi.Net/Types/SchedulePlan.cs new file mode 100644 index 0000000..c8e1f0c --- /dev/null +++ b/src/Vapi.Net/Types/SchedulePlan.cs @@ -0,0 +1,36 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record SchedulePlan +{ + /// + /// This is the ISO 8601 date-time string of the earliest time the call can be scheduled. + /// + [JsonPropertyName("earliestAt")] + public required DateTime EarliestAt { get; set; } + + /// + /// This is the ISO 8601 date-time string of the latest time the call can be scheduled. + /// + [JsonPropertyName("latestAt")] + public DateTime? LatestAt { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/Server.cs b/src/Vapi.Net/Types/Server.cs index e410508..ac9c644 100644 --- a/src/Vapi.Net/Types/Server.cs +++ b/src/Vapi.Net/Types/Server.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -41,6 +42,17 @@ public record Server [JsonPropertyName("backoffPlan")] public BackoffPlan? BackoffPlan { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/ServerMessage.cs b/src/Vapi.Net/Types/ServerMessage.cs index 0e69732..9327975 100644 --- a/src/Vapi.Net/Types/ServerMessage.cs +++ b/src/Vapi.Net/Types/ServerMessage.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using OneOf; using Vapi.Net.Core; @@ -37,6 +38,17 @@ public required OneOf< ServerMessageVoiceRequest > Message { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/ServerMessageAssistantRequest.cs b/src/Vapi.Net/Types/ServerMessageAssistantRequest.cs index 5af6852..2a72055 100644 --- a/src/Vapi.Net/Types/ServerMessageAssistantRequest.cs +++ b/src/Vapi.Net/Types/ServerMessageAssistantRequest.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -22,10 +23,10 @@ public record ServerMessageAssistantRequest public string Type { get; set; } = "assistant-request"; /// - /// This is the ISO-8601 formatted timestamp of when the message was sent. + /// This is the timestamp of when the message was sent in milliseconds since Unix Epoch. /// [JsonPropertyName("timestamp")] - public string? Timestamp { get; set; } + public double? Timestamp { get; set; } /// /// This is a live version of the `call.artifact`. @@ -69,6 +70,17 @@ public record ServerMessageAssistantRequest [JsonPropertyName("call")] public Call? Call { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/ServerMessageConversationUpdate.cs b/src/Vapi.Net/Types/ServerMessageConversationUpdate.cs index 7450030..db05a85 100644 --- a/src/Vapi.Net/Types/ServerMessageConversationUpdate.cs +++ b/src/Vapi.Net/Types/ServerMessageConversationUpdate.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using OneOf; using Vapi.Net.Core; @@ -38,10 +39,10 @@ public IEnumerable< new List(); /// - /// This is the ISO-8601 formatted timestamp of when the message was sent. + /// This is the timestamp of when the message was sent in milliseconds since Unix Epoch. /// [JsonPropertyName("timestamp")] - public string? Timestamp { get; set; } + public double? Timestamp { get; set; } /// /// This is a live version of the `call.artifact`. @@ -85,6 +86,17 @@ public IEnumerable< [JsonPropertyName("call")] public Call? Call { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/ServerMessageEndOfCallReport.cs b/src/Vapi.Net/Types/ServerMessageEndOfCallReport.cs index 5615d1a..45410d3 100644 --- a/src/Vapi.Net/Types/ServerMessageEndOfCallReport.cs +++ b/src/Vapi.Net/Types/ServerMessageEndOfCallReport.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -40,10 +41,10 @@ public record ServerMessageEndOfCallReport public IEnumerable? Costs { get; set; } /// - /// This is the ISO-8601 formatted timestamp of when the message was sent. + /// This is the timestamp of when the message was sent in milliseconds since Unix Epoch. /// [JsonPropertyName("timestamp")] - public string? Timestamp { get; set; } + public double? Timestamp { get; set; } /// /// These are the artifacts from the call. This can also be found at `call.artifact` on GET /call/:id. @@ -103,6 +104,17 @@ public record ServerMessageEndOfCallReport [JsonPropertyName("endedAt")] public DateTime? EndedAt { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/ServerMessageEndOfCallReportEndedReason.cs b/src/Vapi.Net/Types/ServerMessageEndOfCallReportEndedReason.cs index b607102..3bc7fdf 100644 --- a/src/Vapi.Net/Types/ServerMessageEndOfCallReportEndedReason.cs +++ b/src/Vapi.Net/Types/ServerMessageEndOfCallReportEndedReason.cs @@ -7,12 +7,6 @@ namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] public enum ServerMessageEndOfCallReportEndedReason { - [EnumMember(Value = "assistant-not-valid")] - AssistantNotValid, - - [EnumMember(Value = "assistant-not-provided")] - AssistantNotProvided, - [EnumMember(Value = "call-start-error-neither-assistant-nor-server-set")] CallStartErrorNeitherAssistantNorServerSet, @@ -34,54 +28,42 @@ public enum ServerMessageEndOfCallReportEndedReason [EnumMember(Value = "assistant-request-returned-forwarding-phone-number")] AssistantRequestReturnedForwardingPhoneNumber, - [EnumMember(Value = "assistant-ended-call")] - AssistantEndedCall, + [EnumMember(Value = "call.start.error-get-org")] + CallStartErrorGetOrg, - [EnumMember(Value = "assistant-said-end-call-phrase")] - AssistantSaidEndCallPhrase, + [EnumMember(Value = "call.start.error-get-subscription")] + CallStartErrorGetSubscription, - [EnumMember(Value = "assistant-ended-call-with-hangup-task")] - AssistantEndedCallWithHangupTask, + [EnumMember(Value = "call.start.error-get-assistant")] + CallStartErrorGetAssistant, - [EnumMember(Value = "assistant-forwarded-call")] - AssistantForwardedCall, - - [EnumMember(Value = "assistant-join-timed-out")] - AssistantJoinTimedOut, - - [EnumMember(Value = "customer-busy")] - CustomerBusy, - - [EnumMember(Value = "customer-ended-call")] - CustomerEndedCall, + [EnumMember(Value = "call.start.error-get-phone-number")] + CallStartErrorGetPhoneNumber, - [EnumMember(Value = "customer-did-not-answer")] - CustomerDidNotAnswer, + [EnumMember(Value = "call.start.error-get-customer")] + CallStartErrorGetCustomer, - [EnumMember(Value = "customer-did-not-give-microphone-permission")] - CustomerDidNotGiveMicrophonePermission, + [EnumMember(Value = "call.start.error-get-resources-validation")] + CallStartErrorGetResourcesValidation, - [EnumMember(Value = "assistant-said-message-with-end-call-enabled")] - AssistantSaidMessageWithEndCallEnabled, + [EnumMember(Value = "call.start.error-vapi-number-international")] + CallStartErrorVapiNumberInternational, - [EnumMember(Value = "exceeded-max-duration")] - ExceededMaxDuration, + [EnumMember(Value = "call.start.error-vapi-number-outbound-daily-limit")] + CallStartErrorVapiNumberOutboundDailyLimit, - [EnumMember(Value = "manually-canceled")] - ManuallyCanceled, + [EnumMember(Value = "call.start.error-get-transport")] + CallStartErrorGetTransport, - [EnumMember(Value = "phone-call-provider-closed-websocket")] - PhoneCallProviderClosedWebsocket, + [EnumMember(Value = "assistant-not-valid")] + AssistantNotValid, - [EnumMember(Value = "db-error")] - DbError, + [EnumMember(Value = "database-error")] + DatabaseError, [EnumMember(Value = "assistant-not-found")] AssistantNotFound, - [EnumMember(Value = "license-check-failed")] - LicenseCheckFailed, - [EnumMember(Value = "pipeline-error-openai-voice-failed")] PipelineErrorOpenaiVoiceFailed, @@ -106,32 +88,59 @@ public enum ServerMessageEndOfCallReportEndedReason [EnumMember(Value = "pipeline-error-rime-ai-voice-failed")] PipelineErrorRimeAiVoiceFailed, - [EnumMember(Value = "pipeline-error-neets-voice-failed")] - PipelineErrorNeetsVoiceFailed, - [EnumMember(Value = "pipeline-error-smallest-ai-voice-failed")] PipelineErrorSmallestAiVoiceFailed, [EnumMember(Value = "pipeline-error-neuphonic-voice-failed")] PipelineErrorNeuphonicVoiceFailed, - [EnumMember(Value = "pipeline-error-deepgram-transcriber-failed")] - PipelineErrorDeepgramTranscriberFailed, + [EnumMember(Value = "pipeline-error-hume-voice-failed")] + PipelineErrorHumeVoiceFailed, - [EnumMember(Value = "pipeline-error-gladia-transcriber-failed")] - PipelineErrorGladiaTranscriberFailed, + [EnumMember(Value = "pipeline-error-sesame-voice-failed")] + PipelineErrorSesameVoiceFailed, - [EnumMember(Value = "pipeline-error-speechmatics-transcriber-failed")] - PipelineErrorSpeechmaticsTranscriberFailed, + [EnumMember(Value = "pipeline-error-tavus-video-failed")] + PipelineErrorTavusVideoFailed, - [EnumMember(Value = "pipeline-error-assembly-ai-transcriber-failed")] - PipelineErrorAssemblyAiTranscriberFailed, + [EnumMember(Value = "call.in-progress.error-vapifault-openai-voice-failed")] + CallInProgressErrorVapifaultOpenaiVoiceFailed, - [EnumMember(Value = "pipeline-error-talkscriber-transcriber-failed")] - PipelineErrorTalkscriberTranscriberFailed, + [EnumMember(Value = "call.in-progress.error-vapifault-cartesia-voice-failed")] + CallInProgressErrorVapifaultCartesiaVoiceFailed, - [EnumMember(Value = "pipeline-error-azure-speech-transcriber-failed")] - PipelineErrorAzureSpeechTranscriberFailed, + [EnumMember(Value = "call.in-progress.error-vapifault-deepgram-voice-failed")] + CallInProgressErrorVapifaultDeepgramVoiceFailed, + + [EnumMember(Value = "call.in-progress.error-vapifault-eleven-labs-voice-failed")] + CallInProgressErrorVapifaultElevenLabsVoiceFailed, + + [EnumMember(Value = "call.in-progress.error-vapifault-playht-voice-failed")] + CallInProgressErrorVapifaultPlayhtVoiceFailed, + + [EnumMember(Value = "call.in-progress.error-vapifault-lmnt-voice-failed")] + CallInProgressErrorVapifaultLmntVoiceFailed, + + [EnumMember(Value = "call.in-progress.error-vapifault-azure-voice-failed")] + CallInProgressErrorVapifaultAzureVoiceFailed, + + [EnumMember(Value = "call.in-progress.error-vapifault-rime-ai-voice-failed")] + CallInProgressErrorVapifaultRimeAiVoiceFailed, + + [EnumMember(Value = "call.in-progress.error-vapifault-smallest-ai-voice-failed")] + CallInProgressErrorVapifaultSmallestAiVoiceFailed, + + [EnumMember(Value = "call.in-progress.error-vapifault-neuphonic-voice-failed")] + CallInProgressErrorVapifaultNeuphonicVoiceFailed, + + [EnumMember(Value = "call.in-progress.error-vapifault-hume-voice-failed")] + CallInProgressErrorVapifaultHumeVoiceFailed, + + [EnumMember(Value = "call.in-progress.error-vapifault-sesame-voice-failed")] + CallInProgressErrorVapifaultSesameVoiceFailed, + + [EnumMember(Value = "call.in-progress.error-vapifault-tavus-video-failed")] + CallInProgressErrorVapifaultTavusVideoFailed, [EnumMember(Value = "pipeline-error-vapi-llm-failed")] PipelineErrorVapiLlmFailed, @@ -151,8 +160,108 @@ public enum ServerMessageEndOfCallReportEndedReason [EnumMember(Value = "pipeline-error-vapi-500-server-error")] PipelineErrorVapi500ServerError, - [EnumMember(Value = "pipeline-no-available-model")] - PipelineNoAvailableModel, + [EnumMember(Value = "pipeline-error-vapi-503-server-overloaded-error")] + PipelineErrorVapi503ServerOverloadedError, + + [EnumMember(Value = "call.in-progress.error-vapifault-vapi-llm-failed")] + CallInProgressErrorVapifaultVapiLlmFailed, + + [EnumMember(Value = "call.in-progress.error-vapifault-vapi-400-bad-request-validation-failed")] + CallInProgressErrorVapifaultVapi400BadRequestValidationFailed, + + [EnumMember(Value = "call.in-progress.error-vapifault-vapi-401-unauthorized")] + CallInProgressErrorVapifaultVapi401Unauthorized, + + [EnumMember(Value = "call.in-progress.error-vapifault-vapi-403-model-access-denied")] + CallInProgressErrorVapifaultVapi403ModelAccessDenied, + + [EnumMember(Value = "call.in-progress.error-vapifault-vapi-429-exceeded-quota")] + CallInProgressErrorVapifaultVapi429ExceededQuota, + + [EnumMember(Value = "call.in-progress.error-providerfault-vapi-500-server-error")] + CallInProgressErrorProviderfaultVapi500ServerError, + + [EnumMember(Value = "call.in-progress.error-providerfault-vapi-503-server-overloaded-error")] + CallInProgressErrorProviderfaultVapi503ServerOverloadedError, + + [EnumMember(Value = "pipeline-error-deepgram-transcriber-failed")] + PipelineErrorDeepgramTranscriberFailed, + + [EnumMember(Value = "call.in-progress.error-vapifault-deepgram-transcriber-failed")] + CallInProgressErrorVapifaultDeepgramTranscriberFailed, + + [EnumMember(Value = "pipeline-error-gladia-transcriber-failed")] + PipelineErrorGladiaTranscriberFailed, + + [EnumMember(Value = "call.in-progress.error-vapifault-gladia-transcriber-failed")] + CallInProgressErrorVapifaultGladiaTranscriberFailed, + + [EnumMember(Value = "pipeline-error-speechmatics-transcriber-failed")] + PipelineErrorSpeechmaticsTranscriberFailed, + + [EnumMember(Value = "call.in-progress.error-vapifault-speechmatics-transcriber-failed")] + CallInProgressErrorVapifaultSpeechmaticsTranscriberFailed, + + [EnumMember(Value = "pipeline-error-assembly-ai-transcriber-failed")] + PipelineErrorAssemblyAiTranscriberFailed, + + [EnumMember(Value = "pipeline-error-assembly-ai-returning-400-insufficent-funds")] + PipelineErrorAssemblyAiReturning400InsufficentFunds, + + [EnumMember(Value = "pipeline-error-assembly-ai-returning-400-paid-only-feature")] + PipelineErrorAssemblyAiReturning400PaidOnlyFeature, + + [EnumMember(Value = "pipeline-error-assembly-ai-returning-401-invalid-credentials")] + PipelineErrorAssemblyAiReturning401InvalidCredentials, + + [EnumMember(Value = "pipeline-error-assembly-ai-returning-500-invalid-schema")] + PipelineErrorAssemblyAiReturning500InvalidSchema, + + [EnumMember(Value = "pipeline-error-assembly-ai-returning-500-word-boost-parsing-failed")] + PipelineErrorAssemblyAiReturning500WordBoostParsingFailed, + + [EnumMember(Value = "call.in-progress.error-vapifault-assembly-ai-transcriber-failed")] + CallInProgressErrorVapifaultAssemblyAiTranscriberFailed, + + [EnumMember( + Value = "call.in-progress.error-vapifault-assembly-ai-returning-400-insufficent-funds" + )] + CallInProgressErrorVapifaultAssemblyAiReturning400InsufficentFunds, + + [EnumMember( + Value = "call.in-progress.error-vapifault-assembly-ai-returning-400-paid-only-feature" + )] + CallInProgressErrorVapifaultAssemblyAiReturning400PaidOnlyFeature, + + [EnumMember( + Value = "call.in-progress.error-vapifault-assembly-ai-returning-401-invalid-credentials" + )] + CallInProgressErrorVapifaultAssemblyAiReturning401InvalidCredentials, + + [EnumMember( + Value = "call.in-progress.error-vapifault-assembly-ai-returning-500-invalid-schema" + )] + CallInProgressErrorVapifaultAssemblyAiReturning500InvalidSchema, + + [EnumMember( + Value = "call.in-progress.error-vapifault-assembly-ai-returning-500-word-boost-parsing-failed" + )] + CallInProgressErrorVapifaultAssemblyAiReturning500WordBoostParsingFailed, + + [EnumMember(Value = "pipeline-error-talkscriber-transcriber-failed")] + PipelineErrorTalkscriberTranscriberFailed, + + [EnumMember(Value = "call.in-progress.error-vapifault-talkscriber-transcriber-failed")] + CallInProgressErrorVapifaultTalkscriberTranscriberFailed, + + [EnumMember(Value = "pipeline-error-azure-speech-transcriber-failed")] + PipelineErrorAzureSpeechTranscriberFailed, + + [EnumMember(Value = "call.in-progress.error-vapifault-azure-speech-transcriber-failed")] + CallInProgressErrorVapifaultAzureSpeechTranscriberFailed, + + [EnumMember(Value = "call.in-progress.error-pipeline-no-available-llm-model")] + CallInProgressErrorPipelineNoAvailableLlmModel, [EnumMember(Value = "worker-shutdown")] WorkerShutdown, @@ -166,56 +275,49 @@ public enum ServerMessageEndOfCallReportEndedReason [EnumMember(Value = "vonage-failed-to-connect-call")] VonageFailedToConnectCall, + [EnumMember(Value = "vonage-completed")] + VonageCompleted, + [EnumMember(Value = "phone-call-provider-bypass-enabled-but-no-call-received")] PhoneCallProviderBypassEnabledButNoCallReceived, - [EnumMember(Value = "vapifault-phone-call-worker-setup-socket-error")] - VapifaultPhoneCallWorkerSetupSocketError, - - [EnumMember(Value = "vapifault-phone-call-worker-worker-setup-socket-timeout")] - VapifaultPhoneCallWorkerWorkerSetupSocketTimeout, - - [EnumMember(Value = "vapifault-phone-call-worker-could-not-find-call")] - VapifaultPhoneCallWorkerCouldNotFindCall, - - [EnumMember(Value = "vapifault-transport-never-connected")] - VapifaultTransportNeverConnected, - - [EnumMember(Value = "vapifault-web-call-worker-setup-failed")] - VapifaultWebCallWorkerSetupFailed, + [EnumMember(Value = "call.in-progress.error-vapifault-transport-never-connected")] + CallInProgressErrorVapifaultTransportNeverConnected, - [EnumMember(Value = "vapifault-transport-connected-but-call-not-active")] - VapifaultTransportConnectedButCallNotActive, + [EnumMember(Value = "call.in-progress.error-vapifault-transport-connected-but-call-not-active")] + CallInProgressErrorVapifaultTransportConnectedButCallNotActive, - [EnumMember(Value = "vapifault-call-started-but-connection-to-transport-missing")] - VapifaultCallStartedButConnectionToTransportMissing, + [EnumMember( + Value = "call.in-progress.error-vapifault-call-started-but-connection-to-transport-missing" + )] + CallInProgressErrorVapifaultCallStartedButConnectionToTransportMissing, - [EnumMember(Value = "pipeline-error-openai-llm-failed")] - PipelineErrorOpenaiLlmFailed, + [EnumMember(Value = "call.in-progress.error-vapifault-openai-llm-failed")] + CallInProgressErrorVapifaultOpenaiLlmFailed, - [EnumMember(Value = "pipeline-error-azure-openai-llm-failed")] - PipelineErrorAzureOpenaiLlmFailed, + [EnumMember(Value = "call.in-progress.error-vapifault-azure-openai-llm-failed")] + CallInProgressErrorVapifaultAzureOpenaiLlmFailed, - [EnumMember(Value = "pipeline-error-groq-llm-failed")] - PipelineErrorGroqLlmFailed, + [EnumMember(Value = "call.in-progress.error-vapifault-groq-llm-failed")] + CallInProgressErrorVapifaultGroqLlmFailed, - [EnumMember(Value = "pipeline-error-google-llm-failed")] - PipelineErrorGoogleLlmFailed, + [EnumMember(Value = "call.in-progress.error-vapifault-google-llm-failed")] + CallInProgressErrorVapifaultGoogleLlmFailed, - [EnumMember(Value = "pipeline-error-xai-llm-failed")] - PipelineErrorXaiLlmFailed, + [EnumMember(Value = "call.in-progress.error-vapifault-xai-llm-failed")] + CallInProgressErrorVapifaultXaiLlmFailed, - [EnumMember(Value = "pipeline-error-mistral-llm-failed")] - PipelineErrorMistralLlmFailed, + [EnumMember(Value = "call.in-progress.error-vapifault-mistral-llm-failed")] + CallInProgressErrorVapifaultMistralLlmFailed, - [EnumMember(Value = "pipeline-error-inflection-ai-llm-failed")] - PipelineErrorInflectionAiLlmFailed, + [EnumMember(Value = "call.in-progress.error-vapifault-inflection-ai-llm-failed")] + CallInProgressErrorVapifaultInflectionAiLlmFailed, - [EnumMember(Value = "pipeline-error-cerebras-llm-failed")] - PipelineErrorCerebrasLlmFailed, + [EnumMember(Value = "call.in-progress.error-vapifault-cerebras-llm-failed")] + CallInProgressErrorVapifaultCerebrasLlmFailed, - [EnumMember(Value = "pipeline-error-deep-seek-llm-failed")] - PipelineErrorDeepSeekLlmFailed, + [EnumMember(Value = "call.in-progress.error-vapifault-deep-seek-llm-failed")] + CallInProgressErrorVapifaultDeepSeekLlmFailed, [EnumMember(Value = "pipeline-error-openai-400-bad-request-validation-failed")] PipelineErrorOpenai400BadRequestValidationFailed, @@ -223,15 +325,102 @@ public enum ServerMessageEndOfCallReportEndedReason [EnumMember(Value = "pipeline-error-openai-401-unauthorized")] PipelineErrorOpenai401Unauthorized, + [EnumMember(Value = "pipeline-error-openai-401-incorrect-api-key")] + PipelineErrorOpenai401IncorrectApiKey, + + [EnumMember(Value = "pipeline-error-openai-401-account-not-in-organization")] + PipelineErrorOpenai401AccountNotInOrganization, + [EnumMember(Value = "pipeline-error-openai-403-model-access-denied")] PipelineErrorOpenai403ModelAccessDenied, [EnumMember(Value = "pipeline-error-openai-429-exceeded-quota")] PipelineErrorOpenai429ExceededQuota, + [EnumMember(Value = "pipeline-error-openai-429-rate-limit-reached")] + PipelineErrorOpenai429RateLimitReached, + [EnumMember(Value = "pipeline-error-openai-500-server-error")] PipelineErrorOpenai500ServerError, + [EnumMember(Value = "pipeline-error-openai-503-server-overloaded-error")] + PipelineErrorOpenai503ServerOverloadedError, + + [EnumMember(Value = "pipeline-error-openai-llm-failed")] + PipelineErrorOpenaiLlmFailed, + + [EnumMember( + Value = "call.in-progress.error-vapifault-openai-400-bad-request-validation-failed" + )] + CallInProgressErrorVapifaultOpenai400BadRequestValidationFailed, + + [EnumMember(Value = "call.in-progress.error-vapifault-openai-401-unauthorized")] + CallInProgressErrorVapifaultOpenai401Unauthorized, + + [EnumMember(Value = "call.in-progress.error-vapifault-openai-401-incorrect-api-key")] + CallInProgressErrorVapifaultOpenai401IncorrectApiKey, + + [EnumMember(Value = "call.in-progress.error-vapifault-openai-401-account-not-in-organization")] + CallInProgressErrorVapifaultOpenai401AccountNotInOrganization, + + [EnumMember(Value = "call.in-progress.error-vapifault-openai-403-model-access-denied")] + CallInProgressErrorVapifaultOpenai403ModelAccessDenied, + + [EnumMember(Value = "call.in-progress.error-vapifault-openai-429-exceeded-quota")] + CallInProgressErrorVapifaultOpenai429ExceededQuota, + + [EnumMember(Value = "call.in-progress.error-vapifault-openai-429-rate-limit-reached")] + CallInProgressErrorVapifaultOpenai429RateLimitReached, + + [EnumMember(Value = "call.in-progress.error-providerfault-openai-500-server-error")] + CallInProgressErrorProviderfaultOpenai500ServerError, + + [EnumMember(Value = "call.in-progress.error-providerfault-openai-503-server-overloaded-error")] + CallInProgressErrorProviderfaultOpenai503ServerOverloadedError, + + [EnumMember(Value = "pipeline-error-azure-openai-400-bad-request-validation-failed")] + PipelineErrorAzureOpenai400BadRequestValidationFailed, + + [EnumMember(Value = "pipeline-error-azure-openai-401-unauthorized")] + PipelineErrorAzureOpenai401Unauthorized, + + [EnumMember(Value = "pipeline-error-azure-openai-403-model-access-denied")] + PipelineErrorAzureOpenai403ModelAccessDenied, + + [EnumMember(Value = "pipeline-error-azure-openai-429-exceeded-quota")] + PipelineErrorAzureOpenai429ExceededQuota, + + [EnumMember(Value = "pipeline-error-azure-openai-500-server-error")] + PipelineErrorAzureOpenai500ServerError, + + [EnumMember(Value = "pipeline-error-azure-openai-503-server-overloaded-error")] + PipelineErrorAzureOpenai503ServerOverloadedError, + + [EnumMember(Value = "pipeline-error-azure-openai-llm-failed")] + PipelineErrorAzureOpenaiLlmFailed, + + [EnumMember( + Value = "call.in-progress.error-vapifault-azure-openai-400-bad-request-validation-failed" + )] + CallInProgressErrorVapifaultAzureOpenai400BadRequestValidationFailed, + + [EnumMember(Value = "call.in-progress.error-vapifault-azure-openai-401-unauthorized")] + CallInProgressErrorVapifaultAzureOpenai401Unauthorized, + + [EnumMember(Value = "call.in-progress.error-vapifault-azure-openai-403-model-access-denied")] + CallInProgressErrorVapifaultAzureOpenai403ModelAccessDenied, + + [EnumMember(Value = "call.in-progress.error-vapifault-azure-openai-429-exceeded-quota")] + CallInProgressErrorVapifaultAzureOpenai429ExceededQuota, + + [EnumMember(Value = "call.in-progress.error-providerfault-azure-openai-500-server-error")] + CallInProgressErrorProviderfaultAzureOpenai500ServerError, + + [EnumMember( + Value = "call.in-progress.error-providerfault-azure-openai-503-server-overloaded-error" + )] + CallInProgressErrorProviderfaultAzureOpenai503ServerOverloadedError, + [EnumMember(Value = "pipeline-error-google-400-bad-request-validation-failed")] PipelineErrorGoogle400BadRequestValidationFailed, @@ -247,6 +436,32 @@ public enum ServerMessageEndOfCallReportEndedReason [EnumMember(Value = "pipeline-error-google-500-server-error")] PipelineErrorGoogle500ServerError, + [EnumMember(Value = "pipeline-error-google-503-server-overloaded-error")] + PipelineErrorGoogle503ServerOverloadedError, + + [EnumMember(Value = "pipeline-error-google-llm-failed")] + PipelineErrorGoogleLlmFailed, + + [EnumMember( + Value = "call.in-progress.error-vapifault-google-400-bad-request-validation-failed" + )] + CallInProgressErrorVapifaultGoogle400BadRequestValidationFailed, + + [EnumMember(Value = "call.in-progress.error-vapifault-google-401-unauthorized")] + CallInProgressErrorVapifaultGoogle401Unauthorized, + + [EnumMember(Value = "call.in-progress.error-vapifault-google-403-model-access-denied")] + CallInProgressErrorVapifaultGoogle403ModelAccessDenied, + + [EnumMember(Value = "call.in-progress.error-vapifault-google-429-exceeded-quota")] + CallInProgressErrorVapifaultGoogle429ExceededQuota, + + [EnumMember(Value = "call.in-progress.error-providerfault-google-500-server-error")] + CallInProgressErrorProviderfaultGoogle500ServerError, + + [EnumMember(Value = "call.in-progress.error-providerfault-google-503-server-overloaded-error")] + CallInProgressErrorProviderfaultGoogle503ServerOverloadedError, + [EnumMember(Value = "pipeline-error-xai-400-bad-request-validation-failed")] PipelineErrorXai400BadRequestValidationFailed, @@ -262,6 +477,30 @@ public enum ServerMessageEndOfCallReportEndedReason [EnumMember(Value = "pipeline-error-xai-500-server-error")] PipelineErrorXai500ServerError, + [EnumMember(Value = "pipeline-error-xai-503-server-overloaded-error")] + PipelineErrorXai503ServerOverloadedError, + + [EnumMember(Value = "pipeline-error-xai-llm-failed")] + PipelineErrorXaiLlmFailed, + + [EnumMember(Value = "call.in-progress.error-vapifault-xai-400-bad-request-validation-failed")] + CallInProgressErrorVapifaultXai400BadRequestValidationFailed, + + [EnumMember(Value = "call.in-progress.error-vapifault-xai-401-unauthorized")] + CallInProgressErrorVapifaultXai401Unauthorized, + + [EnumMember(Value = "call.in-progress.error-vapifault-xai-403-model-access-denied")] + CallInProgressErrorVapifaultXai403ModelAccessDenied, + + [EnumMember(Value = "call.in-progress.error-vapifault-xai-429-exceeded-quota")] + CallInProgressErrorVapifaultXai429ExceededQuota, + + [EnumMember(Value = "call.in-progress.error-providerfault-xai-500-server-error")] + CallInProgressErrorProviderfaultXai500ServerError, + + [EnumMember(Value = "call.in-progress.error-providerfault-xai-503-server-overloaded-error")] + CallInProgressErrorProviderfaultXai503ServerOverloadedError, + [EnumMember(Value = "pipeline-error-mistral-400-bad-request-validation-failed")] PipelineErrorMistral400BadRequestValidationFailed, @@ -277,6 +516,32 @@ public enum ServerMessageEndOfCallReportEndedReason [EnumMember(Value = "pipeline-error-mistral-500-server-error")] PipelineErrorMistral500ServerError, + [EnumMember(Value = "pipeline-error-mistral-503-server-overloaded-error")] + PipelineErrorMistral503ServerOverloadedError, + + [EnumMember(Value = "pipeline-error-mistral-llm-failed")] + PipelineErrorMistralLlmFailed, + + [EnumMember( + Value = "call.in-progress.error-vapifault-mistral-400-bad-request-validation-failed" + )] + CallInProgressErrorVapifaultMistral400BadRequestValidationFailed, + + [EnumMember(Value = "call.in-progress.error-vapifault-mistral-401-unauthorized")] + CallInProgressErrorVapifaultMistral401Unauthorized, + + [EnumMember(Value = "call.in-progress.error-vapifault-mistral-403-model-access-denied")] + CallInProgressErrorVapifaultMistral403ModelAccessDenied, + + [EnumMember(Value = "call.in-progress.error-vapifault-mistral-429-exceeded-quota")] + CallInProgressErrorVapifaultMistral429ExceededQuota, + + [EnumMember(Value = "call.in-progress.error-providerfault-mistral-500-server-error")] + CallInProgressErrorProviderfaultMistral500ServerError, + + [EnumMember(Value = "call.in-progress.error-providerfault-mistral-503-server-overloaded-error")] + CallInProgressErrorProviderfaultMistral503ServerOverloadedError, + [EnumMember(Value = "pipeline-error-inflection-ai-400-bad-request-validation-failed")] PipelineErrorInflectionAi400BadRequestValidationFailed, @@ -292,6 +557,34 @@ public enum ServerMessageEndOfCallReportEndedReason [EnumMember(Value = "pipeline-error-inflection-ai-500-server-error")] PipelineErrorInflectionAi500ServerError, + [EnumMember(Value = "pipeline-error-inflection-ai-503-server-overloaded-error")] + PipelineErrorInflectionAi503ServerOverloadedError, + + [EnumMember(Value = "pipeline-error-inflection-ai-llm-failed")] + PipelineErrorInflectionAiLlmFailed, + + [EnumMember( + Value = "call.in-progress.error-vapifault-inflection-ai-400-bad-request-validation-failed" + )] + CallInProgressErrorVapifaultInflectionAi400BadRequestValidationFailed, + + [EnumMember(Value = "call.in-progress.error-vapifault-inflection-ai-401-unauthorized")] + CallInProgressErrorVapifaultInflectionAi401Unauthorized, + + [EnumMember(Value = "call.in-progress.error-vapifault-inflection-ai-403-model-access-denied")] + CallInProgressErrorVapifaultInflectionAi403ModelAccessDenied, + + [EnumMember(Value = "call.in-progress.error-vapifault-inflection-ai-429-exceeded-quota")] + CallInProgressErrorVapifaultInflectionAi429ExceededQuota, + + [EnumMember(Value = "call.in-progress.error-providerfault-inflection-ai-500-server-error")] + CallInProgressErrorProviderfaultInflectionAi500ServerError, + + [EnumMember( + Value = "call.in-progress.error-providerfault-inflection-ai-503-server-overloaded-error" + )] + CallInProgressErrorProviderfaultInflectionAi503ServerOverloadedError, + [EnumMember(Value = "pipeline-error-deep-seek-400-bad-request-validation-failed")] PipelineErrorDeepSeek400BadRequestValidationFailed, @@ -307,20 +600,33 @@ public enum ServerMessageEndOfCallReportEndedReason [EnumMember(Value = "pipeline-error-deep-seek-500-server-error")] PipelineErrorDeepSeek500ServerError, - [EnumMember(Value = "pipeline-error-azure-openai-400-bad-request-validation-failed")] - PipelineErrorAzureOpenai400BadRequestValidationFailed, + [EnumMember(Value = "pipeline-error-deep-seek-503-server-overloaded-error")] + PipelineErrorDeepSeek503ServerOverloadedError, - [EnumMember(Value = "pipeline-error-azure-openai-401-unauthorized")] - PipelineErrorAzureOpenai401Unauthorized, + [EnumMember(Value = "pipeline-error-deep-seek-llm-failed")] + PipelineErrorDeepSeekLlmFailed, - [EnumMember(Value = "pipeline-error-azure-openai-403-model-access-denied")] - PipelineErrorAzureOpenai403ModelAccessDenied, + [EnumMember( + Value = "call.in-progress.error-vapifault-deep-seek-400-bad-request-validation-failed" + )] + CallInProgressErrorVapifaultDeepSeek400BadRequestValidationFailed, - [EnumMember(Value = "pipeline-error-azure-openai-429-exceeded-quota")] - PipelineErrorAzureOpenai429ExceededQuota, + [EnumMember(Value = "call.in-progress.error-vapifault-deep-seek-401-unauthorized")] + CallInProgressErrorVapifaultDeepSeek401Unauthorized, - [EnumMember(Value = "pipeline-error-azure-openai-500-server-error")] - PipelineErrorAzureOpenai500ServerError, + [EnumMember(Value = "call.in-progress.error-vapifault-deep-seek-403-model-access-denied")] + CallInProgressErrorVapifaultDeepSeek403ModelAccessDenied, + + [EnumMember(Value = "call.in-progress.error-vapifault-deep-seek-429-exceeded-quota")] + CallInProgressErrorVapifaultDeepSeek429ExceededQuota, + + [EnumMember(Value = "call.in-progress.error-providerfault-deep-seek-500-server-error")] + CallInProgressErrorProviderfaultDeepSeek500ServerError, + + [EnumMember( + Value = "call.in-progress.error-providerfault-deep-seek-503-server-overloaded-error" + )] + CallInProgressErrorProviderfaultDeepSeek503ServerOverloadedError, [EnumMember(Value = "pipeline-error-groq-400-bad-request-validation-failed")] PipelineErrorGroq400BadRequestValidationFailed, @@ -337,6 +643,30 @@ public enum ServerMessageEndOfCallReportEndedReason [EnumMember(Value = "pipeline-error-groq-500-server-error")] PipelineErrorGroq500ServerError, + [EnumMember(Value = "pipeline-error-groq-503-server-overloaded-error")] + PipelineErrorGroq503ServerOverloadedError, + + [EnumMember(Value = "pipeline-error-groq-llm-failed")] + PipelineErrorGroqLlmFailed, + + [EnumMember(Value = "call.in-progress.error-vapifault-groq-400-bad-request-validation-failed")] + CallInProgressErrorVapifaultGroq400BadRequestValidationFailed, + + [EnumMember(Value = "call.in-progress.error-vapifault-groq-401-unauthorized")] + CallInProgressErrorVapifaultGroq401Unauthorized, + + [EnumMember(Value = "call.in-progress.error-vapifault-groq-403-model-access-denied")] + CallInProgressErrorVapifaultGroq403ModelAccessDenied, + + [EnumMember(Value = "call.in-progress.error-vapifault-groq-429-exceeded-quota")] + CallInProgressErrorVapifaultGroq429ExceededQuota, + + [EnumMember(Value = "call.in-progress.error-providerfault-groq-500-server-error")] + CallInProgressErrorProviderfaultGroq500ServerError, + + [EnumMember(Value = "call.in-progress.error-providerfault-groq-503-server-overloaded-error")] + CallInProgressErrorProviderfaultGroq503ServerOverloadedError, + [EnumMember(Value = "pipeline-error-cerebras-400-bad-request-validation-failed")] PipelineErrorCerebras400BadRequestValidationFailed, @@ -346,29 +676,181 @@ public enum ServerMessageEndOfCallReportEndedReason [EnumMember(Value = "pipeline-error-cerebras-403-model-access-denied")] PipelineErrorCerebras403ModelAccessDenied, - [EnumMember(Value = "pipeline-error-cerebras-429-exceeded-quota")] - PipelineErrorCerebras429ExceededQuota, + [EnumMember(Value = "pipeline-error-cerebras-429-exceeded-quota")] + PipelineErrorCerebras429ExceededQuota, + + [EnumMember(Value = "pipeline-error-cerebras-500-server-error")] + PipelineErrorCerebras500ServerError, + + [EnumMember(Value = "pipeline-error-cerebras-503-server-overloaded-error")] + PipelineErrorCerebras503ServerOverloadedError, + + [EnumMember(Value = "pipeline-error-cerebras-llm-failed")] + PipelineErrorCerebrasLlmFailed, + + [EnumMember( + Value = "call.in-progress.error-vapifault-cerebras-400-bad-request-validation-failed" + )] + CallInProgressErrorVapifaultCerebras400BadRequestValidationFailed, + + [EnumMember(Value = "call.in-progress.error-vapifault-cerebras-401-unauthorized")] + CallInProgressErrorVapifaultCerebras401Unauthorized, + + [EnumMember(Value = "call.in-progress.error-vapifault-cerebras-403-model-access-denied")] + CallInProgressErrorVapifaultCerebras403ModelAccessDenied, + + [EnumMember(Value = "call.in-progress.error-vapifault-cerebras-429-exceeded-quota")] + CallInProgressErrorVapifaultCerebras429ExceededQuota, + + [EnumMember(Value = "call.in-progress.error-providerfault-cerebras-500-server-error")] + CallInProgressErrorProviderfaultCerebras500ServerError, + + [EnumMember( + Value = "call.in-progress.error-providerfault-cerebras-503-server-overloaded-error" + )] + CallInProgressErrorProviderfaultCerebras503ServerOverloadedError, + + [EnumMember(Value = "pipeline-error-anthropic-400-bad-request-validation-failed")] + PipelineErrorAnthropic400BadRequestValidationFailed, + + [EnumMember(Value = "pipeline-error-anthropic-401-unauthorized")] + PipelineErrorAnthropic401Unauthorized, + + [EnumMember(Value = "pipeline-error-anthropic-403-model-access-denied")] + PipelineErrorAnthropic403ModelAccessDenied, + + [EnumMember(Value = "pipeline-error-anthropic-429-exceeded-quota")] + PipelineErrorAnthropic429ExceededQuota, + + [EnumMember(Value = "pipeline-error-anthropic-500-server-error")] + PipelineErrorAnthropic500ServerError, + + [EnumMember(Value = "pipeline-error-anthropic-503-server-overloaded-error")] + PipelineErrorAnthropic503ServerOverloadedError, + + [EnumMember(Value = "pipeline-error-anthropic-llm-failed")] + PipelineErrorAnthropicLlmFailed, + + [EnumMember(Value = "call.in-progress.error-vapifault-anthropic-llm-failed")] + CallInProgressErrorVapifaultAnthropicLlmFailed, + + [EnumMember( + Value = "call.in-progress.error-vapifault-anthropic-400-bad-request-validation-failed" + )] + CallInProgressErrorVapifaultAnthropic400BadRequestValidationFailed, + + [EnumMember(Value = "call.in-progress.error-vapifault-anthropic-401-unauthorized")] + CallInProgressErrorVapifaultAnthropic401Unauthorized, + + [EnumMember(Value = "call.in-progress.error-vapifault-anthropic-403-model-access-denied")] + CallInProgressErrorVapifaultAnthropic403ModelAccessDenied, + + [EnumMember(Value = "call.in-progress.error-vapifault-anthropic-429-exceeded-quota")] + CallInProgressErrorVapifaultAnthropic429ExceededQuota, + + [EnumMember(Value = "call.in-progress.error-providerfault-anthropic-500-server-error")] + CallInProgressErrorProviderfaultAnthropic500ServerError, + + [EnumMember( + Value = "call.in-progress.error-providerfault-anthropic-503-server-overloaded-error" + )] + CallInProgressErrorProviderfaultAnthropic503ServerOverloadedError, + + [EnumMember(Value = "pipeline-error-anthropic-bedrock-400-bad-request-validation-failed")] + PipelineErrorAnthropicBedrock400BadRequestValidationFailed, + + [EnumMember(Value = "pipeline-error-anthropic-bedrock-401-unauthorized")] + PipelineErrorAnthropicBedrock401Unauthorized, + + [EnumMember(Value = "pipeline-error-anthropic-bedrock-403-model-access-denied")] + PipelineErrorAnthropicBedrock403ModelAccessDenied, + + [EnumMember(Value = "pipeline-error-anthropic-bedrock-429-exceeded-quota")] + PipelineErrorAnthropicBedrock429ExceededQuota, + + [EnumMember(Value = "pipeline-error-anthropic-bedrock-500-server-error")] + PipelineErrorAnthropicBedrock500ServerError, + + [EnumMember(Value = "pipeline-error-anthropic-bedrock-503-server-overloaded-error")] + PipelineErrorAnthropicBedrock503ServerOverloadedError, + + [EnumMember(Value = "pipeline-error-anthropic-bedrock-llm-failed")] + PipelineErrorAnthropicBedrockLlmFailed, + + [EnumMember(Value = "call.in-progress.error-vapifault-anthropic-bedrock-llm-failed")] + CallInProgressErrorVapifaultAnthropicBedrockLlmFailed, + + [EnumMember( + Value = "call.in-progress.error-vapifault-anthropic-bedrock-400-bad-request-validation-failed" + )] + CallInProgressErrorVapifaultAnthropicBedrock400BadRequestValidationFailed, + + [EnumMember(Value = "call.in-progress.error-vapifault-anthropic-bedrock-401-unauthorized")] + CallInProgressErrorVapifaultAnthropicBedrock401Unauthorized, + + [EnumMember( + Value = "call.in-progress.error-vapifault-anthropic-bedrock-403-model-access-denied" + )] + CallInProgressErrorVapifaultAnthropicBedrock403ModelAccessDenied, + + [EnumMember(Value = "call.in-progress.error-vapifault-anthropic-bedrock-429-exceeded-quota")] + CallInProgressErrorVapifaultAnthropicBedrock429ExceededQuota, + + [EnumMember(Value = "call.in-progress.error-providerfault-anthropic-bedrock-500-server-error")] + CallInProgressErrorProviderfaultAnthropicBedrock500ServerError, + + [EnumMember( + Value = "call.in-progress.error-providerfault-anthropic-bedrock-503-server-overloaded-error" + )] + CallInProgressErrorProviderfaultAnthropicBedrock503ServerOverloadedError, + + [EnumMember(Value = "pipeline-error-anthropic-vertex-400-bad-request-validation-failed")] + PipelineErrorAnthropicVertex400BadRequestValidationFailed, + + [EnumMember(Value = "pipeline-error-anthropic-vertex-401-unauthorized")] + PipelineErrorAnthropicVertex401Unauthorized, + + [EnumMember(Value = "pipeline-error-anthropic-vertex-403-model-access-denied")] + PipelineErrorAnthropicVertex403ModelAccessDenied, + + [EnumMember(Value = "pipeline-error-anthropic-vertex-429-exceeded-quota")] + PipelineErrorAnthropicVertex429ExceededQuota, + + [EnumMember(Value = "pipeline-error-anthropic-vertex-500-server-error")] + PipelineErrorAnthropicVertex500ServerError, + + [EnumMember(Value = "pipeline-error-anthropic-vertex-503-server-overloaded-error")] + PipelineErrorAnthropicVertex503ServerOverloadedError, - [EnumMember(Value = "pipeline-error-cerebras-500-server-error")] - PipelineErrorCerebras500ServerError, + [EnumMember(Value = "pipeline-error-anthropic-vertex-llm-failed")] + PipelineErrorAnthropicVertexLlmFailed, - [EnumMember(Value = "pipeline-error-anthropic-400-bad-request-validation-failed")] - PipelineErrorAnthropic400BadRequestValidationFailed, + [EnumMember(Value = "call.in-progress.error-vapifault-anthropic-vertex-llm-failed")] + CallInProgressErrorVapifaultAnthropicVertexLlmFailed, - [EnumMember(Value = "pipeline-error-anthropic-401-unauthorized")] - PipelineErrorAnthropic401Unauthorized, + [EnumMember( + Value = "call.in-progress.error-vapifault-anthropic-vertex-400-bad-request-validation-failed" + )] + CallInProgressErrorVapifaultAnthropicVertex400BadRequestValidationFailed, - [EnumMember(Value = "pipeline-error-anthropic-403-model-access-denied")] - PipelineErrorAnthropic403ModelAccessDenied, + [EnumMember(Value = "call.in-progress.error-vapifault-anthropic-vertex-401-unauthorized")] + CallInProgressErrorVapifaultAnthropicVertex401Unauthorized, - [EnumMember(Value = "pipeline-error-anthropic-429-exceeded-quota")] - PipelineErrorAnthropic429ExceededQuota, + [EnumMember( + Value = "call.in-progress.error-vapifault-anthropic-vertex-403-model-access-denied" + )] + CallInProgressErrorVapifaultAnthropicVertex403ModelAccessDenied, - [EnumMember(Value = "pipeline-error-anthropic-500-server-error")] - PipelineErrorAnthropic500ServerError, + [EnumMember(Value = "call.in-progress.error-vapifault-anthropic-vertex-429-exceeded-quota")] + CallInProgressErrorVapifaultAnthropicVertex429ExceededQuota, - [EnumMember(Value = "pipeline-error-anthropic-llm-failed")] - PipelineErrorAnthropicLlmFailed, + [EnumMember(Value = "call.in-progress.error-providerfault-anthropic-vertex-500-server-error")] + CallInProgressErrorProviderfaultAnthropicVertex500ServerError, + + [EnumMember( + Value = "call.in-progress.error-providerfault-anthropic-vertex-503-server-overloaded-error" + )] + CallInProgressErrorProviderfaultAnthropicVertex503ServerOverloadedError, [EnumMember(Value = "pipeline-error-together-ai-400-bad-request-validation-failed")] PipelineErrorTogetherAi400BadRequestValidationFailed, @@ -385,9 +867,37 @@ public enum ServerMessageEndOfCallReportEndedReason [EnumMember(Value = "pipeline-error-together-ai-500-server-error")] PipelineErrorTogetherAi500ServerError, + [EnumMember(Value = "pipeline-error-together-ai-503-server-overloaded-error")] + PipelineErrorTogetherAi503ServerOverloadedError, + [EnumMember(Value = "pipeline-error-together-ai-llm-failed")] PipelineErrorTogetherAiLlmFailed, + [EnumMember(Value = "call.in-progress.error-vapifault-together-ai-llm-failed")] + CallInProgressErrorVapifaultTogetherAiLlmFailed, + + [EnumMember( + Value = "call.in-progress.error-vapifault-together-ai-400-bad-request-validation-failed" + )] + CallInProgressErrorVapifaultTogetherAi400BadRequestValidationFailed, + + [EnumMember(Value = "call.in-progress.error-vapifault-together-ai-401-unauthorized")] + CallInProgressErrorVapifaultTogetherAi401Unauthorized, + + [EnumMember(Value = "call.in-progress.error-vapifault-together-ai-403-model-access-denied")] + CallInProgressErrorVapifaultTogetherAi403ModelAccessDenied, + + [EnumMember(Value = "call.in-progress.error-vapifault-together-ai-429-exceeded-quota")] + CallInProgressErrorVapifaultTogetherAi429ExceededQuota, + + [EnumMember(Value = "call.in-progress.error-providerfault-together-ai-500-server-error")] + CallInProgressErrorProviderfaultTogetherAi500ServerError, + + [EnumMember( + Value = "call.in-progress.error-providerfault-together-ai-503-server-overloaded-error" + )] + CallInProgressErrorProviderfaultTogetherAi503ServerOverloadedError, + [EnumMember(Value = "pipeline-error-anyscale-400-bad-request-validation-failed")] PipelineErrorAnyscale400BadRequestValidationFailed, @@ -403,9 +913,37 @@ public enum ServerMessageEndOfCallReportEndedReason [EnumMember(Value = "pipeline-error-anyscale-500-server-error")] PipelineErrorAnyscale500ServerError, + [EnumMember(Value = "pipeline-error-anyscale-503-server-overloaded-error")] + PipelineErrorAnyscale503ServerOverloadedError, + [EnumMember(Value = "pipeline-error-anyscale-llm-failed")] PipelineErrorAnyscaleLlmFailed, + [EnumMember(Value = "call.in-progress.error-vapifault-anyscale-llm-failed")] + CallInProgressErrorVapifaultAnyscaleLlmFailed, + + [EnumMember( + Value = "call.in-progress.error-vapifault-anyscale-400-bad-request-validation-failed" + )] + CallInProgressErrorVapifaultAnyscale400BadRequestValidationFailed, + + [EnumMember(Value = "call.in-progress.error-vapifault-anyscale-401-unauthorized")] + CallInProgressErrorVapifaultAnyscale401Unauthorized, + + [EnumMember(Value = "call.in-progress.error-vapifault-anyscale-403-model-access-denied")] + CallInProgressErrorVapifaultAnyscale403ModelAccessDenied, + + [EnumMember(Value = "call.in-progress.error-vapifault-anyscale-429-exceeded-quota")] + CallInProgressErrorVapifaultAnyscale429ExceededQuota, + + [EnumMember(Value = "call.in-progress.error-providerfault-anyscale-500-server-error")] + CallInProgressErrorProviderfaultAnyscale500ServerError, + + [EnumMember( + Value = "call.in-progress.error-providerfault-anyscale-503-server-overloaded-error" + )] + CallInProgressErrorProviderfaultAnyscale503ServerOverloadedError, + [EnumMember(Value = "pipeline-error-openrouter-400-bad-request-validation-failed")] PipelineErrorOpenrouter400BadRequestValidationFailed, @@ -421,9 +959,37 @@ public enum ServerMessageEndOfCallReportEndedReason [EnumMember(Value = "pipeline-error-openrouter-500-server-error")] PipelineErrorOpenrouter500ServerError, + [EnumMember(Value = "pipeline-error-openrouter-503-server-overloaded-error")] + PipelineErrorOpenrouter503ServerOverloadedError, + [EnumMember(Value = "pipeline-error-openrouter-llm-failed")] PipelineErrorOpenrouterLlmFailed, + [EnumMember(Value = "call.in-progress.error-vapifault-openrouter-llm-failed")] + CallInProgressErrorVapifaultOpenrouterLlmFailed, + + [EnumMember( + Value = "call.in-progress.error-vapifault-openrouter-400-bad-request-validation-failed" + )] + CallInProgressErrorVapifaultOpenrouter400BadRequestValidationFailed, + + [EnumMember(Value = "call.in-progress.error-vapifault-openrouter-401-unauthorized")] + CallInProgressErrorVapifaultOpenrouter401Unauthorized, + + [EnumMember(Value = "call.in-progress.error-vapifault-openrouter-403-model-access-denied")] + CallInProgressErrorVapifaultOpenrouter403ModelAccessDenied, + + [EnumMember(Value = "call.in-progress.error-vapifault-openrouter-429-exceeded-quota")] + CallInProgressErrorVapifaultOpenrouter429ExceededQuota, + + [EnumMember(Value = "call.in-progress.error-providerfault-openrouter-500-server-error")] + CallInProgressErrorProviderfaultOpenrouter500ServerError, + + [EnumMember( + Value = "call.in-progress.error-providerfault-openrouter-503-server-overloaded-error" + )] + CallInProgressErrorProviderfaultOpenrouter503ServerOverloadedError, + [EnumMember(Value = "pipeline-error-perplexity-ai-400-bad-request-validation-failed")] PipelineErrorPerplexityAi400BadRequestValidationFailed, @@ -439,9 +1005,37 @@ public enum ServerMessageEndOfCallReportEndedReason [EnumMember(Value = "pipeline-error-perplexity-ai-500-server-error")] PipelineErrorPerplexityAi500ServerError, + [EnumMember(Value = "pipeline-error-perplexity-ai-503-server-overloaded-error")] + PipelineErrorPerplexityAi503ServerOverloadedError, + [EnumMember(Value = "pipeline-error-perplexity-ai-llm-failed")] PipelineErrorPerplexityAiLlmFailed, + [EnumMember(Value = "call.in-progress.error-vapifault-perplexity-ai-llm-failed")] + CallInProgressErrorVapifaultPerplexityAiLlmFailed, + + [EnumMember( + Value = "call.in-progress.error-vapifault-perplexity-ai-400-bad-request-validation-failed" + )] + CallInProgressErrorVapifaultPerplexityAi400BadRequestValidationFailed, + + [EnumMember(Value = "call.in-progress.error-vapifault-perplexity-ai-401-unauthorized")] + CallInProgressErrorVapifaultPerplexityAi401Unauthorized, + + [EnumMember(Value = "call.in-progress.error-vapifault-perplexity-ai-403-model-access-denied")] + CallInProgressErrorVapifaultPerplexityAi403ModelAccessDenied, + + [EnumMember(Value = "call.in-progress.error-vapifault-perplexity-ai-429-exceeded-quota")] + CallInProgressErrorVapifaultPerplexityAi429ExceededQuota, + + [EnumMember(Value = "call.in-progress.error-providerfault-perplexity-ai-500-server-error")] + CallInProgressErrorProviderfaultPerplexityAi500ServerError, + + [EnumMember( + Value = "call.in-progress.error-providerfault-perplexity-ai-503-server-overloaded-error" + )] + CallInProgressErrorProviderfaultPerplexityAi503ServerOverloadedError, + [EnumMember(Value = "pipeline-error-deepinfra-400-bad-request-validation-failed")] PipelineErrorDeepinfra400BadRequestValidationFailed, @@ -457,9 +1051,37 @@ public enum ServerMessageEndOfCallReportEndedReason [EnumMember(Value = "pipeline-error-deepinfra-500-server-error")] PipelineErrorDeepinfra500ServerError, + [EnumMember(Value = "pipeline-error-deepinfra-503-server-overloaded-error")] + PipelineErrorDeepinfra503ServerOverloadedError, + [EnumMember(Value = "pipeline-error-deepinfra-llm-failed")] PipelineErrorDeepinfraLlmFailed, + [EnumMember(Value = "call.in-progress.error-vapifault-deepinfra-llm-failed")] + CallInProgressErrorVapifaultDeepinfraLlmFailed, + + [EnumMember( + Value = "call.in-progress.error-vapifault-deepinfra-400-bad-request-validation-failed" + )] + CallInProgressErrorVapifaultDeepinfra400BadRequestValidationFailed, + + [EnumMember(Value = "call.in-progress.error-vapifault-deepinfra-401-unauthorized")] + CallInProgressErrorVapifaultDeepinfra401Unauthorized, + + [EnumMember(Value = "call.in-progress.error-vapifault-deepinfra-403-model-access-denied")] + CallInProgressErrorVapifaultDeepinfra403ModelAccessDenied, + + [EnumMember(Value = "call.in-progress.error-vapifault-deepinfra-429-exceeded-quota")] + CallInProgressErrorVapifaultDeepinfra429ExceededQuota, + + [EnumMember(Value = "call.in-progress.error-providerfault-deepinfra-500-server-error")] + CallInProgressErrorProviderfaultDeepinfra500ServerError, + + [EnumMember( + Value = "call.in-progress.error-providerfault-deepinfra-503-server-overloaded-error" + )] + CallInProgressErrorProviderfaultDeepinfra503ServerOverloadedError, + [EnumMember(Value = "pipeline-error-runpod-400-bad-request-validation-failed")] PipelineErrorRunpod400BadRequestValidationFailed, @@ -475,9 +1097,35 @@ public enum ServerMessageEndOfCallReportEndedReason [EnumMember(Value = "pipeline-error-runpod-500-server-error")] PipelineErrorRunpod500ServerError, + [EnumMember(Value = "pipeline-error-runpod-503-server-overloaded-error")] + PipelineErrorRunpod503ServerOverloadedError, + [EnumMember(Value = "pipeline-error-runpod-llm-failed")] PipelineErrorRunpodLlmFailed, + [EnumMember(Value = "call.in-progress.error-vapifault-runpod-llm-failed")] + CallInProgressErrorVapifaultRunpodLlmFailed, + + [EnumMember( + Value = "call.in-progress.error-vapifault-runpod-400-bad-request-validation-failed" + )] + CallInProgressErrorVapifaultRunpod400BadRequestValidationFailed, + + [EnumMember(Value = "call.in-progress.error-vapifault-runpod-401-unauthorized")] + CallInProgressErrorVapifaultRunpod401Unauthorized, + + [EnumMember(Value = "call.in-progress.error-vapifault-runpod-403-model-access-denied")] + CallInProgressErrorVapifaultRunpod403ModelAccessDenied, + + [EnumMember(Value = "call.in-progress.error-vapifault-runpod-429-exceeded-quota")] + CallInProgressErrorVapifaultRunpod429ExceededQuota, + + [EnumMember(Value = "call.in-progress.error-providerfault-runpod-500-server-error")] + CallInProgressErrorProviderfaultRunpod500ServerError, + + [EnumMember(Value = "call.in-progress.error-providerfault-runpod-503-server-overloaded-error")] + CallInProgressErrorProviderfaultRunpod503ServerOverloadedError, + [EnumMember(Value = "pipeline-error-custom-llm-400-bad-request-validation-failed")] PipelineErrorCustomLlm400BadRequestValidationFailed, @@ -493,9 +1141,37 @@ public enum ServerMessageEndOfCallReportEndedReason [EnumMember(Value = "pipeline-error-custom-llm-500-server-error")] PipelineErrorCustomLlm500ServerError, + [EnumMember(Value = "pipeline-error-custom-llm-503-server-overloaded-error")] + PipelineErrorCustomLlm503ServerOverloadedError, + [EnumMember(Value = "pipeline-error-custom-llm-llm-failed")] PipelineErrorCustomLlmLlmFailed, + [EnumMember(Value = "call.in-progress.error-vapifault-custom-llm-llm-failed")] + CallInProgressErrorVapifaultCustomLlmLlmFailed, + + [EnumMember( + Value = "call.in-progress.error-vapifault-custom-llm-400-bad-request-validation-failed" + )] + CallInProgressErrorVapifaultCustomLlm400BadRequestValidationFailed, + + [EnumMember(Value = "call.in-progress.error-vapifault-custom-llm-401-unauthorized")] + CallInProgressErrorVapifaultCustomLlm401Unauthorized, + + [EnumMember(Value = "call.in-progress.error-vapifault-custom-llm-403-model-access-denied")] + CallInProgressErrorVapifaultCustomLlm403ModelAccessDenied, + + [EnumMember(Value = "call.in-progress.error-vapifault-custom-llm-429-exceeded-quota")] + CallInProgressErrorVapifaultCustomLlm429ExceededQuota, + + [EnumMember(Value = "call.in-progress.error-providerfault-custom-llm-500-server-error")] + CallInProgressErrorProviderfaultCustomLlm500ServerError, + + [EnumMember( + Value = "call.in-progress.error-providerfault-custom-llm-503-server-overloaded-error" + )] + CallInProgressErrorProviderfaultCustomLlm503ServerOverloadedError, + [EnumMember(Value = "pipeline-error-custom-voice-failed")] PipelineErrorCustomVoiceFailed, @@ -514,6 +1190,21 @@ public enum ServerMessageEndOfCallReportEndedReason [EnumMember(Value = "pipeline-error-cartesia-522-server-error")] PipelineErrorCartesia522ServerError, + [EnumMember(Value = "call.in-progress.error-vapifault-cartesia-socket-hang-up")] + CallInProgressErrorVapifaultCartesiaSocketHangUp, + + [EnumMember(Value = "call.in-progress.error-vapifault-cartesia-requested-payment")] + CallInProgressErrorVapifaultCartesiaRequestedPayment, + + [EnumMember(Value = "call.in-progress.error-providerfault-cartesia-500-server-error")] + CallInProgressErrorProviderfaultCartesia500ServerError, + + [EnumMember(Value = "call.in-progress.error-providerfault-cartesia-503-server-error")] + CallInProgressErrorProviderfaultCartesia503ServerError, + + [EnumMember(Value = "call.in-progress.error-providerfault-cartesia-522-server-error")] + CallInProgressErrorProviderfaultCartesia522ServerError, + [EnumMember(Value = "pipeline-error-eleven-labs-voice-not-found")] PipelineErrorElevenLabsVoiceNotFound, @@ -572,9 +1263,6 @@ public enum ServerMessageEndOfCallReportEndedReason [EnumMember(Value = "pipeline-error-eleven-labs-voice-not-allowed-for-free-users")] PipelineErrorElevenLabsVoiceNotAllowedForFreeUsers, - [EnumMember(Value = "pipeline-error-eleven-labs-500-server-error")] - PipelineErrorElevenLabs500ServerError, - [EnumMember(Value = "pipeline-error-eleven-labs-max-character-limit-exceeded")] PipelineErrorElevenLabsMaxCharacterLimitExceeded, @@ -583,6 +1271,98 @@ public enum ServerMessageEndOfCallReportEndedReason )] PipelineErrorElevenLabsBlockedVoicePotentiallyAgainstTermsOfServiceAndAwaitingVerification, + [EnumMember(Value = "pipeline-error-eleven-labs-500-server-error")] + PipelineErrorElevenLabs500ServerError, + + [EnumMember(Value = "call.in-progress.error-vapifault-eleven-labs-voice-not-found")] + CallInProgressErrorVapifaultElevenLabsVoiceNotFound, + + [EnumMember(Value = "call.in-progress.error-vapifault-eleven-labs-quota-exceeded")] + CallInProgressErrorVapifaultElevenLabsQuotaExceeded, + + [EnumMember(Value = "call.in-progress.error-vapifault-eleven-labs-unauthorized-access")] + CallInProgressErrorVapifaultElevenLabsUnauthorizedAccess, + + [EnumMember( + Value = "call.in-progress.error-vapifault-eleven-labs-unauthorized-to-access-model" + )] + CallInProgressErrorVapifaultElevenLabsUnauthorizedToAccessModel, + + [EnumMember( + Value = "call.in-progress.error-vapifault-eleven-labs-professional-voices-only-for-creator-plus" + )] + CallInProgressErrorVapifaultElevenLabsProfessionalVoicesOnlyForCreatorPlus, + + [EnumMember( + Value = "call.in-progress.error-vapifault-eleven-labs-blocked-free-plan-and-requested-upgrade" + )] + CallInProgressErrorVapifaultElevenLabsBlockedFreePlanAndRequestedUpgrade, + + [EnumMember( + Value = "call.in-progress.error-vapifault-eleven-labs-blocked-concurrent-requests-and-requested-upgrade" + )] + CallInProgressErrorVapifaultElevenLabsBlockedConcurrentRequestsAndRequestedUpgrade, + + [EnumMember( + Value = "call.in-progress.error-vapifault-eleven-labs-blocked-using-instant-voice-clone-and-requested-upgrade" + )] + CallInProgressErrorVapifaultElevenLabsBlockedUsingInstantVoiceCloneAndRequestedUpgrade, + + [EnumMember( + Value = "call.in-progress.error-vapifault-eleven-labs-system-busy-and-requested-upgrade" + )] + CallInProgressErrorVapifaultElevenLabsSystemBusyAndRequestedUpgrade, + + [EnumMember(Value = "call.in-progress.error-vapifault-eleven-labs-voice-not-fine-tuned")] + CallInProgressErrorVapifaultElevenLabsVoiceNotFineTuned, + + [EnumMember(Value = "call.in-progress.error-vapifault-eleven-labs-invalid-api-key")] + CallInProgressErrorVapifaultElevenLabsInvalidApiKey, + + [EnumMember(Value = "call.in-progress.error-vapifault-eleven-labs-invalid-voice-samples")] + CallInProgressErrorVapifaultElevenLabsInvalidVoiceSamples, + + [EnumMember(Value = "call.in-progress.error-vapifault-eleven-labs-voice-disabled-by-owner")] + CallInProgressErrorVapifaultElevenLabsVoiceDisabledByOwner, + + [EnumMember( + Value = "call.in-progress.error-vapifault-eleven-labs-blocked-account-in-probation" + )] + CallInProgressErrorVapifaultElevenLabsBlockedAccountInProbation, + + [EnumMember( + Value = "call.in-progress.error-vapifault-eleven-labs-blocked-content-against-their-policy" + )] + CallInProgressErrorVapifaultElevenLabsBlockedContentAgainstTheirPolicy, + + [EnumMember( + Value = "call.in-progress.error-vapifault-eleven-labs-missing-samples-for-voice-clone" + )] + CallInProgressErrorVapifaultElevenLabsMissingSamplesForVoiceClone, + + [EnumMember( + Value = "call.in-progress.error-vapifault-eleven-labs-voice-not-fine-tuned-and-cannot-be-used" + )] + CallInProgressErrorVapifaultElevenLabsVoiceNotFineTunedAndCannotBeUsed, + + [EnumMember( + Value = "call.in-progress.error-vapifault-eleven-labs-voice-not-allowed-for-free-users" + )] + CallInProgressErrorVapifaultElevenLabsVoiceNotAllowedForFreeUsers, + + [EnumMember( + Value = "call.in-progress.error-vapifault-eleven-labs-max-character-limit-exceeded" + )] + CallInProgressErrorVapifaultElevenLabsMaxCharacterLimitExceeded, + + [EnumMember( + Value = "call.in-progress.error-vapifault-eleven-labs-blocked-voice-potentially-against-terms-of-service-and-awaiting-verification" + )] + CallInProgressErrorVapifaultElevenLabsBlockedVoicePotentiallyAgainstTermsOfServiceAndAwaitingVerification, + + [EnumMember(Value = "call.in-progress.error-providerfault-eleven-labs-500-server-error")] + CallInProgressErrorProviderfaultElevenLabs500ServerError, + [EnumMember(Value = "pipeline-error-playht-request-timed-out")] PipelineErrorPlayhtRequestTimedOut, @@ -619,26 +1399,72 @@ public enum ServerMessageEndOfCallReportEndedReason [EnumMember(Value = "pipeline-error-playht-504-gateway-error")] PipelineErrorPlayht504GatewayError, - [EnumMember(Value = "pipeline-error-tavus-video-failed")] - PipelineErrorTavusVideoFailed, + [EnumMember(Value = "call.in-progress.error-vapifault-playht-request-timed-out")] + CallInProgressErrorVapifaultPlayhtRequestTimedOut, + + [EnumMember(Value = "call.in-progress.error-vapifault-playht-invalid-voice")] + CallInProgressErrorVapifaultPlayhtInvalidVoice, + + [EnumMember(Value = "call.in-progress.error-vapifault-playht-unexpected-error")] + CallInProgressErrorVapifaultPlayhtUnexpectedError, + + [EnumMember(Value = "call.in-progress.error-vapifault-playht-out-of-credits")] + CallInProgressErrorVapifaultPlayhtOutOfCredits, + + [EnumMember(Value = "call.in-progress.error-vapifault-playht-invalid-emotion")] + CallInProgressErrorVapifaultPlayhtInvalidEmotion, + + [EnumMember( + Value = "call.in-progress.error-vapifault-playht-voice-must-be-a-valid-voice-manifest-uri" + )] + CallInProgressErrorVapifaultPlayhtVoiceMustBeAValidVoiceManifestUri, + + [EnumMember(Value = "call.in-progress.error-vapifault-playht-401-unauthorized")] + CallInProgressErrorVapifaultPlayht401Unauthorized, + + [EnumMember(Value = "call.in-progress.error-vapifault-playht-403-forbidden-out-of-characters")] + CallInProgressErrorVapifaultPlayht403ForbiddenOutOfCharacters, + + [EnumMember( + Value = "call.in-progress.error-vapifault-playht-403-forbidden-api-access-not-available" + )] + CallInProgressErrorVapifaultPlayht403ForbiddenApiAccessNotAvailable, + + [EnumMember(Value = "call.in-progress.error-vapifault-playht-429-exceeded-quota")] + CallInProgressErrorVapifaultPlayht429ExceededQuota, + + [EnumMember(Value = "call.in-progress.error-providerfault-playht-502-gateway-error")] + CallInProgressErrorProviderfaultPlayht502GatewayError, + + [EnumMember(Value = "call.in-progress.error-providerfault-playht-504-gateway-error")] + CallInProgressErrorProviderfaultPlayht504GatewayError, [EnumMember(Value = "pipeline-error-custom-transcriber-failed")] PipelineErrorCustomTranscriberFailed, - [EnumMember(Value = "pipeline-error-deepgram-returning-403-model-access-denied")] - PipelineErrorDeepgramReturning403ModelAccessDenied, + [EnumMember(Value = "call.in-progress.error-vapifault-custom-transcriber-failed")] + CallInProgressErrorVapifaultCustomTranscriberFailed, - [EnumMember(Value = "pipeline-error-deepgram-returning-401-invalid-credentials")] - PipelineErrorDeepgramReturning401InvalidCredentials, + [EnumMember(Value = "pipeline-error-eleven-labs-transcriber-failed")] + PipelineErrorElevenLabsTranscriberFailed, - [EnumMember(Value = "pipeline-error-deepgram-returning-404-not-found")] - PipelineErrorDeepgramReturning404NotFound, + [EnumMember(Value = "call.in-progress.error-vapifault-eleven-labs-transcriber-failed")] + CallInProgressErrorVapifaultElevenLabsTranscriberFailed, [EnumMember( Value = "pipeline-error-deepgram-returning-400-no-such-model-language-tier-combination" )] PipelineErrorDeepgramReturning400NoSuchModelLanguageTierCombination, + [EnumMember(Value = "pipeline-error-deepgram-returning-401-invalid-credentials")] + PipelineErrorDeepgramReturning401InvalidCredentials, + + [EnumMember(Value = "pipeline-error-deepgram-returning-403-model-access-denied")] + PipelineErrorDeepgramReturning403ModelAccessDenied, + + [EnumMember(Value = "pipeline-error-deepgram-returning-404-not-found")] + PipelineErrorDeepgramReturning404NotFound, + [EnumMember(Value = "pipeline-error-deepgram-returning-500-invalid-json")] PipelineErrorDeepgramReturning500InvalidJson, @@ -648,11 +1474,102 @@ public enum ServerMessageEndOfCallReportEndedReason [EnumMember(Value = "pipeline-error-deepgram-returning-502-bad-gateway-ehostunreach")] PipelineErrorDeepgramReturning502BadGatewayEhostunreach, + [EnumMember( + Value = "call.in-progress.error-vapifault-deepgram-returning-400-no-such-model-language-tier-combination" + )] + CallInProgressErrorVapifaultDeepgramReturning400NoSuchModelLanguageTierCombination, + + [EnumMember( + Value = "call.in-progress.error-vapifault-deepgram-returning-401-invalid-credentials" + )] + CallInProgressErrorVapifaultDeepgramReturning401InvalidCredentials, + + [EnumMember(Value = "call.in-progress.error-vapifault-deepgram-returning-404-not-found")] + CallInProgressErrorVapifaultDeepgramReturning404NotFound, + + [EnumMember( + Value = "call.in-progress.error-vapifault-deepgram-returning-403-model-access-denied" + )] + CallInProgressErrorVapifaultDeepgramReturning403ModelAccessDenied, + + [EnumMember(Value = "call.in-progress.error-providerfault-deepgram-returning-500-invalid-json")] + CallInProgressErrorProviderfaultDeepgramReturning500InvalidJson, + + [EnumMember( + Value = "call.in-progress.error-providerfault-deepgram-returning-502-network-error" + )] + CallInProgressErrorProviderfaultDeepgramReturning502NetworkError, + + [EnumMember( + Value = "call.in-progress.error-providerfault-deepgram-returning-502-bad-gateway-ehostunreach" + )] + CallInProgressErrorProviderfaultDeepgramReturning502BadGatewayEhostunreach, + + [EnumMember(Value = "pipeline-error-google-transcriber-failed")] + PipelineErrorGoogleTranscriberFailed, + + [EnumMember(Value = "call.in-progress.error-vapifault-google-transcriber-failed")] + CallInProgressErrorVapifaultGoogleTranscriberFailed, + + [EnumMember(Value = "pipeline-error-openai-transcriber-failed")] + PipelineErrorOpenaiTranscriberFailed, + + [EnumMember(Value = "call.in-progress.error-vapifault-openai-transcriber-failed")] + CallInProgressErrorVapifaultOpenaiTranscriberFailed, + + [EnumMember(Value = "assistant-ended-call")] + AssistantEndedCall, + + [EnumMember(Value = "assistant-said-end-call-phrase")] + AssistantSaidEndCallPhrase, + + [EnumMember(Value = "assistant-ended-call-with-hangup-task")] + AssistantEndedCallWithHangupTask, + + [EnumMember(Value = "assistant-ended-call-after-message-spoken")] + AssistantEndedCallAfterMessageSpoken, + + [EnumMember(Value = "assistant-forwarded-call")] + AssistantForwardedCall, + + [EnumMember(Value = "assistant-join-timed-out")] + AssistantJoinTimedOut, + + [EnumMember(Value = "call.in-progress.error-assistant-did-not-receive-customer-audio")] + CallInProgressErrorAssistantDidNotReceiveCustomerAudio, + + [EnumMember(Value = "customer-busy")] + CustomerBusy, + + [EnumMember(Value = "customer-ended-call")] + CustomerEndedCall, + + [EnumMember(Value = "customer-did-not-answer")] + CustomerDidNotAnswer, + + [EnumMember(Value = "customer-did-not-give-microphone-permission")] + CustomerDidNotGiveMicrophonePermission, + + [EnumMember(Value = "exceeded-max-duration")] + ExceededMaxDuration, + + [EnumMember(Value = "manually-canceled")] + ManuallyCanceled, + + [EnumMember(Value = "phone-call-provider-closed-websocket")] + PhoneCallProviderClosedWebsocket, + [EnumMember(Value = "silence-timed-out")] SilenceTimedOut, - [EnumMember(Value = "sip-gateway-failed-to-connect-call")] - SipGatewayFailedToConnectCall, + [EnumMember(Value = "call.in-progress.error-sip-telephony-provider-failed-to-connect-call")] + CallInProgressErrorSipTelephonyProviderFailedToConnectCall, + + [EnumMember(Value = "call.ringing.hook-executed-say")] + CallRingingHookExecutedSay, + + [EnumMember(Value = "call.ringing.hook-executed-transfer")] + CallRingingHookExecutedTransfer, [EnumMember(Value = "twilio-failed-to-connect-call")] TwilioFailedToConnectCall, diff --git a/src/Vapi.Net/Types/ServerMessageHang.cs b/src/Vapi.Net/Types/ServerMessageHang.cs index c1214f4..252b49a 100644 --- a/src/Vapi.Net/Types/ServerMessageHang.cs +++ b/src/Vapi.Net/Types/ServerMessageHang.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -26,10 +27,10 @@ public record ServerMessageHang public string Type { get; set; } = "hang"; /// - /// This is the ISO-8601 formatted timestamp of when the message was sent. + /// This is the timestamp of when the message was sent in milliseconds since Unix Epoch. /// [JsonPropertyName("timestamp")] - public string? Timestamp { get; set; } + public double? Timestamp { get; set; } /// /// This is a live version of the `call.artifact`. @@ -73,6 +74,17 @@ public record ServerMessageHang [JsonPropertyName("call")] public Call? Call { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/ServerMessageKnowledgeBaseRequest.cs b/src/Vapi.Net/Types/ServerMessageKnowledgeBaseRequest.cs index 3136941..7713dfb 100644 --- a/src/Vapi.Net/Types/ServerMessageKnowledgeBaseRequest.cs +++ b/src/Vapi.Net/Types/ServerMessageKnowledgeBaseRequest.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using OneOf; using Vapi.Net.Core; @@ -38,10 +39,10 @@ public IEnumerable< new List(); /// - /// This is the ISO-8601 formatted timestamp of when the message was sent. + /// This is the timestamp of when the message was sent in milliseconds since Unix Epoch. /// [JsonPropertyName("timestamp")] - public string? Timestamp { get; set; } + public double? Timestamp { get; set; } /// /// This is a live version of the `call.artifact`. @@ -85,6 +86,17 @@ public IEnumerable< [JsonPropertyName("call")] public Call? Call { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/ServerMessageLanguageChangeDetected.cs b/src/Vapi.Net/Types/ServerMessageLanguageChangeDetected.cs index 469ffde..59fa137 100644 --- a/src/Vapi.Net/Types/ServerMessageLanguageChangeDetected.cs +++ b/src/Vapi.Net/Types/ServerMessageLanguageChangeDetected.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -22,10 +23,10 @@ public record ServerMessageLanguageChangeDetected public string Type { get; set; } = "language-change-detected"; /// - /// This is the ISO-8601 formatted timestamp of when the message was sent. + /// This is the timestamp of when the message was sent in milliseconds since Unix Epoch. /// [JsonPropertyName("timestamp")] - public string? Timestamp { get; set; } + public double? Timestamp { get; set; } /// /// This is a live version of the `call.artifact`. @@ -75,6 +76,17 @@ public record ServerMessageLanguageChangeDetected [JsonPropertyName("language")] public required string Language { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/ServerMessageModelOutput.cs b/src/Vapi.Net/Types/ServerMessageModelOutput.cs index 7c41a0b..116606c 100644 --- a/src/Vapi.Net/Types/ServerMessageModelOutput.cs +++ b/src/Vapi.Net/Types/ServerMessageModelOutput.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -22,10 +23,10 @@ public record ServerMessageModelOutput public string Type { get; set; } = "model-output"; /// - /// This is the ISO-8601 formatted timestamp of when the message was sent. + /// This is the timestamp of when the message was sent in milliseconds since Unix Epoch. /// [JsonPropertyName("timestamp")] - public string? Timestamp { get; set; } + public double? Timestamp { get; set; } /// /// This is a live version of the `call.artifact`. @@ -75,6 +76,17 @@ public record ServerMessageModelOutput [JsonPropertyName("output")] public object Output { get; set; } = new Dictionary(); + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/ServerMessagePhoneCallControl.cs b/src/Vapi.Net/Types/ServerMessagePhoneCallControl.cs index fa3e394..edfb08a 100644 --- a/src/Vapi.Net/Types/ServerMessagePhoneCallControl.cs +++ b/src/Vapi.Net/Types/ServerMessagePhoneCallControl.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -36,10 +37,10 @@ public record ServerMessagePhoneCallControl public object? Destination { get; set; } /// - /// This is the ISO-8601 formatted timestamp of when the message was sent. + /// This is the timestamp of when the message was sent in milliseconds since Unix Epoch. /// [JsonPropertyName("timestamp")] - public string? Timestamp { get; set; } + public double? Timestamp { get; set; } /// /// This is a live version of the `call.artifact`. @@ -83,6 +84,17 @@ public record ServerMessagePhoneCallControl [JsonPropertyName("call")] public Call? Call { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/ServerMessageResponse.cs b/src/Vapi.Net/Types/ServerMessageResponse.cs index da341cd..5d42429 100644 --- a/src/Vapi.Net/Types/ServerMessageResponse.cs +++ b/src/Vapi.Net/Types/ServerMessageResponse.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using OneOf; using Vapi.Net.Core; @@ -20,6 +21,17 @@ public required OneOf< ServerMessageResponseVoiceRequest > MessageResponse { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/ServerMessageResponseAssistantRequest.cs b/src/Vapi.Net/Types/ServerMessageResponseAssistantRequest.cs index a52cd51..7042456 100644 --- a/src/Vapi.Net/Types/ServerMessageResponseAssistantRequest.cs +++ b/src/Vapi.Net/Types/ServerMessageResponseAssistantRequest.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -53,6 +54,17 @@ public record ServerMessageResponseAssistantRequest [JsonPropertyName("error")] public string? Error { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/ServerMessageResponseKnowledgeBaseRequest.cs b/src/Vapi.Net/Types/ServerMessageResponseKnowledgeBaseRequest.cs index 42de12b..6e99e64 100644 --- a/src/Vapi.Net/Types/ServerMessageResponseKnowledgeBaseRequest.cs +++ b/src/Vapi.Net/Types/ServerMessageResponseKnowledgeBaseRequest.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -17,6 +18,17 @@ public record ServerMessageResponseKnowledgeBaseRequest [JsonPropertyName("message")] public CustomMessage? Message { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/ServerMessageResponseToolCalls.cs b/src/Vapi.Net/Types/ServerMessageResponseToolCalls.cs index 9c39839..93558f1 100644 --- a/src/Vapi.Net/Types/ServerMessageResponseToolCalls.cs +++ b/src/Vapi.Net/Types/ServerMessageResponseToolCalls.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -17,6 +18,17 @@ public record ServerMessageResponseToolCalls [JsonPropertyName("error")] public string? Error { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/ServerMessageResponseTransferDestinationRequest.cs b/src/Vapi.Net/Types/ServerMessageResponseTransferDestinationRequest.cs index 58e138a..86fdd39 100644 --- a/src/Vapi.Net/Types/ServerMessageResponseTransferDestinationRequest.cs +++ b/src/Vapi.Net/Types/ServerMessageResponseTransferDestinationRequest.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -17,6 +18,17 @@ public record ServerMessageResponseTransferDestinationRequest [JsonPropertyName("error")] public string? Error { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/ServerMessageResponseVoiceRequest.cs b/src/Vapi.Net/Types/ServerMessageResponseVoiceRequest.cs index 49d598b..428f3fd 100644 --- a/src/Vapi.Net/Types/ServerMessageResponseVoiceRequest.cs +++ b/src/Vapi.Net/Types/ServerMessageResponseVoiceRequest.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -32,6 +33,17 @@ public record ServerMessageResponseVoiceRequest [JsonPropertyName("data")] public required string Data { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/ServerMessageSpeechUpdate.cs b/src/Vapi.Net/Types/ServerMessageSpeechUpdate.cs index 3a7e332..9efb6c7 100644 --- a/src/Vapi.Net/Types/ServerMessageSpeechUpdate.cs +++ b/src/Vapi.Net/Types/ServerMessageSpeechUpdate.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -34,10 +35,16 @@ public record ServerMessageSpeechUpdate public required ServerMessageSpeechUpdateRole Role { get; set; } /// - /// This is the ISO-8601 formatted timestamp of when the message was sent. + /// This is the turn number of the speech update (0-indexed). + /// + [JsonPropertyName("turn")] + public double? Turn { get; set; } + + /// + /// This is the timestamp of when the message was sent in milliseconds since Unix Epoch. /// [JsonPropertyName("timestamp")] - public string? Timestamp { get; set; } + public double? Timestamp { get; set; } /// /// This is a live version of the `call.artifact`. @@ -81,6 +88,17 @@ public record ServerMessageSpeechUpdate [JsonPropertyName("call")] public Call? Call { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/ServerMessageStatusUpdate.cs b/src/Vapi.Net/Types/ServerMessageStatusUpdate.cs index 9ab5196..ee2a1f7 100644 --- a/src/Vapi.Net/Types/ServerMessageStatusUpdate.cs +++ b/src/Vapi.Net/Types/ServerMessageStatusUpdate.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using OneOf; using Vapi.Net.Core; @@ -55,10 +56,10 @@ public IEnumerable< public object? Destination { get; set; } /// - /// This is the ISO-8601 formatted timestamp of when the message was sent. + /// This is the timestamp of when the message was sent in milliseconds since Unix Epoch. /// [JsonPropertyName("timestamp")] - public string? Timestamp { get; set; } + public double? Timestamp { get; set; } /// /// This is a live version of the `call.artifact`. @@ -122,6 +123,17 @@ public IEnumerable< [JsonPropertyName("inboundPhoneCallDebuggingArtifacts")] public object? InboundPhoneCallDebuggingArtifacts { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/ServerMessageStatusUpdateEndedReason.cs b/src/Vapi.Net/Types/ServerMessageStatusUpdateEndedReason.cs index ca9f22d..ab1fdce 100644 --- a/src/Vapi.Net/Types/ServerMessageStatusUpdateEndedReason.cs +++ b/src/Vapi.Net/Types/ServerMessageStatusUpdateEndedReason.cs @@ -7,12 +7,6 @@ namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] public enum ServerMessageStatusUpdateEndedReason { - [EnumMember(Value = "assistant-not-valid")] - AssistantNotValid, - - [EnumMember(Value = "assistant-not-provided")] - AssistantNotProvided, - [EnumMember(Value = "call-start-error-neither-assistant-nor-server-set")] CallStartErrorNeitherAssistantNorServerSet, @@ -34,54 +28,42 @@ public enum ServerMessageStatusUpdateEndedReason [EnumMember(Value = "assistant-request-returned-forwarding-phone-number")] AssistantRequestReturnedForwardingPhoneNumber, - [EnumMember(Value = "assistant-ended-call")] - AssistantEndedCall, + [EnumMember(Value = "call.start.error-get-org")] + CallStartErrorGetOrg, - [EnumMember(Value = "assistant-said-end-call-phrase")] - AssistantSaidEndCallPhrase, + [EnumMember(Value = "call.start.error-get-subscription")] + CallStartErrorGetSubscription, - [EnumMember(Value = "assistant-ended-call-with-hangup-task")] - AssistantEndedCallWithHangupTask, + [EnumMember(Value = "call.start.error-get-assistant")] + CallStartErrorGetAssistant, - [EnumMember(Value = "assistant-forwarded-call")] - AssistantForwardedCall, - - [EnumMember(Value = "assistant-join-timed-out")] - AssistantJoinTimedOut, - - [EnumMember(Value = "customer-busy")] - CustomerBusy, - - [EnumMember(Value = "customer-ended-call")] - CustomerEndedCall, + [EnumMember(Value = "call.start.error-get-phone-number")] + CallStartErrorGetPhoneNumber, - [EnumMember(Value = "customer-did-not-answer")] - CustomerDidNotAnswer, + [EnumMember(Value = "call.start.error-get-customer")] + CallStartErrorGetCustomer, - [EnumMember(Value = "customer-did-not-give-microphone-permission")] - CustomerDidNotGiveMicrophonePermission, + [EnumMember(Value = "call.start.error-get-resources-validation")] + CallStartErrorGetResourcesValidation, - [EnumMember(Value = "assistant-said-message-with-end-call-enabled")] - AssistantSaidMessageWithEndCallEnabled, + [EnumMember(Value = "call.start.error-vapi-number-international")] + CallStartErrorVapiNumberInternational, - [EnumMember(Value = "exceeded-max-duration")] - ExceededMaxDuration, + [EnumMember(Value = "call.start.error-vapi-number-outbound-daily-limit")] + CallStartErrorVapiNumberOutboundDailyLimit, - [EnumMember(Value = "manually-canceled")] - ManuallyCanceled, + [EnumMember(Value = "call.start.error-get-transport")] + CallStartErrorGetTransport, - [EnumMember(Value = "phone-call-provider-closed-websocket")] - PhoneCallProviderClosedWebsocket, + [EnumMember(Value = "assistant-not-valid")] + AssistantNotValid, - [EnumMember(Value = "db-error")] - DbError, + [EnumMember(Value = "database-error")] + DatabaseError, [EnumMember(Value = "assistant-not-found")] AssistantNotFound, - [EnumMember(Value = "license-check-failed")] - LicenseCheckFailed, - [EnumMember(Value = "pipeline-error-openai-voice-failed")] PipelineErrorOpenaiVoiceFailed, @@ -106,32 +88,59 @@ public enum ServerMessageStatusUpdateEndedReason [EnumMember(Value = "pipeline-error-rime-ai-voice-failed")] PipelineErrorRimeAiVoiceFailed, - [EnumMember(Value = "pipeline-error-neets-voice-failed")] - PipelineErrorNeetsVoiceFailed, - [EnumMember(Value = "pipeline-error-smallest-ai-voice-failed")] PipelineErrorSmallestAiVoiceFailed, [EnumMember(Value = "pipeline-error-neuphonic-voice-failed")] PipelineErrorNeuphonicVoiceFailed, - [EnumMember(Value = "pipeline-error-deepgram-transcriber-failed")] - PipelineErrorDeepgramTranscriberFailed, + [EnumMember(Value = "pipeline-error-hume-voice-failed")] + PipelineErrorHumeVoiceFailed, - [EnumMember(Value = "pipeline-error-gladia-transcriber-failed")] - PipelineErrorGladiaTranscriberFailed, + [EnumMember(Value = "pipeline-error-sesame-voice-failed")] + PipelineErrorSesameVoiceFailed, - [EnumMember(Value = "pipeline-error-speechmatics-transcriber-failed")] - PipelineErrorSpeechmaticsTranscriberFailed, + [EnumMember(Value = "pipeline-error-tavus-video-failed")] + PipelineErrorTavusVideoFailed, - [EnumMember(Value = "pipeline-error-assembly-ai-transcriber-failed")] - PipelineErrorAssemblyAiTranscriberFailed, + [EnumMember(Value = "call.in-progress.error-vapifault-openai-voice-failed")] + CallInProgressErrorVapifaultOpenaiVoiceFailed, - [EnumMember(Value = "pipeline-error-talkscriber-transcriber-failed")] - PipelineErrorTalkscriberTranscriberFailed, + [EnumMember(Value = "call.in-progress.error-vapifault-cartesia-voice-failed")] + CallInProgressErrorVapifaultCartesiaVoiceFailed, - [EnumMember(Value = "pipeline-error-azure-speech-transcriber-failed")] - PipelineErrorAzureSpeechTranscriberFailed, + [EnumMember(Value = "call.in-progress.error-vapifault-deepgram-voice-failed")] + CallInProgressErrorVapifaultDeepgramVoiceFailed, + + [EnumMember(Value = "call.in-progress.error-vapifault-eleven-labs-voice-failed")] + CallInProgressErrorVapifaultElevenLabsVoiceFailed, + + [EnumMember(Value = "call.in-progress.error-vapifault-playht-voice-failed")] + CallInProgressErrorVapifaultPlayhtVoiceFailed, + + [EnumMember(Value = "call.in-progress.error-vapifault-lmnt-voice-failed")] + CallInProgressErrorVapifaultLmntVoiceFailed, + + [EnumMember(Value = "call.in-progress.error-vapifault-azure-voice-failed")] + CallInProgressErrorVapifaultAzureVoiceFailed, + + [EnumMember(Value = "call.in-progress.error-vapifault-rime-ai-voice-failed")] + CallInProgressErrorVapifaultRimeAiVoiceFailed, + + [EnumMember(Value = "call.in-progress.error-vapifault-smallest-ai-voice-failed")] + CallInProgressErrorVapifaultSmallestAiVoiceFailed, + + [EnumMember(Value = "call.in-progress.error-vapifault-neuphonic-voice-failed")] + CallInProgressErrorVapifaultNeuphonicVoiceFailed, + + [EnumMember(Value = "call.in-progress.error-vapifault-hume-voice-failed")] + CallInProgressErrorVapifaultHumeVoiceFailed, + + [EnumMember(Value = "call.in-progress.error-vapifault-sesame-voice-failed")] + CallInProgressErrorVapifaultSesameVoiceFailed, + + [EnumMember(Value = "call.in-progress.error-vapifault-tavus-video-failed")] + CallInProgressErrorVapifaultTavusVideoFailed, [EnumMember(Value = "pipeline-error-vapi-llm-failed")] PipelineErrorVapiLlmFailed, @@ -151,8 +160,108 @@ public enum ServerMessageStatusUpdateEndedReason [EnumMember(Value = "pipeline-error-vapi-500-server-error")] PipelineErrorVapi500ServerError, - [EnumMember(Value = "pipeline-no-available-model")] - PipelineNoAvailableModel, + [EnumMember(Value = "pipeline-error-vapi-503-server-overloaded-error")] + PipelineErrorVapi503ServerOverloadedError, + + [EnumMember(Value = "call.in-progress.error-vapifault-vapi-llm-failed")] + CallInProgressErrorVapifaultVapiLlmFailed, + + [EnumMember(Value = "call.in-progress.error-vapifault-vapi-400-bad-request-validation-failed")] + CallInProgressErrorVapifaultVapi400BadRequestValidationFailed, + + [EnumMember(Value = "call.in-progress.error-vapifault-vapi-401-unauthorized")] + CallInProgressErrorVapifaultVapi401Unauthorized, + + [EnumMember(Value = "call.in-progress.error-vapifault-vapi-403-model-access-denied")] + CallInProgressErrorVapifaultVapi403ModelAccessDenied, + + [EnumMember(Value = "call.in-progress.error-vapifault-vapi-429-exceeded-quota")] + CallInProgressErrorVapifaultVapi429ExceededQuota, + + [EnumMember(Value = "call.in-progress.error-providerfault-vapi-500-server-error")] + CallInProgressErrorProviderfaultVapi500ServerError, + + [EnumMember(Value = "call.in-progress.error-providerfault-vapi-503-server-overloaded-error")] + CallInProgressErrorProviderfaultVapi503ServerOverloadedError, + + [EnumMember(Value = "pipeline-error-deepgram-transcriber-failed")] + PipelineErrorDeepgramTranscriberFailed, + + [EnumMember(Value = "call.in-progress.error-vapifault-deepgram-transcriber-failed")] + CallInProgressErrorVapifaultDeepgramTranscriberFailed, + + [EnumMember(Value = "pipeline-error-gladia-transcriber-failed")] + PipelineErrorGladiaTranscriberFailed, + + [EnumMember(Value = "call.in-progress.error-vapifault-gladia-transcriber-failed")] + CallInProgressErrorVapifaultGladiaTranscriberFailed, + + [EnumMember(Value = "pipeline-error-speechmatics-transcriber-failed")] + PipelineErrorSpeechmaticsTranscriberFailed, + + [EnumMember(Value = "call.in-progress.error-vapifault-speechmatics-transcriber-failed")] + CallInProgressErrorVapifaultSpeechmaticsTranscriberFailed, + + [EnumMember(Value = "pipeline-error-assembly-ai-transcriber-failed")] + PipelineErrorAssemblyAiTranscriberFailed, + + [EnumMember(Value = "pipeline-error-assembly-ai-returning-400-insufficent-funds")] + PipelineErrorAssemblyAiReturning400InsufficentFunds, + + [EnumMember(Value = "pipeline-error-assembly-ai-returning-400-paid-only-feature")] + PipelineErrorAssemblyAiReturning400PaidOnlyFeature, + + [EnumMember(Value = "pipeline-error-assembly-ai-returning-401-invalid-credentials")] + PipelineErrorAssemblyAiReturning401InvalidCredentials, + + [EnumMember(Value = "pipeline-error-assembly-ai-returning-500-invalid-schema")] + PipelineErrorAssemblyAiReturning500InvalidSchema, + + [EnumMember(Value = "pipeline-error-assembly-ai-returning-500-word-boost-parsing-failed")] + PipelineErrorAssemblyAiReturning500WordBoostParsingFailed, + + [EnumMember(Value = "call.in-progress.error-vapifault-assembly-ai-transcriber-failed")] + CallInProgressErrorVapifaultAssemblyAiTranscriberFailed, + + [EnumMember( + Value = "call.in-progress.error-vapifault-assembly-ai-returning-400-insufficent-funds" + )] + CallInProgressErrorVapifaultAssemblyAiReturning400InsufficentFunds, + + [EnumMember( + Value = "call.in-progress.error-vapifault-assembly-ai-returning-400-paid-only-feature" + )] + CallInProgressErrorVapifaultAssemblyAiReturning400PaidOnlyFeature, + + [EnumMember( + Value = "call.in-progress.error-vapifault-assembly-ai-returning-401-invalid-credentials" + )] + CallInProgressErrorVapifaultAssemblyAiReturning401InvalidCredentials, + + [EnumMember( + Value = "call.in-progress.error-vapifault-assembly-ai-returning-500-invalid-schema" + )] + CallInProgressErrorVapifaultAssemblyAiReturning500InvalidSchema, + + [EnumMember( + Value = "call.in-progress.error-vapifault-assembly-ai-returning-500-word-boost-parsing-failed" + )] + CallInProgressErrorVapifaultAssemblyAiReturning500WordBoostParsingFailed, + + [EnumMember(Value = "pipeline-error-talkscriber-transcriber-failed")] + PipelineErrorTalkscriberTranscriberFailed, + + [EnumMember(Value = "call.in-progress.error-vapifault-talkscriber-transcriber-failed")] + CallInProgressErrorVapifaultTalkscriberTranscriberFailed, + + [EnumMember(Value = "pipeline-error-azure-speech-transcriber-failed")] + PipelineErrorAzureSpeechTranscriberFailed, + + [EnumMember(Value = "call.in-progress.error-vapifault-azure-speech-transcriber-failed")] + CallInProgressErrorVapifaultAzureSpeechTranscriberFailed, + + [EnumMember(Value = "call.in-progress.error-pipeline-no-available-llm-model")] + CallInProgressErrorPipelineNoAvailableLlmModel, [EnumMember(Value = "worker-shutdown")] WorkerShutdown, @@ -166,56 +275,49 @@ public enum ServerMessageStatusUpdateEndedReason [EnumMember(Value = "vonage-failed-to-connect-call")] VonageFailedToConnectCall, + [EnumMember(Value = "vonage-completed")] + VonageCompleted, + [EnumMember(Value = "phone-call-provider-bypass-enabled-but-no-call-received")] PhoneCallProviderBypassEnabledButNoCallReceived, - [EnumMember(Value = "vapifault-phone-call-worker-setup-socket-error")] - VapifaultPhoneCallWorkerSetupSocketError, - - [EnumMember(Value = "vapifault-phone-call-worker-worker-setup-socket-timeout")] - VapifaultPhoneCallWorkerWorkerSetupSocketTimeout, - - [EnumMember(Value = "vapifault-phone-call-worker-could-not-find-call")] - VapifaultPhoneCallWorkerCouldNotFindCall, - - [EnumMember(Value = "vapifault-transport-never-connected")] - VapifaultTransportNeverConnected, - - [EnumMember(Value = "vapifault-web-call-worker-setup-failed")] - VapifaultWebCallWorkerSetupFailed, + [EnumMember(Value = "call.in-progress.error-vapifault-transport-never-connected")] + CallInProgressErrorVapifaultTransportNeverConnected, - [EnumMember(Value = "vapifault-transport-connected-but-call-not-active")] - VapifaultTransportConnectedButCallNotActive, + [EnumMember(Value = "call.in-progress.error-vapifault-transport-connected-but-call-not-active")] + CallInProgressErrorVapifaultTransportConnectedButCallNotActive, - [EnumMember(Value = "vapifault-call-started-but-connection-to-transport-missing")] - VapifaultCallStartedButConnectionToTransportMissing, + [EnumMember( + Value = "call.in-progress.error-vapifault-call-started-but-connection-to-transport-missing" + )] + CallInProgressErrorVapifaultCallStartedButConnectionToTransportMissing, - [EnumMember(Value = "pipeline-error-openai-llm-failed")] - PipelineErrorOpenaiLlmFailed, + [EnumMember(Value = "call.in-progress.error-vapifault-openai-llm-failed")] + CallInProgressErrorVapifaultOpenaiLlmFailed, - [EnumMember(Value = "pipeline-error-azure-openai-llm-failed")] - PipelineErrorAzureOpenaiLlmFailed, + [EnumMember(Value = "call.in-progress.error-vapifault-azure-openai-llm-failed")] + CallInProgressErrorVapifaultAzureOpenaiLlmFailed, - [EnumMember(Value = "pipeline-error-groq-llm-failed")] - PipelineErrorGroqLlmFailed, + [EnumMember(Value = "call.in-progress.error-vapifault-groq-llm-failed")] + CallInProgressErrorVapifaultGroqLlmFailed, - [EnumMember(Value = "pipeline-error-google-llm-failed")] - PipelineErrorGoogleLlmFailed, + [EnumMember(Value = "call.in-progress.error-vapifault-google-llm-failed")] + CallInProgressErrorVapifaultGoogleLlmFailed, - [EnumMember(Value = "pipeline-error-xai-llm-failed")] - PipelineErrorXaiLlmFailed, + [EnumMember(Value = "call.in-progress.error-vapifault-xai-llm-failed")] + CallInProgressErrorVapifaultXaiLlmFailed, - [EnumMember(Value = "pipeline-error-mistral-llm-failed")] - PipelineErrorMistralLlmFailed, + [EnumMember(Value = "call.in-progress.error-vapifault-mistral-llm-failed")] + CallInProgressErrorVapifaultMistralLlmFailed, - [EnumMember(Value = "pipeline-error-inflection-ai-llm-failed")] - PipelineErrorInflectionAiLlmFailed, + [EnumMember(Value = "call.in-progress.error-vapifault-inflection-ai-llm-failed")] + CallInProgressErrorVapifaultInflectionAiLlmFailed, - [EnumMember(Value = "pipeline-error-cerebras-llm-failed")] - PipelineErrorCerebrasLlmFailed, + [EnumMember(Value = "call.in-progress.error-vapifault-cerebras-llm-failed")] + CallInProgressErrorVapifaultCerebrasLlmFailed, - [EnumMember(Value = "pipeline-error-deep-seek-llm-failed")] - PipelineErrorDeepSeekLlmFailed, + [EnumMember(Value = "call.in-progress.error-vapifault-deep-seek-llm-failed")] + CallInProgressErrorVapifaultDeepSeekLlmFailed, [EnumMember(Value = "pipeline-error-openai-400-bad-request-validation-failed")] PipelineErrorOpenai400BadRequestValidationFailed, @@ -223,15 +325,102 @@ public enum ServerMessageStatusUpdateEndedReason [EnumMember(Value = "pipeline-error-openai-401-unauthorized")] PipelineErrorOpenai401Unauthorized, + [EnumMember(Value = "pipeline-error-openai-401-incorrect-api-key")] + PipelineErrorOpenai401IncorrectApiKey, + + [EnumMember(Value = "pipeline-error-openai-401-account-not-in-organization")] + PipelineErrorOpenai401AccountNotInOrganization, + [EnumMember(Value = "pipeline-error-openai-403-model-access-denied")] PipelineErrorOpenai403ModelAccessDenied, [EnumMember(Value = "pipeline-error-openai-429-exceeded-quota")] PipelineErrorOpenai429ExceededQuota, + [EnumMember(Value = "pipeline-error-openai-429-rate-limit-reached")] + PipelineErrorOpenai429RateLimitReached, + [EnumMember(Value = "pipeline-error-openai-500-server-error")] PipelineErrorOpenai500ServerError, + [EnumMember(Value = "pipeline-error-openai-503-server-overloaded-error")] + PipelineErrorOpenai503ServerOverloadedError, + + [EnumMember(Value = "pipeline-error-openai-llm-failed")] + PipelineErrorOpenaiLlmFailed, + + [EnumMember( + Value = "call.in-progress.error-vapifault-openai-400-bad-request-validation-failed" + )] + CallInProgressErrorVapifaultOpenai400BadRequestValidationFailed, + + [EnumMember(Value = "call.in-progress.error-vapifault-openai-401-unauthorized")] + CallInProgressErrorVapifaultOpenai401Unauthorized, + + [EnumMember(Value = "call.in-progress.error-vapifault-openai-401-incorrect-api-key")] + CallInProgressErrorVapifaultOpenai401IncorrectApiKey, + + [EnumMember(Value = "call.in-progress.error-vapifault-openai-401-account-not-in-organization")] + CallInProgressErrorVapifaultOpenai401AccountNotInOrganization, + + [EnumMember(Value = "call.in-progress.error-vapifault-openai-403-model-access-denied")] + CallInProgressErrorVapifaultOpenai403ModelAccessDenied, + + [EnumMember(Value = "call.in-progress.error-vapifault-openai-429-exceeded-quota")] + CallInProgressErrorVapifaultOpenai429ExceededQuota, + + [EnumMember(Value = "call.in-progress.error-vapifault-openai-429-rate-limit-reached")] + CallInProgressErrorVapifaultOpenai429RateLimitReached, + + [EnumMember(Value = "call.in-progress.error-providerfault-openai-500-server-error")] + CallInProgressErrorProviderfaultOpenai500ServerError, + + [EnumMember(Value = "call.in-progress.error-providerfault-openai-503-server-overloaded-error")] + CallInProgressErrorProviderfaultOpenai503ServerOverloadedError, + + [EnumMember(Value = "pipeline-error-azure-openai-400-bad-request-validation-failed")] + PipelineErrorAzureOpenai400BadRequestValidationFailed, + + [EnumMember(Value = "pipeline-error-azure-openai-401-unauthorized")] + PipelineErrorAzureOpenai401Unauthorized, + + [EnumMember(Value = "pipeline-error-azure-openai-403-model-access-denied")] + PipelineErrorAzureOpenai403ModelAccessDenied, + + [EnumMember(Value = "pipeline-error-azure-openai-429-exceeded-quota")] + PipelineErrorAzureOpenai429ExceededQuota, + + [EnumMember(Value = "pipeline-error-azure-openai-500-server-error")] + PipelineErrorAzureOpenai500ServerError, + + [EnumMember(Value = "pipeline-error-azure-openai-503-server-overloaded-error")] + PipelineErrorAzureOpenai503ServerOverloadedError, + + [EnumMember(Value = "pipeline-error-azure-openai-llm-failed")] + PipelineErrorAzureOpenaiLlmFailed, + + [EnumMember( + Value = "call.in-progress.error-vapifault-azure-openai-400-bad-request-validation-failed" + )] + CallInProgressErrorVapifaultAzureOpenai400BadRequestValidationFailed, + + [EnumMember(Value = "call.in-progress.error-vapifault-azure-openai-401-unauthorized")] + CallInProgressErrorVapifaultAzureOpenai401Unauthorized, + + [EnumMember(Value = "call.in-progress.error-vapifault-azure-openai-403-model-access-denied")] + CallInProgressErrorVapifaultAzureOpenai403ModelAccessDenied, + + [EnumMember(Value = "call.in-progress.error-vapifault-azure-openai-429-exceeded-quota")] + CallInProgressErrorVapifaultAzureOpenai429ExceededQuota, + + [EnumMember(Value = "call.in-progress.error-providerfault-azure-openai-500-server-error")] + CallInProgressErrorProviderfaultAzureOpenai500ServerError, + + [EnumMember( + Value = "call.in-progress.error-providerfault-azure-openai-503-server-overloaded-error" + )] + CallInProgressErrorProviderfaultAzureOpenai503ServerOverloadedError, + [EnumMember(Value = "pipeline-error-google-400-bad-request-validation-failed")] PipelineErrorGoogle400BadRequestValidationFailed, @@ -247,6 +436,32 @@ public enum ServerMessageStatusUpdateEndedReason [EnumMember(Value = "pipeline-error-google-500-server-error")] PipelineErrorGoogle500ServerError, + [EnumMember(Value = "pipeline-error-google-503-server-overloaded-error")] + PipelineErrorGoogle503ServerOverloadedError, + + [EnumMember(Value = "pipeline-error-google-llm-failed")] + PipelineErrorGoogleLlmFailed, + + [EnumMember( + Value = "call.in-progress.error-vapifault-google-400-bad-request-validation-failed" + )] + CallInProgressErrorVapifaultGoogle400BadRequestValidationFailed, + + [EnumMember(Value = "call.in-progress.error-vapifault-google-401-unauthorized")] + CallInProgressErrorVapifaultGoogle401Unauthorized, + + [EnumMember(Value = "call.in-progress.error-vapifault-google-403-model-access-denied")] + CallInProgressErrorVapifaultGoogle403ModelAccessDenied, + + [EnumMember(Value = "call.in-progress.error-vapifault-google-429-exceeded-quota")] + CallInProgressErrorVapifaultGoogle429ExceededQuota, + + [EnumMember(Value = "call.in-progress.error-providerfault-google-500-server-error")] + CallInProgressErrorProviderfaultGoogle500ServerError, + + [EnumMember(Value = "call.in-progress.error-providerfault-google-503-server-overloaded-error")] + CallInProgressErrorProviderfaultGoogle503ServerOverloadedError, + [EnumMember(Value = "pipeline-error-xai-400-bad-request-validation-failed")] PipelineErrorXai400BadRequestValidationFailed, @@ -262,6 +477,30 @@ public enum ServerMessageStatusUpdateEndedReason [EnumMember(Value = "pipeline-error-xai-500-server-error")] PipelineErrorXai500ServerError, + [EnumMember(Value = "pipeline-error-xai-503-server-overloaded-error")] + PipelineErrorXai503ServerOverloadedError, + + [EnumMember(Value = "pipeline-error-xai-llm-failed")] + PipelineErrorXaiLlmFailed, + + [EnumMember(Value = "call.in-progress.error-vapifault-xai-400-bad-request-validation-failed")] + CallInProgressErrorVapifaultXai400BadRequestValidationFailed, + + [EnumMember(Value = "call.in-progress.error-vapifault-xai-401-unauthorized")] + CallInProgressErrorVapifaultXai401Unauthorized, + + [EnumMember(Value = "call.in-progress.error-vapifault-xai-403-model-access-denied")] + CallInProgressErrorVapifaultXai403ModelAccessDenied, + + [EnumMember(Value = "call.in-progress.error-vapifault-xai-429-exceeded-quota")] + CallInProgressErrorVapifaultXai429ExceededQuota, + + [EnumMember(Value = "call.in-progress.error-providerfault-xai-500-server-error")] + CallInProgressErrorProviderfaultXai500ServerError, + + [EnumMember(Value = "call.in-progress.error-providerfault-xai-503-server-overloaded-error")] + CallInProgressErrorProviderfaultXai503ServerOverloadedError, + [EnumMember(Value = "pipeline-error-mistral-400-bad-request-validation-failed")] PipelineErrorMistral400BadRequestValidationFailed, @@ -277,6 +516,32 @@ public enum ServerMessageStatusUpdateEndedReason [EnumMember(Value = "pipeline-error-mistral-500-server-error")] PipelineErrorMistral500ServerError, + [EnumMember(Value = "pipeline-error-mistral-503-server-overloaded-error")] + PipelineErrorMistral503ServerOverloadedError, + + [EnumMember(Value = "pipeline-error-mistral-llm-failed")] + PipelineErrorMistralLlmFailed, + + [EnumMember( + Value = "call.in-progress.error-vapifault-mistral-400-bad-request-validation-failed" + )] + CallInProgressErrorVapifaultMistral400BadRequestValidationFailed, + + [EnumMember(Value = "call.in-progress.error-vapifault-mistral-401-unauthorized")] + CallInProgressErrorVapifaultMistral401Unauthorized, + + [EnumMember(Value = "call.in-progress.error-vapifault-mistral-403-model-access-denied")] + CallInProgressErrorVapifaultMistral403ModelAccessDenied, + + [EnumMember(Value = "call.in-progress.error-vapifault-mistral-429-exceeded-quota")] + CallInProgressErrorVapifaultMistral429ExceededQuota, + + [EnumMember(Value = "call.in-progress.error-providerfault-mistral-500-server-error")] + CallInProgressErrorProviderfaultMistral500ServerError, + + [EnumMember(Value = "call.in-progress.error-providerfault-mistral-503-server-overloaded-error")] + CallInProgressErrorProviderfaultMistral503ServerOverloadedError, + [EnumMember(Value = "pipeline-error-inflection-ai-400-bad-request-validation-failed")] PipelineErrorInflectionAi400BadRequestValidationFailed, @@ -292,6 +557,34 @@ public enum ServerMessageStatusUpdateEndedReason [EnumMember(Value = "pipeline-error-inflection-ai-500-server-error")] PipelineErrorInflectionAi500ServerError, + [EnumMember(Value = "pipeline-error-inflection-ai-503-server-overloaded-error")] + PipelineErrorInflectionAi503ServerOverloadedError, + + [EnumMember(Value = "pipeline-error-inflection-ai-llm-failed")] + PipelineErrorInflectionAiLlmFailed, + + [EnumMember( + Value = "call.in-progress.error-vapifault-inflection-ai-400-bad-request-validation-failed" + )] + CallInProgressErrorVapifaultInflectionAi400BadRequestValidationFailed, + + [EnumMember(Value = "call.in-progress.error-vapifault-inflection-ai-401-unauthorized")] + CallInProgressErrorVapifaultInflectionAi401Unauthorized, + + [EnumMember(Value = "call.in-progress.error-vapifault-inflection-ai-403-model-access-denied")] + CallInProgressErrorVapifaultInflectionAi403ModelAccessDenied, + + [EnumMember(Value = "call.in-progress.error-vapifault-inflection-ai-429-exceeded-quota")] + CallInProgressErrorVapifaultInflectionAi429ExceededQuota, + + [EnumMember(Value = "call.in-progress.error-providerfault-inflection-ai-500-server-error")] + CallInProgressErrorProviderfaultInflectionAi500ServerError, + + [EnumMember( + Value = "call.in-progress.error-providerfault-inflection-ai-503-server-overloaded-error" + )] + CallInProgressErrorProviderfaultInflectionAi503ServerOverloadedError, + [EnumMember(Value = "pipeline-error-deep-seek-400-bad-request-validation-failed")] PipelineErrorDeepSeek400BadRequestValidationFailed, @@ -307,20 +600,33 @@ public enum ServerMessageStatusUpdateEndedReason [EnumMember(Value = "pipeline-error-deep-seek-500-server-error")] PipelineErrorDeepSeek500ServerError, - [EnumMember(Value = "pipeline-error-azure-openai-400-bad-request-validation-failed")] - PipelineErrorAzureOpenai400BadRequestValidationFailed, + [EnumMember(Value = "pipeline-error-deep-seek-503-server-overloaded-error")] + PipelineErrorDeepSeek503ServerOverloadedError, - [EnumMember(Value = "pipeline-error-azure-openai-401-unauthorized")] - PipelineErrorAzureOpenai401Unauthorized, + [EnumMember(Value = "pipeline-error-deep-seek-llm-failed")] + PipelineErrorDeepSeekLlmFailed, - [EnumMember(Value = "pipeline-error-azure-openai-403-model-access-denied")] - PipelineErrorAzureOpenai403ModelAccessDenied, + [EnumMember( + Value = "call.in-progress.error-vapifault-deep-seek-400-bad-request-validation-failed" + )] + CallInProgressErrorVapifaultDeepSeek400BadRequestValidationFailed, - [EnumMember(Value = "pipeline-error-azure-openai-429-exceeded-quota")] - PipelineErrorAzureOpenai429ExceededQuota, + [EnumMember(Value = "call.in-progress.error-vapifault-deep-seek-401-unauthorized")] + CallInProgressErrorVapifaultDeepSeek401Unauthorized, - [EnumMember(Value = "pipeline-error-azure-openai-500-server-error")] - PipelineErrorAzureOpenai500ServerError, + [EnumMember(Value = "call.in-progress.error-vapifault-deep-seek-403-model-access-denied")] + CallInProgressErrorVapifaultDeepSeek403ModelAccessDenied, + + [EnumMember(Value = "call.in-progress.error-vapifault-deep-seek-429-exceeded-quota")] + CallInProgressErrorVapifaultDeepSeek429ExceededQuota, + + [EnumMember(Value = "call.in-progress.error-providerfault-deep-seek-500-server-error")] + CallInProgressErrorProviderfaultDeepSeek500ServerError, + + [EnumMember( + Value = "call.in-progress.error-providerfault-deep-seek-503-server-overloaded-error" + )] + CallInProgressErrorProviderfaultDeepSeek503ServerOverloadedError, [EnumMember(Value = "pipeline-error-groq-400-bad-request-validation-failed")] PipelineErrorGroq400BadRequestValidationFailed, @@ -337,6 +643,30 @@ public enum ServerMessageStatusUpdateEndedReason [EnumMember(Value = "pipeline-error-groq-500-server-error")] PipelineErrorGroq500ServerError, + [EnumMember(Value = "pipeline-error-groq-503-server-overloaded-error")] + PipelineErrorGroq503ServerOverloadedError, + + [EnumMember(Value = "pipeline-error-groq-llm-failed")] + PipelineErrorGroqLlmFailed, + + [EnumMember(Value = "call.in-progress.error-vapifault-groq-400-bad-request-validation-failed")] + CallInProgressErrorVapifaultGroq400BadRequestValidationFailed, + + [EnumMember(Value = "call.in-progress.error-vapifault-groq-401-unauthorized")] + CallInProgressErrorVapifaultGroq401Unauthorized, + + [EnumMember(Value = "call.in-progress.error-vapifault-groq-403-model-access-denied")] + CallInProgressErrorVapifaultGroq403ModelAccessDenied, + + [EnumMember(Value = "call.in-progress.error-vapifault-groq-429-exceeded-quota")] + CallInProgressErrorVapifaultGroq429ExceededQuota, + + [EnumMember(Value = "call.in-progress.error-providerfault-groq-500-server-error")] + CallInProgressErrorProviderfaultGroq500ServerError, + + [EnumMember(Value = "call.in-progress.error-providerfault-groq-503-server-overloaded-error")] + CallInProgressErrorProviderfaultGroq503ServerOverloadedError, + [EnumMember(Value = "pipeline-error-cerebras-400-bad-request-validation-failed")] PipelineErrorCerebras400BadRequestValidationFailed, @@ -346,29 +676,181 @@ public enum ServerMessageStatusUpdateEndedReason [EnumMember(Value = "pipeline-error-cerebras-403-model-access-denied")] PipelineErrorCerebras403ModelAccessDenied, - [EnumMember(Value = "pipeline-error-cerebras-429-exceeded-quota")] - PipelineErrorCerebras429ExceededQuota, + [EnumMember(Value = "pipeline-error-cerebras-429-exceeded-quota")] + PipelineErrorCerebras429ExceededQuota, + + [EnumMember(Value = "pipeline-error-cerebras-500-server-error")] + PipelineErrorCerebras500ServerError, + + [EnumMember(Value = "pipeline-error-cerebras-503-server-overloaded-error")] + PipelineErrorCerebras503ServerOverloadedError, + + [EnumMember(Value = "pipeline-error-cerebras-llm-failed")] + PipelineErrorCerebrasLlmFailed, + + [EnumMember( + Value = "call.in-progress.error-vapifault-cerebras-400-bad-request-validation-failed" + )] + CallInProgressErrorVapifaultCerebras400BadRequestValidationFailed, + + [EnumMember(Value = "call.in-progress.error-vapifault-cerebras-401-unauthorized")] + CallInProgressErrorVapifaultCerebras401Unauthorized, + + [EnumMember(Value = "call.in-progress.error-vapifault-cerebras-403-model-access-denied")] + CallInProgressErrorVapifaultCerebras403ModelAccessDenied, + + [EnumMember(Value = "call.in-progress.error-vapifault-cerebras-429-exceeded-quota")] + CallInProgressErrorVapifaultCerebras429ExceededQuota, + + [EnumMember(Value = "call.in-progress.error-providerfault-cerebras-500-server-error")] + CallInProgressErrorProviderfaultCerebras500ServerError, + + [EnumMember( + Value = "call.in-progress.error-providerfault-cerebras-503-server-overloaded-error" + )] + CallInProgressErrorProviderfaultCerebras503ServerOverloadedError, + + [EnumMember(Value = "pipeline-error-anthropic-400-bad-request-validation-failed")] + PipelineErrorAnthropic400BadRequestValidationFailed, + + [EnumMember(Value = "pipeline-error-anthropic-401-unauthorized")] + PipelineErrorAnthropic401Unauthorized, + + [EnumMember(Value = "pipeline-error-anthropic-403-model-access-denied")] + PipelineErrorAnthropic403ModelAccessDenied, + + [EnumMember(Value = "pipeline-error-anthropic-429-exceeded-quota")] + PipelineErrorAnthropic429ExceededQuota, + + [EnumMember(Value = "pipeline-error-anthropic-500-server-error")] + PipelineErrorAnthropic500ServerError, + + [EnumMember(Value = "pipeline-error-anthropic-503-server-overloaded-error")] + PipelineErrorAnthropic503ServerOverloadedError, + + [EnumMember(Value = "pipeline-error-anthropic-llm-failed")] + PipelineErrorAnthropicLlmFailed, + + [EnumMember(Value = "call.in-progress.error-vapifault-anthropic-llm-failed")] + CallInProgressErrorVapifaultAnthropicLlmFailed, + + [EnumMember( + Value = "call.in-progress.error-vapifault-anthropic-400-bad-request-validation-failed" + )] + CallInProgressErrorVapifaultAnthropic400BadRequestValidationFailed, + + [EnumMember(Value = "call.in-progress.error-vapifault-anthropic-401-unauthorized")] + CallInProgressErrorVapifaultAnthropic401Unauthorized, + + [EnumMember(Value = "call.in-progress.error-vapifault-anthropic-403-model-access-denied")] + CallInProgressErrorVapifaultAnthropic403ModelAccessDenied, + + [EnumMember(Value = "call.in-progress.error-vapifault-anthropic-429-exceeded-quota")] + CallInProgressErrorVapifaultAnthropic429ExceededQuota, + + [EnumMember(Value = "call.in-progress.error-providerfault-anthropic-500-server-error")] + CallInProgressErrorProviderfaultAnthropic500ServerError, + + [EnumMember( + Value = "call.in-progress.error-providerfault-anthropic-503-server-overloaded-error" + )] + CallInProgressErrorProviderfaultAnthropic503ServerOverloadedError, + + [EnumMember(Value = "pipeline-error-anthropic-bedrock-400-bad-request-validation-failed")] + PipelineErrorAnthropicBedrock400BadRequestValidationFailed, + + [EnumMember(Value = "pipeline-error-anthropic-bedrock-401-unauthorized")] + PipelineErrorAnthropicBedrock401Unauthorized, + + [EnumMember(Value = "pipeline-error-anthropic-bedrock-403-model-access-denied")] + PipelineErrorAnthropicBedrock403ModelAccessDenied, + + [EnumMember(Value = "pipeline-error-anthropic-bedrock-429-exceeded-quota")] + PipelineErrorAnthropicBedrock429ExceededQuota, + + [EnumMember(Value = "pipeline-error-anthropic-bedrock-500-server-error")] + PipelineErrorAnthropicBedrock500ServerError, + + [EnumMember(Value = "pipeline-error-anthropic-bedrock-503-server-overloaded-error")] + PipelineErrorAnthropicBedrock503ServerOverloadedError, + + [EnumMember(Value = "pipeline-error-anthropic-bedrock-llm-failed")] + PipelineErrorAnthropicBedrockLlmFailed, + + [EnumMember(Value = "call.in-progress.error-vapifault-anthropic-bedrock-llm-failed")] + CallInProgressErrorVapifaultAnthropicBedrockLlmFailed, + + [EnumMember( + Value = "call.in-progress.error-vapifault-anthropic-bedrock-400-bad-request-validation-failed" + )] + CallInProgressErrorVapifaultAnthropicBedrock400BadRequestValidationFailed, + + [EnumMember(Value = "call.in-progress.error-vapifault-anthropic-bedrock-401-unauthorized")] + CallInProgressErrorVapifaultAnthropicBedrock401Unauthorized, + + [EnumMember( + Value = "call.in-progress.error-vapifault-anthropic-bedrock-403-model-access-denied" + )] + CallInProgressErrorVapifaultAnthropicBedrock403ModelAccessDenied, + + [EnumMember(Value = "call.in-progress.error-vapifault-anthropic-bedrock-429-exceeded-quota")] + CallInProgressErrorVapifaultAnthropicBedrock429ExceededQuota, + + [EnumMember(Value = "call.in-progress.error-providerfault-anthropic-bedrock-500-server-error")] + CallInProgressErrorProviderfaultAnthropicBedrock500ServerError, + + [EnumMember( + Value = "call.in-progress.error-providerfault-anthropic-bedrock-503-server-overloaded-error" + )] + CallInProgressErrorProviderfaultAnthropicBedrock503ServerOverloadedError, + + [EnumMember(Value = "pipeline-error-anthropic-vertex-400-bad-request-validation-failed")] + PipelineErrorAnthropicVertex400BadRequestValidationFailed, + + [EnumMember(Value = "pipeline-error-anthropic-vertex-401-unauthorized")] + PipelineErrorAnthropicVertex401Unauthorized, + + [EnumMember(Value = "pipeline-error-anthropic-vertex-403-model-access-denied")] + PipelineErrorAnthropicVertex403ModelAccessDenied, + + [EnumMember(Value = "pipeline-error-anthropic-vertex-429-exceeded-quota")] + PipelineErrorAnthropicVertex429ExceededQuota, + + [EnumMember(Value = "pipeline-error-anthropic-vertex-500-server-error")] + PipelineErrorAnthropicVertex500ServerError, + + [EnumMember(Value = "pipeline-error-anthropic-vertex-503-server-overloaded-error")] + PipelineErrorAnthropicVertex503ServerOverloadedError, - [EnumMember(Value = "pipeline-error-cerebras-500-server-error")] - PipelineErrorCerebras500ServerError, + [EnumMember(Value = "pipeline-error-anthropic-vertex-llm-failed")] + PipelineErrorAnthropicVertexLlmFailed, - [EnumMember(Value = "pipeline-error-anthropic-400-bad-request-validation-failed")] - PipelineErrorAnthropic400BadRequestValidationFailed, + [EnumMember(Value = "call.in-progress.error-vapifault-anthropic-vertex-llm-failed")] + CallInProgressErrorVapifaultAnthropicVertexLlmFailed, - [EnumMember(Value = "pipeline-error-anthropic-401-unauthorized")] - PipelineErrorAnthropic401Unauthorized, + [EnumMember( + Value = "call.in-progress.error-vapifault-anthropic-vertex-400-bad-request-validation-failed" + )] + CallInProgressErrorVapifaultAnthropicVertex400BadRequestValidationFailed, - [EnumMember(Value = "pipeline-error-anthropic-403-model-access-denied")] - PipelineErrorAnthropic403ModelAccessDenied, + [EnumMember(Value = "call.in-progress.error-vapifault-anthropic-vertex-401-unauthorized")] + CallInProgressErrorVapifaultAnthropicVertex401Unauthorized, - [EnumMember(Value = "pipeline-error-anthropic-429-exceeded-quota")] - PipelineErrorAnthropic429ExceededQuota, + [EnumMember( + Value = "call.in-progress.error-vapifault-anthropic-vertex-403-model-access-denied" + )] + CallInProgressErrorVapifaultAnthropicVertex403ModelAccessDenied, - [EnumMember(Value = "pipeline-error-anthropic-500-server-error")] - PipelineErrorAnthropic500ServerError, + [EnumMember(Value = "call.in-progress.error-vapifault-anthropic-vertex-429-exceeded-quota")] + CallInProgressErrorVapifaultAnthropicVertex429ExceededQuota, - [EnumMember(Value = "pipeline-error-anthropic-llm-failed")] - PipelineErrorAnthropicLlmFailed, + [EnumMember(Value = "call.in-progress.error-providerfault-anthropic-vertex-500-server-error")] + CallInProgressErrorProviderfaultAnthropicVertex500ServerError, + + [EnumMember( + Value = "call.in-progress.error-providerfault-anthropic-vertex-503-server-overloaded-error" + )] + CallInProgressErrorProviderfaultAnthropicVertex503ServerOverloadedError, [EnumMember(Value = "pipeline-error-together-ai-400-bad-request-validation-failed")] PipelineErrorTogetherAi400BadRequestValidationFailed, @@ -385,9 +867,37 @@ public enum ServerMessageStatusUpdateEndedReason [EnumMember(Value = "pipeline-error-together-ai-500-server-error")] PipelineErrorTogetherAi500ServerError, + [EnumMember(Value = "pipeline-error-together-ai-503-server-overloaded-error")] + PipelineErrorTogetherAi503ServerOverloadedError, + [EnumMember(Value = "pipeline-error-together-ai-llm-failed")] PipelineErrorTogetherAiLlmFailed, + [EnumMember(Value = "call.in-progress.error-vapifault-together-ai-llm-failed")] + CallInProgressErrorVapifaultTogetherAiLlmFailed, + + [EnumMember( + Value = "call.in-progress.error-vapifault-together-ai-400-bad-request-validation-failed" + )] + CallInProgressErrorVapifaultTogetherAi400BadRequestValidationFailed, + + [EnumMember(Value = "call.in-progress.error-vapifault-together-ai-401-unauthorized")] + CallInProgressErrorVapifaultTogetherAi401Unauthorized, + + [EnumMember(Value = "call.in-progress.error-vapifault-together-ai-403-model-access-denied")] + CallInProgressErrorVapifaultTogetherAi403ModelAccessDenied, + + [EnumMember(Value = "call.in-progress.error-vapifault-together-ai-429-exceeded-quota")] + CallInProgressErrorVapifaultTogetherAi429ExceededQuota, + + [EnumMember(Value = "call.in-progress.error-providerfault-together-ai-500-server-error")] + CallInProgressErrorProviderfaultTogetherAi500ServerError, + + [EnumMember( + Value = "call.in-progress.error-providerfault-together-ai-503-server-overloaded-error" + )] + CallInProgressErrorProviderfaultTogetherAi503ServerOverloadedError, + [EnumMember(Value = "pipeline-error-anyscale-400-bad-request-validation-failed")] PipelineErrorAnyscale400BadRequestValidationFailed, @@ -403,9 +913,37 @@ public enum ServerMessageStatusUpdateEndedReason [EnumMember(Value = "pipeline-error-anyscale-500-server-error")] PipelineErrorAnyscale500ServerError, + [EnumMember(Value = "pipeline-error-anyscale-503-server-overloaded-error")] + PipelineErrorAnyscale503ServerOverloadedError, + [EnumMember(Value = "pipeline-error-anyscale-llm-failed")] PipelineErrorAnyscaleLlmFailed, + [EnumMember(Value = "call.in-progress.error-vapifault-anyscale-llm-failed")] + CallInProgressErrorVapifaultAnyscaleLlmFailed, + + [EnumMember( + Value = "call.in-progress.error-vapifault-anyscale-400-bad-request-validation-failed" + )] + CallInProgressErrorVapifaultAnyscale400BadRequestValidationFailed, + + [EnumMember(Value = "call.in-progress.error-vapifault-anyscale-401-unauthorized")] + CallInProgressErrorVapifaultAnyscale401Unauthorized, + + [EnumMember(Value = "call.in-progress.error-vapifault-anyscale-403-model-access-denied")] + CallInProgressErrorVapifaultAnyscale403ModelAccessDenied, + + [EnumMember(Value = "call.in-progress.error-vapifault-anyscale-429-exceeded-quota")] + CallInProgressErrorVapifaultAnyscale429ExceededQuota, + + [EnumMember(Value = "call.in-progress.error-providerfault-anyscale-500-server-error")] + CallInProgressErrorProviderfaultAnyscale500ServerError, + + [EnumMember( + Value = "call.in-progress.error-providerfault-anyscale-503-server-overloaded-error" + )] + CallInProgressErrorProviderfaultAnyscale503ServerOverloadedError, + [EnumMember(Value = "pipeline-error-openrouter-400-bad-request-validation-failed")] PipelineErrorOpenrouter400BadRequestValidationFailed, @@ -421,9 +959,37 @@ public enum ServerMessageStatusUpdateEndedReason [EnumMember(Value = "pipeline-error-openrouter-500-server-error")] PipelineErrorOpenrouter500ServerError, + [EnumMember(Value = "pipeline-error-openrouter-503-server-overloaded-error")] + PipelineErrorOpenrouter503ServerOverloadedError, + [EnumMember(Value = "pipeline-error-openrouter-llm-failed")] PipelineErrorOpenrouterLlmFailed, + [EnumMember(Value = "call.in-progress.error-vapifault-openrouter-llm-failed")] + CallInProgressErrorVapifaultOpenrouterLlmFailed, + + [EnumMember( + Value = "call.in-progress.error-vapifault-openrouter-400-bad-request-validation-failed" + )] + CallInProgressErrorVapifaultOpenrouter400BadRequestValidationFailed, + + [EnumMember(Value = "call.in-progress.error-vapifault-openrouter-401-unauthorized")] + CallInProgressErrorVapifaultOpenrouter401Unauthorized, + + [EnumMember(Value = "call.in-progress.error-vapifault-openrouter-403-model-access-denied")] + CallInProgressErrorVapifaultOpenrouter403ModelAccessDenied, + + [EnumMember(Value = "call.in-progress.error-vapifault-openrouter-429-exceeded-quota")] + CallInProgressErrorVapifaultOpenrouter429ExceededQuota, + + [EnumMember(Value = "call.in-progress.error-providerfault-openrouter-500-server-error")] + CallInProgressErrorProviderfaultOpenrouter500ServerError, + + [EnumMember( + Value = "call.in-progress.error-providerfault-openrouter-503-server-overloaded-error" + )] + CallInProgressErrorProviderfaultOpenrouter503ServerOverloadedError, + [EnumMember(Value = "pipeline-error-perplexity-ai-400-bad-request-validation-failed")] PipelineErrorPerplexityAi400BadRequestValidationFailed, @@ -439,9 +1005,37 @@ public enum ServerMessageStatusUpdateEndedReason [EnumMember(Value = "pipeline-error-perplexity-ai-500-server-error")] PipelineErrorPerplexityAi500ServerError, + [EnumMember(Value = "pipeline-error-perplexity-ai-503-server-overloaded-error")] + PipelineErrorPerplexityAi503ServerOverloadedError, + [EnumMember(Value = "pipeline-error-perplexity-ai-llm-failed")] PipelineErrorPerplexityAiLlmFailed, + [EnumMember(Value = "call.in-progress.error-vapifault-perplexity-ai-llm-failed")] + CallInProgressErrorVapifaultPerplexityAiLlmFailed, + + [EnumMember( + Value = "call.in-progress.error-vapifault-perplexity-ai-400-bad-request-validation-failed" + )] + CallInProgressErrorVapifaultPerplexityAi400BadRequestValidationFailed, + + [EnumMember(Value = "call.in-progress.error-vapifault-perplexity-ai-401-unauthorized")] + CallInProgressErrorVapifaultPerplexityAi401Unauthorized, + + [EnumMember(Value = "call.in-progress.error-vapifault-perplexity-ai-403-model-access-denied")] + CallInProgressErrorVapifaultPerplexityAi403ModelAccessDenied, + + [EnumMember(Value = "call.in-progress.error-vapifault-perplexity-ai-429-exceeded-quota")] + CallInProgressErrorVapifaultPerplexityAi429ExceededQuota, + + [EnumMember(Value = "call.in-progress.error-providerfault-perplexity-ai-500-server-error")] + CallInProgressErrorProviderfaultPerplexityAi500ServerError, + + [EnumMember( + Value = "call.in-progress.error-providerfault-perplexity-ai-503-server-overloaded-error" + )] + CallInProgressErrorProviderfaultPerplexityAi503ServerOverloadedError, + [EnumMember(Value = "pipeline-error-deepinfra-400-bad-request-validation-failed")] PipelineErrorDeepinfra400BadRequestValidationFailed, @@ -457,9 +1051,37 @@ public enum ServerMessageStatusUpdateEndedReason [EnumMember(Value = "pipeline-error-deepinfra-500-server-error")] PipelineErrorDeepinfra500ServerError, + [EnumMember(Value = "pipeline-error-deepinfra-503-server-overloaded-error")] + PipelineErrorDeepinfra503ServerOverloadedError, + [EnumMember(Value = "pipeline-error-deepinfra-llm-failed")] PipelineErrorDeepinfraLlmFailed, + [EnumMember(Value = "call.in-progress.error-vapifault-deepinfra-llm-failed")] + CallInProgressErrorVapifaultDeepinfraLlmFailed, + + [EnumMember( + Value = "call.in-progress.error-vapifault-deepinfra-400-bad-request-validation-failed" + )] + CallInProgressErrorVapifaultDeepinfra400BadRequestValidationFailed, + + [EnumMember(Value = "call.in-progress.error-vapifault-deepinfra-401-unauthorized")] + CallInProgressErrorVapifaultDeepinfra401Unauthorized, + + [EnumMember(Value = "call.in-progress.error-vapifault-deepinfra-403-model-access-denied")] + CallInProgressErrorVapifaultDeepinfra403ModelAccessDenied, + + [EnumMember(Value = "call.in-progress.error-vapifault-deepinfra-429-exceeded-quota")] + CallInProgressErrorVapifaultDeepinfra429ExceededQuota, + + [EnumMember(Value = "call.in-progress.error-providerfault-deepinfra-500-server-error")] + CallInProgressErrorProviderfaultDeepinfra500ServerError, + + [EnumMember( + Value = "call.in-progress.error-providerfault-deepinfra-503-server-overloaded-error" + )] + CallInProgressErrorProviderfaultDeepinfra503ServerOverloadedError, + [EnumMember(Value = "pipeline-error-runpod-400-bad-request-validation-failed")] PipelineErrorRunpod400BadRequestValidationFailed, @@ -475,9 +1097,35 @@ public enum ServerMessageStatusUpdateEndedReason [EnumMember(Value = "pipeline-error-runpod-500-server-error")] PipelineErrorRunpod500ServerError, + [EnumMember(Value = "pipeline-error-runpod-503-server-overloaded-error")] + PipelineErrorRunpod503ServerOverloadedError, + [EnumMember(Value = "pipeline-error-runpod-llm-failed")] PipelineErrorRunpodLlmFailed, + [EnumMember(Value = "call.in-progress.error-vapifault-runpod-llm-failed")] + CallInProgressErrorVapifaultRunpodLlmFailed, + + [EnumMember( + Value = "call.in-progress.error-vapifault-runpod-400-bad-request-validation-failed" + )] + CallInProgressErrorVapifaultRunpod400BadRequestValidationFailed, + + [EnumMember(Value = "call.in-progress.error-vapifault-runpod-401-unauthorized")] + CallInProgressErrorVapifaultRunpod401Unauthorized, + + [EnumMember(Value = "call.in-progress.error-vapifault-runpod-403-model-access-denied")] + CallInProgressErrorVapifaultRunpod403ModelAccessDenied, + + [EnumMember(Value = "call.in-progress.error-vapifault-runpod-429-exceeded-quota")] + CallInProgressErrorVapifaultRunpod429ExceededQuota, + + [EnumMember(Value = "call.in-progress.error-providerfault-runpod-500-server-error")] + CallInProgressErrorProviderfaultRunpod500ServerError, + + [EnumMember(Value = "call.in-progress.error-providerfault-runpod-503-server-overloaded-error")] + CallInProgressErrorProviderfaultRunpod503ServerOverloadedError, + [EnumMember(Value = "pipeline-error-custom-llm-400-bad-request-validation-failed")] PipelineErrorCustomLlm400BadRequestValidationFailed, @@ -493,9 +1141,37 @@ public enum ServerMessageStatusUpdateEndedReason [EnumMember(Value = "pipeline-error-custom-llm-500-server-error")] PipelineErrorCustomLlm500ServerError, + [EnumMember(Value = "pipeline-error-custom-llm-503-server-overloaded-error")] + PipelineErrorCustomLlm503ServerOverloadedError, + [EnumMember(Value = "pipeline-error-custom-llm-llm-failed")] PipelineErrorCustomLlmLlmFailed, + [EnumMember(Value = "call.in-progress.error-vapifault-custom-llm-llm-failed")] + CallInProgressErrorVapifaultCustomLlmLlmFailed, + + [EnumMember( + Value = "call.in-progress.error-vapifault-custom-llm-400-bad-request-validation-failed" + )] + CallInProgressErrorVapifaultCustomLlm400BadRequestValidationFailed, + + [EnumMember(Value = "call.in-progress.error-vapifault-custom-llm-401-unauthorized")] + CallInProgressErrorVapifaultCustomLlm401Unauthorized, + + [EnumMember(Value = "call.in-progress.error-vapifault-custom-llm-403-model-access-denied")] + CallInProgressErrorVapifaultCustomLlm403ModelAccessDenied, + + [EnumMember(Value = "call.in-progress.error-vapifault-custom-llm-429-exceeded-quota")] + CallInProgressErrorVapifaultCustomLlm429ExceededQuota, + + [EnumMember(Value = "call.in-progress.error-providerfault-custom-llm-500-server-error")] + CallInProgressErrorProviderfaultCustomLlm500ServerError, + + [EnumMember( + Value = "call.in-progress.error-providerfault-custom-llm-503-server-overloaded-error" + )] + CallInProgressErrorProviderfaultCustomLlm503ServerOverloadedError, + [EnumMember(Value = "pipeline-error-custom-voice-failed")] PipelineErrorCustomVoiceFailed, @@ -514,6 +1190,21 @@ public enum ServerMessageStatusUpdateEndedReason [EnumMember(Value = "pipeline-error-cartesia-522-server-error")] PipelineErrorCartesia522ServerError, + [EnumMember(Value = "call.in-progress.error-vapifault-cartesia-socket-hang-up")] + CallInProgressErrorVapifaultCartesiaSocketHangUp, + + [EnumMember(Value = "call.in-progress.error-vapifault-cartesia-requested-payment")] + CallInProgressErrorVapifaultCartesiaRequestedPayment, + + [EnumMember(Value = "call.in-progress.error-providerfault-cartesia-500-server-error")] + CallInProgressErrorProviderfaultCartesia500ServerError, + + [EnumMember(Value = "call.in-progress.error-providerfault-cartesia-503-server-error")] + CallInProgressErrorProviderfaultCartesia503ServerError, + + [EnumMember(Value = "call.in-progress.error-providerfault-cartesia-522-server-error")] + CallInProgressErrorProviderfaultCartesia522ServerError, + [EnumMember(Value = "pipeline-error-eleven-labs-voice-not-found")] PipelineErrorElevenLabsVoiceNotFound, @@ -572,9 +1263,6 @@ public enum ServerMessageStatusUpdateEndedReason [EnumMember(Value = "pipeline-error-eleven-labs-voice-not-allowed-for-free-users")] PipelineErrorElevenLabsVoiceNotAllowedForFreeUsers, - [EnumMember(Value = "pipeline-error-eleven-labs-500-server-error")] - PipelineErrorElevenLabs500ServerError, - [EnumMember(Value = "pipeline-error-eleven-labs-max-character-limit-exceeded")] PipelineErrorElevenLabsMaxCharacterLimitExceeded, @@ -583,6 +1271,98 @@ public enum ServerMessageStatusUpdateEndedReason )] PipelineErrorElevenLabsBlockedVoicePotentiallyAgainstTermsOfServiceAndAwaitingVerification, + [EnumMember(Value = "pipeline-error-eleven-labs-500-server-error")] + PipelineErrorElevenLabs500ServerError, + + [EnumMember(Value = "call.in-progress.error-vapifault-eleven-labs-voice-not-found")] + CallInProgressErrorVapifaultElevenLabsVoiceNotFound, + + [EnumMember(Value = "call.in-progress.error-vapifault-eleven-labs-quota-exceeded")] + CallInProgressErrorVapifaultElevenLabsQuotaExceeded, + + [EnumMember(Value = "call.in-progress.error-vapifault-eleven-labs-unauthorized-access")] + CallInProgressErrorVapifaultElevenLabsUnauthorizedAccess, + + [EnumMember( + Value = "call.in-progress.error-vapifault-eleven-labs-unauthorized-to-access-model" + )] + CallInProgressErrorVapifaultElevenLabsUnauthorizedToAccessModel, + + [EnumMember( + Value = "call.in-progress.error-vapifault-eleven-labs-professional-voices-only-for-creator-plus" + )] + CallInProgressErrorVapifaultElevenLabsProfessionalVoicesOnlyForCreatorPlus, + + [EnumMember( + Value = "call.in-progress.error-vapifault-eleven-labs-blocked-free-plan-and-requested-upgrade" + )] + CallInProgressErrorVapifaultElevenLabsBlockedFreePlanAndRequestedUpgrade, + + [EnumMember( + Value = "call.in-progress.error-vapifault-eleven-labs-blocked-concurrent-requests-and-requested-upgrade" + )] + CallInProgressErrorVapifaultElevenLabsBlockedConcurrentRequestsAndRequestedUpgrade, + + [EnumMember( + Value = "call.in-progress.error-vapifault-eleven-labs-blocked-using-instant-voice-clone-and-requested-upgrade" + )] + CallInProgressErrorVapifaultElevenLabsBlockedUsingInstantVoiceCloneAndRequestedUpgrade, + + [EnumMember( + Value = "call.in-progress.error-vapifault-eleven-labs-system-busy-and-requested-upgrade" + )] + CallInProgressErrorVapifaultElevenLabsSystemBusyAndRequestedUpgrade, + + [EnumMember(Value = "call.in-progress.error-vapifault-eleven-labs-voice-not-fine-tuned")] + CallInProgressErrorVapifaultElevenLabsVoiceNotFineTuned, + + [EnumMember(Value = "call.in-progress.error-vapifault-eleven-labs-invalid-api-key")] + CallInProgressErrorVapifaultElevenLabsInvalidApiKey, + + [EnumMember(Value = "call.in-progress.error-vapifault-eleven-labs-invalid-voice-samples")] + CallInProgressErrorVapifaultElevenLabsInvalidVoiceSamples, + + [EnumMember(Value = "call.in-progress.error-vapifault-eleven-labs-voice-disabled-by-owner")] + CallInProgressErrorVapifaultElevenLabsVoiceDisabledByOwner, + + [EnumMember( + Value = "call.in-progress.error-vapifault-eleven-labs-blocked-account-in-probation" + )] + CallInProgressErrorVapifaultElevenLabsBlockedAccountInProbation, + + [EnumMember( + Value = "call.in-progress.error-vapifault-eleven-labs-blocked-content-against-their-policy" + )] + CallInProgressErrorVapifaultElevenLabsBlockedContentAgainstTheirPolicy, + + [EnumMember( + Value = "call.in-progress.error-vapifault-eleven-labs-missing-samples-for-voice-clone" + )] + CallInProgressErrorVapifaultElevenLabsMissingSamplesForVoiceClone, + + [EnumMember( + Value = "call.in-progress.error-vapifault-eleven-labs-voice-not-fine-tuned-and-cannot-be-used" + )] + CallInProgressErrorVapifaultElevenLabsVoiceNotFineTunedAndCannotBeUsed, + + [EnumMember( + Value = "call.in-progress.error-vapifault-eleven-labs-voice-not-allowed-for-free-users" + )] + CallInProgressErrorVapifaultElevenLabsVoiceNotAllowedForFreeUsers, + + [EnumMember( + Value = "call.in-progress.error-vapifault-eleven-labs-max-character-limit-exceeded" + )] + CallInProgressErrorVapifaultElevenLabsMaxCharacterLimitExceeded, + + [EnumMember( + Value = "call.in-progress.error-vapifault-eleven-labs-blocked-voice-potentially-against-terms-of-service-and-awaiting-verification" + )] + CallInProgressErrorVapifaultElevenLabsBlockedVoicePotentiallyAgainstTermsOfServiceAndAwaitingVerification, + + [EnumMember(Value = "call.in-progress.error-providerfault-eleven-labs-500-server-error")] + CallInProgressErrorProviderfaultElevenLabs500ServerError, + [EnumMember(Value = "pipeline-error-playht-request-timed-out")] PipelineErrorPlayhtRequestTimedOut, @@ -619,26 +1399,72 @@ public enum ServerMessageStatusUpdateEndedReason [EnumMember(Value = "pipeline-error-playht-504-gateway-error")] PipelineErrorPlayht504GatewayError, - [EnumMember(Value = "pipeline-error-tavus-video-failed")] - PipelineErrorTavusVideoFailed, + [EnumMember(Value = "call.in-progress.error-vapifault-playht-request-timed-out")] + CallInProgressErrorVapifaultPlayhtRequestTimedOut, + + [EnumMember(Value = "call.in-progress.error-vapifault-playht-invalid-voice")] + CallInProgressErrorVapifaultPlayhtInvalidVoice, + + [EnumMember(Value = "call.in-progress.error-vapifault-playht-unexpected-error")] + CallInProgressErrorVapifaultPlayhtUnexpectedError, + + [EnumMember(Value = "call.in-progress.error-vapifault-playht-out-of-credits")] + CallInProgressErrorVapifaultPlayhtOutOfCredits, + + [EnumMember(Value = "call.in-progress.error-vapifault-playht-invalid-emotion")] + CallInProgressErrorVapifaultPlayhtInvalidEmotion, + + [EnumMember( + Value = "call.in-progress.error-vapifault-playht-voice-must-be-a-valid-voice-manifest-uri" + )] + CallInProgressErrorVapifaultPlayhtVoiceMustBeAValidVoiceManifestUri, + + [EnumMember(Value = "call.in-progress.error-vapifault-playht-401-unauthorized")] + CallInProgressErrorVapifaultPlayht401Unauthorized, + + [EnumMember(Value = "call.in-progress.error-vapifault-playht-403-forbidden-out-of-characters")] + CallInProgressErrorVapifaultPlayht403ForbiddenOutOfCharacters, + + [EnumMember( + Value = "call.in-progress.error-vapifault-playht-403-forbidden-api-access-not-available" + )] + CallInProgressErrorVapifaultPlayht403ForbiddenApiAccessNotAvailable, + + [EnumMember(Value = "call.in-progress.error-vapifault-playht-429-exceeded-quota")] + CallInProgressErrorVapifaultPlayht429ExceededQuota, + + [EnumMember(Value = "call.in-progress.error-providerfault-playht-502-gateway-error")] + CallInProgressErrorProviderfaultPlayht502GatewayError, + + [EnumMember(Value = "call.in-progress.error-providerfault-playht-504-gateway-error")] + CallInProgressErrorProviderfaultPlayht504GatewayError, [EnumMember(Value = "pipeline-error-custom-transcriber-failed")] PipelineErrorCustomTranscriberFailed, - [EnumMember(Value = "pipeline-error-deepgram-returning-403-model-access-denied")] - PipelineErrorDeepgramReturning403ModelAccessDenied, + [EnumMember(Value = "call.in-progress.error-vapifault-custom-transcriber-failed")] + CallInProgressErrorVapifaultCustomTranscriberFailed, - [EnumMember(Value = "pipeline-error-deepgram-returning-401-invalid-credentials")] - PipelineErrorDeepgramReturning401InvalidCredentials, + [EnumMember(Value = "pipeline-error-eleven-labs-transcriber-failed")] + PipelineErrorElevenLabsTranscriberFailed, - [EnumMember(Value = "pipeline-error-deepgram-returning-404-not-found")] - PipelineErrorDeepgramReturning404NotFound, + [EnumMember(Value = "call.in-progress.error-vapifault-eleven-labs-transcriber-failed")] + CallInProgressErrorVapifaultElevenLabsTranscriberFailed, [EnumMember( Value = "pipeline-error-deepgram-returning-400-no-such-model-language-tier-combination" )] PipelineErrorDeepgramReturning400NoSuchModelLanguageTierCombination, + [EnumMember(Value = "pipeline-error-deepgram-returning-401-invalid-credentials")] + PipelineErrorDeepgramReturning401InvalidCredentials, + + [EnumMember(Value = "pipeline-error-deepgram-returning-403-model-access-denied")] + PipelineErrorDeepgramReturning403ModelAccessDenied, + + [EnumMember(Value = "pipeline-error-deepgram-returning-404-not-found")] + PipelineErrorDeepgramReturning404NotFound, + [EnumMember(Value = "pipeline-error-deepgram-returning-500-invalid-json")] PipelineErrorDeepgramReturning500InvalidJson, @@ -648,11 +1474,102 @@ public enum ServerMessageStatusUpdateEndedReason [EnumMember(Value = "pipeline-error-deepgram-returning-502-bad-gateway-ehostunreach")] PipelineErrorDeepgramReturning502BadGatewayEhostunreach, + [EnumMember( + Value = "call.in-progress.error-vapifault-deepgram-returning-400-no-such-model-language-tier-combination" + )] + CallInProgressErrorVapifaultDeepgramReturning400NoSuchModelLanguageTierCombination, + + [EnumMember( + Value = "call.in-progress.error-vapifault-deepgram-returning-401-invalid-credentials" + )] + CallInProgressErrorVapifaultDeepgramReturning401InvalidCredentials, + + [EnumMember(Value = "call.in-progress.error-vapifault-deepgram-returning-404-not-found")] + CallInProgressErrorVapifaultDeepgramReturning404NotFound, + + [EnumMember( + Value = "call.in-progress.error-vapifault-deepgram-returning-403-model-access-denied" + )] + CallInProgressErrorVapifaultDeepgramReturning403ModelAccessDenied, + + [EnumMember(Value = "call.in-progress.error-providerfault-deepgram-returning-500-invalid-json")] + CallInProgressErrorProviderfaultDeepgramReturning500InvalidJson, + + [EnumMember( + Value = "call.in-progress.error-providerfault-deepgram-returning-502-network-error" + )] + CallInProgressErrorProviderfaultDeepgramReturning502NetworkError, + + [EnumMember( + Value = "call.in-progress.error-providerfault-deepgram-returning-502-bad-gateway-ehostunreach" + )] + CallInProgressErrorProviderfaultDeepgramReturning502BadGatewayEhostunreach, + + [EnumMember(Value = "pipeline-error-google-transcriber-failed")] + PipelineErrorGoogleTranscriberFailed, + + [EnumMember(Value = "call.in-progress.error-vapifault-google-transcriber-failed")] + CallInProgressErrorVapifaultGoogleTranscriberFailed, + + [EnumMember(Value = "pipeline-error-openai-transcriber-failed")] + PipelineErrorOpenaiTranscriberFailed, + + [EnumMember(Value = "call.in-progress.error-vapifault-openai-transcriber-failed")] + CallInProgressErrorVapifaultOpenaiTranscriberFailed, + + [EnumMember(Value = "assistant-ended-call")] + AssistantEndedCall, + + [EnumMember(Value = "assistant-said-end-call-phrase")] + AssistantSaidEndCallPhrase, + + [EnumMember(Value = "assistant-ended-call-with-hangup-task")] + AssistantEndedCallWithHangupTask, + + [EnumMember(Value = "assistant-ended-call-after-message-spoken")] + AssistantEndedCallAfterMessageSpoken, + + [EnumMember(Value = "assistant-forwarded-call")] + AssistantForwardedCall, + + [EnumMember(Value = "assistant-join-timed-out")] + AssistantJoinTimedOut, + + [EnumMember(Value = "call.in-progress.error-assistant-did-not-receive-customer-audio")] + CallInProgressErrorAssistantDidNotReceiveCustomerAudio, + + [EnumMember(Value = "customer-busy")] + CustomerBusy, + + [EnumMember(Value = "customer-ended-call")] + CustomerEndedCall, + + [EnumMember(Value = "customer-did-not-answer")] + CustomerDidNotAnswer, + + [EnumMember(Value = "customer-did-not-give-microphone-permission")] + CustomerDidNotGiveMicrophonePermission, + + [EnumMember(Value = "exceeded-max-duration")] + ExceededMaxDuration, + + [EnumMember(Value = "manually-canceled")] + ManuallyCanceled, + + [EnumMember(Value = "phone-call-provider-closed-websocket")] + PhoneCallProviderClosedWebsocket, + [EnumMember(Value = "silence-timed-out")] SilenceTimedOut, - [EnumMember(Value = "sip-gateway-failed-to-connect-call")] - SipGatewayFailedToConnectCall, + [EnumMember(Value = "call.in-progress.error-sip-telephony-provider-failed-to-connect-call")] + CallInProgressErrorSipTelephonyProviderFailedToConnectCall, + + [EnumMember(Value = "call.ringing.hook-executed-say")] + CallRingingHookExecutedSay, + + [EnumMember(Value = "call.ringing.hook-executed-transfer")] + CallRingingHookExecutedTransfer, [EnumMember(Value = "twilio-failed-to-connect-call")] TwilioFailedToConnectCall, diff --git a/src/Vapi.Net/Types/ServerMessageStatusUpdateStatus.cs b/src/Vapi.Net/Types/ServerMessageStatusUpdateStatus.cs index 0760ac7..68bdb6e 100644 --- a/src/Vapi.Net/Types/ServerMessageStatusUpdateStatus.cs +++ b/src/Vapi.Net/Types/ServerMessageStatusUpdateStatus.cs @@ -7,6 +7,9 @@ namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] public enum ServerMessageStatusUpdateStatus { + [EnumMember(Value = "scheduled")] + Scheduled, + [EnumMember(Value = "queued")] Queued, diff --git a/src/Vapi.Net/Types/ServerMessageToolCalls.cs b/src/Vapi.Net/Types/ServerMessageToolCalls.cs index e39891f..20b8077 100644 --- a/src/Vapi.Net/Types/ServerMessageToolCalls.cs +++ b/src/Vapi.Net/Types/ServerMessageToolCalls.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -28,10 +29,10 @@ public record ServerMessageToolCalls public IEnumerable ToolWithToolCallList { get; set; } = new List(); /// - /// This is the ISO-8601 formatted timestamp of when the message was sent. + /// This is the timestamp of when the message was sent in milliseconds since Unix Epoch. /// [JsonPropertyName("timestamp")] - public string? Timestamp { get; set; } + public double? Timestamp { get; set; } /// /// This is a live version of the `call.artifact`. @@ -81,6 +82,17 @@ public record ServerMessageToolCalls [JsonPropertyName("toolCallList")] public IEnumerable ToolCallList { get; set; } = new List(); + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/ServerMessageTranscript.cs b/src/Vapi.Net/Types/ServerMessageTranscript.cs index 1b5cda9..8d380a8 100644 --- a/src/Vapi.Net/Types/ServerMessageTranscript.cs +++ b/src/Vapi.Net/Types/ServerMessageTranscript.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -22,10 +23,10 @@ public record ServerMessageTranscript public required ServerMessageTranscriptType Type { get; set; } /// - /// This is the ISO-8601 formatted timestamp of when the message was sent. + /// This is the timestamp of when the message was sent in milliseconds since Unix Epoch. /// [JsonPropertyName("timestamp")] - public string? Timestamp { get; set; } + public double? Timestamp { get; set; } /// /// This is a live version of the `call.artifact`. @@ -87,6 +88,17 @@ public record ServerMessageTranscript [JsonPropertyName("transcript")] public required string Transcript { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/ServerMessageTransferDestinationRequest.cs b/src/Vapi.Net/Types/ServerMessageTransferDestinationRequest.cs index 4d63127..54bbe5d 100644 --- a/src/Vapi.Net/Types/ServerMessageTransferDestinationRequest.cs +++ b/src/Vapi.Net/Types/ServerMessageTransferDestinationRequest.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -22,10 +23,10 @@ public record ServerMessageTransferDestinationRequest public string Type { get; set; } = "transfer-destination-request"; /// - /// This is the ISO-8601 formatted timestamp of when the message was sent. + /// This is the timestamp of when the message was sent in milliseconds since Unix Epoch. /// [JsonPropertyName("timestamp")] - public string? Timestamp { get; set; } + public double? Timestamp { get; set; } /// /// This is a live version of the `call.artifact`. @@ -69,6 +70,17 @@ public record ServerMessageTransferDestinationRequest [JsonPropertyName("call")] public Call? Call { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/ServerMessageTransferUpdate.cs b/src/Vapi.Net/Types/ServerMessageTransferUpdate.cs index 4758dd4..ca05fdc 100644 --- a/src/Vapi.Net/Types/ServerMessageTransferUpdate.cs +++ b/src/Vapi.Net/Types/ServerMessageTransferUpdate.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -28,10 +29,10 @@ public record ServerMessageTransferUpdate public object? Destination { get; set; } /// - /// This is the ISO-8601 formatted timestamp of when the message was sent. + /// This is the timestamp of when the message was sent in milliseconds since Unix Epoch. /// [JsonPropertyName("timestamp")] - public string? Timestamp { get; set; } + public double? Timestamp { get; set; } /// /// This is a live version of the `call.artifact`. @@ -99,6 +100,17 @@ public record ServerMessageTransferUpdate [JsonPropertyName("fromStepRecord")] public object? FromStepRecord { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/ServerMessageUserInterrupted.cs b/src/Vapi.Net/Types/ServerMessageUserInterrupted.cs index af1e3d5..5fac510 100644 --- a/src/Vapi.Net/Types/ServerMessageUserInterrupted.cs +++ b/src/Vapi.Net/Types/ServerMessageUserInterrupted.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -22,10 +23,10 @@ public record ServerMessageUserInterrupted public string Type { get; set; } = "user-interrupted"; /// - /// This is the ISO-8601 formatted timestamp of when the message was sent. + /// This is the timestamp of when the message was sent in milliseconds since Unix Epoch. /// [JsonPropertyName("timestamp")] - public string? Timestamp { get; set; } + public double? Timestamp { get; set; } /// /// This is a live version of the `call.artifact`. @@ -69,6 +70,17 @@ public record ServerMessageUserInterrupted [JsonPropertyName("call")] public Call? Call { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/ServerMessageVoiceInput.cs b/src/Vapi.Net/Types/ServerMessageVoiceInput.cs index 72bdfae..224e7a8 100644 --- a/src/Vapi.Net/Types/ServerMessageVoiceInput.cs +++ b/src/Vapi.Net/Types/ServerMessageVoiceInput.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -22,10 +23,10 @@ public record ServerMessageVoiceInput public string Type { get; set; } = "voice-input"; /// - /// This is the ISO-8601 formatted timestamp of when the message was sent. + /// This is the timestamp of when the message was sent in milliseconds since Unix Epoch. /// [JsonPropertyName("timestamp")] - public string? Timestamp { get; set; } + public double? Timestamp { get; set; } /// /// This is a live version of the `call.artifact`. @@ -75,6 +76,17 @@ public record ServerMessageVoiceInput [JsonPropertyName("input")] public required string Input { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/ServerMessageVoiceRequest.cs b/src/Vapi.Net/Types/ServerMessageVoiceRequest.cs index 8290e49..7184885 100644 --- a/src/Vapi.Net/Types/ServerMessageVoiceRequest.cs +++ b/src/Vapi.Net/Types/ServerMessageVoiceRequest.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -43,10 +44,10 @@ public record ServerMessageVoiceRequest public string Type { get; set; } = "voice-request"; /// - /// This is the ISO-8601 formatted timestamp of when the message was sent. + /// This is the timestamp of when the message was sent in milliseconds since Unix Epoch. /// [JsonPropertyName("timestamp")] - public string? Timestamp { get; set; } + public double? Timestamp { get; set; } /// /// This is a live version of the `call.artifact`. @@ -102,6 +103,17 @@ public record ServerMessageVoiceRequest [JsonPropertyName("sampleRate")] public required double SampleRate { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/SipAuthentication.cs b/src/Vapi.Net/Types/SipAuthentication.cs index 671db41..936eb80 100644 --- a/src/Vapi.Net/Types/SipAuthentication.cs +++ b/src/Vapi.Net/Types/SipAuthentication.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -23,6 +24,17 @@ public record SipAuthentication [JsonPropertyName("password")] public required string Password { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/SipTrunkGateway.cs b/src/Vapi.Net/Types/SipTrunkGateway.cs index be7da18..6c23916 100644 --- a/src/Vapi.Net/Types/SipTrunkGateway.cs +++ b/src/Vapi.Net/Types/SipTrunkGateway.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -63,6 +64,17 @@ public record SipTrunkGateway [JsonPropertyName("optionsPingEnabled")] public bool? OptionsPingEnabled { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/SipTrunkOutboundAuthenticationPlan.cs b/src/Vapi.Net/Types/SipTrunkOutboundAuthenticationPlan.cs index 794de4b..d07b138 100644 --- a/src/Vapi.Net/Types/SipTrunkOutboundAuthenticationPlan.cs +++ b/src/Vapi.Net/Types/SipTrunkOutboundAuthenticationPlan.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -20,6 +21,17 @@ public record SipTrunkOutboundAuthenticationPlan [JsonPropertyName("sipRegisterPlan")] public SipTrunkOutboundSipRegisterPlan? SipRegisterPlan { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/SipTrunkOutboundSipRegisterPlan.cs b/src/Vapi.Net/Types/SipTrunkOutboundSipRegisterPlan.cs index e565bec..bfb8b88 100644 --- a/src/Vapi.Net/Types/SipTrunkOutboundSipRegisterPlan.cs +++ b/src/Vapi.Net/Types/SipTrunkOutboundSipRegisterPlan.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -14,6 +15,17 @@ public record SipTrunkOutboundSipRegisterPlan [JsonPropertyName("realm")] public string? Realm { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/SlackOAuth2AuthorizationCredential.cs b/src/Vapi.Net/Types/SlackOAuth2AuthorizationCredential.cs new file mode 100644 index 0000000..69fd66f --- /dev/null +++ b/src/Vapi.Net/Types/SlackOAuth2AuthorizationCredential.cs @@ -0,0 +1,63 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record SlackOAuth2AuthorizationCredential +{ + [JsonPropertyName("provider")] + public string Provider { get; set; } = "slack.oauth2-authorization"; + + /// + /// The authorization ID for the OAuth2 authorization + /// + [JsonPropertyName("authorizationId")] + public required string AuthorizationId { get; set; } + + /// + /// This is the unique identifier for the credential. + /// + [JsonPropertyName("id")] + public required string Id { get; set; } + + /// + /// This is the unique identifier for the org that this credential belongs to. + /// + [JsonPropertyName("orgId")] + public required string OrgId { get; set; } + + /// + /// This is the ISO 8601 date-time string of when the credential was created. + /// + [JsonPropertyName("createdAt")] + public required DateTime CreatedAt { get; set; } + + /// + /// This is the ISO 8601 date-time string of when the assistant was last updated. + /// + [JsonPropertyName("updatedAt")] + public required DateTime UpdatedAt { get; set; } + + /// + /// This is the name of credential. This is just for your reference. + /// + [JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/SlackSendMessageTool.cs b/src/Vapi.Net/Types/SlackSendMessageTool.cs new file mode 100644 index 0000000..f99ee74 --- /dev/null +++ b/src/Vapi.Net/Types/SlackSendMessageTool.cs @@ -0,0 +1,88 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record SlackSendMessageTool +{ + /// + /// This determines if the tool is async. + /// + /// If async, the assistant will move forward without waiting for your server to respond. This is useful if you just want to trigger something on your server. + /// + /// If sync, the assistant will wait for your server to respond. This is useful if want assistant to respond with the result from your server. + /// + /// Defaults to synchronous (`false`). + /// + [JsonPropertyName("async")] + public bool? Async { get; set; } + + /// + /// These are the messages that will be spoken to the user as the tool is running. + /// + /// For some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured. + /// + [JsonPropertyName("messages")] + public IEnumerable? Messages { get; set; } + + /// + /// This is the unique identifier for the tool. + /// + [JsonPropertyName("id")] + public required string Id { get; set; } + + /// + /// This is the unique identifier for the organization that this tool belongs to. + /// + [JsonPropertyName("orgId")] + public required string OrgId { get; set; } + + /// + /// This is the ISO 8601 date-time string of when the tool was created. + /// + [JsonPropertyName("createdAt")] + public required DateTime CreatedAt { get; set; } + + /// + /// This is the ISO 8601 date-time string of when the tool was last updated. + /// + [JsonPropertyName("updatedAt")] + public required DateTime UpdatedAt { get; set; } + + /// + /// This is the function definition of the tool. + /// + /// For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + /// + /// An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + /// + [JsonPropertyName("function")] + public OpenAiFunction? Function { get; set; } + + /// + /// This is the server that will be hit when this tool is requested by the model. + /// + /// All requests will be sent with the call object among other things. You can find more details in the Server URL documentation. + /// + /// This overrides the serverUrl set on the org and the phoneNumber. Order of precedence: highest tool.server.url, then assistant.serverUrl, then phoneNumber.serverUrl, then org.serverUrl. + /// + [JsonPropertyName("server")] + public Server? Server { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/SmallestAiCredential.cs b/src/Vapi.Net/Types/SmallestAiCredential.cs index ba1f136..0331e10 100644 --- a/src/Vapi.Net/Types/SmallestAiCredential.cs +++ b/src/Vapi.Net/Types/SmallestAiCredential.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -44,6 +45,17 @@ public record SmallestAiCredential [JsonPropertyName("name")] public string? Name { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/SmallestAiVoice.cs b/src/Vapi.Net/Types/SmallestAiVoice.cs index 451614b..9f93c24 100644 --- a/src/Vapi.Net/Types/SmallestAiVoice.cs +++ b/src/Vapi.Net/Types/SmallestAiVoice.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using OneOf; using Vapi.Net.Core; @@ -36,6 +37,17 @@ public record SmallestAiVoice [JsonPropertyName("fallbackPlan")] public FallbackPlan? FallbackPlan { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/SmsSendTool.cs b/src/Vapi.Net/Types/SmsSendTool.cs new file mode 100644 index 0000000..3c5fde5 --- /dev/null +++ b/src/Vapi.Net/Types/SmsSendTool.cs @@ -0,0 +1,88 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record SmsSendTool +{ + /// + /// This determines if the tool is async. + /// + /// If async, the assistant will move forward without waiting for your server to respond. This is useful if you just want to trigger something on your server. + /// + /// If sync, the assistant will wait for your server to respond. This is useful if want assistant to respond with the result from your server. + /// + /// Defaults to synchronous (`false`). + /// + [JsonPropertyName("async")] + public bool? Async { get; set; } + + /// + /// These are the messages that will be spoken to the user as the tool is running. + /// + /// For some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured. + /// + [JsonPropertyName("messages")] + public IEnumerable? Messages { get; set; } + + /// + /// This is the unique identifier for the tool. + /// + [JsonPropertyName("id")] + public required string Id { get; set; } + + /// + /// This is the unique identifier for the organization that this tool belongs to. + /// + [JsonPropertyName("orgId")] + public required string OrgId { get; set; } + + /// + /// This is the ISO 8601 date-time string of when the tool was created. + /// + [JsonPropertyName("createdAt")] + public required DateTime CreatedAt { get; set; } + + /// + /// This is the ISO 8601 date-time string of when the tool was last updated. + /// + [JsonPropertyName("updatedAt")] + public required DateTime UpdatedAt { get; set; } + + /// + /// This is the function definition of the tool. + /// + /// For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + /// + /// An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + /// + [JsonPropertyName("function")] + public OpenAiFunction? Function { get; set; } + + /// + /// This is the server that will be hit when this tool is requested by the model. + /// + /// All requests will be sent with the call object among other things. You can find more details in the Server URL documentation. + /// + /// This overrides the serverUrl set on the org and the phoneNumber. Order of precedence: highest tool.server.url, then assistant.serverUrl, then phoneNumber.serverUrl, then org.serverUrl. + /// + [JsonPropertyName("server")] + public Server? Server { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/SpeechmaticsCredential.cs b/src/Vapi.Net/Types/SpeechmaticsCredential.cs new file mode 100644 index 0000000..bbb3a6e --- /dev/null +++ b/src/Vapi.Net/Types/SpeechmaticsCredential.cs @@ -0,0 +1,63 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record SpeechmaticsCredential +{ + [JsonPropertyName("provider")] + public string Provider { get; set; } = "speechmatics"; + + /// + /// This is not returned in the API. + /// + [JsonPropertyName("apiKey")] + public required string ApiKey { get; set; } + + /// + /// This is the unique identifier for the credential. + /// + [JsonPropertyName("id")] + public required string Id { get; set; } + + /// + /// This is the unique identifier for the org that this credential belongs to. + /// + [JsonPropertyName("orgId")] + public required string OrgId { get; set; } + + /// + /// This is the ISO 8601 date-time string of when the credential was created. + /// + [JsonPropertyName("createdAt")] + public required DateTime CreatedAt { get; set; } + + /// + /// This is the ISO 8601 date-time string of when the assistant was last updated. + /// + [JsonPropertyName("updatedAt")] + public required DateTime UpdatedAt { get; set; } + + /// + /// This is the name of credential. This is just for your reference. + /// + [JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/SpeechmaticsTranscriber.cs b/src/Vapi.Net/Types/SpeechmaticsTranscriber.cs new file mode 100644 index 0000000..bde6e02 --- /dev/null +++ b/src/Vapi.Net/Types/SpeechmaticsTranscriber.cs @@ -0,0 +1,39 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record SpeechmaticsTranscriber +{ + /// + /// This is the model that will be used for the transcription. + /// + [JsonPropertyName("model")] + public string? Model { get; set; } + + [JsonPropertyName("language")] + public SpeechmaticsTranscriberLanguage? Language { get; set; } + + /// + /// This is the plan for voice provider fallbacks in the event that the primary voice provider fails. + /// + [JsonPropertyName("fallbackPlan")] + public FallbackTranscriberPlan? FallbackPlan { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/SpeechmaticsTranscriberLanguage.cs b/src/Vapi.Net/Types/SpeechmaticsTranscriberLanguage.cs new file mode 100644 index 0000000..9e1442f --- /dev/null +++ b/src/Vapi.Net/Types/SpeechmaticsTranscriberLanguage.cs @@ -0,0 +1,177 @@ +using System.Runtime.Serialization; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[JsonConverter(typeof(EnumSerializer))] +public enum SpeechmaticsTranscriberLanguage +{ + [EnumMember(Value = "auto")] + Auto, + + [EnumMember(Value = "ar")] + Ar, + + [EnumMember(Value = "ba")] + Ba, + + [EnumMember(Value = "eu")] + Eu, + + [EnumMember(Value = "be")] + Be, + + [EnumMember(Value = "bn")] + Bn, + + [EnumMember(Value = "bg")] + Bg, + + [EnumMember(Value = "yue")] + Yue, + + [EnumMember(Value = "ca")] + Ca, + + [EnumMember(Value = "hr")] + Hr, + + [EnumMember(Value = "cs")] + Cs, + + [EnumMember(Value = "da")] + Da, + + [EnumMember(Value = "nl")] + Nl, + + [EnumMember(Value = "en")] + En, + + [EnumMember(Value = "eo")] + Eo, + + [EnumMember(Value = "et")] + Et, + + [EnumMember(Value = "fi")] + Fi, + + [EnumMember(Value = "fr")] + Fr, + + [EnumMember(Value = "gl")] + Gl, + + [EnumMember(Value = "de")] + De, + + [EnumMember(Value = "el")] + El, + + [EnumMember(Value = "he")] + He, + + [EnumMember(Value = "hi")] + Hi, + + [EnumMember(Value = "hu")] + Hu, + + [EnumMember(Value = "id")] + Id, + + [EnumMember(Value = "ia")] + Ia, + + [EnumMember(Value = "ga")] + Ga, + + [EnumMember(Value = "it")] + It, + + [EnumMember(Value = "ja")] + Ja, + + [EnumMember(Value = "ko")] + Ko, + + [EnumMember(Value = "lv")] + Lv, + + [EnumMember(Value = "lt")] + Lt, + + [EnumMember(Value = "ms")] + Ms, + + [EnumMember(Value = "mt")] + Mt, + + [EnumMember(Value = "cmn")] + Cmn, + + [EnumMember(Value = "mr")] + Mr, + + [EnumMember(Value = "mn")] + Mn, + + [EnumMember(Value = "no")] + No, + + [EnumMember(Value = "fa")] + Fa, + + [EnumMember(Value = "pl")] + Pl, + + [EnumMember(Value = "pt")] + Pt, + + [EnumMember(Value = "ro")] + Ro, + + [EnumMember(Value = "ru")] + Ru, + + [EnumMember(Value = "sk")] + Sk, + + [EnumMember(Value = "sl")] + Sl, + + [EnumMember(Value = "es")] + Es, + + [EnumMember(Value = "sw")] + Sw, + + [EnumMember(Value = "sv")] + Sv, + + [EnumMember(Value = "ta")] + Ta, + + [EnumMember(Value = "th")] + Th, + + [EnumMember(Value = "tr")] + Tr, + + [EnumMember(Value = "uk")] + Uk, + + [EnumMember(Value = "ur")] + Ur, + + [EnumMember(Value = "ug")] + Ug, + + [EnumMember(Value = "vi")] + Vi, + + [EnumMember(Value = "cy")] + Cy, +} diff --git a/src/Vapi.Net/Types/Squad.cs b/src/Vapi.Net/Types/Squad.cs index dcb730c..d51198e 100644 --- a/src/Vapi.Net/Types/Squad.cs +++ b/src/Vapi.Net/Types/Squad.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -51,6 +52,17 @@ public record Squad [JsonPropertyName("updatedAt")] public required DateTime UpdatedAt { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/SquadMemberDto.cs b/src/Vapi.Net/Types/SquadMemberDto.cs index d36b3b4..75129b1 100644 --- a/src/Vapi.Net/Types/SquadMemberDto.cs +++ b/src/Vapi.Net/Types/SquadMemberDto.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -31,6 +32,17 @@ public record SquadMemberDto [JsonPropertyName("assistantDestinations")] public IEnumerable? AssistantDestinations { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/StartSpeakingPlan.cs b/src/Vapi.Net/Types/StartSpeakingPlan.cs index 9ea614f..3886b7d 100644 --- a/src/Vapi.Net/Types/StartSpeakingPlan.cs +++ b/src/Vapi.Net/Types/StartSpeakingPlan.cs @@ -1,4 +1,6 @@ +using System.Text.Json; using System.Text.Json.Serialization; +using OneOf; using Vapi.Net.Core; namespace Vapi.Net; @@ -22,20 +24,20 @@ public record StartSpeakingPlan [JsonPropertyName("waitSeconds")] public double? WaitSeconds { get; set; } + [JsonPropertyName("smartEndpointingEnabled")] + public object? SmartEndpointingEnabled { get; set; } + /// - /// This determines if a customer speech is considered done (endpointing) using a Vapi custom-trained model on customer's speech. This is good for middle-of-thought detection. - /// - /// Once an endpoint is triggered, the request is sent to `assistant.model`. - /// - /// Usage: - /// - If your conversations are long-form and you want assistant to wait smartly even if customer pauses for a bit to think, you can use this instead. - /// - /// This overrides `transcriptionEndpointingPlan`. + /// This is the plan for smart endpointing. Pick between Vapi smart endpointing or LiveKit smart endpointing (or nothing). We strongly recommend using livekit endpointing when working in English. LiveKit endpointing is not supported in other languages, yet. /// - /// @default false + /// If this is set, it will override and take precedence over `transcriptionEndpointingPlan`. + /// This plan will still be overridden by any matching `customEndpointingRules`. /// - [JsonPropertyName("smartEndpointingEnabled")] - public bool? SmartEndpointingEnabled { get; set; } + [JsonPropertyName("smartEndpointingPlan")] + public OneOf< + VapiSmartEndpointingPlan, + LivekitSmartEndpointingPlan + >? SmartEndpointingPlan { get; set; } /// /// These are the custom endpointing rules to set an endpointing timeout based on a regex on the customer's speech or the assistant's last message. @@ -45,10 +47,15 @@ public record StartSpeakingPlan /// - If you have questions where the customer may pause to look up information like "what's my account number?", you can set a longer timeout. /// - If you want to wait longer while customer is enumerating a list of numbers, you can set a longer timeout. /// - /// These override `transcriptionEndpointingPlan` and `smartEndpointingEnabled` when a rule is matched. + /// These rules have the highest precedence and will override both `smartEndpointingPlan` and `transcriptionEndpointingPlan` when a rule is matched. /// /// The rules are evaluated in order and the first one that matches will be used. /// + /// Order of precedence for endpointing: + /// 1. customEndpointingRules (if any match) + /// 2. smartEndpointingPlan (if set) + /// 3. transcriptionEndpointingPlan + /// /// @default [] /// [JsonPropertyName("customEndpointingRules")] @@ -58,10 +65,24 @@ public record StartSpeakingPlan /// This determines how a customer speech is considered done (endpointing) using the transcription of customer's speech. /// /// Once an endpoint is triggered, the request is sent to `assistant.model`. + /// + /// Note: This plan is only used if `smartEndpointingPlan` is not set. If both are provided, `smartEndpointingPlan` takes precedence. + /// This plan will also be overridden by any matching `customEndpointingRules`. /// [JsonPropertyName("transcriptionEndpointingPlan")] public TranscriptionEndpointingPlan? TranscriptionEndpointingPlan { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/StepDestination.cs b/src/Vapi.Net/Types/StepDestination.cs deleted file mode 100644 index 7224105..0000000 --- a/src/Vapi.Net/Types/StepDestination.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System.Text.Json.Serialization; -using Vapi.Net.Core; - -namespace Vapi.Net; - -public record StepDestination -{ - [JsonPropertyName("type")] - public string Type { get; set; } = "step"; - - /// - /// This is an optional array of conditions that must be met for this destination to be triggered. If empty, this is the default destination that the step transfers to. - /// - [JsonPropertyName("conditions")] - public IEnumerable? Conditions { get; set; } - - [JsonPropertyName("stepName")] - public required string StepName { get; set; } - - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Vapi.Net/Types/StopSpeakingPlan.cs b/src/Vapi.Net/Types/StopSpeakingPlan.cs index ff5c05c..20477d5 100644 --- a/src/Vapi.Net/Types/StopSpeakingPlan.cs +++ b/src/Vapi.Net/Types/StopSpeakingPlan.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -61,6 +62,17 @@ public record StopSpeakingPlan [JsonPropertyName("interruptionPhrases")] public IEnumerable? InterruptionPhrases { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/StructuredDataMultiPlan.cs b/src/Vapi.Net/Types/StructuredDataMultiPlan.cs new file mode 100644 index 0000000..8b2345b --- /dev/null +++ b/src/Vapi.Net/Types/StructuredDataMultiPlan.cs @@ -0,0 +1,36 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record StructuredDataMultiPlan +{ + /// + /// This is the key of the structured data plan in the catalog. + /// + [JsonPropertyName("key")] + public required string Key { get; set; } + + /// + /// This is an individual structured data plan in the catalog. + /// + [JsonPropertyName("plan")] + public required StructuredDataPlan Plan { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/StructuredDataPlan.cs b/src/Vapi.Net/Types/StructuredDataPlan.cs index 430e5ae..a5ceca3 100644 --- a/src/Vapi.Net/Types/StructuredDataPlan.cs +++ b/src/Vapi.Net/Types/StructuredDataPlan.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -58,6 +59,17 @@ public record StructuredDataPlan [JsonPropertyName("timeoutSeconds")] public double? TimeoutSeconds { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/Subscription.cs b/src/Vapi.Net/Types/Subscription.cs index d303d02..6fd417d 100644 --- a/src/Vapi.Net/Types/Subscription.cs +++ b/src/Vapi.Net/Types/Subscription.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -209,6 +210,36 @@ public record Subscription [JsonPropertyName("couponUsageLeft")] public string? CouponUsageLeft { get; set; } + /// + /// This is the invoice plan for the subscription. + /// + [JsonPropertyName("invoicePlan")] + public InvoicePlan? InvoicePlan { get; set; } + + /// + /// This is the PCI enabled flag for the subscription. It determines whether orgs under this + /// subscription have the option to enable PCI compliance. + /// + [JsonPropertyName("pciEnabled")] + public bool? PciEnabled { get; set; } + + /// + /// This is the ID for the Common Paper agreement outlining the PCI contract. + /// + [JsonPropertyName("pciCommonPaperAgreementId")] + public string? PciCommonPaperAgreementId { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/SuccessEvaluationPlan.cs b/src/Vapi.Net/Types/SuccessEvaluationPlan.cs index d54c6f4..a79a11a 100644 --- a/src/Vapi.Net/Types/SuccessEvaluationPlan.cs +++ b/src/Vapi.Net/Types/SuccessEvaluationPlan.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -72,6 +73,17 @@ public record SuccessEvaluationPlan [JsonPropertyName("timeoutSeconds")] public double? TimeoutSeconds { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/SummaryPlan.cs b/src/Vapi.Net/Types/SummaryPlan.cs index fbe73f4..bf2a421 100644 --- a/src/Vapi.Net/Types/SummaryPlan.cs +++ b/src/Vapi.Net/Types/SummaryPlan.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -50,6 +51,17 @@ public record SummaryPlan [JsonPropertyName("timeoutSeconds")] public double? TimeoutSeconds { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/SupabaseBucketPlan.cs b/src/Vapi.Net/Types/SupabaseBucketPlan.cs new file mode 100644 index 0000000..3ef1e32 --- /dev/null +++ b/src/Vapi.Net/Types/SupabaseBucketPlan.cs @@ -0,0 +1,71 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record SupabaseBucketPlan +{ + /// + /// This is the S3 Region. It should look like us-east-1 + /// It should be one of the supabase regions defined in the SUPABASE_REGION enum + /// Check https://supabase.com/docs/guides/platform/regions for up to date regions + /// + [JsonPropertyName("region")] + public required SupabaseBucketPlanRegion Region { get; set; } + + /// + /// This is the S3 compatible URL for Supabase S3 + /// This should look like https://<project-ID>.supabase.co/storage/v1/s3 + /// + [JsonPropertyName("url")] + public required string Url { get; set; } + + /// + /// This is the Supabase S3 Access Key ID. + /// The user creates this in the Supabase project Storage settings + /// + [JsonPropertyName("accessKeyId")] + public required string AccessKeyId { get; set; } + + /// + /// This is the Supabase S3 Secret Access Key. + /// The user creates this in the Supabase project Storage settings along with the access key id + /// + [JsonPropertyName("secretAccessKey")] + public required string SecretAccessKey { get; set; } + + /// + /// This is the Supabase S3 Bucket Name. + /// The user must create this in Supabase under Storage > Buckets + /// A bucket that does not exist will not be checked now, but file uploads will fail + /// + [JsonPropertyName("name")] + public required string Name { get; set; } + + /// + /// This is the Supabase S3 Bucket Folder Path. + /// The user can create this in Supabase under Storage > Buckets + /// A path that does not exist will not be checked now, but file uploads will fail + /// A Path is like a folder in the bucket + /// Eg. If the bucket is called "my-bucket" and the path is "my-folder", the full path is "my-bucket/my-folder" + /// + [JsonPropertyName("path")] + public string? Path { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/SupabaseBucketPlanRegion.cs b/src/Vapi.Net/Types/SupabaseBucketPlanRegion.cs new file mode 100644 index 0000000..215a1ab --- /dev/null +++ b/src/Vapi.Net/Types/SupabaseBucketPlanRegion.cs @@ -0,0 +1,57 @@ +using System.Runtime.Serialization; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[JsonConverter(typeof(EnumSerializer))] +public enum SupabaseBucketPlanRegion +{ + [EnumMember(Value = "us-west-1")] + UsWest1, + + [EnumMember(Value = "us-east-1")] + UsEast1, + + [EnumMember(Value = "us-east-2")] + UsEast2, + + [EnumMember(Value = "ca-central-1")] + CaCentral1, + + [EnumMember(Value = "eu-west-1")] + EuWest1, + + [EnumMember(Value = "eu-west-2")] + EuWest2, + + [EnumMember(Value = "eu-west-3")] + EuWest3, + + [EnumMember(Value = "eu-central-1")] + EuCentral1, + + [EnumMember(Value = "eu-central-2")] + EuCentral2, + + [EnumMember(Value = "eu-north-1")] + EuNorth1, + + [EnumMember(Value = "ap-south-1")] + ApSouth1, + + [EnumMember(Value = "ap-southeast-1")] + ApSoutheast1, + + [EnumMember(Value = "ap-northeast-1")] + ApNortheast1, + + [EnumMember(Value = "ap-northeast-2")] + ApNortheast2, + + [EnumMember(Value = "ap-southeast-2")] + ApSoutheast2, + + [EnumMember(Value = "sa-east-1")] + SaEast1, +} diff --git a/src/Vapi.Net/Types/SupabaseCredential.cs b/src/Vapi.Net/Types/SupabaseCredential.cs new file mode 100644 index 0000000..b21598c --- /dev/null +++ b/src/Vapi.Net/Types/SupabaseCredential.cs @@ -0,0 +1,63 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record SupabaseCredential +{ + /// + /// This is for supabase storage. + /// + [JsonPropertyName("provider")] + public string Provider { get; set; } = "supabase"; + + /// + /// This is the unique identifier for the credential. + /// + [JsonPropertyName("id")] + public required string Id { get; set; } + + /// + /// This is the unique identifier for the org that this credential belongs to. + /// + [JsonPropertyName("orgId")] + public required string OrgId { get; set; } + + /// + /// This is the ISO 8601 date-time string of when the credential was created. + /// + [JsonPropertyName("createdAt")] + public required DateTime CreatedAt { get; set; } + + /// + /// This is the ISO 8601 date-time string of when the assistant was last updated. + /// + [JsonPropertyName("updatedAt")] + public required DateTime UpdatedAt { get; set; } + + /// + /// This is the name of credential. This is just for your reference. + /// + [JsonPropertyName("name")] + public string? Name { get; set; } + + [JsonPropertyName("bucketPlan")] + public SupabaseBucketPlan? BucketPlan { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/SyncVoiceLibraryDto.cs b/src/Vapi.Net/Types/SyncVoiceLibraryDto.cs index b5b1696..1140900 100644 --- a/src/Vapi.Net/Types/SyncVoiceLibraryDto.cs +++ b/src/Vapi.Net/Types/SyncVoiceLibraryDto.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -11,6 +12,17 @@ public record SyncVoiceLibraryDto [JsonPropertyName("providers")] public IEnumerable? Providers { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/SyncVoiceLibraryDtoProvidersItem.cs b/src/Vapi.Net/Types/SyncVoiceLibraryDtoProvidersItem.cs index 976b912..46d7583 100644 --- a/src/Vapi.Net/Types/SyncVoiceLibraryDtoProvidersItem.cs +++ b/src/Vapi.Net/Types/SyncVoiceLibraryDtoProvidersItem.cs @@ -7,6 +7,9 @@ namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] public enum SyncVoiceLibraryDtoProvidersItem { + [EnumMember(Value = "vapi")] + Vapi, + [EnumMember(Value = "11labs")] ElevenLabs, @@ -22,12 +25,12 @@ public enum SyncVoiceLibraryDtoProvidersItem [EnumMember(Value = "deepgram")] Deepgram, + [EnumMember(Value = "hume")] + Hume, + [EnumMember(Value = "lmnt")] Lmnt, - [EnumMember(Value = "neets")] - Neets, - [EnumMember(Value = "neuphonic")] Neuphonic, @@ -45,4 +48,7 @@ public enum SyncVoiceLibraryDtoProvidersItem [EnumMember(Value = "tavus")] Tavus, + + [EnumMember(Value = "sesame")] + Sesame, } diff --git a/src/Vapi.Net/Types/SystemMessage.cs b/src/Vapi.Net/Types/SystemMessage.cs index 3ca2c0d..60e5870 100644 --- a/src/Vapi.Net/Types/SystemMessage.cs +++ b/src/Vapi.Net/Types/SystemMessage.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -29,6 +30,17 @@ public record SystemMessage [JsonPropertyName("secondsFromStart")] public required double SecondsFromStart { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/TalkscriberTranscriber.cs b/src/Vapi.Net/Types/TalkscriberTranscriber.cs index 32858e3..6e87626 100644 --- a/src/Vapi.Net/Types/TalkscriberTranscriber.cs +++ b/src/Vapi.Net/Types/TalkscriberTranscriber.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -17,6 +18,23 @@ public record TalkscriberTranscriber [JsonPropertyName("language")] public TalkscriberTranscriberLanguage? Language { get; set; } + /// + /// This is the plan for voice provider fallbacks in the event that the primary voice provider fails. + /// + [JsonPropertyName("fallbackPlan")] + public FallbackTranscriberPlan? FallbackPlan { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/TargetPlan.cs b/src/Vapi.Net/Types/TargetPlan.cs new file mode 100644 index 0000000..afe09d6 --- /dev/null +++ b/src/Vapi.Net/Types/TargetPlan.cs @@ -0,0 +1,54 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record TargetPlan +{ + /// + /// This is the phone number that is being tested. + /// During the actual test, it'll be called and the assistant attached to it will pick up and be tested. + /// To test an assistant directly, send assistantId instead. + /// + [JsonPropertyName("phoneNumberId")] + public string? PhoneNumberId { get; set; } + + /// + /// This can be any phone number (even not on Vapi). + /// During the actual test, it'll be called. + /// To test a Vapi number, send phoneNumberId. To test an assistant directly, send assistantId instead. + /// + [JsonPropertyName("phoneNumber")] + public TestSuitePhoneNumber? PhoneNumber { get; set; } + + /// + /// This is the assistant being tested. + /// During the actual test, it'll invoked directly. + /// To test the assistant over phone number, send phoneNumberId instead. + /// + [JsonPropertyName("assistantId")] + public string? AssistantId { get; set; } + + /// + /// This is the assistant overrides applied to assistantId before it is tested. + /// + [JsonPropertyName("assistantOverrides")] + public AssistantOverrides? AssistantOverrides { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/TavusConversationProperties.cs b/src/Vapi.Net/Types/TavusConversationProperties.cs index 7e04047..90cad96 100644 --- a/src/Vapi.Net/Types/TavusConversationProperties.cs +++ b/src/Vapi.Net/Types/TavusConversationProperties.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -73,6 +74,17 @@ public record TavusConversationProperties [JsonPropertyName("awsAssumeRoleArn")] public string? AwsAssumeRoleArn { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/TavusCredential.cs b/src/Vapi.Net/Types/TavusCredential.cs index 9a44af7..98e5e93 100644 --- a/src/Vapi.Net/Types/TavusCredential.cs +++ b/src/Vapi.Net/Types/TavusCredential.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -44,6 +45,17 @@ public record TavusCredential [JsonPropertyName("name")] public string? Name { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/TavusVoice.cs b/src/Vapi.Net/Types/TavusVoice.cs index 9898954..bc0fb6e 100644 --- a/src/Vapi.Net/Types/TavusVoice.cs +++ b/src/Vapi.Net/Types/TavusVoice.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using OneOf; using Vapi.Net.Core; @@ -60,6 +61,17 @@ public record TavusVoice [JsonPropertyName("fallbackPlan")] public FallbackPlan? FallbackPlan { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/TelnyxPhoneNumber.cs b/src/Vapi.Net/Types/TelnyxPhoneNumber.cs new file mode 100644 index 0000000..2b729cc --- /dev/null +++ b/src/Vapi.Net/Types/TelnyxPhoneNumber.cs @@ -0,0 +1,117 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record TelnyxPhoneNumber +{ + /// + /// This is the fallback destination an inbound call will be transferred to if: + /// 1. `assistantId` is not set + /// 2. `squadId` is not set + /// 3. and, `assistant-request` message to the `serverUrl` fails + /// + /// If this is not set and above conditions are met, the inbound call is hung up with an error message. + /// + [JsonPropertyName("fallbackDestination")] + public object? FallbackDestination { get; set; } + + /// + /// This is the hooks that will be used for incoming calls to this phone number. + /// + [JsonPropertyName("hooks")] + public IEnumerable? Hooks { get; set; } + + /// + /// This is the unique identifier for the phone number. + /// + [JsonPropertyName("id")] + public required string Id { get; set; } + + /// + /// This is the unique identifier for the org that this phone number belongs to. + /// + [JsonPropertyName("orgId")] + public required string OrgId { get; set; } + + /// + /// This is the ISO 8601 date-time string of when the phone number was created. + /// + [JsonPropertyName("createdAt")] + public required DateTime CreatedAt { get; set; } + + /// + /// This is the ISO 8601 date-time string of when the phone number was last updated. + /// + [JsonPropertyName("updatedAt")] + public required DateTime UpdatedAt { get; set; } + + /// + /// This is the status of the phone number. + /// + [JsonPropertyName("status")] + public TelnyxPhoneNumberStatus? Status { get; set; } + + /// + /// This is the name of the phone number. This is just for your own reference. + /// + [JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// This is the assistant that will be used for incoming calls to this phone number. + /// + /// If neither `assistantId` nor `squadId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected. + /// + [JsonPropertyName("assistantId")] + public string? AssistantId { get; set; } + + /// + /// This is the squad that will be used for incoming calls to this phone number. + /// + /// If neither `assistantId` nor `squadId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected. + /// + [JsonPropertyName("squadId")] + public string? SquadId { get; set; } + + /// + /// This is where Vapi will send webhooks. You can find all webhooks available along with their shape in ServerMessage schema. + /// + /// The order of precedence is: + /// + /// 1. assistant.server + /// 2. phoneNumber.server + /// 3. org.server + /// + [JsonPropertyName("server")] + public Server? Server { get; set; } + + /// + /// These are the digits of the phone number you own on your Telnyx. + /// + [JsonPropertyName("number")] + public required string Number { get; set; } + + /// + /// This is the credential you added in dashboard.vapi.ai/keys. This is used to configure the number to send inbound calls to Vapi, make outbound calls and do live call updates like transfers and hangups. + /// + [JsonPropertyName("credentialId")] + public required string CredentialId { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/TelnyxPhoneNumberStatus.cs b/src/Vapi.Net/Types/TelnyxPhoneNumberStatus.cs new file mode 100644 index 0000000..0fae573 --- /dev/null +++ b/src/Vapi.Net/Types/TelnyxPhoneNumberStatus.cs @@ -0,0 +1,18 @@ +using System.Runtime.Serialization; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[JsonConverter(typeof(EnumSerializer))] +public enum TelnyxPhoneNumberStatus +{ + [EnumMember(Value = "active")] + Active, + + [EnumMember(Value = "activating")] + Activating, + + [EnumMember(Value = "blocked")] + Blocked, +} diff --git a/src/Vapi.Net/Types/Template.cs b/src/Vapi.Net/Types/Template.cs index c5ef408..c057638 100644 --- a/src/Vapi.Net/Types/Template.cs +++ b/src/Vapi.Net/Types/Template.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -53,6 +54,17 @@ public record Template [JsonPropertyName("updatedAt")] public required DateTime UpdatedAt { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/TestSuite.cs b/src/Vapi.Net/Types/TestSuite.cs index c713167..96fa7f6 100644 --- a/src/Vapi.Net/Types/TestSuite.cs +++ b/src/Vapi.Net/Types/TestSuite.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -41,6 +42,31 @@ public record TestSuite [JsonPropertyName("phoneNumberId")] public string? PhoneNumberId { get; set; } + /// + /// Override the default tester plan by providing custom assistant configuration for the test agent. + /// + /// We recommend only using this if you are confident, as we have already set sensible defaults on the tester plan. + /// + [JsonPropertyName("testerPlan")] + public TesterPlan? TesterPlan { get; set; } + + /// + /// These are the configuration for the assistant / phone number that is being tested. + /// + [JsonPropertyName("targetPlan")] + public TargetPlan? TargetPlan { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/TestSuitePhoneNumber.cs b/src/Vapi.Net/Types/TestSuitePhoneNumber.cs new file mode 100644 index 0000000..a3a1101 --- /dev/null +++ b/src/Vapi.Net/Types/TestSuitePhoneNumber.cs @@ -0,0 +1,36 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record TestSuitePhoneNumber +{ + /// + /// This is the provider of the phone number. + /// + [JsonPropertyName("provider")] + public string Provider { get; set; } = "test-suite"; + + /// + /// This is the phone number that is being tested. + /// + [JsonPropertyName("number")] + public required string Number { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/TestSuiteRun.cs b/src/Vapi.Net/Types/TestSuiteRun.cs index 5e79bfd..00db32a 100644 --- a/src/Vapi.Net/Types/TestSuiteRun.cs +++ b/src/Vapi.Net/Types/TestSuiteRun.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -54,6 +55,17 @@ public record TestSuiteRun [JsonPropertyName("name")] public string? Name { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/TestSuiteRunScorerAi.cs b/src/Vapi.Net/Types/TestSuiteRunScorerAi.cs index 77cb652..5e3a283 100644 --- a/src/Vapi.Net/Types/TestSuiteRunScorerAi.cs +++ b/src/Vapi.Net/Types/TestSuiteRunScorerAi.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -29,6 +30,17 @@ public record TestSuiteRunScorerAi [JsonPropertyName("rubric")] public required string Rubric { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/TestSuiteRunStatus.cs b/src/Vapi.Net/Types/TestSuiteRunStatus.cs index 22e5399..a8ae0c1 100644 --- a/src/Vapi.Net/Types/TestSuiteRunStatus.cs +++ b/src/Vapi.Net/Types/TestSuiteRunStatus.cs @@ -15,4 +15,7 @@ public enum TestSuiteRunStatus [EnumMember(Value = "completed")] Completed, + + [EnumMember(Value = "failed")] + Failed, } diff --git a/src/Vapi.Net/Types/TestSuiteRunTestAttempt.cs b/src/Vapi.Net/Types/TestSuiteRunTestAttempt.cs index 453b338..21a5779 100644 --- a/src/Vapi.Net/Types/TestSuiteRunTestAttempt.cs +++ b/src/Vapi.Net/Types/TestSuiteRunTestAttempt.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -16,8 +17,31 @@ public record TestSuiteRunTestAttempt /// This is the call made during the test attempt. /// [JsonPropertyName("call")] - public required TestSuiteRunTestAttemptCall Call { get; set; } + public TestSuiteRunTestAttemptCall? Call { get; set; } + /// + /// This is the call ID for the test attempt. + /// + [JsonPropertyName("callId")] + public string? CallId { get; set; } + + /// + /// This is the metadata for the test attempt. + /// + [JsonPropertyName("metadata")] + public TestSuiteRunTestAttemptMetadata? Metadata { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/TestSuiteRunTestAttemptCall.cs b/src/Vapi.Net/Types/TestSuiteRunTestAttemptCall.cs index 922d916..c6de614 100644 --- a/src/Vapi.Net/Types/TestSuiteRunTestAttemptCall.cs +++ b/src/Vapi.Net/Types/TestSuiteRunTestAttemptCall.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -6,11 +7,22 @@ namespace Vapi.Net; public record TestSuiteRunTestAttemptCall { /// - /// This is the artifact associated with the call. + /// This is the artifact of the call. /// [JsonPropertyName("artifact")] public required Artifact Artifact { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/TestSuiteRunTestAttemptMetadata.cs b/src/Vapi.Net/Types/TestSuiteRunTestAttemptMetadata.cs new file mode 100644 index 0000000..77e70bc --- /dev/null +++ b/src/Vapi.Net/Types/TestSuiteRunTestAttemptMetadata.cs @@ -0,0 +1,30 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record TestSuiteRunTestAttemptMetadata +{ + /// + /// This is the session ID for the test attempt. + /// + [JsonPropertyName("sessionId")] + public required string SessionId { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/TestSuiteRunTestResult.cs b/src/Vapi.Net/Types/TestSuiteRunTestResult.cs index d644aa1..63d5592 100644 --- a/src/Vapi.Net/Types/TestSuiteRunTestResult.cs +++ b/src/Vapi.Net/Types/TestSuiteRunTestResult.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -18,6 +19,17 @@ public record TestSuiteRunTestResult public IEnumerable Attempts { get; set; } = new List(); + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/TestSuiteRunsPaginatedResponse.cs b/src/Vapi.Net/Types/TestSuiteRunsPaginatedResponse.cs index 6633500..e8e080f 100644 --- a/src/Vapi.Net/Types/TestSuiteRunsPaginatedResponse.cs +++ b/src/Vapi.Net/Types/TestSuiteRunsPaginatedResponse.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -11,6 +12,17 @@ public record TestSuiteRunsPaginatedResponse [JsonPropertyName("metadata")] public required PaginationMeta Metadata { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/TestSuiteTestChat.cs b/src/Vapi.Net/Types/TestSuiteTestChat.cs new file mode 100644 index 0000000..d9a7393 --- /dev/null +++ b/src/Vapi.Net/Types/TestSuiteTestChat.cs @@ -0,0 +1,79 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record TestSuiteTestChat +{ + /// + /// These are the scorers used to evaluate the test. + /// + [JsonPropertyName("scorers")] + public IEnumerable Scorers { get; set; } = + new List(); + + /// + /// This is the unique identifier for the test. + /// + [JsonPropertyName("id")] + public required string Id { get; set; } + + /// + /// This is the unique identifier for the test suite this test belongs to. + /// + [JsonPropertyName("testSuiteId")] + public required string TestSuiteId { get; set; } + + /// + /// This is the unique identifier for the organization this test belongs to. + /// + [JsonPropertyName("orgId")] + public required string OrgId { get; set; } + + /// + /// This is the ISO 8601 date-time string of when the test was created. + /// + [JsonPropertyName("createdAt")] + public required DateTime CreatedAt { get; set; } + + /// + /// This is the ISO 8601 date-time string of when the test was last updated. + /// + [JsonPropertyName("updatedAt")] + public required DateTime UpdatedAt { get; set; } + + /// + /// This is the name of the test. + /// + [JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// This is the script to be used for the chat test. + /// + [JsonPropertyName("script")] + public required string Script { get; set; } + + /// + /// This is the number of attempts allowed for the test. + /// + [JsonPropertyName("numAttempts")] + public double? NumAttempts { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/TestSuiteTestScorerAi.cs b/src/Vapi.Net/Types/TestSuiteTestScorerAi.cs index 8309b77..9ba57fc 100644 --- a/src/Vapi.Net/Types/TestSuiteTestScorerAi.cs +++ b/src/Vapi.Net/Types/TestSuiteTestScorerAi.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -17,6 +18,17 @@ public record TestSuiteTestScorerAi [JsonPropertyName("rubric")] public required string Rubric { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/TestSuiteTestVoice.cs b/src/Vapi.Net/Types/TestSuiteTestVoice.cs index afaa4d0..fbd242c 100644 --- a/src/Vapi.Net/Types/TestSuiteTestVoice.cs +++ b/src/Vapi.Net/Types/TestSuiteTestVoice.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -60,6 +61,17 @@ public record TestSuiteTestVoice [JsonPropertyName("numAttempts")] public double? NumAttempts { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/TestSuiteTestsPaginatedResponse.cs b/src/Vapi.Net/Types/TestSuiteTestsPaginatedResponse.cs index b997779..5710a85 100644 --- a/src/Vapi.Net/Types/TestSuiteTestsPaginatedResponse.cs +++ b/src/Vapi.Net/Types/TestSuiteTestsPaginatedResponse.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -9,7 +10,7 @@ public record TestSuiteTestsPaginatedResponse /// A list of test suite tests. /// [JsonPropertyName("results")] - public IEnumerable Results { get; set; } = new List(); + public IEnumerable Results { get; set; } = new List(); /// /// Metadata about the pagination. @@ -17,6 +18,17 @@ public record TestSuiteTestsPaginatedResponse [JsonPropertyName("metadata")] public required PaginationMeta Metadata { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/TestSuitesPaginatedResponse.cs b/src/Vapi.Net/Types/TestSuitesPaginatedResponse.cs index d191dd0..49800d1 100644 --- a/src/Vapi.Net/Types/TestSuitesPaginatedResponse.cs +++ b/src/Vapi.Net/Types/TestSuitesPaginatedResponse.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -11,6 +12,17 @@ public record TestSuitesPaginatedResponse [JsonPropertyName("metadata")] public required PaginationMeta Metadata { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/TesterPlan.cs b/src/Vapi.Net/Types/TesterPlan.cs new file mode 100644 index 0000000..c59c4c0 --- /dev/null +++ b/src/Vapi.Net/Types/TesterPlan.cs @@ -0,0 +1,49 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record TesterPlan +{ + /// + /// Pass a transient assistant to use for the test assistant. + /// + /// Make sure to write a detailed system prompt for a test assistant, and use the {{test.script}} variable to access the test script. + /// + [JsonPropertyName("assistant")] + public CreateAssistantDto? Assistant { get; set; } + + /// + /// Pass an assistant id that can be access + /// + /// Make sure to write a detailed system prompt for the test assistant, and use the {{test.script}} variable to access the test script. + /// + [JsonPropertyName("assistantId")] + public string? AssistantId { get; set; } + + /// + /// Add any assistant overrides to the test assistant. + /// + /// One use case is if you want to pass custom variables into the test using variableValues, that you can then access in the script + /// and rubric using {{varName}}. + /// + [JsonPropertyName("assistantOverrides")] + public AssistantOverrides? AssistantOverrides { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/TextContent.cs b/src/Vapi.Net/Types/TextContent.cs index 3dbe061..038453b 100644 --- a/src/Vapi.Net/Types/TextContent.cs +++ b/src/Vapi.Net/Types/TextContent.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -14,6 +15,17 @@ public record TextContent [JsonPropertyName("language")] public required TextContentLanguage Language { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/TextEditorTool.cs b/src/Vapi.Net/Types/TextEditorTool.cs index d721791..79235bf 100644 --- a/src/Vapi.Net/Types/TextEditorTool.cs +++ b/src/Vapi.Net/Types/TextEditorTool.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -81,6 +82,17 @@ public record TextEditorTool [JsonPropertyName("name")] public string Name { get; set; } = "str_replace_editor"; + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/TextEditorToolWithToolCall.cs b/src/Vapi.Net/Types/TextEditorToolWithToolCall.cs index d826f25..f5941e4 100644 --- a/src/Vapi.Net/Types/TextEditorToolWithToolCall.cs +++ b/src/Vapi.Net/Types/TextEditorToolWithToolCall.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -60,6 +61,17 @@ public record TextEditorToolWithToolCall [JsonPropertyName("server")] public Server? Server { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/TimeRange.cs b/src/Vapi.Net/Types/TimeRange.cs index ebdb88c..b7b4a2a 100644 --- a/src/Vapi.Net/Types/TimeRange.cs +++ b/src/Vapi.Net/Types/TimeRange.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -37,6 +38,17 @@ public record TimeRange [JsonPropertyName("timezone")] public string? Timezone { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/TogetherAiCredential.cs b/src/Vapi.Net/Types/TogetherAiCredential.cs index dde3e5d..7e10a65 100644 --- a/src/Vapi.Net/Types/TogetherAiCredential.cs +++ b/src/Vapi.Net/Types/TogetherAiCredential.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -44,6 +45,17 @@ public record TogetherAiCredential [JsonPropertyName("name")] public string? Name { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/TogetherAiModel.cs b/src/Vapi.Net/Types/TogetherAiModel.cs index a0263b4..48fd2e3 100644 --- a/src/Vapi.Net/Types/TogetherAiModel.cs +++ b/src/Vapi.Net/Types/TogetherAiModel.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -77,6 +78,17 @@ public record TogetherAiModel [JsonPropertyName("numFastTurns")] public double? NumFastTurns { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/Token.cs b/src/Vapi.Net/Types/Token.cs index 2c777db..292f4fc 100644 --- a/src/Vapi.Net/Types/Token.cs +++ b/src/Vapi.Net/Types/Token.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -53,6 +54,17 @@ public record Token [JsonPropertyName("restrictions")] public TokenRestrictions? Restrictions { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/TokenRestrictions.cs b/src/Vapi.Net/Types/TokenRestrictions.cs index 05524aa..29bfd84 100644 --- a/src/Vapi.Net/Types/TokenRestrictions.cs +++ b/src/Vapi.Net/Types/TokenRestrictions.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -37,6 +38,17 @@ public record TokenRestrictions [JsonPropertyName("allowTransientAssistant")] public bool? AllowTransientAssistant { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/ToolCall.cs b/src/Vapi.Net/Types/ToolCall.cs index 8c46cf7..ad4517c 100644 --- a/src/Vapi.Net/Types/ToolCall.cs +++ b/src/Vapi.Net/Types/ToolCall.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -23,6 +24,17 @@ public record ToolCall [JsonPropertyName("id")] public required string Id { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/ToolCallBlock.cs b/src/Vapi.Net/Types/ToolCallBlock.cs deleted file mode 100644 index 2609679..0000000 --- a/src/Vapi.Net/Types/ToolCallBlock.cs +++ /dev/null @@ -1,85 +0,0 @@ -using System.Text.Json.Serialization; -using Vapi.Net.Core; - -namespace Vapi.Net; - -public record ToolCallBlock -{ - /// - /// These are the pre-configured messages that will be spoken to the user while the block is running. - /// - [JsonPropertyName("messages")] - public IEnumerable? Messages { get; set; } - - /// - /// This is the input schema for the block. This is the input the block needs to run. It's given to the block as `steps[0].input` - /// - /// These are accessible as variables: - /// - ({{input.propertyName}}) in context of the block execution (step) - /// - ({{stepName.input.propertyName}}) in context of the workflow - /// - [JsonPropertyName("inputSchema")] - public JsonSchema? InputSchema { get; set; } - - /// - /// This is the output schema for the block. This is the output the block will return to the workflow (`{{stepName.output}}`). - /// - /// These are accessible as variables: - /// - ({{output.propertyName}}) in context of the block execution (step) - /// - ({{stepName.output.propertyName}}) in context of the workflow (read caveat #1) - /// - ({{blockName.output.propertyName}}) in context of the workflow (read caveat #2) - /// - /// Caveats: - /// 1. a workflow can execute a step multiple times. example, if a loop is used in the graph. {{stepName.output.propertyName}} will reference the latest usage of the step. - /// 2. a workflow can execute a block multiple times. example, if a step is called multiple times or if a block is used in multiple steps. {{blockName.output.propertyName}} will reference the latest usage of the block. this liquid variable is just provided for convenience when creating blocks outside of a workflow with steps. - /// - [JsonPropertyName("outputSchema")] - public JsonSchema? OutputSchema { get; set; } - - /// - /// This is the tool that the block will call. To use an existing tool, use `toolId`. - /// - [JsonPropertyName("tool")] - public object? Tool { get; set; } - - /// - /// This is the unique identifier for the block. - /// - [JsonPropertyName("id")] - public required string Id { get; set; } - - /// - /// This is the unique identifier for the organization that this block belongs to. - /// - [JsonPropertyName("orgId")] - public required string OrgId { get; set; } - - /// - /// This is the ISO 8601 date-time string of when the block was created. - /// - [JsonPropertyName("createdAt")] - public required DateTime CreatedAt { get; set; } - - /// - /// This is the ISO 8601 date-time string of when the block was last updated. - /// - [JsonPropertyName("updatedAt")] - public required DateTime UpdatedAt { get; set; } - - /// - /// This is the name of the block. This is just for your reference. - /// - [JsonPropertyName("name")] - public string? Name { get; set; } - - /// - /// This is the id of the tool that the block will call. To use a transient tool, use `tool`. - /// - [JsonPropertyName("toolId")] - public string? ToolId { get; set; } - - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Vapi.Net/Types/ToolCallFunction.cs b/src/Vapi.Net/Types/ToolCallFunction.cs index d068f7c..f57fec7 100644 --- a/src/Vapi.Net/Types/ToolCallFunction.cs +++ b/src/Vapi.Net/Types/ToolCallFunction.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -17,6 +18,17 @@ public record ToolCallFunction [JsonPropertyName("arguments")] public object Arguments { get; set; } = new Dictionary(); + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/ToolCallMessage.cs b/src/Vapi.Net/Types/ToolCallMessage.cs index 16a0900..4bccc6a 100644 --- a/src/Vapi.Net/Types/ToolCallMessage.cs +++ b/src/Vapi.Net/Types/ToolCallMessage.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -35,6 +36,17 @@ public record ToolCallMessage [JsonPropertyName("secondsFromStart")] public required double SecondsFromStart { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/ToolCallResult.cs b/src/Vapi.Net/Types/ToolCallResult.cs index 4731643..7b88558 100644 --- a/src/Vapi.Net/Types/ToolCallResult.cs +++ b/src/Vapi.Net/Types/ToolCallResult.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -49,6 +50,17 @@ public record ToolCallResult [JsonPropertyName("error")] public string? Error { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/ToolCallResultMessage.cs b/src/Vapi.Net/Types/ToolCallResultMessage.cs index 6ff79cc..ec5f709 100644 --- a/src/Vapi.Net/Types/ToolCallResultMessage.cs +++ b/src/Vapi.Net/Types/ToolCallResultMessage.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -41,6 +42,17 @@ public record ToolCallResultMessage [JsonPropertyName("secondsFromStart")] public required double SecondsFromStart { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/ToolMessageComplete.cs b/src/Vapi.Net/Types/ToolMessageComplete.cs index 6894880..aff2a6a 100644 --- a/src/Vapi.Net/Types/ToolMessageComplete.cs +++ b/src/Vapi.Net/Types/ToolMessageComplete.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -61,6 +62,17 @@ public record ToolMessageComplete [JsonPropertyName("conditions")] public IEnumerable? Conditions { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/ToolMessageDelayed.cs b/src/Vapi.Net/Types/ToolMessageDelayed.cs index 9012604..7fb2eff 100644 --- a/src/Vapi.Net/Types/ToolMessageDelayed.cs +++ b/src/Vapi.Net/Types/ToolMessageDelayed.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -35,6 +36,17 @@ public record ToolMessageDelayed [JsonPropertyName("conditions")] public IEnumerable? Conditions { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/ToolMessageFailed.cs b/src/Vapi.Net/Types/ToolMessageFailed.cs index f965904..de40b57 100644 --- a/src/Vapi.Net/Types/ToolMessageFailed.cs +++ b/src/Vapi.Net/Types/ToolMessageFailed.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -37,6 +38,17 @@ public record ToolMessageFailed [JsonPropertyName("conditions")] public IEnumerable? Conditions { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/ToolMessageStart.cs b/src/Vapi.Net/Types/ToolMessageStart.cs index 9959f23..4e0d076 100644 --- a/src/Vapi.Net/Types/ToolMessageStart.cs +++ b/src/Vapi.Net/Types/ToolMessageStart.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -37,6 +38,17 @@ public record ToolMessageStart [JsonPropertyName("conditions")] public IEnumerable? Conditions { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/ToolTemplateMetadata.cs b/src/Vapi.Net/Types/ToolTemplateMetadata.cs index 79c6de3..53b7557 100644 --- a/src/Vapi.Net/Types/ToolTemplateMetadata.cs +++ b/src/Vapi.Net/Types/ToolTemplateMetadata.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -14,6 +15,17 @@ public record ToolTemplateMetadata [JsonPropertyName("collectionName")] public string? CollectionName { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/ToolTemplateSetup.cs b/src/Vapi.Net/Types/ToolTemplateSetup.cs index 9ae9064..43055a3 100644 --- a/src/Vapi.Net/Types/ToolTemplateSetup.cs +++ b/src/Vapi.Net/Types/ToolTemplateSetup.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -17,6 +18,17 @@ public record ToolTemplateSetup [JsonPropertyName("docsUrl")] public string? DocsUrl { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/TranscriberCost.cs b/src/Vapi.Net/Types/TranscriberCost.cs index c21739e..325ff27 100644 --- a/src/Vapi.Net/Types/TranscriberCost.cs +++ b/src/Vapi.Net/Types/TranscriberCost.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -31,6 +32,17 @@ public record TranscriberCost [JsonPropertyName("cost")] public required double Cost { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/TranscriptPlan.cs b/src/Vapi.Net/Types/TranscriptPlan.cs index c3a975f..4163d6c 100644 --- a/src/Vapi.Net/Types/TranscriptPlan.cs +++ b/src/Vapi.Net/Types/TranscriptPlan.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -47,6 +48,17 @@ public record TranscriptPlan [JsonPropertyName("userName")] public string? UserName { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/TranscriptionEndpointingPlan.cs b/src/Vapi.Net/Types/TranscriptionEndpointingPlan.cs index 049698d..b1174bc 100644 --- a/src/Vapi.Net/Types/TranscriptionEndpointingPlan.cs +++ b/src/Vapi.Net/Types/TranscriptionEndpointingPlan.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -35,6 +36,17 @@ public record TranscriptionEndpointingPlan [JsonPropertyName("onNumberSeconds")] public double? OnNumberSeconds { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/Transfer.cs b/src/Vapi.Net/Types/Transfer.cs index 1471f16..3045fd8 100644 --- a/src/Vapi.Net/Types/Transfer.cs +++ b/src/Vapi.Net/Types/Transfer.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -17,6 +18,17 @@ public record Transfer [JsonPropertyName("metadata")] public object? Metadata { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/TransferAssistantHookAction.cs b/src/Vapi.Net/Types/TransferAssistantHookAction.cs index e9a1333..e3544d9 100644 --- a/src/Vapi.Net/Types/TransferAssistantHookAction.cs +++ b/src/Vapi.Net/Types/TransferAssistantHookAction.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -17,6 +18,17 @@ public record TransferAssistantHookAction [JsonPropertyName("destination")] public object? Destination { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/TransferCallTool.cs b/src/Vapi.Net/Types/TransferCallTool.cs index d455796..0ea9570 100644 --- a/src/Vapi.Net/Types/TransferCallTool.cs +++ b/src/Vapi.Net/Types/TransferCallTool.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -75,6 +76,17 @@ public record TransferCallTool [JsonPropertyName("server")] public Server? Server { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/TransferDestinationAssistant.cs b/src/Vapi.Net/Types/TransferDestinationAssistant.cs index ef4ddec..6cb5d38 100644 --- a/src/Vapi.Net/Types/TransferDestinationAssistant.cs +++ b/src/Vapi.Net/Types/TransferDestinationAssistant.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using OneOf; using Vapi.Net.Core; @@ -123,6 +124,17 @@ public record TransferDestinationAssistant [JsonPropertyName("description")] public string? Description { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/TransferDestinationNumber.cs b/src/Vapi.Net/Types/TransferDestinationNumber.cs index e26dc37..9524203 100644 --- a/src/Vapi.Net/Types/TransferDestinationNumber.cs +++ b/src/Vapi.Net/Types/TransferDestinationNumber.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using OneOf; using Vapi.Net.Core; @@ -73,6 +74,17 @@ public record TransferDestinationNumber [JsonPropertyName("description")] public string? Description { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/TransferDestinationSip.cs b/src/Vapi.Net/Types/TransferDestinationSip.cs index 11ff5f8..7e14038 100644 --- a/src/Vapi.Net/Types/TransferDestinationSip.cs +++ b/src/Vapi.Net/Types/TransferDestinationSip.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using OneOf; using Vapi.Net.Core; @@ -44,6 +45,17 @@ public record TransferDestinationSip [JsonPropertyName("description")] public string? Description { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/TransferDestinationStep.cs b/src/Vapi.Net/Types/TransferDestinationStep.cs index 2b317be..666874f 100644 --- a/src/Vapi.Net/Types/TransferDestinationStep.cs +++ b/src/Vapi.Net/Types/TransferDestinationStep.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using OneOf; using Vapi.Net.Core; @@ -30,6 +31,17 @@ public record TransferDestinationStep [JsonPropertyName("description")] public string? Description { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/TransferPlan.cs b/src/Vapi.Net/Types/TransferPlan.cs index 90f0e02..8c6768b 100644 --- a/src/Vapi.Net/Types/TransferPlan.cs +++ b/src/Vapi.Net/Types/TransferPlan.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using OneOf; using Vapi.Net.Core; @@ -36,6 +37,7 @@ public record TransferPlan /// This specifies the SIP verb to use while transferring the call. /// - 'refer': Uses SIP REFER to transfer the call (default) /// - 'bye': Ends current call with SIP BYE + /// - 'dial': Uses SIP DIAL to transfer the call /// [JsonPropertyName("sipVerb")] public object? SipVerb { get; set; } @@ -67,6 +69,17 @@ public record TransferPlan [JsonPropertyName("summaryPlan")] public SummaryPlan? SummaryPlan { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/Transport.cs b/src/Vapi.Net/Types/Transport.cs deleted file mode 100644 index 0bdd066..0000000 --- a/src/Vapi.Net/Types/Transport.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System.Text.Json.Serialization; -using Vapi.Net.Core; - -namespace Vapi.Net; - -public record Transport -{ - /// - /// This is the provider used for the call. - /// - [JsonPropertyName("provider")] - public TransportProvider? Provider { get; set; } - - /// - /// This is determines whether the assistant will have video enabled. - /// - /// Only relevant for `webCall` type. - /// - [JsonPropertyName("assistantVideoEnabled")] - public bool? AssistantVideoEnabled { get; set; } - - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Vapi.Net/Types/TransportConfigurationTwilio.cs b/src/Vapi.Net/Types/TransportConfigurationTwilio.cs index d4b7101..29fc823 100644 --- a/src/Vapi.Net/Types/TransportConfigurationTwilio.cs +++ b/src/Vapi.Net/Types/TransportConfigurationTwilio.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -43,6 +44,17 @@ public record TransportConfigurationTwilio [JsonPropertyName("recordingChannels")] public TransportConfigurationTwilioRecordingChannels? RecordingChannels { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/TransportCost.cs b/src/Vapi.Net/Types/TransportCost.cs index d6bc26a..03e4bbb 100644 --- a/src/Vapi.Net/Types/TransportCost.cs +++ b/src/Vapi.Net/Types/TransportCost.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -20,6 +21,17 @@ public record TransportCost [JsonPropertyName("cost")] public required double Cost { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/TransportProvider.cs b/src/Vapi.Net/Types/TransportProvider.cs deleted file mode 100644 index 90cf160..0000000 --- a/src/Vapi.Net/Types/TransportProvider.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using Vapi.Net.Core; - -namespace Vapi.Net; - -[JsonConverter(typeof(EnumSerializer))] -public enum TransportProvider -{ - [EnumMember(Value = "twilio")] - Twilio, - - [EnumMember(Value = "vonage")] - Vonage, - - [EnumMember(Value = "vapi")] - Vapi, - - [EnumMember(Value = "daily")] - Daily, -} diff --git a/src/Vapi.Net/Types/TrieveCredential.cs b/src/Vapi.Net/Types/TrieveCredential.cs new file mode 100644 index 0000000..9f05cf3 --- /dev/null +++ b/src/Vapi.Net/Types/TrieveCredential.cs @@ -0,0 +1,63 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record TrieveCredential +{ + [JsonPropertyName("provider")] + public string Provider { get; set; } = "trieve"; + + /// + /// This is not returned in the API. + /// + [JsonPropertyName("apiKey")] + public required string ApiKey { get; set; } + + /// + /// This is the unique identifier for the credential. + /// + [JsonPropertyName("id")] + public required string Id { get; set; } + + /// + /// This is the unique identifier for the org that this credential belongs to. + /// + [JsonPropertyName("orgId")] + public required string OrgId { get; set; } + + /// + /// This is the ISO 8601 date-time string of when the credential was created. + /// + [JsonPropertyName("createdAt")] + public required DateTime CreatedAt { get; set; } + + /// + /// This is the ISO 8601 date-time string of when the assistant was last updated. + /// + [JsonPropertyName("updatedAt")] + public required DateTime UpdatedAt { get; set; } + + /// + /// This is the name of credential. This is just for your reference. + /// + [JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/TrieveKnowledgeBase.cs b/src/Vapi.Net/Types/TrieveKnowledgeBase.cs index b8abf2e..079ce43 100644 --- a/src/Vapi.Net/Types/TrieveKnowledgeBase.cs +++ b/src/Vapi.Net/Types/TrieveKnowledgeBase.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -25,7 +26,7 @@ public record TrieveKnowledgeBase /// This is the plan if you want us to create/import a new vector store using Trieve. /// [JsonPropertyName("createPlan")] - public object? CreatePlan { get; set; } + public TrieveKnowledgeBaseImport? CreatePlan { get; set; } /// /// This is the id of the knowledge base. @@ -39,6 +40,17 @@ public record TrieveKnowledgeBase [JsonPropertyName("orgId")] public required string OrgId { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/TrieveKnowledgeBaseChunkPlan.cs b/src/Vapi.Net/Types/TrieveKnowledgeBaseChunkPlan.cs index e2f0956..0dd02f7 100644 --- a/src/Vapi.Net/Types/TrieveKnowledgeBaseChunkPlan.cs +++ b/src/Vapi.Net/Types/TrieveKnowledgeBaseChunkPlan.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -35,6 +36,17 @@ public record TrieveKnowledgeBaseChunkPlan [JsonPropertyName("rebalanceChunks")] public bool? RebalanceChunks { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/TrieveKnowledgeBaseCreate.cs b/src/Vapi.Net/Types/TrieveKnowledgeBaseCreate.cs index 65732db..f0d665d 100644 --- a/src/Vapi.Net/Types/TrieveKnowledgeBaseCreate.cs +++ b/src/Vapi.Net/Types/TrieveKnowledgeBaseCreate.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -5,6 +6,12 @@ namespace Vapi.Net; public record TrieveKnowledgeBaseCreate { + /// + /// This is to create a new dataset on Trieve. + /// + [JsonPropertyName("type")] + public string Type { get; set; } = "create"; + /// /// These are the chunk plans used to create the dataset. /// @@ -12,6 +19,17 @@ public record TrieveKnowledgeBaseCreate public IEnumerable ChunkPlans { get; set; } = new List(); + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/TrieveKnowledgeBaseImport.cs b/src/Vapi.Net/Types/TrieveKnowledgeBaseImport.cs index 32a628b..41f1161 100644 --- a/src/Vapi.Net/Types/TrieveKnowledgeBaseImport.cs +++ b/src/Vapi.Net/Types/TrieveKnowledgeBaseImport.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -5,12 +6,29 @@ namespace Vapi.Net; public record TrieveKnowledgeBaseImport { + /// + /// This is to import an existing dataset from Trieve. + /// + [JsonPropertyName("type")] + public string Type { get; set; } = "import"; + /// /// This is the `datasetId` of the dataset on your Trieve account. /// [JsonPropertyName("providerId")] public required string ProviderId { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/TrieveKnowledgeBaseSearchPlan.cs b/src/Vapi.Net/Types/TrieveKnowledgeBaseSearchPlan.cs index 5abd6f8..2aa1649 100644 --- a/src/Vapi.Net/Types/TrieveKnowledgeBaseSearchPlan.cs +++ b/src/Vapi.Net/Types/TrieveKnowledgeBaseSearchPlan.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -29,6 +30,17 @@ public record TrieveKnowledgeBaseSearchPlan [JsonPropertyName("searchType")] public required TrieveKnowledgeBaseSearchPlanSearchType SearchType { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/TwilioCredential.cs b/src/Vapi.Net/Types/TwilioCredential.cs index 759c3ab..7e6b8f5 100644 --- a/src/Vapi.Net/Types/TwilioCredential.cs +++ b/src/Vapi.Net/Types/TwilioCredential.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -47,6 +48,17 @@ public record TwilioCredential [JsonPropertyName("accountSid")] public required string AccountSid { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/TwilioPhoneNumber.cs b/src/Vapi.Net/Types/TwilioPhoneNumber.cs index cf5484e..f6f09d2 100644 --- a/src/Vapi.Net/Types/TwilioPhoneNumber.cs +++ b/src/Vapi.Net/Types/TwilioPhoneNumber.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -16,6 +17,12 @@ public record TwilioPhoneNumber [JsonPropertyName("fallbackDestination")] public object? FallbackDestination { get; set; } + /// + /// This is the hooks that will be used for incoming calls to this phone number. + /// + [JsonPropertyName("hooks")] + public IEnumerable? Hooks { get; set; } + /// /// This is the unique identifier for the phone number. /// @@ -98,6 +105,17 @@ public record TwilioPhoneNumber [JsonPropertyName("twilioAuthToken")] public required string TwilioAuthToken { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/TwilioVoicemailDetection.cs b/src/Vapi.Net/Types/TwilioVoicemailDetectionPlan.cs similarity index 90% rename from src/Vapi.Net/Types/TwilioVoicemailDetection.cs rename to src/Vapi.Net/Types/TwilioVoicemailDetectionPlan.cs index 9137140..0f17b02 100644 --- a/src/Vapi.Net/Types/TwilioVoicemailDetection.cs +++ b/src/Vapi.Net/Types/TwilioVoicemailDetectionPlan.cs @@ -1,23 +1,18 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; namespace Vapi.Net; -public record TwilioVoicemailDetection +public record TwilioVoicemailDetectionPlan { - /// - /// This is the provider to use for voicemail detection. - /// - [JsonPropertyName("provider")] - public string Provider { get; set; } = "twilio"; - /// /// These are the AMD messages from Twilio that are considered as voicemail. Default is ['machine_end_beep', 'machine_end_silence']. /// /// @default {Array} ['machine_end_beep', 'machine_end_silence'] /// [JsonPropertyName("voicemailDetectionTypes")] - public IEnumerable? VoicemailDetectionTypes { get; set; } + public IEnumerable? VoicemailDetectionTypes { get; set; } /// /// This sets whether the assistant should detect voicemail. Defaults to true. @@ -85,6 +80,17 @@ public record TwilioVoicemailDetection [JsonPropertyName("machineDetectionSilenceTimeout")] public double? MachineDetectionSilenceTimeout { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/TwilioVoicemailDetectionVoicemailDetectionTypesItem.cs b/src/Vapi.Net/Types/TwilioVoicemailDetectionPlanVoicemailDetectionTypesItem.cs similarity index 76% rename from src/Vapi.Net/Types/TwilioVoicemailDetectionVoicemailDetectionTypesItem.cs rename to src/Vapi.Net/Types/TwilioVoicemailDetectionPlanVoicemailDetectionTypesItem.cs index a193770..2d29e3b 100644 --- a/src/Vapi.Net/Types/TwilioVoicemailDetectionVoicemailDetectionTypesItem.cs +++ b/src/Vapi.Net/Types/TwilioVoicemailDetectionPlanVoicemailDetectionTypesItem.cs @@ -4,8 +4,8 @@ namespace Vapi.Net; -[JsonConverter(typeof(EnumSerializer))] -public enum TwilioVoicemailDetectionVoicemailDetectionTypesItem +[JsonConverter(typeof(EnumSerializer))] +public enum TwilioVoicemailDetectionPlanVoicemailDetectionTypesItem { [EnumMember(Value = "machine_start")] MachineStart, diff --git a/src/Vapi.Net/Types/UpdateAnthropicCredentialDto.cs b/src/Vapi.Net/Types/UpdateAnthropicCredentialDto.cs index 6e7d414..987360b 100644 --- a/src/Vapi.Net/Types/UpdateAnthropicCredentialDto.cs +++ b/src/Vapi.Net/Types/UpdateAnthropicCredentialDto.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -17,6 +18,17 @@ public record UpdateAnthropicCredentialDto [JsonPropertyName("name")] public string? Name { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/UpdateAnyscaleCredentialDto.cs b/src/Vapi.Net/Types/UpdateAnyscaleCredentialDto.cs index ce49c16..a1ff7cb 100644 --- a/src/Vapi.Net/Types/UpdateAnyscaleCredentialDto.cs +++ b/src/Vapi.Net/Types/UpdateAnyscaleCredentialDto.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -17,6 +18,17 @@ public record UpdateAnyscaleCredentialDto [JsonPropertyName("name")] public string? Name { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/UpdateAssemblyAiCredentialDto.cs b/src/Vapi.Net/Types/UpdateAssemblyAiCredentialDto.cs index c12b825..9957be5 100644 --- a/src/Vapi.Net/Types/UpdateAssemblyAiCredentialDto.cs +++ b/src/Vapi.Net/Types/UpdateAssemblyAiCredentialDto.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -17,6 +18,17 @@ public record UpdateAssemblyAiCredentialDto [JsonPropertyName("name")] public string? Name { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/UpdateAzureCredentialDto.cs b/src/Vapi.Net/Types/UpdateAzureCredentialDto.cs index 9766839..bd44063 100644 --- a/src/Vapi.Net/Types/UpdateAzureCredentialDto.cs +++ b/src/Vapi.Net/Types/UpdateAzureCredentialDto.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -35,6 +36,17 @@ public record UpdateAzureCredentialDto [JsonPropertyName("bucketPlan")] public AzureBlobStorageBucketPlan? BucketPlan { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/UpdateAzureOpenAiCredentialDto.cs b/src/Vapi.Net/Types/UpdateAzureOpenAiCredentialDto.cs index a3f2563..d1682f3 100644 --- a/src/Vapi.Net/Types/UpdateAzureOpenAiCredentialDto.cs +++ b/src/Vapi.Net/Types/UpdateAzureOpenAiCredentialDto.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -32,6 +33,17 @@ public record UpdateAzureOpenAiCredentialDto [JsonPropertyName("openAIEndpoint")] public string? OpenAiEndpoint { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/UpdateAzureOpenAiCredentialDtoModelsItem.cs b/src/Vapi.Net/Types/UpdateAzureOpenAiCredentialDtoModelsItem.cs index 5bb9003..b68c9f5 100644 --- a/src/Vapi.Net/Types/UpdateAzureOpenAiCredentialDtoModelsItem.cs +++ b/src/Vapi.Net/Types/UpdateAzureOpenAiCredentialDtoModelsItem.cs @@ -7,8 +7,8 @@ namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] public enum UpdateAzureOpenAiCredentialDtoModelsItem { - [EnumMember(Value = "gpt-4o-2024-08-06-ptu")] - Gpt4O20240806Ptu, + [EnumMember(Value = "gpt-4o-2024-11-20")] + Gpt4O20241120, [EnumMember(Value = "gpt-4o-2024-08-06")] Gpt4O20240806, diff --git a/src/Vapi.Net/Types/UpdateBashToolDto.cs b/src/Vapi.Net/Types/UpdateBashToolDto.cs index 594a414..899255e 100644 --- a/src/Vapi.Net/Types/UpdateBashToolDto.cs +++ b/src/Vapi.Net/Types/UpdateBashToolDto.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -57,6 +58,17 @@ public record UpdateBashToolDto [JsonPropertyName("name")] public string? Name { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/UpdateByoPhoneNumberDto.cs b/src/Vapi.Net/Types/UpdateByoPhoneNumberDto.cs index a096390..3397696 100644 --- a/src/Vapi.Net/Types/UpdateByoPhoneNumberDto.cs +++ b/src/Vapi.Net/Types/UpdateByoPhoneNumberDto.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -16,6 +17,12 @@ public record UpdateByoPhoneNumberDto [JsonPropertyName("fallbackDestination")] public object? FallbackDestination { get; set; } + /// + /// This is the hooks that will be used for incoming calls to this phone number. + /// + [JsonPropertyName("hooks")] + public IEnumerable? Hooks { get; set; } + /// /// This is the flag to toggle the E164 check for the `number` field. This is an advanced property which should be used if you know your use case requires it. /// @@ -78,6 +85,17 @@ public record UpdateByoPhoneNumberDto [JsonPropertyName("credentialId")] public string? CredentialId { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/UpdateByoSipTrunkCredentialDto.cs b/src/Vapi.Net/Types/UpdateByoSipTrunkCredentialDto.cs index 952d9f0..b5dcd1f 100644 --- a/src/Vapi.Net/Types/UpdateByoSipTrunkCredentialDto.cs +++ b/src/Vapi.Net/Types/UpdateByoSipTrunkCredentialDto.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -52,6 +53,17 @@ public record UpdateByoSipTrunkCredentialDto [JsonPropertyName("sbcConfiguration")] public SbcConfiguration? SbcConfiguration { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/UpdateCartesiaCredentialDto.cs b/src/Vapi.Net/Types/UpdateCartesiaCredentialDto.cs index 69ab2a3..e37c58e 100644 --- a/src/Vapi.Net/Types/UpdateCartesiaCredentialDto.cs +++ b/src/Vapi.Net/Types/UpdateCartesiaCredentialDto.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -17,6 +18,17 @@ public record UpdateCartesiaCredentialDto [JsonPropertyName("name")] public string? Name { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/UpdateCerebrasCredentialDto.cs b/src/Vapi.Net/Types/UpdateCerebrasCredentialDto.cs index 7713aaf..66b5c88 100644 --- a/src/Vapi.Net/Types/UpdateCerebrasCredentialDto.cs +++ b/src/Vapi.Net/Types/UpdateCerebrasCredentialDto.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -17,6 +18,17 @@ public record UpdateCerebrasCredentialDto [JsonPropertyName("name")] public string? Name { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/UpdateCloudflareCredentialDto.cs b/src/Vapi.Net/Types/UpdateCloudflareCredentialDto.cs index f1ca704..20936be 100644 --- a/src/Vapi.Net/Types/UpdateCloudflareCredentialDto.cs +++ b/src/Vapi.Net/Types/UpdateCloudflareCredentialDto.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -35,6 +36,17 @@ public record UpdateCloudflareCredentialDto [JsonPropertyName("bucketPlan")] public CloudflareR2BucketPlan? BucketPlan { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/UpdateComputerToolDto.cs b/src/Vapi.Net/Types/UpdateComputerToolDto.cs index 2bf6365..41ff4a3 100644 --- a/src/Vapi.Net/Types/UpdateComputerToolDto.cs +++ b/src/Vapi.Net/Types/UpdateComputerToolDto.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -75,6 +76,17 @@ public record UpdateComputerToolDto [JsonPropertyName("displayNumber")] public double? DisplayNumber { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/UpdateConversationBlockDto.cs b/src/Vapi.Net/Types/UpdateConversationBlockDto.cs deleted file mode 100644 index fbeca07..0000000 --- a/src/Vapi.Net/Types/UpdateConversationBlockDto.cs +++ /dev/null @@ -1,73 +0,0 @@ -using System.Text.Json.Serialization; -using Vapi.Net.Core; - -namespace Vapi.Net; - -public record UpdateConversationBlockDto -{ - /// - /// These are the pre-configured messages that will be spoken to the user while the block is running. - /// - [JsonPropertyName("messages")] - public IEnumerable? Messages { get; set; } - - /// - /// This is the input schema for the block. This is the input the block needs to run. It's given to the block as `steps[0].input` - /// - /// These are accessible as variables: - /// - ({{input.propertyName}}) in context of the block execution (step) - /// - ({{stepName.input.propertyName}}) in context of the workflow - /// - [JsonPropertyName("inputSchema")] - public JsonSchema? InputSchema { get; set; } - - /// - /// This is the output schema for the block. This is the output the block will return to the workflow (`{{stepName.output}}`). - /// - /// These are accessible as variables: - /// - ({{output.propertyName}}) in context of the block execution (step) - /// - ({{stepName.output.propertyName}}) in context of the workflow (read caveat #1) - /// - ({{blockName.output.propertyName}}) in context of the workflow (read caveat #2) - /// - /// Caveats: - /// 1. a workflow can execute a step multiple times. example, if a loop is used in the graph. {{stepName.output.propertyName}} will reference the latest usage of the step. - /// 2. a workflow can execute a block multiple times. example, if a step is called multiple times or if a block is used in multiple steps. {{blockName.output.propertyName}} will reference the latest usage of the block. this liquid variable is just provided for convenience when creating blocks outside of a workflow with steps. - /// - [JsonPropertyName("outputSchema")] - public JsonSchema? OutputSchema { get; set; } - - /// - /// This is the name of the block. This is just for your reference. - /// - [JsonPropertyName("name")] - public string? Name { get; set; } - - /// - /// This is the instruction to the model. - /// - /// You can reference any variable in the context of the current block execution (step): - /// - "{{input.your-property-name}}" for the current step's input - /// - "{{your-step-name.output.your-property-name}}" for another step's output (in the same workflow; read caveat #1) - /// - "{{your-step-name.input.your-property-name}}" for another step's input (in the same workflow; read caveat #1) - /// - "{{your-block-name.output.your-property-name}}" for another block's output (in the same workflow; read caveat #2) - /// - "{{your-block-name.input.your-property-name}}" for another block's input (in the same workflow; read caveat #2) - /// - "{{workflow.input.your-property-name}}" for the current workflow's input - /// - "{{global.your-property-name}}" for the global context - /// - /// This can be as simple or as complex as you want it to be. - /// - "say hello and ask the user about their day!" - /// - "collect the user's first and last name" - /// - "user is {{input.firstName}} {{input.lastName}}. their age is {{input.age}}. ask them about their salary and if they might be interested in buying a house. we offer {{input.offer}}" - /// - /// Caveats: - /// 1. a workflow can execute a step multiple times. example, if a loop is used in the graph. {{stepName.output/input.propertyName}} will reference the latest usage of the step. - /// 2. a workflow can execute a block multiple times. example, if a step is called multiple times or if a block is used in multiple steps. {{blockName.output/input.propertyName}} will reference the latest usage of the block. this liquid variable is just provided for convenience when creating blocks outside of a workflow with steps. - /// - [JsonPropertyName("instruction")] - public string? Instruction { get; set; } - - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Vapi.Net/Types/UpdateCustomKnowledgeBaseDto.cs b/src/Vapi.Net/Types/UpdateCustomKnowledgeBaseDto.cs index 976d577..b89b269 100644 --- a/src/Vapi.Net/Types/UpdateCustomKnowledgeBaseDto.cs +++ b/src/Vapi.Net/Types/UpdateCustomKnowledgeBaseDto.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -49,6 +50,17 @@ public record UpdateCustomKnowledgeBaseDto [JsonPropertyName("server")] public Server? Server { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/UpdateCustomLlmCredentialDto.cs b/src/Vapi.Net/Types/UpdateCustomLlmCredentialDto.cs index 66f2a3a..5fcb087 100644 --- a/src/Vapi.Net/Types/UpdateCustomLlmCredentialDto.cs +++ b/src/Vapi.Net/Types/UpdateCustomLlmCredentialDto.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -23,6 +24,17 @@ public record UpdateCustomLlmCredentialDto [JsonPropertyName("name")] public string? Name { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/UpdateDeepInfraCredentialDto.cs b/src/Vapi.Net/Types/UpdateDeepInfraCredentialDto.cs index 8b9850f..55efdb6 100644 --- a/src/Vapi.Net/Types/UpdateDeepInfraCredentialDto.cs +++ b/src/Vapi.Net/Types/UpdateDeepInfraCredentialDto.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -17,6 +18,17 @@ public record UpdateDeepInfraCredentialDto [JsonPropertyName("name")] public string? Name { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/UpdateDeepSeekCredentialDto.cs b/src/Vapi.Net/Types/UpdateDeepSeekCredentialDto.cs index dc76c54..0333f95 100644 --- a/src/Vapi.Net/Types/UpdateDeepSeekCredentialDto.cs +++ b/src/Vapi.Net/Types/UpdateDeepSeekCredentialDto.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -17,6 +18,17 @@ public record UpdateDeepSeekCredentialDto [JsonPropertyName("name")] public string? Name { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/UpdateDeepgramCredentialDto.cs b/src/Vapi.Net/Types/UpdateDeepgramCredentialDto.cs index 2746e97..1a80a60 100644 --- a/src/Vapi.Net/Types/UpdateDeepgramCredentialDto.cs +++ b/src/Vapi.Net/Types/UpdateDeepgramCredentialDto.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -23,6 +24,17 @@ public record UpdateDeepgramCredentialDto [JsonPropertyName("apiUrl")] public string? ApiUrl { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/UpdateDtmfToolDto.cs b/src/Vapi.Net/Types/UpdateDtmfToolDto.cs index 9b9ba0c..6d23a5b 100644 --- a/src/Vapi.Net/Types/UpdateDtmfToolDto.cs +++ b/src/Vapi.Net/Types/UpdateDtmfToolDto.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -45,6 +46,17 @@ public record UpdateDtmfToolDto [JsonPropertyName("server")] public Server? Server { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/UpdateElevenLabsCredentialDto.cs b/src/Vapi.Net/Types/UpdateElevenLabsCredentialDto.cs index 3648e11..466d8d1 100644 --- a/src/Vapi.Net/Types/UpdateElevenLabsCredentialDto.cs +++ b/src/Vapi.Net/Types/UpdateElevenLabsCredentialDto.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -20,6 +21,17 @@ public record UpdateElevenLabsCredentialDto [JsonPropertyName("provider")] public string? Provider { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/UpdateEndCallToolDto.cs b/src/Vapi.Net/Types/UpdateEndCallToolDto.cs index e18ee24..c58da86 100644 --- a/src/Vapi.Net/Types/UpdateEndCallToolDto.cs +++ b/src/Vapi.Net/Types/UpdateEndCallToolDto.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -45,6 +46,17 @@ public record UpdateEndCallToolDto [JsonPropertyName("server")] public Server? Server { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/UpdateFunctionToolDto.cs b/src/Vapi.Net/Types/UpdateFunctionToolDto.cs index 567daf0..2410d1d 100644 --- a/src/Vapi.Net/Types/UpdateFunctionToolDto.cs +++ b/src/Vapi.Net/Types/UpdateFunctionToolDto.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -45,6 +46,17 @@ public record UpdateFunctionToolDto [JsonPropertyName("server")] public Server? Server { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/UpdateGcpCredentialDto.cs b/src/Vapi.Net/Types/UpdateGcpCredentialDto.cs index 65a3801..19aea85 100644 --- a/src/Vapi.Net/Types/UpdateGcpCredentialDto.cs +++ b/src/Vapi.Net/Types/UpdateGcpCredentialDto.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -25,6 +26,17 @@ public record UpdateGcpCredentialDto [JsonPropertyName("bucketPlan")] public BucketPlan? BucketPlan { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/UpdateGhlToolDto.cs b/src/Vapi.Net/Types/UpdateGhlToolDto.cs index de906e1..cedff07 100644 --- a/src/Vapi.Net/Types/UpdateGhlToolDto.cs +++ b/src/Vapi.Net/Types/UpdateGhlToolDto.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -48,6 +49,17 @@ public record UpdateGhlToolDto [JsonPropertyName("metadata")] public GhlToolMetadata? Metadata { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/UpdateGladiaCredentialDto.cs b/src/Vapi.Net/Types/UpdateGladiaCredentialDto.cs index a63a51a..5f091ea 100644 --- a/src/Vapi.Net/Types/UpdateGladiaCredentialDto.cs +++ b/src/Vapi.Net/Types/UpdateGladiaCredentialDto.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -17,6 +18,17 @@ public record UpdateGladiaCredentialDto [JsonPropertyName("name")] public string? Name { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/UpdateGoHighLevelCredentialDto.cs b/src/Vapi.Net/Types/UpdateGoHighLevelCredentialDto.cs index b67dd5b..b9f3e08 100644 --- a/src/Vapi.Net/Types/UpdateGoHighLevelCredentialDto.cs +++ b/src/Vapi.Net/Types/UpdateGoHighLevelCredentialDto.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -17,6 +18,17 @@ public record UpdateGoHighLevelCredentialDto [JsonPropertyName("name")] public string? Name { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/UpdateGoogleCalendarCheckAvailabilityToolDto.cs b/src/Vapi.Net/Types/UpdateGoogleCalendarCheckAvailabilityToolDto.cs new file mode 100644 index 0000000..a5d3f4e --- /dev/null +++ b/src/Vapi.Net/Types/UpdateGoogleCalendarCheckAvailabilityToolDto.cs @@ -0,0 +1,64 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record UpdateGoogleCalendarCheckAvailabilityToolDto +{ + /// + /// This determines if the tool is async. + /// + /// If async, the assistant will move forward without waiting for your server to respond. This is useful if you just want to trigger something on your server. + /// + /// If sync, the assistant will wait for your server to respond. This is useful if want assistant to respond with the result from your server. + /// + /// Defaults to synchronous (`false`). + /// + [JsonPropertyName("async")] + public bool? Async { get; set; } + + /// + /// These are the messages that will be spoken to the user as the tool is running. + /// + /// For some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured. + /// + [JsonPropertyName("messages")] + public IEnumerable? Messages { get; set; } + + /// + /// This is the function definition of the tool. + /// + /// For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + /// + /// An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + /// + [JsonPropertyName("function")] + public OpenAiFunction? Function { get; set; } + + /// + /// This is the server that will be hit when this tool is requested by the model. + /// + /// All requests will be sent with the call object among other things. You can find more details in the Server URL documentation. + /// + /// This overrides the serverUrl set on the org and the phoneNumber. Order of precedence: highest tool.server.url, then assistant.serverUrl, then phoneNumber.serverUrl, then org.serverUrl. + /// + [JsonPropertyName("server")] + public Server? Server { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/UpdateGoogleCalendarCreateEventToolDto.cs b/src/Vapi.Net/Types/UpdateGoogleCalendarCreateEventToolDto.cs new file mode 100644 index 0000000..b8a8e86 --- /dev/null +++ b/src/Vapi.Net/Types/UpdateGoogleCalendarCreateEventToolDto.cs @@ -0,0 +1,64 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record UpdateGoogleCalendarCreateEventToolDto +{ + /// + /// This determines if the tool is async. + /// + /// If async, the assistant will move forward without waiting for your server to respond. This is useful if you just want to trigger something on your server. + /// + /// If sync, the assistant will wait for your server to respond. This is useful if want assistant to respond with the result from your server. + /// + /// Defaults to synchronous (`false`). + /// + [JsonPropertyName("async")] + public bool? Async { get; set; } + + /// + /// These are the messages that will be spoken to the user as the tool is running. + /// + /// For some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured. + /// + [JsonPropertyName("messages")] + public IEnumerable? Messages { get; set; } + + /// + /// This is the function definition of the tool. + /// + /// For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + /// + /// An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + /// + [JsonPropertyName("function")] + public OpenAiFunction? Function { get; set; } + + /// + /// This is the server that will be hit when this tool is requested by the model. + /// + /// All requests will be sent with the call object among other things. You can find more details in the Server URL documentation. + /// + /// This overrides the serverUrl set on the org and the phoneNumber. Order of precedence: highest tool.server.url, then assistant.serverUrl, then phoneNumber.serverUrl, then org.serverUrl. + /// + [JsonPropertyName("server")] + public Server? Server { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/UpdateGoogleCalendarOAuth2AuthorizationCredentialDto.cs b/src/Vapi.Net/Types/UpdateGoogleCalendarOAuth2AuthorizationCredentialDto.cs new file mode 100644 index 0000000..d6b763b --- /dev/null +++ b/src/Vapi.Net/Types/UpdateGoogleCalendarOAuth2AuthorizationCredentialDto.cs @@ -0,0 +1,36 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record UpdateGoogleCalendarOAuth2AuthorizationCredentialDto +{ + /// + /// The authorization ID for the OAuth2 authorization + /// + [JsonPropertyName("authorizationId")] + public string? AuthorizationId { get; set; } + + /// + /// This is the name of credential. This is just for your reference. + /// + [JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/UpdateGoogleCalendarOAuth2ClientCredentialDto.cs b/src/Vapi.Net/Types/UpdateGoogleCalendarOAuth2ClientCredentialDto.cs new file mode 100644 index 0000000..655680d --- /dev/null +++ b/src/Vapi.Net/Types/UpdateGoogleCalendarOAuth2ClientCredentialDto.cs @@ -0,0 +1,30 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record UpdateGoogleCalendarOAuth2ClientCredentialDto +{ + /// + /// This is the name of credential. This is just for your reference. + /// + [JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/UpdateGoogleCredentialDto.cs b/src/Vapi.Net/Types/UpdateGoogleCredentialDto.cs index e662d06..4437ce5 100644 --- a/src/Vapi.Net/Types/UpdateGoogleCredentialDto.cs +++ b/src/Vapi.Net/Types/UpdateGoogleCredentialDto.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -17,6 +18,17 @@ public record UpdateGoogleCredentialDto [JsonPropertyName("name")] public string? Name { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/UpdateGoogleSheetsOAuth2AuthorizationCredentialDto.cs b/src/Vapi.Net/Types/UpdateGoogleSheetsOAuth2AuthorizationCredentialDto.cs new file mode 100644 index 0000000..9bc0681 --- /dev/null +++ b/src/Vapi.Net/Types/UpdateGoogleSheetsOAuth2AuthorizationCredentialDto.cs @@ -0,0 +1,36 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record UpdateGoogleSheetsOAuth2AuthorizationCredentialDto +{ + /// + /// The authorization ID for the OAuth2 authorization + /// + [JsonPropertyName("authorizationId")] + public string? AuthorizationId { get; set; } + + /// + /// This is the name of credential. This is just for your reference. + /// + [JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/UpdateGoogleSheetsRowAppendToolDto.cs b/src/Vapi.Net/Types/UpdateGoogleSheetsRowAppendToolDto.cs new file mode 100644 index 0000000..0f23894 --- /dev/null +++ b/src/Vapi.Net/Types/UpdateGoogleSheetsRowAppendToolDto.cs @@ -0,0 +1,64 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record UpdateGoogleSheetsRowAppendToolDto +{ + /// + /// This determines if the tool is async. + /// + /// If async, the assistant will move forward without waiting for your server to respond. This is useful if you just want to trigger something on your server. + /// + /// If sync, the assistant will wait for your server to respond. This is useful if want assistant to respond with the result from your server. + /// + /// Defaults to synchronous (`false`). + /// + [JsonPropertyName("async")] + public bool? Async { get; set; } + + /// + /// These are the messages that will be spoken to the user as the tool is running. + /// + /// For some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured. + /// + [JsonPropertyName("messages")] + public IEnumerable? Messages { get; set; } + + /// + /// This is the function definition of the tool. + /// + /// For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + /// + /// An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + /// + [JsonPropertyName("function")] + public OpenAiFunction? Function { get; set; } + + /// + /// This is the server that will be hit when this tool is requested by the model. + /// + /// All requests will be sent with the call object among other things. You can find more details in the Server URL documentation. + /// + /// This overrides the serverUrl set on the org and the phoneNumber. Order of precedence: highest tool.server.url, then assistant.serverUrl, then phoneNumber.serverUrl, then org.serverUrl. + /// + [JsonPropertyName("server")] + public Server? Server { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/UpdateGroqCredentialDto.cs b/src/Vapi.Net/Types/UpdateGroqCredentialDto.cs index d2c9d6c..636a74e 100644 --- a/src/Vapi.Net/Types/UpdateGroqCredentialDto.cs +++ b/src/Vapi.Net/Types/UpdateGroqCredentialDto.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -17,6 +18,17 @@ public record UpdateGroqCredentialDto [JsonPropertyName("name")] public string? Name { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/UpdateHumeCredentialDto.cs b/src/Vapi.Net/Types/UpdateHumeCredentialDto.cs new file mode 100644 index 0000000..8abf135 --- /dev/null +++ b/src/Vapi.Net/Types/UpdateHumeCredentialDto.cs @@ -0,0 +1,36 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record UpdateHumeCredentialDto +{ + /// + /// This is not returned in the API. + /// + [JsonPropertyName("apiKey")] + public string? ApiKey { get; set; } + + /// + /// This is the name of credential. This is just for your reference. + /// + [JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/UpdateInflectionAiCredentialDto.cs b/src/Vapi.Net/Types/UpdateInflectionAiCredentialDto.cs index cd0174a..4bd79cb 100644 --- a/src/Vapi.Net/Types/UpdateInflectionAiCredentialDto.cs +++ b/src/Vapi.Net/Types/UpdateInflectionAiCredentialDto.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -17,6 +18,17 @@ public record UpdateInflectionAiCredentialDto [JsonPropertyName("name")] public string? Name { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/UpdateLangfuseCredentialDto.cs b/src/Vapi.Net/Types/UpdateLangfuseCredentialDto.cs index 478e04d..d862c0c 100644 --- a/src/Vapi.Net/Types/UpdateLangfuseCredentialDto.cs +++ b/src/Vapi.Net/Types/UpdateLangfuseCredentialDto.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -29,6 +30,17 @@ public record UpdateLangfuseCredentialDto [JsonPropertyName("name")] public string? Name { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/UpdateLmntCredentialDto.cs b/src/Vapi.Net/Types/UpdateLmntCredentialDto.cs index 6fba7d7..d390cd5 100644 --- a/src/Vapi.Net/Types/UpdateLmntCredentialDto.cs +++ b/src/Vapi.Net/Types/UpdateLmntCredentialDto.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -17,6 +18,17 @@ public record UpdateLmntCredentialDto [JsonPropertyName("name")] public string? Name { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/UpdateMakeCredentialDto.cs b/src/Vapi.Net/Types/UpdateMakeCredentialDto.cs index 8451369..7b24203 100644 --- a/src/Vapi.Net/Types/UpdateMakeCredentialDto.cs +++ b/src/Vapi.Net/Types/UpdateMakeCredentialDto.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -29,6 +30,17 @@ public record UpdateMakeCredentialDto [JsonPropertyName("name")] public string? Name { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/UpdateMakeToolDto.cs b/src/Vapi.Net/Types/UpdateMakeToolDto.cs index 1237494..badd5c5 100644 --- a/src/Vapi.Net/Types/UpdateMakeToolDto.cs +++ b/src/Vapi.Net/Types/UpdateMakeToolDto.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -48,6 +49,17 @@ public record UpdateMakeToolDto [JsonPropertyName("metadata")] public MakeToolMetadata? Metadata { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/UpdateMcpToolDto.cs b/src/Vapi.Net/Types/UpdateMcpToolDto.cs new file mode 100644 index 0000000..7f969e8 --- /dev/null +++ b/src/Vapi.Net/Types/UpdateMcpToolDto.cs @@ -0,0 +1,64 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record UpdateMcpToolDto +{ + /// + /// This determines if the tool is async. + /// + /// If async, the assistant will move forward without waiting for your server to respond. This is useful if you just want to trigger something on your server. + /// + /// If sync, the assistant will wait for your server to respond. This is useful if want assistant to respond with the result from your server. + /// + /// Defaults to synchronous (`false`). + /// + [JsonPropertyName("async")] + public bool? Async { get; set; } + + /// + /// These are the messages that will be spoken to the user as the tool is running. + /// + /// For some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured. + /// + [JsonPropertyName("messages")] + public IEnumerable? Messages { get; set; } + + /// + /// This is the function definition of the tool. + /// + /// For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + /// + /// An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + /// + [JsonPropertyName("function")] + public OpenAiFunction? Function { get; set; } + + /// + /// This is the server that will be hit when this tool is requested by the model. + /// + /// All requests will be sent with the call object among other things. You can find more details in the Server URL documentation. + /// + /// This overrides the serverUrl set on the org and the phoneNumber. Order of precedence: highest tool.server.url, then assistant.serverUrl, then phoneNumber.serverUrl, then org.serverUrl. + /// + [JsonPropertyName("server")] + public Server? Server { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/UpdateMistralCredentialDto.cs b/src/Vapi.Net/Types/UpdateMistralCredentialDto.cs new file mode 100644 index 0000000..86b8211 --- /dev/null +++ b/src/Vapi.Net/Types/UpdateMistralCredentialDto.cs @@ -0,0 +1,36 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record UpdateMistralCredentialDto +{ + /// + /// This is not returned in the API. + /// + [JsonPropertyName("apiKey")] + public string? ApiKey { get; set; } + + /// + /// This is the name of credential. This is just for your reference. + /// + [JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/UpdateNeuphonicCredentialDto.cs b/src/Vapi.Net/Types/UpdateNeuphonicCredentialDto.cs new file mode 100644 index 0000000..1a2d53b --- /dev/null +++ b/src/Vapi.Net/Types/UpdateNeuphonicCredentialDto.cs @@ -0,0 +1,36 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record UpdateNeuphonicCredentialDto +{ + /// + /// This is not returned in the API. + /// + [JsonPropertyName("apiKey")] + public string? ApiKey { get; set; } + + /// + /// This is the name of credential. This is just for your reference. + /// + [JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/UpdateOpenAiCredentialDto.cs b/src/Vapi.Net/Types/UpdateOpenAiCredentialDto.cs index 7bb1ef0..f6e58f2 100644 --- a/src/Vapi.Net/Types/UpdateOpenAiCredentialDto.cs +++ b/src/Vapi.Net/Types/UpdateOpenAiCredentialDto.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -17,6 +18,17 @@ public record UpdateOpenAiCredentialDto [JsonPropertyName("name")] public string? Name { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/UpdateOpenRouterCredentialDto.cs b/src/Vapi.Net/Types/UpdateOpenRouterCredentialDto.cs index 137f393..7107752 100644 --- a/src/Vapi.Net/Types/UpdateOpenRouterCredentialDto.cs +++ b/src/Vapi.Net/Types/UpdateOpenRouterCredentialDto.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -17,6 +18,17 @@ public record UpdateOpenRouterCredentialDto [JsonPropertyName("name")] public string? Name { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/UpdateOrgDto.cs b/src/Vapi.Net/Types/UpdateOrgDto.cs index 5aaa289..aa541db 100644 --- a/src/Vapi.Net/Types/UpdateOrgDto.cs +++ b/src/Vapi.Net/Types/UpdateOrgDto.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -55,6 +56,28 @@ public record UpdateOrgDto [JsonPropertyName("concurrencyLimit")] public double? ConcurrencyLimit { get; set; } + /// + /// Stores the information about the compliance plan enforced at the organization level. Currently pciEnabled is supported through this field. + /// When this is enabled, any logs, recordings, or transcriptions will be shipped to the customer endpoints if provided else lost. + /// At the end of the call, you will receive an end-of-call-report message to store on your server, if webhook is provided. + /// Defaults to false. + /// When PCI is enabled, only PCI-compliant Providers will be available for LLM, Voice and transcribers. + /// This is due to the compliance requirements of PCI. Other providers may not meet these requirements. + /// + [JsonPropertyName("compliancePlan")] + public CompliancePlan? CompliancePlan { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/UpdateOutputToolDto.cs b/src/Vapi.Net/Types/UpdateOutputToolDto.cs index 5d36f42..2084668 100644 --- a/src/Vapi.Net/Types/UpdateOutputToolDto.cs +++ b/src/Vapi.Net/Types/UpdateOutputToolDto.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -45,6 +46,17 @@ public record UpdateOutputToolDto [JsonPropertyName("server")] public Server? Server { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/UpdatePerplexityAiCredentialDto.cs b/src/Vapi.Net/Types/UpdatePerplexityAiCredentialDto.cs index 30b23f1..5faa4f1 100644 --- a/src/Vapi.Net/Types/UpdatePerplexityAiCredentialDto.cs +++ b/src/Vapi.Net/Types/UpdatePerplexityAiCredentialDto.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -17,6 +18,17 @@ public record UpdatePerplexityAiCredentialDto [JsonPropertyName("name")] public string? Name { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/UpdatePlayHtCredentialDto.cs b/src/Vapi.Net/Types/UpdatePlayHtCredentialDto.cs index 3b848a6..c8d47db 100644 --- a/src/Vapi.Net/Types/UpdatePlayHtCredentialDto.cs +++ b/src/Vapi.Net/Types/UpdatePlayHtCredentialDto.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -20,6 +21,17 @@ public record UpdatePlayHtCredentialDto [JsonPropertyName("userId")] public string? UserId { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/UpdateQueryToolDto.cs b/src/Vapi.Net/Types/UpdateQueryToolDto.cs new file mode 100644 index 0000000..b436f2a --- /dev/null +++ b/src/Vapi.Net/Types/UpdateQueryToolDto.cs @@ -0,0 +1,70 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record UpdateQueryToolDto +{ + /// + /// This determines if the tool is async. + /// + /// If async, the assistant will move forward without waiting for your server to respond. This is useful if you just want to trigger something on your server. + /// + /// If sync, the assistant will wait for your server to respond. This is useful if want assistant to respond with the result from your server. + /// + /// Defaults to synchronous (`false`). + /// + [JsonPropertyName("async")] + public bool? Async { get; set; } + + /// + /// These are the messages that will be spoken to the user as the tool is running. + /// + /// For some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured. + /// + [JsonPropertyName("messages")] + public IEnumerable? Messages { get; set; } + + /// + /// The knowledge bases to query + /// + [JsonPropertyName("knowledgeBases")] + public IEnumerable? KnowledgeBases { get; set; } + + /// + /// This is the function definition of the tool. + /// + /// For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + /// + /// An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + /// + [JsonPropertyName("function")] + public OpenAiFunction? Function { get; set; } + + /// + /// This is the server that will be hit when this tool is requested by the model. + /// + /// All requests will be sent with the call object among other things. You can find more details in the Server URL documentation. + /// + /// This overrides the serverUrl set on the org and the phoneNumber. Order of precedence: highest tool.server.url, then assistant.serverUrl, then phoneNumber.serverUrl, then org.serverUrl. + /// + [JsonPropertyName("server")] + public Server? Server { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/UpdateRimeAiCredentialDto.cs b/src/Vapi.Net/Types/UpdateRimeAiCredentialDto.cs index e6c2bc6..9eef677 100644 --- a/src/Vapi.Net/Types/UpdateRimeAiCredentialDto.cs +++ b/src/Vapi.Net/Types/UpdateRimeAiCredentialDto.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -17,6 +18,17 @@ public record UpdateRimeAiCredentialDto [JsonPropertyName("name")] public string? Name { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/UpdateRunpodCredentialDto.cs b/src/Vapi.Net/Types/UpdateRunpodCredentialDto.cs index 688a709..ad30a12 100644 --- a/src/Vapi.Net/Types/UpdateRunpodCredentialDto.cs +++ b/src/Vapi.Net/Types/UpdateRunpodCredentialDto.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -17,6 +18,17 @@ public record UpdateRunpodCredentialDto [JsonPropertyName("name")] public string? Name { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/UpdateS3CredentialDto.cs b/src/Vapi.Net/Types/UpdateS3CredentialDto.cs index 60af4cd..7c3a6f5 100644 --- a/src/Vapi.Net/Types/UpdateS3CredentialDto.cs +++ b/src/Vapi.Net/Types/UpdateS3CredentialDto.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -41,6 +42,17 @@ public record UpdateS3CredentialDto [JsonPropertyName("name")] public string? Name { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/UpdateSlackOAuth2AuthorizationCredentialDto.cs b/src/Vapi.Net/Types/UpdateSlackOAuth2AuthorizationCredentialDto.cs new file mode 100644 index 0000000..a406612 --- /dev/null +++ b/src/Vapi.Net/Types/UpdateSlackOAuth2AuthorizationCredentialDto.cs @@ -0,0 +1,36 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record UpdateSlackOAuth2AuthorizationCredentialDto +{ + /// + /// The authorization ID for the OAuth2 authorization + /// + [JsonPropertyName("authorizationId")] + public string? AuthorizationId { get; set; } + + /// + /// This is the name of credential. This is just for your reference. + /// + [JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/UpdateSlackSendMessageToolDto.cs b/src/Vapi.Net/Types/UpdateSlackSendMessageToolDto.cs new file mode 100644 index 0000000..1dc5fa6 --- /dev/null +++ b/src/Vapi.Net/Types/UpdateSlackSendMessageToolDto.cs @@ -0,0 +1,64 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record UpdateSlackSendMessageToolDto +{ + /// + /// This determines if the tool is async. + /// + /// If async, the assistant will move forward without waiting for your server to respond. This is useful if you just want to trigger something on your server. + /// + /// If sync, the assistant will wait for your server to respond. This is useful if want assistant to respond with the result from your server. + /// + /// Defaults to synchronous (`false`). + /// + [JsonPropertyName("async")] + public bool? Async { get; set; } + + /// + /// These are the messages that will be spoken to the user as the tool is running. + /// + /// For some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured. + /// + [JsonPropertyName("messages")] + public IEnumerable? Messages { get; set; } + + /// + /// This is the function definition of the tool. + /// + /// For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + /// + /// An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + /// + [JsonPropertyName("function")] + public OpenAiFunction? Function { get; set; } + + /// + /// This is the server that will be hit when this tool is requested by the model. + /// + /// All requests will be sent with the call object among other things. You can find more details in the Server URL documentation. + /// + /// This overrides the serverUrl set on the org and the phoneNumber. Order of precedence: highest tool.server.url, then assistant.serverUrl, then phoneNumber.serverUrl, then org.serverUrl. + /// + [JsonPropertyName("server")] + public Server? Server { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/UpdateSmallestAiCredentialDto.cs b/src/Vapi.Net/Types/UpdateSmallestAiCredentialDto.cs index 8d79caa..9223ab3 100644 --- a/src/Vapi.Net/Types/UpdateSmallestAiCredentialDto.cs +++ b/src/Vapi.Net/Types/UpdateSmallestAiCredentialDto.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -17,6 +18,17 @@ public record UpdateSmallestAiCredentialDto [JsonPropertyName("name")] public string? Name { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/UpdateSmsSendToolDto.cs b/src/Vapi.Net/Types/UpdateSmsSendToolDto.cs new file mode 100644 index 0000000..2a43e99 --- /dev/null +++ b/src/Vapi.Net/Types/UpdateSmsSendToolDto.cs @@ -0,0 +1,64 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record UpdateSmsSendToolDto +{ + /// + /// This determines if the tool is async. + /// + /// If async, the assistant will move forward without waiting for your server to respond. This is useful if you just want to trigger something on your server. + /// + /// If sync, the assistant will wait for your server to respond. This is useful if want assistant to respond with the result from your server. + /// + /// Defaults to synchronous (`false`). + /// + [JsonPropertyName("async")] + public bool? Async { get; set; } + + /// + /// These are the messages that will be spoken to the user as the tool is running. + /// + /// For some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured. + /// + [JsonPropertyName("messages")] + public IEnumerable? Messages { get; set; } + + /// + /// This is the function definition of the tool. + /// + /// For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + /// + /// An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + /// + [JsonPropertyName("function")] + public OpenAiFunction? Function { get; set; } + + /// + /// This is the server that will be hit when this tool is requested by the model. + /// + /// All requests will be sent with the call object among other things. You can find more details in the Server URL documentation. + /// + /// This overrides the serverUrl set on the org and the phoneNumber. Order of precedence: highest tool.server.url, then assistant.serverUrl, then phoneNumber.serverUrl, then org.serverUrl. + /// + [JsonPropertyName("server")] + public Server? Server { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/UpdateSpeechmaticsCredentialDto.cs b/src/Vapi.Net/Types/UpdateSpeechmaticsCredentialDto.cs new file mode 100644 index 0000000..997885b --- /dev/null +++ b/src/Vapi.Net/Types/UpdateSpeechmaticsCredentialDto.cs @@ -0,0 +1,36 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record UpdateSpeechmaticsCredentialDto +{ + /// + /// This is not returned in the API. + /// + [JsonPropertyName("apiKey")] + public string? ApiKey { get; set; } + + /// + /// This is the name of credential. This is just for your reference. + /// + [JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/UpdateSupabaseCredentialDto.cs b/src/Vapi.Net/Types/UpdateSupabaseCredentialDto.cs new file mode 100644 index 0000000..5e725a6 --- /dev/null +++ b/src/Vapi.Net/Types/UpdateSupabaseCredentialDto.cs @@ -0,0 +1,33 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record UpdateSupabaseCredentialDto +{ + /// + /// This is the name of credential. This is just for your reference. + /// + [JsonPropertyName("name")] + public string? Name { get; set; } + + [JsonPropertyName("bucketPlan")] + public SupabaseBucketPlan? BucketPlan { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/UpdateTavusCredentialDto.cs b/src/Vapi.Net/Types/UpdateTavusCredentialDto.cs index aefc195..34f3f26 100644 --- a/src/Vapi.Net/Types/UpdateTavusCredentialDto.cs +++ b/src/Vapi.Net/Types/UpdateTavusCredentialDto.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -17,6 +18,17 @@ public record UpdateTavusCredentialDto [JsonPropertyName("name")] public string? Name { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/UpdateTelnyxPhoneNumberDto.cs b/src/Vapi.Net/Types/UpdateTelnyxPhoneNumberDto.cs new file mode 100644 index 0000000..e9e309a --- /dev/null +++ b/src/Vapi.Net/Types/UpdateTelnyxPhoneNumberDto.cs @@ -0,0 +1,87 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record UpdateTelnyxPhoneNumberDto +{ + /// + /// This is the fallback destination an inbound call will be transferred to if: + /// 1. `assistantId` is not set + /// 2. `squadId` is not set + /// 3. and, `assistant-request` message to the `serverUrl` fails + /// + /// If this is not set and above conditions are met, the inbound call is hung up with an error message. + /// + [JsonPropertyName("fallbackDestination")] + public object? FallbackDestination { get; set; } + + /// + /// This is the hooks that will be used for incoming calls to this phone number. + /// + [JsonPropertyName("hooks")] + public IEnumerable? Hooks { get; set; } + + /// + /// This is the name of the phone number. This is just for your own reference. + /// + [JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// This is the assistant that will be used for incoming calls to this phone number. + /// + /// If neither `assistantId` nor `squadId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected. + /// + [JsonPropertyName("assistantId")] + public string? AssistantId { get; set; } + + /// + /// This is the squad that will be used for incoming calls to this phone number. + /// + /// If neither `assistantId` nor `squadId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected. + /// + [JsonPropertyName("squadId")] + public string? SquadId { get; set; } + + /// + /// This is where Vapi will send webhooks. You can find all webhooks available along with their shape in ServerMessage schema. + /// + /// The order of precedence is: + /// + /// 1. assistant.server + /// 2. phoneNumber.server + /// 3. org.server + /// + [JsonPropertyName("server")] + public Server? Server { get; set; } + + /// + /// These are the digits of the phone number you own on your Telnyx. + /// + [JsonPropertyName("number")] + public string? Number { get; set; } + + /// + /// This is the credential you added in dashboard.vapi.ai/keys. This is used to configure the number to send inbound calls to Vapi, make outbound calls and do live call updates like transfers and hangups. + /// + [JsonPropertyName("credentialId")] + public string? CredentialId { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/UpdateTestSuiteTestChatDto.cs b/src/Vapi.Net/Types/UpdateTestSuiteTestChatDto.cs new file mode 100644 index 0000000..99ed8be --- /dev/null +++ b/src/Vapi.Net/Types/UpdateTestSuiteTestChatDto.cs @@ -0,0 +1,48 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record UpdateTestSuiteTestChatDto +{ + /// + /// These are the scorers used to evaluate the test. + /// + [JsonPropertyName("scorers")] + public IEnumerable? Scorers { get; set; } + + /// + /// This is the name of the test. + /// + [JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// This is the script to be used for the chat test. + /// + [JsonPropertyName("script")] + public string? Script { get; set; } + + /// + /// This is the number of attempts allowed for the test. + /// + [JsonPropertyName("numAttempts")] + public double? NumAttempts { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/UpdateTestSuiteTestVoiceDto.cs b/src/Vapi.Net/Types/UpdateTestSuiteTestVoiceDto.cs index 2135fa5..e2222b5 100644 --- a/src/Vapi.Net/Types/UpdateTestSuiteTestVoiceDto.cs +++ b/src/Vapi.Net/Types/UpdateTestSuiteTestVoiceDto.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -29,6 +30,17 @@ public record UpdateTestSuiteTestVoiceDto [JsonPropertyName("numAttempts")] public double? NumAttempts { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/UpdateTextEditorToolDto.cs b/src/Vapi.Net/Types/UpdateTextEditorToolDto.cs index b0533d8..f93ab01 100644 --- a/src/Vapi.Net/Types/UpdateTextEditorToolDto.cs +++ b/src/Vapi.Net/Types/UpdateTextEditorToolDto.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -57,6 +58,17 @@ public record UpdateTextEditorToolDto [JsonPropertyName("name")] public string? Name { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/UpdateTogetherAiCredentialDto.cs b/src/Vapi.Net/Types/UpdateTogetherAiCredentialDto.cs index 01782dd..a88eeb2 100644 --- a/src/Vapi.Net/Types/UpdateTogetherAiCredentialDto.cs +++ b/src/Vapi.Net/Types/UpdateTogetherAiCredentialDto.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -17,6 +18,17 @@ public record UpdateTogetherAiCredentialDto [JsonPropertyName("name")] public string? Name { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/UpdateTokenDto.cs b/src/Vapi.Net/Types/UpdateTokenDto.cs index 93c5e31..2a2b111 100644 --- a/src/Vapi.Net/Types/UpdateTokenDto.cs +++ b/src/Vapi.Net/Types/UpdateTokenDto.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -23,6 +24,17 @@ public record UpdateTokenDto [JsonPropertyName("restrictions")] public TokenRestrictions? Restrictions { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/UpdateToolCallBlockDto.cs b/src/Vapi.Net/Types/UpdateToolCallBlockDto.cs deleted file mode 100644 index e18ca0c..0000000 --- a/src/Vapi.Net/Types/UpdateToolCallBlockDto.cs +++ /dev/null @@ -1,61 +0,0 @@ -using System.Text.Json.Serialization; -using Vapi.Net.Core; - -namespace Vapi.Net; - -public record UpdateToolCallBlockDto -{ - /// - /// These are the pre-configured messages that will be spoken to the user while the block is running. - /// - [JsonPropertyName("messages")] - public IEnumerable? Messages { get; set; } - - /// - /// This is the input schema for the block. This is the input the block needs to run. It's given to the block as `steps[0].input` - /// - /// These are accessible as variables: - /// - ({{input.propertyName}}) in context of the block execution (step) - /// - ({{stepName.input.propertyName}}) in context of the workflow - /// - [JsonPropertyName("inputSchema")] - public JsonSchema? InputSchema { get; set; } - - /// - /// This is the output schema for the block. This is the output the block will return to the workflow (`{{stepName.output}}`). - /// - /// These are accessible as variables: - /// - ({{output.propertyName}}) in context of the block execution (step) - /// - ({{stepName.output.propertyName}}) in context of the workflow (read caveat #1) - /// - ({{blockName.output.propertyName}}) in context of the workflow (read caveat #2) - /// - /// Caveats: - /// 1. a workflow can execute a step multiple times. example, if a loop is used in the graph. {{stepName.output.propertyName}} will reference the latest usage of the step. - /// 2. a workflow can execute a block multiple times. example, if a step is called multiple times or if a block is used in multiple steps. {{blockName.output.propertyName}} will reference the latest usage of the block. this liquid variable is just provided for convenience when creating blocks outside of a workflow with steps. - /// - [JsonPropertyName("outputSchema")] - public JsonSchema? OutputSchema { get; set; } - - /// - /// This is the tool that the block will call. To use an existing tool, use `toolId`. - /// - [JsonPropertyName("tool")] - public object? Tool { get; set; } - - /// - /// This is the name of the block. This is just for your reference. - /// - [JsonPropertyName("name")] - public string? Name { get; set; } - - /// - /// This is the id of the tool that the block will call. To use a transient tool, use `tool`. - /// - [JsonPropertyName("toolId")] - public string? ToolId { get; set; } - - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Vapi.Net/Types/UpdateToolTemplateDto.cs b/src/Vapi.Net/Types/UpdateToolTemplateDto.cs index c396033..11d78a5 100644 --- a/src/Vapi.Net/Types/UpdateToolTemplateDto.cs +++ b/src/Vapi.Net/Types/UpdateToolTemplateDto.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -29,6 +30,17 @@ public record UpdateToolTemplateDto [JsonPropertyName("provider")] public UpdateToolTemplateDtoProvider? Provider { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/UpdateTransferCallToolDto.cs b/src/Vapi.Net/Types/UpdateTransferCallToolDto.cs index cb9e865..f958a8d 100644 --- a/src/Vapi.Net/Types/UpdateTransferCallToolDto.cs +++ b/src/Vapi.Net/Types/UpdateTransferCallToolDto.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -51,6 +52,17 @@ public record UpdateTransferCallToolDto [JsonPropertyName("server")] public Server? Server { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/UpdateTrieveCredentialDto.cs b/src/Vapi.Net/Types/UpdateTrieveCredentialDto.cs new file mode 100644 index 0000000..f0ac9d5 --- /dev/null +++ b/src/Vapi.Net/Types/UpdateTrieveCredentialDto.cs @@ -0,0 +1,36 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record UpdateTrieveCredentialDto +{ + /// + /// This is not returned in the API. + /// + [JsonPropertyName("apiKey")] + public string? ApiKey { get; set; } + + /// + /// This is the name of credential. This is just for your reference. + /// + [JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/UpdateTrieveKnowledgeBaseDto.cs b/src/Vapi.Net/Types/UpdateTrieveKnowledgeBaseDto.cs index cb6902f..f07de9d 100644 --- a/src/Vapi.Net/Types/UpdateTrieveKnowledgeBaseDto.cs +++ b/src/Vapi.Net/Types/UpdateTrieveKnowledgeBaseDto.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -25,8 +26,19 @@ public record UpdateTrieveKnowledgeBaseDto /// This is the plan if you want us to create/import a new vector store using Trieve. /// [JsonPropertyName("createPlan")] - public object? CreatePlan { get; set; } + public TrieveKnowledgeBaseImport? CreatePlan { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/UpdateTwilioCredentialDto.cs b/src/Vapi.Net/Types/UpdateTwilioCredentialDto.cs index 803c5e1..9c30a42 100644 --- a/src/Vapi.Net/Types/UpdateTwilioCredentialDto.cs +++ b/src/Vapi.Net/Types/UpdateTwilioCredentialDto.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -20,6 +21,17 @@ public record UpdateTwilioCredentialDto [JsonPropertyName("accountSid")] public string? AccountSid { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/UpdateTwilioPhoneNumberDto.cs b/src/Vapi.Net/Types/UpdateTwilioPhoneNumberDto.cs index c16620e..92a619d 100644 --- a/src/Vapi.Net/Types/UpdateTwilioPhoneNumberDto.cs +++ b/src/Vapi.Net/Types/UpdateTwilioPhoneNumberDto.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -16,6 +17,12 @@ public record UpdateTwilioPhoneNumberDto [JsonPropertyName("fallbackDestination")] public object? FallbackDestination { get; set; } + /// + /// This is the hooks that will be used for incoming calls to this phone number. + /// + [JsonPropertyName("hooks")] + public IEnumerable? Hooks { get; set; } + /// /// This is the name of the phone number. This is just for your own reference. /// @@ -68,6 +75,17 @@ public record UpdateTwilioPhoneNumberDto [JsonPropertyName("twilioAuthToken")] public string? TwilioAuthToken { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/UpdateUserRoleDto.cs b/src/Vapi.Net/Types/UpdateUserRoleDto.cs index e28e4a2..2d2ab40 100644 --- a/src/Vapi.Net/Types/UpdateUserRoleDto.cs +++ b/src/Vapi.Net/Types/UpdateUserRoleDto.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -11,6 +12,17 @@ public record UpdateUserRoleDto [JsonPropertyName("role")] public required UpdateUserRoleDtoRole Role { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/UpdateVapiPhoneNumberDto.cs b/src/Vapi.Net/Types/UpdateVapiPhoneNumberDto.cs index 9b9dc51..d9d13fb 100644 --- a/src/Vapi.Net/Types/UpdateVapiPhoneNumberDto.cs +++ b/src/Vapi.Net/Types/UpdateVapiPhoneNumberDto.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -16,6 +17,12 @@ public record UpdateVapiPhoneNumberDto [JsonPropertyName("fallbackDestination")] public object? FallbackDestination { get; set; } + /// + /// This is the hooks that will be used for incoming calls to this phone number. + /// + [JsonPropertyName("hooks")] + public IEnumerable? Hooks { get; set; } + /// /// This is the name of the phone number. This is just for your own reference. /// @@ -66,6 +73,17 @@ public record UpdateVapiPhoneNumberDto [JsonPropertyName("authentication")] public SipAuthentication? Authentication { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/UpdateVonageCredentialDto.cs b/src/Vapi.Net/Types/UpdateVonageCredentialDto.cs index eb06048..9f26c3f 100644 --- a/src/Vapi.Net/Types/UpdateVonageCredentialDto.cs +++ b/src/Vapi.Net/Types/UpdateVonageCredentialDto.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -20,6 +21,17 @@ public record UpdateVonageCredentialDto [JsonPropertyName("apiKey")] public string? ApiKey { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/UpdateVonagePhoneNumberDto.cs b/src/Vapi.Net/Types/UpdateVonagePhoneNumberDto.cs index 5c58e42..f5fb98d 100644 --- a/src/Vapi.Net/Types/UpdateVonagePhoneNumberDto.cs +++ b/src/Vapi.Net/Types/UpdateVonagePhoneNumberDto.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -16,6 +17,12 @@ public record UpdateVonagePhoneNumberDto [JsonPropertyName("fallbackDestination")] public object? FallbackDestination { get; set; } + /// + /// This is the hooks that will be used for incoming calls to this phone number. + /// + [JsonPropertyName("hooks")] + public IEnumerable? Hooks { get; set; } + /// /// This is the name of the phone number. This is just for your own reference. /// @@ -57,11 +64,22 @@ public record UpdateVonagePhoneNumberDto public string? Number { get; set; } /// - /// This is the credential that is used to make outgoing calls, and do operations like call transfer and hang up. + /// This is the credential you added in dashboard.vapi.ai/keys. This is used to configure the number to send inbound calls to Vapi, make outbound calls and do live call updates like transfers and hangups. /// [JsonPropertyName("credentialId")] public string? CredentialId { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/UpdateWebhookCredentialDto.cs b/src/Vapi.Net/Types/UpdateWebhookCredentialDto.cs new file mode 100644 index 0000000..0897ca1 --- /dev/null +++ b/src/Vapi.Net/Types/UpdateWebhookCredentialDto.cs @@ -0,0 +1,36 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record UpdateWebhookCredentialDto +{ + /// + /// This is the authentication plan. Currently supports OAuth2 RFC 6749. + /// + [JsonPropertyName("authenticationPlan")] + public OAuth2AuthenticationPlan? AuthenticationPlan { get; set; } + + /// + /// This is the name of credential. This is just for your reference. + /// + [JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/UpdateWorkflowBlockDto.cs b/src/Vapi.Net/Types/UpdateWorkflowBlockDto.cs deleted file mode 100644 index 638e59c..0000000 --- a/src/Vapi.Net/Types/UpdateWorkflowBlockDto.cs +++ /dev/null @@ -1,55 +0,0 @@ -using System.Text.Json.Serialization; -using Vapi.Net.Core; - -namespace Vapi.Net; - -public record UpdateWorkflowBlockDto -{ - /// - /// These are the pre-configured messages that will be spoken to the user while the block is running. - /// - [JsonPropertyName("messages")] - public IEnumerable? Messages { get; set; } - - /// - /// This is the input schema for the block. This is the input the block needs to run. It's given to the block as `steps[0].input` - /// - /// These are accessible as variables: - /// - ({{input.propertyName}}) in context of the block execution (step) - /// - ({{stepName.input.propertyName}}) in context of the workflow - /// - [JsonPropertyName("inputSchema")] - public JsonSchema? InputSchema { get; set; } - - /// - /// This is the output schema for the block. This is the output the block will return to the workflow (`{{stepName.output}}`). - /// - /// These are accessible as variables: - /// - ({{output.propertyName}}) in context of the block execution (step) - /// - ({{stepName.output.propertyName}}) in context of the workflow (read caveat #1) - /// - ({{blockName.output.propertyName}}) in context of the workflow (read caveat #2) - /// - /// Caveats: - /// 1. a workflow can execute a step multiple times. example, if a loop is used in the graph. {{stepName.output.propertyName}} will reference the latest usage of the step. - /// 2. a workflow can execute a block multiple times. example, if a step is called multiple times or if a block is used in multiple steps. {{blockName.output.propertyName}} will reference the latest usage of the block. this liquid variable is just provided for convenience when creating blocks outside of a workflow with steps. - /// - [JsonPropertyName("outputSchema")] - public JsonSchema? OutputSchema { get; set; } - - /// - /// These are the steps in the workflow. - /// - [JsonPropertyName("steps")] - public IEnumerable? Steps { get; set; } - - /// - /// This is the name of the block. This is just for your reference. - /// - [JsonPropertyName("name")] - public string? Name { get; set; } - - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Vapi.Net/Types/UpdateXAiCredentialDto.cs b/src/Vapi.Net/Types/UpdateXAiCredentialDto.cs index 7794f0d..5a30fb8 100644 --- a/src/Vapi.Net/Types/UpdateXAiCredentialDto.cs +++ b/src/Vapi.Net/Types/UpdateXAiCredentialDto.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -17,6 +18,17 @@ public record UpdateXAiCredentialDto [JsonPropertyName("name")] public string? Name { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/User.cs b/src/Vapi.Net/Types/User.cs index 77cdc7a..44a631d 100644 --- a/src/Vapi.Net/Types/User.cs +++ b/src/Vapi.Net/Types/User.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -35,6 +36,17 @@ public record User [JsonPropertyName("fullName")] public string? FullName { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/UserMessage.cs b/src/Vapi.Net/Types/UserMessage.cs index 44ef4d3..224b355 100644 --- a/src/Vapi.Net/Types/UserMessage.cs +++ b/src/Vapi.Net/Types/UserMessage.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -41,6 +42,17 @@ public record UserMessage [JsonPropertyName("duration")] public double? Duration { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/VapiCost.cs b/src/Vapi.Net/Types/VapiCost.cs index a78d101..504e010 100644 --- a/src/Vapi.Net/Types/VapiCost.cs +++ b/src/Vapi.Net/Types/VapiCost.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -23,6 +24,17 @@ public record VapiCost [JsonPropertyName("cost")] public required double Cost { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/VapiModel.cs b/src/Vapi.Net/Types/VapiModel.cs index f38adc3..b622fa8 100644 --- a/src/Vapi.Net/Types/VapiModel.cs +++ b/src/Vapi.Net/Types/VapiModel.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -39,9 +40,6 @@ public record VapiModel [JsonPropertyName("knowledgeBaseId")] public string? KnowledgeBaseId { get; set; } - [JsonPropertyName("steps")] - public IEnumerable? Steps { get; set; } - /// /// This is the workflow that will be used for the call. To use a transient workflow, use `workflow` instead. /// @@ -92,6 +90,17 @@ public record VapiModel [JsonPropertyName("numFastTurns")] public double? NumFastTurns { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/VapiPhoneNumber.cs b/src/Vapi.Net/Types/VapiPhoneNumber.cs index 32211ca..ed38b7e 100644 --- a/src/Vapi.Net/Types/VapiPhoneNumber.cs +++ b/src/Vapi.Net/Types/VapiPhoneNumber.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -16,6 +17,12 @@ public record VapiPhoneNumber [JsonPropertyName("fallbackDestination")] public object? FallbackDestination { get; set; } + /// + /// This is the hooks that will be used for incoming calls to this phone number. + /// + [JsonPropertyName("hooks")] + public IEnumerable? Hooks { get; set; } + /// /// This is the unique identifier for the phone number. /// @@ -108,6 +115,17 @@ public record VapiPhoneNumber [JsonPropertyName("authentication")] public SipAuthentication? Authentication { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/VapiSmartEndpointingPlan.cs b/src/Vapi.Net/Types/VapiSmartEndpointingPlan.cs new file mode 100644 index 0000000..b1c14d0 --- /dev/null +++ b/src/Vapi.Net/Types/VapiSmartEndpointingPlan.cs @@ -0,0 +1,30 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record VapiSmartEndpointingPlan +{ + /// + /// This is the provider for the smart endpointing plan. + /// + [JsonPropertyName("provider")] + public required VapiSmartEndpointingPlanProvider Provider { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/VapiSmartEndpointingPlanProvider.cs b/src/Vapi.Net/Types/VapiSmartEndpointingPlanProvider.cs new file mode 100644 index 0000000..0d411e1 --- /dev/null +++ b/src/Vapi.Net/Types/VapiSmartEndpointingPlanProvider.cs @@ -0,0 +1,15 @@ +using System.Runtime.Serialization; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[JsonConverter(typeof(EnumSerializer))] +public enum VapiSmartEndpointingPlanProvider +{ + [EnumMember(Value = "vapi")] + Vapi, + + [EnumMember(Value = "livekit")] + Livekit, +} diff --git a/src/Vapi.Net/Types/VapiVoice.cs b/src/Vapi.Net/Types/VapiVoice.cs new file mode 100644 index 0000000..ff1fbfb --- /dev/null +++ b/src/Vapi.Net/Types/VapiVoice.cs @@ -0,0 +1,58 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record VapiVoice +{ + /// + /// The voices provided by Vapi + /// + [JsonPropertyName("voiceId")] + public required VapiVoiceVoiceId VoiceId { get; set; } + + /// + /// This is the speed multiplier that will be used. + /// + /// @default 1 + /// + [JsonPropertyName("speed")] + public double? Speed { get; set; } + + /// + /// This is the language code (ISO 639-1) that will be used. + /// + /// @default 'en-US' + /// + [JsonPropertyName("language")] + public VapiVoiceLanguage? Language { get; set; } + + /// + /// This is the plan for chunking the model output before it is sent to the voice provider. + /// + [JsonPropertyName("chunkPlan")] + public ChunkPlan? ChunkPlan { get; set; } + + /// + /// This is the plan for voice provider fallbacks in the event that the primary voice provider fails. + /// + [JsonPropertyName("fallbackPlan")] + public FallbackPlan? FallbackPlan { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/VapiVoiceLanguage.cs b/src/Vapi.Net/Types/VapiVoiceLanguage.cs new file mode 100644 index 0000000..18faf3a --- /dev/null +++ b/src/Vapi.Net/Types/VapiVoiceLanguage.cs @@ -0,0 +1,126 @@ +using System.Runtime.Serialization; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[JsonConverter(typeof(EnumSerializer))] +public enum VapiVoiceLanguage +{ + [EnumMember(Value = "en-US")] + EnUs, + + [EnumMember(Value = "en-GB")] + EnGb, + + [EnumMember(Value = "en-AU")] + EnAu, + + [EnumMember(Value = "en-CA")] + EnCa, + + [EnumMember(Value = "ja")] + Ja, + + [EnumMember(Value = "zh")] + Zh, + + [EnumMember(Value = "de")] + De, + + [EnumMember(Value = "hi")] + Hi, + + [EnumMember(Value = "fr-FR")] + FrFr, + + [EnumMember(Value = "fr-CA")] + FrCa, + + [EnumMember(Value = "ko")] + Ko, + + [EnumMember(Value = "pt-BR")] + PtBr, + + [EnumMember(Value = "pt-PT")] + PtPt, + + [EnumMember(Value = "it")] + It, + + [EnumMember(Value = "es-ES")] + EsEs, + + [EnumMember(Value = "es-MX")] + EsMx, + + [EnumMember(Value = "id")] + Id, + + [EnumMember(Value = "nl")] + Nl, + + [EnumMember(Value = "tr")] + Tr, + + [EnumMember(Value = "fil")] + Fil, + + [EnumMember(Value = "pl")] + Pl, + + [EnumMember(Value = "sv")] + Sv, + + [EnumMember(Value = "bg")] + Bg, + + [EnumMember(Value = "ro")] + Ro, + + [EnumMember(Value = "ar-SA")] + ArSa, + + [EnumMember(Value = "ar-AE")] + ArAe, + + [EnumMember(Value = "cs")] + Cs, + + [EnumMember(Value = "el")] + El, + + [EnumMember(Value = "fi")] + Fi, + + [EnumMember(Value = "hr")] + Hr, + + [EnumMember(Value = "ms")] + Ms, + + [EnumMember(Value = "sk")] + Sk, + + [EnumMember(Value = "da")] + Da, + + [EnumMember(Value = "ta")] + Ta, + + [EnumMember(Value = "uk")] + Uk, + + [EnumMember(Value = "ru")] + Ru, + + [EnumMember(Value = "hu")] + Hu, + + [EnumMember(Value = "no")] + No, + + [EnumMember(Value = "vi")] + Vi, +} diff --git a/src/Vapi.Net/Types/VapiVoiceVoiceId.cs b/src/Vapi.Net/Types/VapiVoiceVoiceId.cs new file mode 100644 index 0000000..6bf479f --- /dev/null +++ b/src/Vapi.Net/Types/VapiVoiceVoiceId.cs @@ -0,0 +1,39 @@ +using System.Runtime.Serialization; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[JsonConverter(typeof(EnumSerializer))] +public enum VapiVoiceVoiceId +{ + [EnumMember(Value = "Elliot")] + Elliot, + + [EnumMember(Value = "Rohan")] + Rohan, + + [EnumMember(Value = "Lily")] + Lily, + + [EnumMember(Value = "Savannah")] + Savannah, + + [EnumMember(Value = "Hana")] + Hana, + + [EnumMember(Value = "Neha")] + Neha, + + [EnumMember(Value = "Cole")] + Cole, + + [EnumMember(Value = "Harry")] + Harry, + + [EnumMember(Value = "Paige")] + Paige, + + [EnumMember(Value = "Spencer")] + Spencer, +} diff --git a/src/Vapi.Net/Types/VoiceCost.cs b/src/Vapi.Net/Types/VoiceCost.cs index b6dc960..632fa22 100644 --- a/src/Vapi.Net/Types/VoiceCost.cs +++ b/src/Vapi.Net/Types/VoiceCost.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -31,6 +32,17 @@ public record VoiceCost [JsonPropertyName("cost")] public required double Cost { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/VoiceLibrary.cs b/src/Vapi.Net/Types/VoiceLibrary.cs index 0b9354b..798682d 100644 --- a/src/Vapi.Net/Types/VoiceLibrary.cs +++ b/src/Vapi.Net/Types/VoiceLibrary.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -119,6 +120,17 @@ public record VoiceLibrary [JsonPropertyName("updatedAt")] public required DateTime UpdatedAt { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/VoiceLibraryVoiceResponse.cs b/src/Vapi.Net/Types/VoiceLibraryVoiceResponse.cs index e4bc3f8..16114d6 100644 --- a/src/Vapi.Net/Types/VoiceLibraryVoiceResponse.cs +++ b/src/Vapi.Net/Types/VoiceLibraryVoiceResponse.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -26,6 +27,17 @@ public record VoiceLibraryVoiceResponse [JsonPropertyName("accent")] public string? Accent { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/VoicemailDetectionCost.cs b/src/Vapi.Net/Types/VoicemailDetectionCost.cs new file mode 100644 index 0000000..3bb3ff4 --- /dev/null +++ b/src/Vapi.Net/Types/VoicemailDetectionCost.cs @@ -0,0 +1,66 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record VoicemailDetectionCost +{ + /// + /// This is the model that was used to perform the analysis. + /// + [JsonPropertyName("model")] + public object Model { get; set; } = new Dictionary(); + + /// + /// This is the provider that was used to detect the voicemail. + /// + [JsonPropertyName("provider")] + public required VoicemailDetectionCostProvider Provider { get; set; } + + /// + /// This is the number of prompt text tokens used in the voicemail detection. + /// + [JsonPropertyName("promptTextTokens")] + public required double PromptTextTokens { get; set; } + + /// + /// This is the number of prompt audio tokens used in the voicemail detection. + /// + [JsonPropertyName("promptAudioTokens")] + public required double PromptAudioTokens { get; set; } + + /// + /// This is the number of completion text tokens used in the voicemail detection. + /// + [JsonPropertyName("completionTextTokens")] + public required double CompletionTextTokens { get; set; } + + /// + /// This is the number of completion audio tokens used in the voicemail detection. + /// + [JsonPropertyName("completionAudioTokens")] + public required double CompletionAudioTokens { get; set; } + + /// + /// This is the cost of the component in USD. + /// + [JsonPropertyName("cost")] + public required double Cost { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/VoicemailDetectionCostProvider.cs b/src/Vapi.Net/Types/VoicemailDetectionCostProvider.cs new file mode 100644 index 0000000..3572c1a --- /dev/null +++ b/src/Vapi.Net/Types/VoicemailDetectionCostProvider.cs @@ -0,0 +1,18 @@ +using System.Runtime.Serialization; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[JsonConverter(typeof(EnumSerializer))] +public enum VoicemailDetectionCostProvider +{ + [EnumMember(Value = "twilio")] + Twilio, + + [EnumMember(Value = "google")] + Google, + + [EnumMember(Value = "openai")] + Openai, +} diff --git a/src/Vapi.Net/Types/VonageCredential.cs b/src/Vapi.Net/Types/VonageCredential.cs index 2d73602..75480a2 100644 --- a/src/Vapi.Net/Types/VonageCredential.cs +++ b/src/Vapi.Net/Types/VonageCredential.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -61,6 +62,17 @@ public record VonageCredential [JsonPropertyName("apiKey")] public required string ApiKey { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/VonagePhoneNumber.cs b/src/Vapi.Net/Types/VonagePhoneNumber.cs index a1b5dbe..fc963ce 100644 --- a/src/Vapi.Net/Types/VonagePhoneNumber.cs +++ b/src/Vapi.Net/Types/VonagePhoneNumber.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -16,6 +17,12 @@ public record VonagePhoneNumber [JsonPropertyName("fallbackDestination")] public object? FallbackDestination { get; set; } + /// + /// This is the hooks that will be used for incoming calls to this phone number. + /// + [JsonPropertyName("hooks")] + public IEnumerable? Hooks { get; set; } + /// /// This is the unique identifier for the phone number. /// @@ -87,11 +94,22 @@ public record VonagePhoneNumber public required string Number { get; set; } /// - /// This is the credential that is used to make outgoing calls, and do operations like call transfer and hang up. + /// This is the credential you added in dashboard.vapi.ai/keys. This is used to configure the number to send inbound calls to Vapi, make outbound calls and do live call updates like transfers and hangups. /// [JsonPropertyName("credentialId")] public required string CredentialId { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/WebhookCredential.cs b/src/Vapi.Net/Types/WebhookCredential.cs index affb2e0..59fc0f3 100644 --- a/src/Vapi.Net/Types/WebhookCredential.cs +++ b/src/Vapi.Net/Types/WebhookCredential.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -50,6 +51,17 @@ public record WebhookCredential [JsonPropertyName("name")] public string? Name { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/Workflow.cs b/src/Vapi.Net/Types/Workflow.cs index 67e9afd..b490bf1 100644 --- a/src/Vapi.Net/Types/Workflow.cs +++ b/src/Vapi.Net/Types/Workflow.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -8,6 +9,12 @@ public record Workflow [JsonPropertyName("nodes")] public IEnumerable Nodes { get; set; } = new List(); + /// + /// These are the options for the workflow's LLM. + /// + [JsonPropertyName("model")] + public object? Model { get; set; } + [JsonPropertyName("id")] public required string Id { get; set; } @@ -26,6 +33,17 @@ public record Workflow [JsonPropertyName("edges")] public IEnumerable Edges { get; set; } = new List(); + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/WorkflowBlock.cs b/src/Vapi.Net/Types/WorkflowBlock.cs deleted file mode 100644 index 680f15c..0000000 --- a/src/Vapi.Net/Types/WorkflowBlock.cs +++ /dev/null @@ -1,79 +0,0 @@ -using System.Text.Json.Serialization; -using Vapi.Net.Core; - -namespace Vapi.Net; - -public record WorkflowBlock -{ - /// - /// These are the pre-configured messages that will be spoken to the user while the block is running. - /// - [JsonPropertyName("messages")] - public IEnumerable? Messages { get; set; } - - /// - /// This is the input schema for the block. This is the input the block needs to run. It's given to the block as `steps[0].input` - /// - /// These are accessible as variables: - /// - ({{input.propertyName}}) in context of the block execution (step) - /// - ({{stepName.input.propertyName}}) in context of the workflow - /// - [JsonPropertyName("inputSchema")] - public JsonSchema? InputSchema { get; set; } - - /// - /// This is the output schema for the block. This is the output the block will return to the workflow (`{{stepName.output}}`). - /// - /// These are accessible as variables: - /// - ({{output.propertyName}}) in context of the block execution (step) - /// - ({{stepName.output.propertyName}}) in context of the workflow (read caveat #1) - /// - ({{blockName.output.propertyName}}) in context of the workflow (read caveat #2) - /// - /// Caveats: - /// 1. a workflow can execute a step multiple times. example, if a loop is used in the graph. {{stepName.output.propertyName}} will reference the latest usage of the step. - /// 2. a workflow can execute a block multiple times. example, if a step is called multiple times or if a block is used in multiple steps. {{blockName.output.propertyName}} will reference the latest usage of the block. this liquid variable is just provided for convenience when creating blocks outside of a workflow with steps. - /// - [JsonPropertyName("outputSchema")] - public JsonSchema? OutputSchema { get; set; } - - /// - /// These are the steps in the workflow. - /// - [JsonPropertyName("steps")] - public IEnumerable? Steps { get; set; } - - /// - /// This is the unique identifier for the block. - /// - [JsonPropertyName("id")] - public required string Id { get; set; } - - /// - /// This is the unique identifier for the organization that this block belongs to. - /// - [JsonPropertyName("orgId")] - public required string OrgId { get; set; } - - /// - /// This is the ISO 8601 date-time string of when the block was created. - /// - [JsonPropertyName("createdAt")] - public required DateTime CreatedAt { get; set; } - - /// - /// This is the ISO 8601 date-time string of when the block was last updated. - /// - [JsonPropertyName("updatedAt")] - public required DateTime UpdatedAt { get; set; } - - /// - /// This is the name of the block. This is just for your reference. - /// - [JsonPropertyName("name")] - public string? Name { get; set; } - - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Vapi.Net/Types/XAiCredential.cs b/src/Vapi.Net/Types/XAiCredential.cs index 4266054..1925aa1 100644 --- a/src/Vapi.Net/Types/XAiCredential.cs +++ b/src/Vapi.Net/Types/XAiCredential.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -47,6 +48,17 @@ public record XAiCredential [JsonPropertyName("name")] public string? Name { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Types/XaiModel.cs b/src/Vapi.Net/Types/XaiModel.cs index 60911a7..c03e4cd 100644 --- a/src/Vapi.Net/Types/XaiModel.cs +++ b/src/Vapi.Net/Types/XaiModel.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using System.Text.Json.Serialization; using Vapi.Net.Core; @@ -77,6 +78,17 @@ public record XaiModel [JsonPropertyName("numFastTurns")] public double? NumFastTurns { get; set; } + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// public override string ToString() { return JsonUtils.Serialize(this); diff --git a/src/Vapi.Net/Vapi.Net.csproj b/src/Vapi.Net/Vapi.Net.csproj index 1ff029a..983b0b0 100644 --- a/src/Vapi.Net/Vapi.Net.csproj +++ b/src/Vapi.Net/Vapi.Net.csproj @@ -1,12 +1,11 @@ - net462;net8.0;net7.0;net6.0;netstandard2.0 enable 12 enable - 0.5.0 + 0.6.0 $(Version) $(Version) README.md @@ -14,9 +13,19 @@ true - + + false + + + $(DefineConstants);USE_PORTABLE_DATE_ONLY + true + + + + + diff --git a/src/Vapi.Net/VapiClient.cs b/src/Vapi.Net/VapiClient.cs index 8e0110c..50f147c 100644 --- a/src/Vapi.Net/VapiClient.cs +++ b/src/Vapi.Net/VapiClient.cs @@ -15,7 +15,7 @@ public VapiClient(string? token = null, ClientOptions? clientOptions = null) { "X-Fern-Language", "C#" }, { "X-Fern-SDK-Name", "Vapi.Net" }, { "X-Fern-SDK-Version", Version.Current }, - { "User-Agent", "Vapi.Net/0.5.0" }, + { "User-Agent", "Vapi.Net/0.6.0" }, } ); clientOptions ??= new ClientOptions(); @@ -30,41 +30,41 @@ public VapiClient(string? token = null, ClientOptions? clientOptions = null) Calls = new CallsClient(_client); Assistants = new AssistantsClient(_client); PhoneNumbers = new PhoneNumbersClient(_client); - Squads = new SquadsClient(_client); - KnowledgeBases = new KnowledgeBasesClient(_client); - Blocks = new BlocksClient(_client); Tools = new ToolsClient(_client); Files = new FilesClient(_client); - Analytics = new AnalyticsClient(_client); - Logs = new LogsClient(_client); + KnowledgeBases = new KnowledgeBasesClient(_client); + Workflow = new WorkflowClient(_client); + Squads = new SquadsClient(_client); TestSuites = new TestSuitesClient(_client); TestSuiteTests = new TestSuiteTestsClient(_client); TestSuiteRuns = new TestSuiteRunsClient(_client); + Analytics = new AnalyticsClient(_client); + Logs = new LogsClient(_client); } - public CallsClient Calls { get; init; } + public CallsClient Calls { get; } - public AssistantsClient Assistants { get; init; } + public AssistantsClient Assistants { get; } - public PhoneNumbersClient PhoneNumbers { get; init; } + public PhoneNumbersClient PhoneNumbers { get; } - public SquadsClient Squads { get; init; } + public ToolsClient Tools { get; } - public KnowledgeBasesClient KnowledgeBases { get; init; } + public FilesClient Files { get; } - public BlocksClient Blocks { get; init; } + public KnowledgeBasesClient KnowledgeBases { get; } - public ToolsClient Tools { get; init; } + public WorkflowClient Workflow { get; } - public FilesClient Files { get; init; } + public SquadsClient Squads { get; } - public AnalyticsClient Analytics { get; init; } + public TestSuitesClient TestSuites { get; } - public LogsClient Logs { get; init; } + public TestSuiteTestsClient TestSuiteTests { get; } - public TestSuitesClient TestSuites { get; init; } + public TestSuiteRunsClient TestSuiteRuns { get; } - public TestSuiteTestsClient TestSuiteTests { get; init; } + public AnalyticsClient Analytics { get; } - public TestSuiteRunsClient TestSuiteRuns { get; init; } + public LogsClient Logs { get; } } diff --git a/src/Vapi.Net/Workflow/Requests/UpdateWorkflowDto.cs b/src/Vapi.Net/Workflow/Requests/UpdateWorkflowDto.cs new file mode 100644 index 0000000..d9347e8 --- /dev/null +++ b/src/Vapi.Net/Workflow/Requests/UpdateWorkflowDto.cs @@ -0,0 +1,28 @@ +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record UpdateWorkflowDto +{ + [JsonPropertyName("nodes")] + public IEnumerable? Nodes { get; set; } + + /// + /// These are the options for the workflow's LLM. + /// + [JsonPropertyName("model")] + public object? Model { get; set; } + + [JsonPropertyName("name")] + public string? Name { get; set; } + + [JsonPropertyName("edges")] + public IEnumerable? Edges { get; set; } + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Workflow/WorkflowClient.cs b/src/Vapi.Net/Workflow/WorkflowClient.cs new file mode 100644 index 0000000..012c918 --- /dev/null +++ b/src/Vapi.Net/Workflow/WorkflowClient.cs @@ -0,0 +1,225 @@ +using System.Net.Http; +using System.Text.Json; +using System.Threading; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public partial class WorkflowClient +{ + private RawClient _client; + + internal WorkflowClient(RawClient client) + { + _client = client; + } + + public async Task> WorkflowControllerFindAllAsync( + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + var response = await _client + .SendRequestAsync( + new JsonRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "workflow", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); + if (response.StatusCode is >= 200 and < 400) + { + var responseBody = await response.Raw.Content.ReadAsStringAsync(); + try + { + return JsonUtils.Deserialize>(responseBody)!; + } + catch (JsonException e) + { + throw new VapiClientException("Failed to deserialize response", e); + } + } + + { + var responseBody = await response.Raw.Content.ReadAsStringAsync(); + throw new VapiClientApiException( + $"Error with status code {response.StatusCode}", + response.StatusCode, + responseBody + ); + } + } + + public async Task WorkflowControllerCreateAsync( + CreateWorkflowDto request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + var response = await _client + .SendRequestAsync( + new JsonRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Post, + Path = "workflow", + Body = request, + ContentType = "application/json", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); + if (response.StatusCode is >= 200 and < 400) + { + var responseBody = await response.Raw.Content.ReadAsStringAsync(); + try + { + return JsonUtils.Deserialize(responseBody)!; + } + catch (JsonException e) + { + throw new VapiClientException("Failed to deserialize response", e); + } + } + + { + var responseBody = await response.Raw.Content.ReadAsStringAsync(); + throw new VapiClientApiException( + $"Error with status code {response.StatusCode}", + response.StatusCode, + responseBody + ); + } + } + + public async Task WorkflowControllerFindOneAsync( + string id, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + var response = await _client + .SendRequestAsync( + new JsonRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = string.Format("workflow/{0}", ValueConvert.ToPathParameterString(id)), + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); + if (response.StatusCode is >= 200 and < 400) + { + var responseBody = await response.Raw.Content.ReadAsStringAsync(); + try + { + return JsonUtils.Deserialize(responseBody)!; + } + catch (JsonException e) + { + throw new VapiClientException("Failed to deserialize response", e); + } + } + + { + var responseBody = await response.Raw.Content.ReadAsStringAsync(); + throw new VapiClientApiException( + $"Error with status code {response.StatusCode}", + response.StatusCode, + responseBody + ); + } + } + + public async Task WorkflowControllerDeleteAsync( + string id, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + var response = await _client + .SendRequestAsync( + new JsonRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Delete, + Path = string.Format("workflow/{0}", ValueConvert.ToPathParameterString(id)), + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); + if (response.StatusCode is >= 200 and < 400) + { + var responseBody = await response.Raw.Content.ReadAsStringAsync(); + try + { + return JsonUtils.Deserialize(responseBody)!; + } + catch (JsonException e) + { + throw new VapiClientException("Failed to deserialize response", e); + } + } + + { + var responseBody = await response.Raw.Content.ReadAsStringAsync(); + throw new VapiClientApiException( + $"Error with status code {response.StatusCode}", + response.StatusCode, + responseBody + ); + } + } + + public async Task WorkflowControllerUpdateAsync( + string id, + UpdateWorkflowDto request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + var response = await _client + .SendRequestAsync( + new JsonRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethodExtensions.Patch, + Path = string.Format("workflow/{0}", ValueConvert.ToPathParameterString(id)), + Body = request, + ContentType = "application/json", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); + if (response.StatusCode is >= 200 and < 400) + { + var responseBody = await response.Raw.Content.ReadAsStringAsync(); + try + { + return JsonUtils.Deserialize(responseBody)!; + } + catch (JsonException e) + { + throw new VapiClientException("Failed to deserialize response", e); + } + } + + { + var responseBody = await response.Raw.Content.ReadAsStringAsync(); + throw new VapiClientApiException( + $"Error with status code {response.StatusCode}", + response.StatusCode, + responseBody + ); + } + } +} From 90df3685375a221e4caaccef6526903408e93885 Mon Sep 17 00:00:00 2001 From: fern-api <115122769+fern-api[bot]@users.noreply.github.com> Date: Fri, 23 May 2025 00:05:33 +0000 Subject: [PATCH 5/5] Release 0.8.1 --- .github/workflows/ci.yml | 6 +- .../Core/QueryStringConverterTests.cs | 4 +- src/Vapi.Net.Test/Vapi.Net.Test.Custom.props | 3 +- src/Vapi.Net.Test/Vapi.Net.Test.csproj | 68 +++++------ src/Vapi.Net.sln | 20 ++-- .../Assistants/Requests/UpdateAssistantDto.cs | 12 +- .../UpdateAssistantDtoClientMessagesItem.cs | 3 + .../UpdateAssistantDtoServerMessagesItem.cs | 53 +++----- src/Vapi.Net/Calls/Requests/CreateCallDto.cs | 48 +++++++- src/Vapi.Net/Core/DateOnlyConverter.cs | 1 - src/Vapi.Net/Core/Public/Version.cs | 2 +- src/Vapi.Net/Core/ValueConvert.cs | 6 + src/Vapi.Net/Types/AnthropicModelModel.cs | 6 + src/Vapi.Net/Types/ApiRequest.cs | 79 ------------ src/Vapi.Net/Types/ApiRequestMode.cs | 15 --- src/Vapi.Net/Types/Artifact.cs | 6 + src/Vapi.Net/Types/Assistant.cs | 12 +- .../Types/AssistantClientMessagesItem.cs | 3 + ...ssistantHookAssistantSpeechInterrupted.cs} | 11 +- ...antHooks.cs => AssistantHookCallEnding.cs} | 15 +-- .../AssistantHookCustomerSpeechInterrupted.cs | 30 +++++ src/Vapi.Net/Types/AssistantOverrides.cs | 12 +- .../AssistantOverridesClientMessagesItem.cs | 3 + .../AssistantOverridesServerMessagesItem.cs | 53 +++----- .../Types/AssistantServerMessagesItem.cs | 53 +++----- ...ActionBase.cs => AssistantUserEditable.cs} | 5 +- .../AssistantVersionPaginatedResponse.cs | 33 +++++ .../Types/AzureOpenAiCredentialModelsItem.cs | 15 ++- src/Vapi.Net/Types/AzureVoice.cs | 6 + src/Vapi.Net/Types/BackoffPlan.cs | 16 +-- src/Vapi.Net/Types/ByoPhoneNumber.cs | 12 +- src/Vapi.Net/Types/Call.cs | 48 +++++++- src/Vapi.Net/Types/CallEndedReason.cs | 9 ++ src/Vapi.Net/Types/CartesiaVoice.cs | 6 + .../Types/ClientMessageConversationUpdate.cs | 30 +++++ src/Vapi.Net/Types/ClientMessageHang.cs | 30 +++++ .../ClientMessageLanguageChangeDetected.cs | 30 +++++ src/Vapi.Net/Types/ClientMessageMetadata.cs | 30 +++++ .../Types/ClientMessageModelOutput.cs | 30 +++++ .../Types/ClientMessageSpeechUpdate.cs | 30 +++++ src/Vapi.Net/Types/ClientMessageToolCalls.cs | 30 +++++ .../Types/ClientMessageToolCallsResult.cs | 30 +++++ src/Vapi.Net/Types/ClientMessageTranscript.cs | 30 +++++ .../Types/ClientMessageTranscriptType.cs | 8 +- .../Types/ClientMessageTransferUpdate.cs | 30 +++++ .../Types/ClientMessageUserInterrupted.cs | 30 +++++ src/Vapi.Net/Types/ClientMessageVoiceInput.cs | 30 +++++ .../Types/ClientMessageWorkflowNodeStarted.cs | 30 +++++ src/Vapi.Net/Types/Condition.cs | 2 +- src/Vapi.Net/Types/ConversationNode.cs | 72 +++++++++++ src/Vapi.Net/Types/CreateApiRequestToolDto.cs | 113 ++++++++++++++++++ ...od.cs => CreateApiRequestToolDtoMethod.cs} | 4 +- src/Vapi.Net/Types/CreateAssistantDto.cs | 12 +- .../CreateAssistantDtoClientMessagesItem.cs | 3 + .../CreateAssistantDtoServerMessagesItem.cs | 53 +++----- ...reateAzureOpenAiCredentialDtoModelsItem.cs | 15 ++- src/Vapi.Net/Types/CreateByoPhoneNumberDto.cs | 12 +- ...eGoHighLevelCalendarAvailabilityToolDto.cs | 64 ++++++++++ ...teGoHighLevelCalendarEventCreateToolDto.cs | 64 ++++++++++ .../CreateGoHighLevelContactCreateToolDto.cs | 64 ++++++++++ .../CreateGoHighLevelContactGetToolDto.cs | 64 ++++++++++ .../CreateGoHighLevelMcpCredentialDto.cs | 36 ++++++ src/Vapi.Net/Types/CreateOutboundCallDto.cs | 48 +++++++- src/Vapi.Net/Types/CreateSesameVoiceDto.cs | 36 ++++++ ...eSmsSendToolDto.cs => CreateSmsToolDto.cs} | 2 +- .../Types/CreateTelnyxPhoneNumberDto.cs | 12 +- .../Types/CreateTwilioCredentialDto.cs | 14 ++- .../Types/CreateTwilioPhoneNumberDto.cs | 37 +++++- .../Types/CreateVapiPhoneNumberDto.cs | 12 +- src/Vapi.Net/Types/CreateVoicemailToolDto.cs | 6 + .../Types/CreateVonagePhoneNumberDto.cs | 12 +- src/Vapi.Net/Types/CreateWebCallDto.cs | 48 +++++++- src/Vapi.Net/Types/CustomVoice.cs | 6 + src/Vapi.Net/Types/DeepgramVoice.cs | 6 + src/Vapi.Net/Types/ElevenLabsVoice.cs | 6 + src/Vapi.Net/Types/FallbackAzureVoice.cs | 6 + src/Vapi.Net/Types/FallbackCartesiaVoice.cs | 6 + src/Vapi.Net/Types/FallbackCustomVoice.cs | 6 + src/Vapi.Net/Types/FallbackDeepgramVoice.cs | 6 + src/Vapi.Net/Types/FallbackElevenLabsVoice.cs | 6 + .../Types/FallbackGoogleTranscriberModel.cs | 6 + src/Vapi.Net/Types/FallbackHumeVoice.cs | 6 + src/Vapi.Net/Types/FallbackLmntVoice.cs | 6 + src/Vapi.Net/Types/FallbackNeuphonicVoice.cs | 6 + src/Vapi.Net/Types/FallbackOpenAiVoice.cs | 6 + src/Vapi.Net/Types/FallbackPlayHtVoice.cs | 6 + src/Vapi.Net/Types/FallbackRimeAiVoice.cs | 8 +- src/Vapi.Net/Types/FallbackSesameVoice.cs | 54 +++++++++ src/Vapi.Net/Types/FallbackSmallestAiVoice.cs | 6 + src/Vapi.Net/Types/FallbackTavusVoice.cs | 6 + src/Vapi.Net/Types/FallbackVapiVoice.cs | 6 + .../Types/FallbackVapiVoiceVoiceId.cs | 3 + .../Types/FormatPlanFormattersEnabledItem.cs | 3 + .../Types/FunctionCallAssistantHookAction.cs | 64 ++++++++++ src/Vapi.Net/Types/Gather.cs | 62 ---------- src/Vapi.Net/Types/GlobalNodePlan.cs | 40 +++++++ .../GoHighLevelCalendarAvailabilityTool.cs | 88 ++++++++++++++ ...alendarAvailabilityToolProviderDetails.cs} | 18 +-- ...velCalendarAvailabilityToolWithToolCall.cs | 73 +++++++++++ .../GoHighLevelCalendarEventCreateTool.cs | 88 ++++++++++++++ ...lCalendarEventCreateToolProviderDetails.cs | 33 +++++ ...evelCalendarEventCreateToolWithToolCall.cs | 73 +++++++++++ .../Types/GoHighLevelContactCreateTool.cs | 88 ++++++++++++++ ...ghLevelContactCreateToolProviderDetails.cs | 33 +++++ ...oHighLevelContactCreateToolWithToolCall.cs | 73 +++++++++++ .../Types/GoHighLevelContactGetTool.cs | 88 ++++++++++++++ ...oHighLevelContactGetToolProviderDetails.cs | 33 +++++ .../GoHighLevelContactGetToolWithToolCall.cs | 73 +++++++++++ .../Types/GoHighLevelMcpCredential.cs | 63 ++++++++++ src/Vapi.Net/Types/GoogleModelModel.cs | 6 + src/Vapi.Net/Types/GoogleTranscriberModel.cs | 6 + .../Types/GoogleVoicemailDetectionPlan.cs | 20 +++- src/Vapi.Net/Types/GroqModelModel.cs | 21 +++- src/Vapi.Net/Types/{Say.cs => HangupNode.cs} | 15 ++- src/Vapi.Net/Types/HookOn.cs | 18 --- src/Vapi.Net/Types/HumeVoice.cs | 6 + .../Types/ImportTwilioPhoneNumberDto.cs | 37 +++++- .../Types/ImportVonagePhoneNumberDto.cs | 12 +- src/Vapi.Net/Types/JwtResponse.cs | 30 +++++ src/Vapi.Net/Types/KnowledgeBaseCost.cs | 48 ++++++++ src/Vapi.Net/Types/KnowledgeBaseModel.cs | 6 + .../Types/LivekitSmartEndpointingPlan.cs | 2 +- src/Vapi.Net/Types/LmntVoice.cs | 6 + src/Vapi.Net/Types/MonitorPlan.cs | 20 ++++ src/Vapi.Net/Types/Mono.cs | 42 +++++++ src/Vapi.Net/Types/NeuphonicVoice.cs | 6 + .../Types/OAuth2AuthenticationPlan.cs | 2 +- .../Types/OAuth2AuthenticationPlanType.cs | 15 +++ .../Types/Oauth2AuthenticationSession.cs | 6 + .../Types/OpenAiModelFallbackModelsItem.cs | 6 + src/Vapi.Net/Types/OpenAiModelModel.cs | 6 + src/Vapi.Net/Types/OpenAiVoice.cs | 6 + .../Types/OpenAiVoicemailDetectionPlan.cs | 20 +++- src/Vapi.Net/Types/Org.cs | 6 + .../Types/PhoneNumberHookCallRinging.cs | 3 +- src/Vapi.Net/Types/PlayHtVoice.cs | 6 + src/Vapi.Net/Types/Recording.cs | 48 ++++++++ src/Vapi.Net/Types/RimeAiVoice.cs | 8 +- src/Vapi.Net/Types/SayAssistantHookAction.cs | 30 +++++ .../{Hook.cs => SayPhoneNumberHookAction.cs} | 12 +- src/Vapi.Net/Types/Server.cs | 20 ++-- .../Types/ServerMessageAssistantRequest.cs | 30 +---- .../Types/ServerMessageConversationUpdate.cs | 30 +---- .../Types/ServerMessageEndOfCallReport.cs | 30 +---- ...ServerMessageEndOfCallReportEndedReason.cs | 9 ++ src/Vapi.Net/Types/ServerMessageHang.cs | 30 +---- .../ServerMessageKnowledgeBaseRequest.cs | 30 +---- .../ServerMessageLanguageChangeDetected.cs | 30 +---- .../Types/ServerMessageModelOutput.cs | 30 +---- .../Types/ServerMessagePhoneCallControl.cs | 30 +---- .../ServerMessageResponseAssistantRequest.cs | 48 +++++++- .../Types/ServerMessageSpeechUpdate.cs | 30 +---- .../Types/ServerMessageStatusUpdate.cs | 30 +---- .../ServerMessageStatusUpdateEndedReason.cs | 9 ++ src/Vapi.Net/Types/ServerMessageToolCalls.cs | 30 +---- src/Vapi.Net/Types/ServerMessageTranscript.cs | 30 +---- .../Types/ServerMessageTranscriptType.cs | 8 +- ...ServerMessageTransferDestinationRequest.cs | 30 +---- .../Types/ServerMessageTransferUpdate.cs | 30 +---- .../Types/ServerMessageUserInterrupted.cs | 30 +---- src/Vapi.Net/Types/ServerMessageVoiceInput.cs | 30 +---- .../Types/ServerMessageVoiceRequest.cs | 30 +---- src/Vapi.Net/Types/SesameVoice.cs | 54 +++++++++ src/Vapi.Net/Types/SmallestAiVoice.cs | 6 + .../Types/{SmsSendTool.cs => SmsTool.cs} | 2 +- src/Vapi.Net/Types/StartSpeakingPlan.cs | 2 +- src/Vapi.Net/Types/StructuredDataPlan.cs | 4 +- src/Vapi.Net/Types/SuccessEvaluationPlan.cs | 4 +- src/Vapi.Net/Types/SummaryPlan.cs | 4 +- src/Vapi.Net/Types/TavusVoice.cs | 6 + src/Vapi.Net/Types/TelnyxPhoneNumber.cs | 12 +- src/Vapi.Net/Types/ToolCallResult.cs | 8 +- src/Vapi.Net/Types/ToolCallResultMessage.cs | 6 + src/Vapi.Net/Types/ToolNode.cs | 51 ++++++++ .../Types/TransferAssistantHookAction.cs | 6 - src/Vapi.Net/Types/TransferDestinationStep.cs | 49 -------- src/Vapi.Net/Types/TransferFallbackPlan.cs | 41 +++++++ ...er.cs => TransferPhoneNumberHookAction.cs} | 14 +-- src/Vapi.Net/Types/TransferPlan.cs | 36 +++++- src/Vapi.Net/Types/TransferPlanMode.cs | 3 + src/Vapi.Net/Types/TwilioCredential.cs | 14 ++- src/Vapi.Net/Types/TwilioPhoneNumber.cs | 47 ++++++-- ...pdateAzureOpenAiCredentialDtoModelsItem.cs | 15 ++- src/Vapi.Net/Types/UpdateByoPhoneNumberDto.cs | 12 +- ...eGoHighLevelCalendarAvailabilityToolDto.cs | 64 ++++++++++ ...teGoHighLevelCalendarEventCreateToolDto.cs | 64 ++++++++++ .../UpdateGoHighLevelContactCreateToolDto.cs | 64 ++++++++++ .../UpdateGoHighLevelContactGetToolDto.cs | 64 ++++++++++ .../UpdateGoHighLevelMcpCredentialDto.cs | 36 ++++++ ...eSmsSendToolDto.cs => UpdateSmsToolDto.cs} | 2 +- .../Types/UpdateTelnyxPhoneNumberDto.cs | 12 +- .../Types/UpdateTwilioCredentialDto.cs | 12 ++ .../Types/UpdateTwilioPhoneNumberDto.cs | 35 +++++- .../Types/UpdateVapiPhoneNumberDto.cs | 12 +- .../Types/UpdateVonagePhoneNumberDto.cs | 12 +- src/Vapi.Net/Types/VapiModel.cs | 5 +- src/Vapi.Net/Types/VapiPhoneNumber.cs | 12 +- src/Vapi.Net/Types/VapiVoice.cs | 6 + src/Vapi.Net/Types/VapiVoiceVoiceId.cs | 3 + .../Types/VapiVoicemailDetectionPlan.cs | 44 +++++++ src/Vapi.Net/Types/VariableExtractionPlan.cs | 28 +++++ .../Types/VariableExtractionSchema.cs | 52 ++++++++ .../Types/VariableExtractionSchemaType.cs | 21 ++++ .../Types/VoicemailDetectionBackoffPlan.cs | 42 +++++++ .../Types/VoicemailDetectionCostProvider.cs | 3 + src/Vapi.Net/Types/VonagePhoneNumber.cs | 12 +- src/Vapi.Net/Types/WorkflowAnthropicModel.cs | 51 ++++++++ .../Types/WorkflowAnthropicModelModel.cs | 36 ++++++ src/Vapi.Net/Types/WorkflowOpenAiModel.cs | 42 +++++++ .../Types/WorkflowOpenAiModelModel.cs | 108 +++++++++++++++++ src/Vapi.Net/Types/WorkflowUserEditable.cs | 39 ++++++ src/Vapi.Net/Vapi.Net.Custom.props | 2 +- src/Vapi.Net/Vapi.Net.csproj | 96 +++++++-------- src/Vapi.Net/VapiClient.cs | 38 +++++- 214 files changed, 4422 insertions(+), 1107 deletions(-) delete mode 100644 src/Vapi.Net/Types/ApiRequest.cs delete mode 100644 src/Vapi.Net/Types/ApiRequestMode.cs rename src/Vapi.Net/Types/{Hangup.cs => AssistantHookAssistantSpeechInterrupted.cs} (73%) rename src/Vapi.Net/Types/{AssistantHooks.cs => AssistantHookCallEnding.cs} (75%) create mode 100644 src/Vapi.Net/Types/AssistantHookCustomerSpeechInterrupted.cs rename src/Vapi.Net/Types/{AssistantHookActionBase.cs => AssistantUserEditable.cs} (82%) create mode 100644 src/Vapi.Net/Types/AssistantVersionPaginatedResponse.cs create mode 100644 src/Vapi.Net/Types/ConversationNode.cs create mode 100644 src/Vapi.Net/Types/CreateApiRequestToolDto.cs rename src/Vapi.Net/Types/{ApiRequestMethod.cs => CreateApiRequestToolDtoMethod.cs} (64%) create mode 100644 src/Vapi.Net/Types/CreateGoHighLevelCalendarAvailabilityToolDto.cs create mode 100644 src/Vapi.Net/Types/CreateGoHighLevelCalendarEventCreateToolDto.cs create mode 100644 src/Vapi.Net/Types/CreateGoHighLevelContactCreateToolDto.cs create mode 100644 src/Vapi.Net/Types/CreateGoHighLevelContactGetToolDto.cs create mode 100644 src/Vapi.Net/Types/CreateGoHighLevelMcpCredentialDto.cs create mode 100644 src/Vapi.Net/Types/CreateSesameVoiceDto.cs rename src/Vapi.Net/Types/{CreateSmsSendToolDto.cs => CreateSmsToolDto.cs} (98%) create mode 100644 src/Vapi.Net/Types/FallbackSesameVoice.cs create mode 100644 src/Vapi.Net/Types/FunctionCallAssistantHookAction.cs delete mode 100644 src/Vapi.Net/Types/Gather.cs create mode 100644 src/Vapi.Net/Types/GlobalNodePlan.cs create mode 100644 src/Vapi.Net/Types/GoHighLevelCalendarAvailabilityTool.cs rename src/Vapi.Net/Types/{SayHook.cs => GoHighLevelCalendarAvailabilityToolProviderDetails.cs} (63%) create mode 100644 src/Vapi.Net/Types/GoHighLevelCalendarAvailabilityToolWithToolCall.cs create mode 100644 src/Vapi.Net/Types/GoHighLevelCalendarEventCreateTool.cs create mode 100644 src/Vapi.Net/Types/GoHighLevelCalendarEventCreateToolProviderDetails.cs create mode 100644 src/Vapi.Net/Types/GoHighLevelCalendarEventCreateToolWithToolCall.cs create mode 100644 src/Vapi.Net/Types/GoHighLevelContactCreateTool.cs create mode 100644 src/Vapi.Net/Types/GoHighLevelContactCreateToolProviderDetails.cs create mode 100644 src/Vapi.Net/Types/GoHighLevelContactCreateToolWithToolCall.cs create mode 100644 src/Vapi.Net/Types/GoHighLevelContactGetTool.cs create mode 100644 src/Vapi.Net/Types/GoHighLevelContactGetToolProviderDetails.cs create mode 100644 src/Vapi.Net/Types/GoHighLevelContactGetToolWithToolCall.cs create mode 100644 src/Vapi.Net/Types/GoHighLevelMcpCredential.cs rename src/Vapi.Net/Types/{Say.cs => HangupNode.cs} (75%) delete mode 100644 src/Vapi.Net/Types/HookOn.cs create mode 100644 src/Vapi.Net/Types/JwtResponse.cs create mode 100644 src/Vapi.Net/Types/KnowledgeBaseCost.cs create mode 100644 src/Vapi.Net/Types/Mono.cs create mode 100644 src/Vapi.Net/Types/OAuth2AuthenticationPlanType.cs create mode 100644 src/Vapi.Net/Types/Recording.cs create mode 100644 src/Vapi.Net/Types/SayAssistantHookAction.cs rename src/Vapi.Net/Types/{Hook.cs => SayPhoneNumberHookAction.cs} (75%) create mode 100644 src/Vapi.Net/Types/SesameVoice.cs rename src/Vapi.Net/Types/{SmsSendTool.cs => SmsTool.cs} (99%) create mode 100644 src/Vapi.Net/Types/ToolNode.cs delete mode 100644 src/Vapi.Net/Types/TransferDestinationStep.cs create mode 100644 src/Vapi.Net/Types/TransferFallbackPlan.cs rename src/Vapi.Net/Types/{Transfer.cs => TransferPhoneNumberHookAction.cs} (68%) create mode 100644 src/Vapi.Net/Types/UpdateGoHighLevelCalendarAvailabilityToolDto.cs create mode 100644 src/Vapi.Net/Types/UpdateGoHighLevelCalendarEventCreateToolDto.cs create mode 100644 src/Vapi.Net/Types/UpdateGoHighLevelContactCreateToolDto.cs create mode 100644 src/Vapi.Net/Types/UpdateGoHighLevelContactGetToolDto.cs create mode 100644 src/Vapi.Net/Types/UpdateGoHighLevelMcpCredentialDto.cs rename src/Vapi.Net/Types/{UpdateSmsSendToolDto.cs => UpdateSmsToolDto.cs} (98%) create mode 100644 src/Vapi.Net/Types/VapiVoicemailDetectionPlan.cs create mode 100644 src/Vapi.Net/Types/VariableExtractionPlan.cs create mode 100644 src/Vapi.Net/Types/VariableExtractionSchema.cs create mode 100644 src/Vapi.Net/Types/VariableExtractionSchemaType.cs create mode 100644 src/Vapi.Net/Types/VoicemailDetectionBackoffPlan.cs create mode 100644 src/Vapi.Net/Types/WorkflowAnthropicModel.cs create mode 100644 src/Vapi.Net/Types/WorkflowAnthropicModelModel.cs create mode 100644 src/Vapi.Net/Types/WorkflowOpenAiModel.cs create mode 100644 src/Vapi.Net/Types/WorkflowOpenAiModelModel.cs create mode 100644 src/Vapi.Net/Types/WorkflowUserEditable.cs diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4372616..6481274 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,7 +8,7 @@ jobs: steps: - name: Checkout repo - uses: actions/checkout@v3 + uses: actions/checkout@v4 - uses: actions/checkout@master @@ -29,7 +29,7 @@ jobs: steps: - name: Checkout repo - uses: actions/checkout@v3 + uses: actions/checkout@v4 - uses: actions/checkout@master @@ -54,7 +54,7 @@ jobs: steps: - name: Checkout repo - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup .NET uses: actions/setup-dotnet@v1 diff --git a/src/Vapi.Net.Test/Core/QueryStringConverterTests.cs b/src/Vapi.Net.Test/Core/QueryStringConverterTests.cs index 9dfa88e..94f9e85 100644 --- a/src/Vapi.Net.Test/Core/QueryStringConverterTests.cs +++ b/src/Vapi.Net.Test/Core/QueryStringConverterTests.cs @@ -109,8 +109,8 @@ public void ToQueryStringCollection_OnString_ThrowsException() [Test] public void ToQueryStringCollection_OnArray_ThrowsException() { - var exception = Assert.Throws( - () => QueryStringConverter.ToForm(Array.Empty()) + var exception = Assert.Throws(() => + QueryStringConverter.ToForm(Array.Empty()) ); Assert.That( exception.Message, diff --git a/src/Vapi.Net.Test/Vapi.Net.Test.Custom.props b/src/Vapi.Net.Test/Vapi.Net.Test.Custom.props index 55e683b..aac9b50 100644 --- a/src/Vapi.Net.Test/Vapi.Net.Test.Custom.props +++ b/src/Vapi.Net.Test/Vapi.Net.Test.Custom.props @@ -3,5 +3,4 @@ Configure additional MSBuild properties for your project in this file: - Step 1: Add this file to your .fernignore file to ensure it is not overwritten. - Step 2: Modify this file to your liking. --> - - \ No newline at end of file + diff --git a/src/Vapi.Net.Test/Vapi.Net.Test.csproj b/src/Vapi.Net.Test/Vapi.Net.Test.csproj index 35f11ab..6a3ecd1 100644 --- a/src/Vapi.Net.Test/Vapi.Net.Test.csproj +++ b/src/Vapi.Net.Test/Vapi.Net.Test.csproj @@ -1,37 +1,33 @@ - - - net8.0 - 12 - enable - enable - false - true - true - - - - - runtime; build; native; contentfiles; analyzers; buildtransitive - all - - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - - - - \ No newline at end of file + + net8.0 + 12 + enable + enable + false + true + true + + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + diff --git a/src/Vapi.Net.sln b/src/Vapi.Net.sln index c6149ec..d922a5c 100644 --- a/src/Vapi.Net.sln +++ b/src/Vapi.Net.sln @@ -3,9 +3,9 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 VisualStudioVersion = 17.0.31903.59 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Vapi.Net", "Vapi.Net\Vapi.Net.csproj", "{97511217-C45A-49CD-A9C8-4B0F42EA576C}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Vapi.Net", "Vapi.Net\Vapi.Net.csproj", "{B7822B17-E7D4-4F82-A255-BAE4080C361A}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Vapi.Net.Test", "Vapi.Net.Test\Vapi.Net.Test.csproj", "{1A0450D4-0B00-479A-88B4-38C53981E4B5}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Vapi.Net.Test", "Vapi.Net.Test\Vapi.Net.Test.csproj", "{0CBE75AE-B4F0-450F-8577-7EFCC284FE08}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -16,13 +16,13 @@ Global HideSolutionNode = FALSE EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {97511217-C45A-49CD-A9C8-4B0F42EA576C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {97511217-C45A-49CD-A9C8-4B0F42EA576C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {97511217-C45A-49CD-A9C8-4B0F42EA576C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {97511217-C45A-49CD-A9C8-4B0F42EA576C}.Release|Any CPU.Build.0 = Release|Any CPU - {1A0450D4-0B00-479A-88B4-38C53981E4B5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {1A0450D4-0B00-479A-88B4-38C53981E4B5}.Debug|Any CPU.Build.0 = Debug|Any CPU - {1A0450D4-0B00-479A-88B4-38C53981E4B5}.Release|Any CPU.ActiveCfg = Release|Any CPU - {1A0450D4-0B00-479A-88B4-38C53981E4B5}.Release|Any CPU.Build.0 = Release|Any CPU + {B7822B17-E7D4-4F82-A255-BAE4080C361A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B7822B17-E7D4-4F82-A255-BAE4080C361A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B7822B17-E7D4-4F82-A255-BAE4080C361A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B7822B17-E7D4-4F82-A255-BAE4080C361A}.Release|Any CPU.Build.0 = Release|Any CPU + {0CBE75AE-B4F0-450F-8577-7EFCC284FE08}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0CBE75AE-B4F0-450F-8577-7EFCC284FE08}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0CBE75AE-B4F0-450F-8577-7EFCC284FE08}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0CBE75AE-B4F0-450F-8577-7EFCC284FE08}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection EndGlobal diff --git a/src/Vapi.Net/Assistants/Requests/UpdateAssistantDto.cs b/src/Vapi.Net/Assistants/Requests/UpdateAssistantDto.cs index 5b219f8..c406f1d 100644 --- a/src/Vapi.Net/Assistants/Requests/UpdateAssistantDto.cs +++ b/src/Vapi.Net/Assistants/Requests/UpdateAssistantDto.cs @@ -130,6 +130,12 @@ public record UpdateAssistantDto [JsonPropertyName("credentials")] public IEnumerable? Credentials { get; set; } + /// + /// This is a set of actions that will be performed on certain events. + /// + [JsonPropertyName("hooks")] + public IEnumerable? Hooks { get; set; } + /// /// This is the name of the assistant. /// @@ -245,12 +251,6 @@ public record UpdateAssistantDto [JsonPropertyName("server")] public Server? Server { get; set; } - /// - /// This is a set of actions that will be performed on certain events. - /// - [JsonPropertyName("hooks")] - public IEnumerable? Hooks { get; set; } - [JsonPropertyName("keypadInputPlan")] public KeypadInputPlan? KeypadInputPlan { get; set; } diff --git a/src/Vapi.Net/Assistants/Types/UpdateAssistantDtoClientMessagesItem.cs b/src/Vapi.Net/Assistants/Types/UpdateAssistantDtoClientMessagesItem.cs index 0809e39..9e99b85 100644 --- a/src/Vapi.Net/Assistants/Types/UpdateAssistantDtoClientMessagesItem.cs +++ b/src/Vapi.Net/Assistants/Types/UpdateAssistantDtoClientMessagesItem.cs @@ -43,6 +43,9 @@ public enum UpdateAssistantDtoClientMessagesItem [EnumMember(Value = "tool-calls-result")] ToolCallsResult, + [EnumMember(Value = "tool.completed")] + ToolCompleted, + [EnumMember(Value = "transfer-update")] TransferUpdate, diff --git a/src/Vapi.Net/Assistants/Types/UpdateAssistantDtoServerMessagesItem.cs b/src/Vapi.Net/Assistants/Types/UpdateAssistantDtoServerMessagesItem.cs index 0cb99da..e99cabb 100644 --- a/src/Vapi.Net/Assistants/Types/UpdateAssistantDtoServerMessagesItem.cs +++ b/src/Vapi.Net/Assistants/Types/UpdateAssistantDtoServerMessagesItem.cs @@ -1,60 +1,43 @@ -using System.Runtime.Serialization; using System.Text.Json.Serialization; using Vapi.Net.Core; +using System.Runtime.Serialization; namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] public enum UpdateAssistantDtoServerMessagesItem { - [EnumMember(Value = "conversation-update")] - ConversationUpdate, + [EnumMember(Value = "conversation-update")]ConversationUpdate, - [EnumMember(Value = "end-of-call-report")] - EndOfCallReport, + [EnumMember(Value = "end-of-call-report")]EndOfCallReport, - [EnumMember(Value = "function-call")] - FunctionCall, + [EnumMember(Value = "function-call")]FunctionCall, - [EnumMember(Value = "hang")] - Hang, + [EnumMember(Value = "hang")]Hang, - [EnumMember(Value = "language-changed")] - LanguageChanged, + [EnumMember(Value = "language-changed")]LanguageChanged, - [EnumMember(Value = "language-change-detected")] - LanguageChangeDetected, + [EnumMember(Value = "language-change-detected")]LanguageChangeDetected, - [EnumMember(Value = "model-output")] - ModelOutput, + [EnumMember(Value = "model-output")]ModelOutput, - [EnumMember(Value = "phone-call-control")] - PhoneCallControl, + [EnumMember(Value = "phone-call-control")]PhoneCallControl, - [EnumMember(Value = "speech-update")] - SpeechUpdate, + [EnumMember(Value = "speech-update")]SpeechUpdate, - [EnumMember(Value = "status-update")] - StatusUpdate, + [EnumMember(Value = "status-update")]StatusUpdate, - [EnumMember(Value = "transcript")] - Transcript, + [EnumMember(Value = "transcript")]Transcript, - [EnumMember(Value = "transcript[transcriptType='final']")] - TranscriptTranscriptTypeFinal, + [EnumMember(Value = "transcript[transcriptType="final"]")]TranscriptTranscriptTypeFinal, - [EnumMember(Value = "tool-calls")] - ToolCalls, + [EnumMember(Value = "tool-calls")]ToolCalls, - [EnumMember(Value = "transfer-destination-request")] - TransferDestinationRequest, + [EnumMember(Value = "transfer-destination-request")]TransferDestinationRequest, - [EnumMember(Value = "transfer-update")] - TransferUpdate, + [EnumMember(Value = "transfer-update")]TransferUpdate, - [EnumMember(Value = "user-interrupted")] - UserInterrupted, + [EnumMember(Value = "user-interrupted")]UserInterrupted, - [EnumMember(Value = "voice-input")] - VoiceInput, + [EnumMember(Value = "voice-input")]VoiceInput } diff --git a/src/Vapi.Net/Calls/Requests/CreateCallDto.cs b/src/Vapi.Net/Calls/Requests/CreateCallDto.cs index 5e86ab1..c48fc78 100644 --- a/src/Vapi.Net/Calls/Requests/CreateCallDto.cs +++ b/src/Vapi.Net/Calls/Requests/CreateCallDto.cs @@ -32,13 +32,23 @@ public record CreateCallDto public object? Transport { get; set; } /// - /// This is the assistant that will be used for the call. To use a transient assistant, use `assistant` instead. + /// This is the assistant ID that will be used for the call. To use a transient assistant, use `assistant` instead. + /// + /// To start a call with: + /// - Assistant, use `assistantId` or `assistant` + /// - Squad, use `squadId` or `squad` + /// - Workflow, use `workflowId` or `workflow` /// [JsonPropertyName("assistantId")] public string? AssistantId { get; set; } /// /// This is the assistant that will be used for the call. To use an existing assistant, use `assistantId` instead. + /// + /// To start a call with: + /// - Assistant, use `assistant` + /// - Squad, use `squad` + /// - Workflow, use `workflow` /// [JsonPropertyName("assistant")] public CreateAssistantDto? Assistant { get; set; } @@ -51,16 +61,52 @@ public record CreateCallDto /// /// This is the squad that will be used for the call. To use a transient squad, use `squad` instead. + /// + /// To start a call with: + /// - Assistant, use `assistant` or `assistantId` + /// - Squad, use `squad` or `squadId` + /// - Workflow, use `workflow` or `workflowId` /// [JsonPropertyName("squadId")] public string? SquadId { get; set; } /// /// This is a squad that will be used for the call. To use an existing squad, use `squadId` instead. + /// + /// To start a call with: + /// - Assistant, use `assistant` or `assistantId` + /// - Squad, use `squad` or `squadId` + /// - Workflow, use `workflow` or `workflowId` /// [JsonPropertyName("squad")] public CreateSquadDto? Squad { get; set; } + /// + /// [BETA] This feature is in active development. The API and behavior are subject to change as we refine it based on user feedback. + /// + /// This is the workflow that will be used for the call. To use a transient workflow, use `workflow` instead. + /// + /// To start a call with: + /// - Assistant, use `assistant` or `assistantId` + /// - Squad, use `squad` or `squadId` + /// - Workflow, use `workflow` or `workflowId` + /// + [JsonPropertyName("workflowId")] + public string? WorkflowId { get; set; } + + /// + /// [BETA] This feature is in active development. The API and behavior are subject to change as we refine it based on user feedback. + /// + /// This is a workflow that will be used for the call. To use an existing workflow, use `workflowId` instead. + /// + /// To start a call with: + /// - Assistant, use `assistant` or `assistantId` + /// - Squad, use `squad` or `squadId` + /// - Workflow, use `workflow` or `workflowId` + /// + [JsonPropertyName("workflow")] + public CreateWorkflowDto? Workflow { get; set; } + /// /// This is the phone number that will be used for the call. To use a transient number, use `phoneNumber` instead. /// diff --git a/src/Vapi.Net/Core/DateOnlyConverter.cs b/src/Vapi.Net/Core/DateOnlyConverter.cs index 2b43ef5..0a5916a 100644 --- a/src/Vapi.Net/Core/DateOnlyConverter.cs +++ b/src/Vapi.Net/Core/DateOnlyConverter.cs @@ -169,7 +169,6 @@ internal static class JsonConstants // ReSharper disable SuggestVarOrType_SimpleTypes // ReSharper disable SuggestVarOrType_BuiltInTypes - internal static class JsonHelpers { [MethodImpl(MethodImplOptions.AggressiveInlining)] diff --git a/src/Vapi.Net/Core/Public/Version.cs b/src/Vapi.Net/Core/Public/Version.cs index 0852d98..c134336 100644 --- a/src/Vapi.Net/Core/Public/Version.cs +++ b/src/Vapi.Net/Core/Public/Version.cs @@ -2,5 +2,5 @@ namespace Vapi.Net; internal class Version { - public const string Current = "0.6.0"; + public const string Current = "0.8.1"; } diff --git a/src/Vapi.Net/Core/ValueConvert.cs b/src/Vapi.Net/Core/ValueConvert.cs index 250e1a0..5c0c0b7 100644 --- a/src/Vapi.Net/Core/ValueConvert.cs +++ b/src/Vapi.Net/Core/ValueConvert.cs @@ -29,6 +29,8 @@ public static class ValueConvert internal static string ToPathParameterString(ulong v) => ToString(v); + internal static string ToPathParameterString(string v) => ToString(v); + internal static string ToPathParameterString(char v) => ToString(v); internal static string ToPathParameterString(Guid v) => ToString(v); @@ -55,6 +57,8 @@ public static class ValueConvert internal static string ToQueryStringValue(ulong v) => ToString(v); + internal static string ToQueryStringValue(string v) => v is null ? "" : v; + internal static string ToQueryStringValue(char v) => ToString(v); internal static string ToQueryStringValue(Guid v) => ToString(v); @@ -105,5 +109,7 @@ internal static string ToString(T value) internal static string ToString(char v) => v.ToString(CultureInfo.InvariantCulture); + internal static string ToString(string v) => v; + internal static string ToString(Guid v) => v.ToString("D"); } diff --git a/src/Vapi.Net/Types/AnthropicModelModel.cs b/src/Vapi.Net/Types/AnthropicModelModel.cs index f3bbff7..9f9090d 100644 --- a/src/Vapi.Net/Types/AnthropicModelModel.cs +++ b/src/Vapi.Net/Types/AnthropicModelModel.cs @@ -27,4 +27,10 @@ public enum AnthropicModelModel [EnumMember(Value = "claude-3-7-sonnet-20250219")] Claude37Sonnet20250219, + + [EnumMember(Value = "claude-opus-4-20250514")] + ClaudeOpus420250514, + + [EnumMember(Value = "claude-sonnet-4-20250514")] + ClaudeSonnet420250514, } diff --git a/src/Vapi.Net/Types/ApiRequest.cs b/src/Vapi.Net/Types/ApiRequest.cs deleted file mode 100644 index 480ae72..0000000 --- a/src/Vapi.Net/Types/ApiRequest.cs +++ /dev/null @@ -1,79 +0,0 @@ -using System.Text.Json; -using System.Text.Json.Serialization; -using Vapi.Net.Core; - -namespace Vapi.Net; - -public record ApiRequest -{ - [JsonPropertyName("method")] - public required ApiRequestMethod Method { get; set; } - - /// - /// Api endpoint to send requests to. - /// - [JsonPropertyName("url")] - public required string Url { get; set; } - - /// - /// These are the custom headers to include in the Api Request sent. - /// - /// Each key-value pair represents a header name and its value. - /// - [JsonPropertyName("headers")] - public JsonSchema? Headers { get; set; } - - /// - /// This defined the JSON body of your Api Request. For example, if `body_schema` - /// included "my_field": "my_gather_statement.user_age", then the json body sent to the server would have that particular value assign to it. - /// Right now, only data from gather statements are supported. - /// - [JsonPropertyName("body")] - public JsonSchema? Body { get; set; } - - /// - /// This is the mode of the Api Request. - /// We only support BLOCKING and BACKGROUND for now. - /// - [JsonPropertyName("mode")] - public required ApiRequestMode Mode { get; set; } - - /// - /// This is a list of hooks for a task. - /// Each hook is a list of tasks to run on a trigger (such as on start, on failure, etc). - /// Only Say is supported for now. - /// - [JsonPropertyName("hooks")] - public IEnumerable? Hooks { get; set; } - - /// - /// This is the schema for the outputs of the Api Request. - /// - [JsonPropertyName("output")] - public JsonSchema? Output { get; set; } - - [JsonPropertyName("name")] - public required string Name { get; set; } - - /// - /// This is for metadata you want to store on the task. - /// - [JsonPropertyName("metadata")] - public object? Metadata { get; set; } - - /// - /// Additional properties received from the response, if any. - /// - /// - /// [EXPERIMENTAL] This API is experimental and may change in future releases. - /// - [JsonExtensionData] - public IDictionary AdditionalProperties { get; internal set; } = - new Dictionary(); - - /// - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Vapi.Net/Types/ApiRequestMode.cs b/src/Vapi.Net/Types/ApiRequestMode.cs deleted file mode 100644 index 95e4417..0000000 --- a/src/Vapi.Net/Types/ApiRequestMode.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using Vapi.Net.Core; - -namespace Vapi.Net; - -[JsonConverter(typeof(EnumSerializer))] -public enum ApiRequestMode -{ - [EnumMember(Value = "blocking")] - Blocking, - - [EnumMember(Value = "background")] - Background, -} diff --git a/src/Vapi.Net/Types/Artifact.cs b/src/Vapi.Net/Types/Artifact.cs index 7106e19..ce1ed36 100644 --- a/src/Vapi.Net/Types/Artifact.cs +++ b/src/Vapi.Net/Types/Artifact.cs @@ -45,6 +45,12 @@ public IEnumerable< [JsonPropertyName("videoRecordingStartDelaySeconds")] public double? VideoRecordingStartDelaySeconds { get; set; } + /// + /// This is the recording url for the call. To enable, set `assistant.artifactPlan.recordingEnabled`. + /// + [JsonPropertyName("recording")] + public Recording? Recording { get; set; } + /// /// This is the transcript of the call. This is derived from `artifact.messages` but provided for convenience. /// diff --git a/src/Vapi.Net/Types/Assistant.cs b/src/Vapi.Net/Types/Assistant.cs index be7c904..c99892a 100644 --- a/src/Vapi.Net/Types/Assistant.cs +++ b/src/Vapi.Net/Types/Assistant.cs @@ -131,6 +131,12 @@ public record Assistant [JsonPropertyName("credentials")] public IEnumerable? Credentials { get; set; } + /// + /// This is a set of actions that will be performed on certain events. + /// + [JsonPropertyName("hooks")] + public IEnumerable? Hooks { get; set; } + /// /// This is the name of the assistant. /// @@ -246,12 +252,6 @@ public record Assistant [JsonPropertyName("server")] public Server? Server { get; set; } - /// - /// This is a set of actions that will be performed on certain events. - /// - [JsonPropertyName("hooks")] - public IEnumerable? Hooks { get; set; } - [JsonPropertyName("keypadInputPlan")] public KeypadInputPlan? KeypadInputPlan { get; set; } diff --git a/src/Vapi.Net/Types/AssistantClientMessagesItem.cs b/src/Vapi.Net/Types/AssistantClientMessagesItem.cs index b35f522..2fbf13d 100644 --- a/src/Vapi.Net/Types/AssistantClientMessagesItem.cs +++ b/src/Vapi.Net/Types/AssistantClientMessagesItem.cs @@ -43,6 +43,9 @@ public enum AssistantClientMessagesItem [EnumMember(Value = "tool-calls-result")] ToolCallsResult, + [EnumMember(Value = "tool.completed")] + ToolCompleted, + [EnumMember(Value = "transfer-update")] TransferUpdate, diff --git a/src/Vapi.Net/Types/Hangup.cs b/src/Vapi.Net/Types/AssistantHookAssistantSpeechInterrupted.cs similarity index 73% rename from src/Vapi.Net/Types/Hangup.cs rename to src/Vapi.Net/Types/AssistantHookAssistantSpeechInterrupted.cs index 9d3dcab..3da917c 100644 --- a/src/Vapi.Net/Types/Hangup.cs +++ b/src/Vapi.Net/Types/AssistantHookAssistantSpeechInterrupted.cs @@ -4,16 +4,13 @@ namespace Vapi.Net; -public record Hangup +public record AssistantHookAssistantSpeechInterrupted { - [JsonPropertyName("name")] - public required string Name { get; set; } - /// - /// This is for metadata you want to store on the task. + /// This is the set of actions to perform when the hook triggers /// - [JsonPropertyName("metadata")] - public object? Metadata { get; set; } + [JsonPropertyName("do")] + public IEnumerable Do { get; set; } = new List(); /// /// Additional properties received from the response, if any. diff --git a/src/Vapi.Net/Types/AssistantHooks.cs b/src/Vapi.Net/Types/AssistantHookCallEnding.cs similarity index 75% rename from src/Vapi.Net/Types/AssistantHooks.cs rename to src/Vapi.Net/Types/AssistantHookCallEnding.cs index a93f232..f9820e0 100644 --- a/src/Vapi.Net/Types/AssistantHooks.cs +++ b/src/Vapi.Net/Types/AssistantHookCallEnding.cs @@ -4,13 +4,13 @@ namespace Vapi.Net; -public record AssistantHooks +public record AssistantHookCallEnding { /// - /// This is the event that triggers this hook + /// This is the set of actions to perform when the hook triggers /// - [JsonPropertyName("on")] - public string On { get; set; } = "call.ending"; + [JsonPropertyName("do")] + public IEnumerable Do { get; set; } = new List(); /// /// This is the set of filters that must match for the hook to trigger @@ -18,13 +18,6 @@ public record AssistantHooks [JsonPropertyName("filters")] public IEnumerable? Filters { get; set; } - /// - /// This is the set of actions to perform when the hook triggers - /// - [JsonPropertyName("do")] - public IEnumerable Do { get; set; } = - new List(); - /// /// Additional properties received from the response, if any. /// diff --git a/src/Vapi.Net/Types/AssistantHookCustomerSpeechInterrupted.cs b/src/Vapi.Net/Types/AssistantHookCustomerSpeechInterrupted.cs new file mode 100644 index 0000000..52ea35c --- /dev/null +++ b/src/Vapi.Net/Types/AssistantHookCustomerSpeechInterrupted.cs @@ -0,0 +1,30 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record AssistantHookCustomerSpeechInterrupted +{ + /// + /// This is the set of actions to perform when the hook triggers + /// + [JsonPropertyName("do")] + public IEnumerable Do { get; set; } = new List(); + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/AssistantOverrides.cs b/src/Vapi.Net/Types/AssistantOverrides.cs index 3635714..b4338ca 100644 --- a/src/Vapi.Net/Types/AssistantOverrides.cs +++ b/src/Vapi.Net/Types/AssistantOverrides.cs @@ -131,6 +131,12 @@ public record AssistantOverrides [JsonPropertyName("credentials")] public IEnumerable? Credentials { get; set; } + /// + /// This is a set of actions that will be performed on certain events. + /// + [JsonPropertyName("hooks")] + public IEnumerable? Hooks { get; set; } + /// /// These are values that will be used to replace the template variables in the assistant messages and other text-based fields. /// This uses LiquidJS syntax. https://liquidjs.com/tutorials/intro-to-liquid.html @@ -258,12 +264,6 @@ public record AssistantOverrides [JsonPropertyName("server")] public Server? Server { get; set; } - /// - /// This is a set of actions that will be performed on certain events. - /// - [JsonPropertyName("hooks")] - public IEnumerable? Hooks { get; set; } - [JsonPropertyName("keypadInputPlan")] public KeypadInputPlan? KeypadInputPlan { get; set; } diff --git a/src/Vapi.Net/Types/AssistantOverridesClientMessagesItem.cs b/src/Vapi.Net/Types/AssistantOverridesClientMessagesItem.cs index 9292b83..024247b 100644 --- a/src/Vapi.Net/Types/AssistantOverridesClientMessagesItem.cs +++ b/src/Vapi.Net/Types/AssistantOverridesClientMessagesItem.cs @@ -43,6 +43,9 @@ public enum AssistantOverridesClientMessagesItem [EnumMember(Value = "tool-calls-result")] ToolCallsResult, + [EnumMember(Value = "tool.completed")] + ToolCompleted, + [EnumMember(Value = "transfer-update")] TransferUpdate, diff --git a/src/Vapi.Net/Types/AssistantOverridesServerMessagesItem.cs b/src/Vapi.Net/Types/AssistantOverridesServerMessagesItem.cs index 7828460..7cc2302 100644 --- a/src/Vapi.Net/Types/AssistantOverridesServerMessagesItem.cs +++ b/src/Vapi.Net/Types/AssistantOverridesServerMessagesItem.cs @@ -1,60 +1,43 @@ -using System.Runtime.Serialization; using System.Text.Json.Serialization; using Vapi.Net.Core; +using System.Runtime.Serialization; namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] public enum AssistantOverridesServerMessagesItem { - [EnumMember(Value = "conversation-update")] - ConversationUpdate, + [EnumMember(Value = "conversation-update")]ConversationUpdate, - [EnumMember(Value = "end-of-call-report")] - EndOfCallReport, + [EnumMember(Value = "end-of-call-report")]EndOfCallReport, - [EnumMember(Value = "function-call")] - FunctionCall, + [EnumMember(Value = "function-call")]FunctionCall, - [EnumMember(Value = "hang")] - Hang, + [EnumMember(Value = "hang")]Hang, - [EnumMember(Value = "language-changed")] - LanguageChanged, + [EnumMember(Value = "language-changed")]LanguageChanged, - [EnumMember(Value = "language-change-detected")] - LanguageChangeDetected, + [EnumMember(Value = "language-change-detected")]LanguageChangeDetected, - [EnumMember(Value = "model-output")] - ModelOutput, + [EnumMember(Value = "model-output")]ModelOutput, - [EnumMember(Value = "phone-call-control")] - PhoneCallControl, + [EnumMember(Value = "phone-call-control")]PhoneCallControl, - [EnumMember(Value = "speech-update")] - SpeechUpdate, + [EnumMember(Value = "speech-update")]SpeechUpdate, - [EnumMember(Value = "status-update")] - StatusUpdate, + [EnumMember(Value = "status-update")]StatusUpdate, - [EnumMember(Value = "transcript")] - Transcript, + [EnumMember(Value = "transcript")]Transcript, - [EnumMember(Value = "transcript[transcriptType='final']")] - TranscriptTranscriptTypeFinal, + [EnumMember(Value = "transcript[transcriptType="final"]")]TranscriptTranscriptTypeFinal, - [EnumMember(Value = "tool-calls")] - ToolCalls, + [EnumMember(Value = "tool-calls")]ToolCalls, - [EnumMember(Value = "transfer-destination-request")] - TransferDestinationRequest, + [EnumMember(Value = "transfer-destination-request")]TransferDestinationRequest, - [EnumMember(Value = "transfer-update")] - TransferUpdate, + [EnumMember(Value = "transfer-update")]TransferUpdate, - [EnumMember(Value = "user-interrupted")] - UserInterrupted, + [EnumMember(Value = "user-interrupted")]UserInterrupted, - [EnumMember(Value = "voice-input")] - VoiceInput, + [EnumMember(Value = "voice-input")]VoiceInput } diff --git a/src/Vapi.Net/Types/AssistantServerMessagesItem.cs b/src/Vapi.Net/Types/AssistantServerMessagesItem.cs index 37e825f..6c445d8 100644 --- a/src/Vapi.Net/Types/AssistantServerMessagesItem.cs +++ b/src/Vapi.Net/Types/AssistantServerMessagesItem.cs @@ -1,60 +1,43 @@ -using System.Runtime.Serialization; using System.Text.Json.Serialization; using Vapi.Net.Core; +using System.Runtime.Serialization; namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] public enum AssistantServerMessagesItem { - [EnumMember(Value = "conversation-update")] - ConversationUpdate, + [EnumMember(Value = "conversation-update")]ConversationUpdate, - [EnumMember(Value = "end-of-call-report")] - EndOfCallReport, + [EnumMember(Value = "end-of-call-report")]EndOfCallReport, - [EnumMember(Value = "function-call")] - FunctionCall, + [EnumMember(Value = "function-call")]FunctionCall, - [EnumMember(Value = "hang")] - Hang, + [EnumMember(Value = "hang")]Hang, - [EnumMember(Value = "language-changed")] - LanguageChanged, + [EnumMember(Value = "language-changed")]LanguageChanged, - [EnumMember(Value = "language-change-detected")] - LanguageChangeDetected, + [EnumMember(Value = "language-change-detected")]LanguageChangeDetected, - [EnumMember(Value = "model-output")] - ModelOutput, + [EnumMember(Value = "model-output")]ModelOutput, - [EnumMember(Value = "phone-call-control")] - PhoneCallControl, + [EnumMember(Value = "phone-call-control")]PhoneCallControl, - [EnumMember(Value = "speech-update")] - SpeechUpdate, + [EnumMember(Value = "speech-update")]SpeechUpdate, - [EnumMember(Value = "status-update")] - StatusUpdate, + [EnumMember(Value = "status-update")]StatusUpdate, - [EnumMember(Value = "transcript")] - Transcript, + [EnumMember(Value = "transcript")]Transcript, - [EnumMember(Value = "transcript[transcriptType='final']")] - TranscriptTranscriptTypeFinal, + [EnumMember(Value = "transcript[transcriptType="final"]")]TranscriptTranscriptTypeFinal, - [EnumMember(Value = "tool-calls")] - ToolCalls, + [EnumMember(Value = "tool-calls")]ToolCalls, - [EnumMember(Value = "transfer-destination-request")] - TransferDestinationRequest, + [EnumMember(Value = "transfer-destination-request")]TransferDestinationRequest, - [EnumMember(Value = "transfer-update")] - TransferUpdate, + [EnumMember(Value = "transfer-update")]TransferUpdate, - [EnumMember(Value = "user-interrupted")] - UserInterrupted, + [EnumMember(Value = "user-interrupted")]UserInterrupted, - [EnumMember(Value = "voice-input")] - VoiceInput, + [EnumMember(Value = "voice-input")]VoiceInput } diff --git a/src/Vapi.Net/Types/AssistantHookActionBase.cs b/src/Vapi.Net/Types/AssistantUserEditable.cs similarity index 82% rename from src/Vapi.Net/Types/AssistantHookActionBase.cs rename to src/Vapi.Net/Types/AssistantUserEditable.cs index 83762f9..c8e6f65 100644 --- a/src/Vapi.Net/Types/AssistantHookActionBase.cs +++ b/src/Vapi.Net/Types/AssistantUserEditable.cs @@ -4,8 +4,11 @@ namespace Vapi.Net; -public record AssistantHookActionBase +public record AssistantUserEditable { + [JsonPropertyName("serverMessages")] + public object? ServerMessages { get; set; } + /// /// Additional properties received from the response, if any. /// diff --git a/src/Vapi.Net/Types/AssistantVersionPaginatedResponse.cs b/src/Vapi.Net/Types/AssistantVersionPaginatedResponse.cs new file mode 100644 index 0000000..785bebe --- /dev/null +++ b/src/Vapi.Net/Types/AssistantVersionPaginatedResponse.cs @@ -0,0 +1,33 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record AssistantVersionPaginatedResponse +{ + [JsonPropertyName("results")] + public IEnumerable Results { get; set; } = new List(); + + [JsonPropertyName("metadata")] + public required PaginationMeta Metadata { get; set; } + + [JsonPropertyName("nextPageState")] + public string? NextPageState { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/AzureOpenAiCredentialModelsItem.cs b/src/Vapi.Net/Types/AzureOpenAiCredentialModelsItem.cs index 476520f..09ad68e 100644 --- a/src/Vapi.Net/Types/AzureOpenAiCredentialModelsItem.cs +++ b/src/Vapi.Net/Types/AzureOpenAiCredentialModelsItem.cs @@ -7,18 +7,27 @@ namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] public enum AzureOpenAiCredentialModelsItem { + [EnumMember(Value = "gpt-4.1-2025-04-14")] + Gpt4120250414, + + [EnumMember(Value = "gpt-4.1-mini-2025-04-14")] + Gpt41Mini20250414, + + [EnumMember(Value = "gpt-4.1-nano-2025-04-14")] + Gpt41Nano20250414, + [EnumMember(Value = "gpt-4o-2024-11-20")] Gpt4O20241120, [EnumMember(Value = "gpt-4o-2024-08-06")] Gpt4O20240806, - [EnumMember(Value = "gpt-4o-mini-2024-07-18")] - Gpt4OMini20240718, - [EnumMember(Value = "gpt-4o-2024-05-13")] Gpt4O20240513, + [EnumMember(Value = "gpt-4o-mini-2024-07-18")] + Gpt4OMini20240718, + [EnumMember(Value = "gpt-4-turbo-2024-04-09")] Gpt4Turbo20240409, diff --git a/src/Vapi.Net/Types/AzureVoice.cs b/src/Vapi.Net/Types/AzureVoice.cs index 6a60345..fd1d4d2 100644 --- a/src/Vapi.Net/Types/AzureVoice.cs +++ b/src/Vapi.Net/Types/AzureVoice.cs @@ -7,6 +7,12 @@ namespace Vapi.Net; public record AzureVoice { + /// + /// This is the flag to toggle voice caching for the assistant. + /// + [JsonPropertyName("cachingEnabled")] + public bool? CachingEnabled { get; set; } + /// /// This is the provider-specific ID that will be used. /// diff --git a/src/Vapi.Net/Types/BackoffPlan.cs b/src/Vapi.Net/Types/BackoffPlan.cs index 1e05539..a84b663 100644 --- a/src/Vapi.Net/Types/BackoffPlan.cs +++ b/src/Vapi.Net/Types/BackoffPlan.cs @@ -6,14 +6,6 @@ namespace Vapi.Net; public record BackoffPlan { - /// - /// This is the maximum number of retries to attempt if the request fails. Defaults to 0 (no retries). - /// - /// @default 0 - /// - [JsonPropertyName("maxRetries")] - public required double MaxRetries { get; set; } - /// /// This is the type of backoff plan to use. Defaults to fixed. /// @@ -22,6 +14,14 @@ public record BackoffPlan [JsonPropertyName("type")] public object Type { get; set; } = new Dictionary(); + /// + /// This is the maximum number of retries to attempt if the request fails. Defaults to 0 (no retries). + /// + /// @default 0 + /// + [JsonPropertyName("maxRetries")] + public required double MaxRetries { get; set; } + /// /// This is the base delay in seconds. For linear backoff, this is the delay between each retry. For exponential backoff, this is the initial delay. /// diff --git a/src/Vapi.Net/Types/ByoPhoneNumber.cs b/src/Vapi.Net/Types/ByoPhoneNumber.cs index 70f9958..9fbb4dc 100644 --- a/src/Vapi.Net/Types/ByoPhoneNumber.cs +++ b/src/Vapi.Net/Types/ByoPhoneNumber.cs @@ -76,15 +76,23 @@ public record ByoPhoneNumber /// /// This is the assistant that will be used for incoming calls to this phone number. /// - /// If neither `assistantId` nor `squadId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected. + /// If neither `assistantId`, `squadId` nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected. /// [JsonPropertyName("assistantId")] public string? AssistantId { get; set; } + /// + /// This is the workflow that will be used for incoming calls to this phone number. + /// + /// If neither `assistantId`, `squadId`, nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected. + /// + [JsonPropertyName("workflowId")] + public string? WorkflowId { get; set; } + /// /// This is the squad that will be used for incoming calls to this phone number. /// - /// If neither `assistantId` nor `squadId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected. + /// If neither `assistantId`, `squadId`, nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected. /// [JsonPropertyName("squadId")] public string? SquadId { get; set; } diff --git a/src/Vapi.Net/Types/Call.cs b/src/Vapi.Net/Types/Call.cs index a791dd4..08dd60e 100644 --- a/src/Vapi.Net/Types/Call.cs +++ b/src/Vapi.Net/Types/Call.cs @@ -139,13 +139,23 @@ public IEnumerable< public string? PhoneCallProviderId { get; set; } /// - /// This is the assistant that will be used for the call. To use a transient assistant, use `assistant` instead. + /// This is the assistant ID that will be used for the call. To use a transient assistant, use `assistant` instead. + /// + /// To start a call with: + /// - Assistant, use `assistantId` or `assistant` + /// - Squad, use `squadId` or `squad` + /// - Workflow, use `workflowId` or `workflow` /// [JsonPropertyName("assistantId")] public string? AssistantId { get; set; } /// /// This is the assistant that will be used for the call. To use an existing assistant, use `assistantId` instead. + /// + /// To start a call with: + /// - Assistant, use `assistant` + /// - Squad, use `squad` + /// - Workflow, use `workflow` /// [JsonPropertyName("assistant")] public CreateAssistantDto? Assistant { get; set; } @@ -158,16 +168,52 @@ public IEnumerable< /// /// This is the squad that will be used for the call. To use a transient squad, use `squad` instead. + /// + /// To start a call with: + /// - Assistant, use `assistant` or `assistantId` + /// - Squad, use `squad` or `squadId` + /// - Workflow, use `workflow` or `workflowId` /// [JsonPropertyName("squadId")] public string? SquadId { get; set; } /// /// This is a squad that will be used for the call. To use an existing squad, use `squadId` instead. + /// + /// To start a call with: + /// - Assistant, use `assistant` or `assistantId` + /// - Squad, use `squad` or `squadId` + /// - Workflow, use `workflow` or `workflowId` /// [JsonPropertyName("squad")] public CreateSquadDto? Squad { get; set; } + /// + /// [BETA] This feature is in active development. The API and behavior are subject to change as we refine it based on user feedback. + /// + /// This is the workflow that will be used for the call. To use a transient workflow, use `workflow` instead. + /// + /// To start a call with: + /// - Assistant, use `assistant` or `assistantId` + /// - Squad, use `squad` or `squadId` + /// - Workflow, use `workflow` or `workflowId` + /// + [JsonPropertyName("workflowId")] + public string? WorkflowId { get; set; } + + /// + /// [BETA] This feature is in active development. The API and behavior are subject to change as we refine it based on user feedback. + /// + /// This is a workflow that will be used for the call. To use an existing workflow, use `workflowId` instead. + /// + /// To start a call with: + /// - Assistant, use `assistant` or `assistantId` + /// - Squad, use `squad` or `squadId` + /// - Workflow, use `workflow` or `workflowId` + /// + [JsonPropertyName("workflow")] + public CreateWorkflowDto? Workflow { get; set; } + /// /// This is the phone number that will be used for the call. To use a transient number, use `phoneNumber` instead. /// diff --git a/src/Vapi.Net/Types/CallEndedReason.cs b/src/Vapi.Net/Types/CallEndedReason.cs index 6d8911a..6b073bf 100644 --- a/src/Vapi.Net/Types/CallEndedReason.cs +++ b/src/Vapi.Net/Types/CallEndedReason.cs @@ -281,6 +281,12 @@ public enum CallEndedReason [EnumMember(Value = "phone-call-provider-bypass-enabled-but-no-call-received")] PhoneCallProviderBypassEnabledButNoCallReceived, + [EnumMember(Value = "call.in-progress.error-providerfault-transport-never-connected")] + CallInProgressErrorProviderfaultTransportNeverConnected, + + [EnumMember(Value = "call.in-progress.error-vapifault-worker-not-available")] + CallInProgressErrorVapifaultWorkerNotAvailable, + [EnumMember(Value = "call.in-progress.error-vapifault-transport-never-connected")] CallInProgressErrorVapifaultTransportNeverConnected, @@ -1559,6 +1565,9 @@ public enum CallEndedReason [EnumMember(Value = "phone-call-provider-closed-websocket")] PhoneCallProviderClosedWebsocket, + [EnumMember(Value = "call.forwarding.operator-busy")] + CallForwardingOperatorBusy, + [EnumMember(Value = "silence-timed-out")] SilenceTimedOut, diff --git a/src/Vapi.Net/Types/CartesiaVoice.cs b/src/Vapi.Net/Types/CartesiaVoice.cs index 8e69f59..d0eb2ee 100644 --- a/src/Vapi.Net/Types/CartesiaVoice.cs +++ b/src/Vapi.Net/Types/CartesiaVoice.cs @@ -6,6 +6,12 @@ namespace Vapi.Net; public record CartesiaVoice { + /// + /// This is the flag to toggle voice caching for the assistant. + /// + [JsonPropertyName("cachingEnabled")] + public bool? CachingEnabled { get; set; } + /// /// The ID of the particular voice you want to use. /// diff --git a/src/Vapi.Net/Types/ClientMessageConversationUpdate.cs b/src/Vapi.Net/Types/ClientMessageConversationUpdate.cs index 7702046..f124dcb 100644 --- a/src/Vapi.Net/Types/ClientMessageConversationUpdate.cs +++ b/src/Vapi.Net/Types/ClientMessageConversationUpdate.cs @@ -7,6 +7,12 @@ namespace Vapi.Net; public record ClientMessageConversationUpdate { + /// + /// This is the phone number that the message is associated with. + /// + [JsonPropertyName("phoneNumber")] + public object? PhoneNumber { get; set; } + /// /// This is the type of the message. "conversation-update" is sent when an update is committed to the conversation history. /// @@ -28,6 +34,30 @@ public IEnumerable< public IEnumerable MessagesOpenAiFormatted { get; set; } = new List(); + /// + /// This is the timestamp of the message. + /// + [JsonPropertyName("timestamp")] + public double? Timestamp { get; set; } + + /// + /// This is the call that the message is associated with. + /// + [JsonPropertyName("call")] + public Call? Call { get; set; } + + /// + /// This is the customer that the message is associated with. + /// + [JsonPropertyName("customer")] + public CreateCustomerDto? Customer { get; set; } + + /// + /// This is the assistant that the message is associated with. + /// + [JsonPropertyName("assistant")] + public CreateAssistantDto? Assistant { get; set; } + /// /// Additional properties received from the response, if any. /// diff --git a/src/Vapi.Net/Types/ClientMessageHang.cs b/src/Vapi.Net/Types/ClientMessageHang.cs index af4a1c3..c6158f1 100644 --- a/src/Vapi.Net/Types/ClientMessageHang.cs +++ b/src/Vapi.Net/Types/ClientMessageHang.cs @@ -6,6 +6,12 @@ namespace Vapi.Net; public record ClientMessageHang { + /// + /// This is the phone number that the message is associated with. + /// + [JsonPropertyName("phoneNumber")] + public object? PhoneNumber { get; set; } + /// /// This is the type of the message. "hang" is sent when the assistant is hanging due to a delay. The delay can be caused by many factors, such as: /// - the model is too slow to respond @@ -16,6 +22,30 @@ public record ClientMessageHang [JsonPropertyName("type")] public string Type { get; set; } = "hang"; + /// + /// This is the timestamp of the message. + /// + [JsonPropertyName("timestamp")] + public double? Timestamp { get; set; } + + /// + /// This is the call that the message is associated with. + /// + [JsonPropertyName("call")] + public Call? Call { get; set; } + + /// + /// This is the customer that the message is associated with. + /// + [JsonPropertyName("customer")] + public CreateCustomerDto? Customer { get; set; } + + /// + /// This is the assistant that the message is associated with. + /// + [JsonPropertyName("assistant")] + public CreateAssistantDto? Assistant { get; set; } + /// /// Additional properties received from the response, if any. /// diff --git a/src/Vapi.Net/Types/ClientMessageLanguageChangeDetected.cs b/src/Vapi.Net/Types/ClientMessageLanguageChangeDetected.cs index 7b8bd39..c5543f5 100644 --- a/src/Vapi.Net/Types/ClientMessageLanguageChangeDetected.cs +++ b/src/Vapi.Net/Types/ClientMessageLanguageChangeDetected.cs @@ -6,12 +6,42 @@ namespace Vapi.Net; public record ClientMessageLanguageChangeDetected { + /// + /// This is the phone number that the message is associated with. + /// + [JsonPropertyName("phoneNumber")] + public object? PhoneNumber { get; set; } + /// /// This is the type of the message. "language-change-detected" is sent when the transcriber is automatically switched based on the detected language. /// [JsonPropertyName("type")] public string Type { get; set; } = "language-change-detected"; + /// + /// This is the timestamp of the message. + /// + [JsonPropertyName("timestamp")] + public double? Timestamp { get; set; } + + /// + /// This is the call that the message is associated with. + /// + [JsonPropertyName("call")] + public Call? Call { get; set; } + + /// + /// This is the customer that the message is associated with. + /// + [JsonPropertyName("customer")] + public CreateCustomerDto? Customer { get; set; } + + /// + /// This is the assistant that the message is associated with. + /// + [JsonPropertyName("assistant")] + public CreateAssistantDto? Assistant { get; set; } + /// /// This is the language the transcriber is switched to. /// diff --git a/src/Vapi.Net/Types/ClientMessageMetadata.cs b/src/Vapi.Net/Types/ClientMessageMetadata.cs index bcf7ea7..5703f2c 100644 --- a/src/Vapi.Net/Types/ClientMessageMetadata.cs +++ b/src/Vapi.Net/Types/ClientMessageMetadata.cs @@ -6,12 +6,42 @@ namespace Vapi.Net; public record ClientMessageMetadata { + /// + /// This is the phone number that the message is associated with. + /// + [JsonPropertyName("phoneNumber")] + public object? PhoneNumber { get; set; } + /// /// This is the type of the message. "metadata" is sent to forward metadata to the client. /// [JsonPropertyName("type")] public string Type { get; set; } = "metadata"; + /// + /// This is the timestamp of the message. + /// + [JsonPropertyName("timestamp")] + public double? Timestamp { get; set; } + + /// + /// This is the call that the message is associated with. + /// + [JsonPropertyName("call")] + public Call? Call { get; set; } + + /// + /// This is the customer that the message is associated with. + /// + [JsonPropertyName("customer")] + public CreateCustomerDto? Customer { get; set; } + + /// + /// This is the assistant that the message is associated with. + /// + [JsonPropertyName("assistant")] + public CreateAssistantDto? Assistant { get; set; } + /// /// This is the metadata content /// diff --git a/src/Vapi.Net/Types/ClientMessageModelOutput.cs b/src/Vapi.Net/Types/ClientMessageModelOutput.cs index 97001a1..b6dd827 100644 --- a/src/Vapi.Net/Types/ClientMessageModelOutput.cs +++ b/src/Vapi.Net/Types/ClientMessageModelOutput.cs @@ -6,12 +6,42 @@ namespace Vapi.Net; public record ClientMessageModelOutput { + /// + /// This is the phone number that the message is associated with. + /// + [JsonPropertyName("phoneNumber")] + public object? PhoneNumber { get; set; } + /// /// This is the type of the message. "model-output" is sent as the model outputs tokens. /// [JsonPropertyName("type")] public string Type { get; set; } = "model-output"; + /// + /// This is the timestamp of the message. + /// + [JsonPropertyName("timestamp")] + public double? Timestamp { get; set; } + + /// + /// This is the call that the message is associated with. + /// + [JsonPropertyName("call")] + public Call? Call { get; set; } + + /// + /// This is the customer that the message is associated with. + /// + [JsonPropertyName("customer")] + public CreateCustomerDto? Customer { get; set; } + + /// + /// This is the assistant that the message is associated with. + /// + [JsonPropertyName("assistant")] + public CreateAssistantDto? Assistant { get; set; } + /// /// This is the output of the model. It can be a token or tool call. /// diff --git a/src/Vapi.Net/Types/ClientMessageSpeechUpdate.cs b/src/Vapi.Net/Types/ClientMessageSpeechUpdate.cs index 3026356..cf077cc 100644 --- a/src/Vapi.Net/Types/ClientMessageSpeechUpdate.cs +++ b/src/Vapi.Net/Types/ClientMessageSpeechUpdate.cs @@ -6,6 +6,12 @@ namespace Vapi.Net; public record ClientMessageSpeechUpdate { + /// + /// This is the phone number that the message is associated with. + /// + [JsonPropertyName("phoneNumber")] + public object? PhoneNumber { get; set; } + /// /// This is the type of the message. "speech-update" is sent whenever assistant or user start or stop speaking. /// @@ -30,6 +36,30 @@ public record ClientMessageSpeechUpdate [JsonPropertyName("turn")] public double? Turn { get; set; } + /// + /// This is the timestamp of the message. + /// + [JsonPropertyName("timestamp")] + public double? Timestamp { get; set; } + + /// + /// This is the call that the message is associated with. + /// + [JsonPropertyName("call")] + public Call? Call { get; set; } + + /// + /// This is the customer that the message is associated with. + /// + [JsonPropertyName("customer")] + public CreateCustomerDto? Customer { get; set; } + + /// + /// This is the assistant that the message is associated with. + /// + [JsonPropertyName("assistant")] + public CreateAssistantDto? Assistant { get; set; } + /// /// Additional properties received from the response, if any. /// diff --git a/src/Vapi.Net/Types/ClientMessageToolCalls.cs b/src/Vapi.Net/Types/ClientMessageToolCalls.cs index 1859422..13e59db 100644 --- a/src/Vapi.Net/Types/ClientMessageToolCalls.cs +++ b/src/Vapi.Net/Types/ClientMessageToolCalls.cs @@ -6,6 +6,12 @@ namespace Vapi.Net; public record ClientMessageToolCalls { + /// + /// This is the phone number that the message is associated with. + /// + [JsonPropertyName("phoneNumber")] + public object? PhoneNumber { get; set; } + /// /// This is the type of the message. "tool-calls" is sent to call a tool. /// @@ -18,6 +24,30 @@ public record ClientMessageToolCalls [JsonPropertyName("toolWithToolCallList")] public IEnumerable ToolWithToolCallList { get; set; } = new List(); + /// + /// This is the timestamp of the message. + /// + [JsonPropertyName("timestamp")] + public double? Timestamp { get; set; } + + /// + /// This is the call that the message is associated with. + /// + [JsonPropertyName("call")] + public Call? Call { get; set; } + + /// + /// This is the customer that the message is associated with. + /// + [JsonPropertyName("customer")] + public CreateCustomerDto? Customer { get; set; } + + /// + /// This is the assistant that the message is associated with. + /// + [JsonPropertyName("assistant")] + public CreateAssistantDto? Assistant { get; set; } + /// /// This is the list of tool calls that the model is requesting. /// diff --git a/src/Vapi.Net/Types/ClientMessageToolCallsResult.cs b/src/Vapi.Net/Types/ClientMessageToolCallsResult.cs index 622ba7f..da357ab 100644 --- a/src/Vapi.Net/Types/ClientMessageToolCallsResult.cs +++ b/src/Vapi.Net/Types/ClientMessageToolCallsResult.cs @@ -6,12 +6,42 @@ namespace Vapi.Net; public record ClientMessageToolCallsResult { + /// + /// This is the phone number that the message is associated with. + /// + [JsonPropertyName("phoneNumber")] + public object? PhoneNumber { get; set; } + /// /// This is the type of the message. "tool-calls-result" is sent to forward the result of a tool call to the client. /// [JsonPropertyName("type")] public string Type { get; set; } = "tool-calls-result"; + /// + /// This is the timestamp of the message. + /// + [JsonPropertyName("timestamp")] + public double? Timestamp { get; set; } + + /// + /// This is the call that the message is associated with. + /// + [JsonPropertyName("call")] + public Call? Call { get; set; } + + /// + /// This is the customer that the message is associated with. + /// + [JsonPropertyName("customer")] + public CreateCustomerDto? Customer { get; set; } + + /// + /// This is the assistant that the message is associated with. + /// + [JsonPropertyName("assistant")] + public CreateAssistantDto? Assistant { get; set; } + /// /// This is the result of the tool call. /// diff --git a/src/Vapi.Net/Types/ClientMessageTranscript.cs b/src/Vapi.Net/Types/ClientMessageTranscript.cs index c2e87cf..90023e1 100644 --- a/src/Vapi.Net/Types/ClientMessageTranscript.cs +++ b/src/Vapi.Net/Types/ClientMessageTranscript.cs @@ -6,12 +6,42 @@ namespace Vapi.Net; public record ClientMessageTranscript { + /// + /// This is the phone number that the message is associated with. + /// + [JsonPropertyName("phoneNumber")] + public object? PhoneNumber { get; set; } + /// /// This is the type of the message. "transcript" is sent as transcriber outputs partial or final transcript. /// [JsonPropertyName("type")] public required ClientMessageTranscriptType Type { get; set; } + /// + /// This is the timestamp of the message. + /// + [JsonPropertyName("timestamp")] + public double? Timestamp { get; set; } + + /// + /// This is the call that the message is associated with. + /// + [JsonPropertyName("call")] + public Call? Call { get; set; } + + /// + /// This is the customer that the message is associated with. + /// + [JsonPropertyName("customer")] + public CreateCustomerDto? Customer { get; set; } + + /// + /// This is the assistant that the message is associated with. + /// + [JsonPropertyName("assistant")] + public CreateAssistantDto? Assistant { get; set; } + /// /// This is the role for which the transcript is for. /// diff --git a/src/Vapi.Net/Types/ClientMessageTranscriptType.cs b/src/Vapi.Net/Types/ClientMessageTranscriptType.cs index 00da4bc..622ec3d 100644 --- a/src/Vapi.Net/Types/ClientMessageTranscriptType.cs +++ b/src/Vapi.Net/Types/ClientMessageTranscriptType.cs @@ -1,15 +1,13 @@ -using System.Runtime.Serialization; using System.Text.Json.Serialization; using Vapi.Net.Core; +using System.Runtime.Serialization; namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] public enum ClientMessageTranscriptType { - [EnumMember(Value = "transcript")] - Transcript, + [EnumMember(Value = "transcript")]Transcript, - [EnumMember(Value = "transcript[transcriptType='final']")] - TranscriptTranscriptTypeFinal, + [EnumMember(Value = "transcript[transcriptType="final"]")]TranscriptTranscriptTypeFinal } diff --git a/src/Vapi.Net/Types/ClientMessageTransferUpdate.cs b/src/Vapi.Net/Types/ClientMessageTransferUpdate.cs index fabe7fe..39dfc28 100644 --- a/src/Vapi.Net/Types/ClientMessageTransferUpdate.cs +++ b/src/Vapi.Net/Types/ClientMessageTransferUpdate.cs @@ -6,6 +6,12 @@ namespace Vapi.Net; public record ClientMessageTransferUpdate { + /// + /// This is the phone number that the message is associated with. + /// + [JsonPropertyName("phoneNumber")] + public object? PhoneNumber { get; set; } + /// /// This is the type of the message. "transfer-update" is sent whenever a transfer happens. /// @@ -18,6 +24,30 @@ public record ClientMessageTransferUpdate [JsonPropertyName("destination")] public object? Destination { get; set; } + /// + /// This is the timestamp of the message. + /// + [JsonPropertyName("timestamp")] + public double? Timestamp { get; set; } + + /// + /// This is the call that the message is associated with. + /// + [JsonPropertyName("call")] + public Call? Call { get; set; } + + /// + /// This is the customer that the message is associated with. + /// + [JsonPropertyName("customer")] + public CreateCustomerDto? Customer { get; set; } + + /// + /// This is the assistant that the message is associated with. + /// + [JsonPropertyName("assistant")] + public CreateAssistantDto? Assistant { get; set; } + /// /// This is the assistant that the call is being transferred to. This is only sent if `destination.type` is "assistant". /// diff --git a/src/Vapi.Net/Types/ClientMessageUserInterrupted.cs b/src/Vapi.Net/Types/ClientMessageUserInterrupted.cs index 320644e..b9667e6 100644 --- a/src/Vapi.Net/Types/ClientMessageUserInterrupted.cs +++ b/src/Vapi.Net/Types/ClientMessageUserInterrupted.cs @@ -6,12 +6,42 @@ namespace Vapi.Net; public record ClientMessageUserInterrupted { + /// + /// This is the phone number that the message is associated with. + /// + [JsonPropertyName("phoneNumber")] + public object? PhoneNumber { get; set; } + /// /// This is the type of the message. "user-interrupted" is sent when the user interrupts the assistant. /// [JsonPropertyName("type")] public string Type { get; set; } = "user-interrupted"; + /// + /// This is the timestamp of the message. + /// + [JsonPropertyName("timestamp")] + public double? Timestamp { get; set; } + + /// + /// This is the call that the message is associated with. + /// + [JsonPropertyName("call")] + public Call? Call { get; set; } + + /// + /// This is the customer that the message is associated with. + /// + [JsonPropertyName("customer")] + public CreateCustomerDto? Customer { get; set; } + + /// + /// This is the assistant that the message is associated with. + /// + [JsonPropertyName("assistant")] + public CreateAssistantDto? Assistant { get; set; } + /// /// Additional properties received from the response, if any. /// diff --git a/src/Vapi.Net/Types/ClientMessageVoiceInput.cs b/src/Vapi.Net/Types/ClientMessageVoiceInput.cs index 4afb4e3..98eab62 100644 --- a/src/Vapi.Net/Types/ClientMessageVoiceInput.cs +++ b/src/Vapi.Net/Types/ClientMessageVoiceInput.cs @@ -6,12 +6,42 @@ namespace Vapi.Net; public record ClientMessageVoiceInput { + /// + /// This is the phone number that the message is associated with. + /// + [JsonPropertyName("phoneNumber")] + public object? PhoneNumber { get; set; } + /// /// This is the type of the message. "voice-input" is sent when a generation is requested from voice provider. /// [JsonPropertyName("type")] public string Type { get; set; } = "voice-input"; + /// + /// This is the timestamp of the message. + /// + [JsonPropertyName("timestamp")] + public double? Timestamp { get; set; } + + /// + /// This is the call that the message is associated with. + /// + [JsonPropertyName("call")] + public Call? Call { get; set; } + + /// + /// This is the customer that the message is associated with. + /// + [JsonPropertyName("customer")] + public CreateCustomerDto? Customer { get; set; } + + /// + /// This is the assistant that the message is associated with. + /// + [JsonPropertyName("assistant")] + public CreateAssistantDto? Assistant { get; set; } + /// /// This is the voice input content /// diff --git a/src/Vapi.Net/Types/ClientMessageWorkflowNodeStarted.cs b/src/Vapi.Net/Types/ClientMessageWorkflowNodeStarted.cs index 11f3d99..d51ee13 100644 --- a/src/Vapi.Net/Types/ClientMessageWorkflowNodeStarted.cs +++ b/src/Vapi.Net/Types/ClientMessageWorkflowNodeStarted.cs @@ -6,12 +6,42 @@ namespace Vapi.Net; public record ClientMessageWorkflowNodeStarted { + /// + /// This is the phone number that the message is associated with. + /// + [JsonPropertyName("phoneNumber")] + public object? PhoneNumber { get; set; } + /// /// This is the type of the message. "workflow.node.started" is sent when the active node changes. /// [JsonPropertyName("type")] public string Type { get; set; } = "workflow.node.started"; + /// + /// This is the timestamp of the message. + /// + [JsonPropertyName("timestamp")] + public double? Timestamp { get; set; } + + /// + /// This is the call that the message is associated with. + /// + [JsonPropertyName("call")] + public Call? Call { get; set; } + + /// + /// This is the customer that the message is associated with. + /// + [JsonPropertyName("customer")] + public CreateCustomerDto? Customer { get; set; } + + /// + /// This is the assistant that the message is associated with. + /// + [JsonPropertyName("assistant")] + public CreateAssistantDto? Assistant { get; set; } + /// /// This is the active node. /// diff --git a/src/Vapi.Net/Types/Condition.cs b/src/Vapi.Net/Types/Condition.cs index 69e166f..dd7323a 100644 --- a/src/Vapi.Net/Types/Condition.cs +++ b/src/Vapi.Net/Types/Condition.cs @@ -22,7 +22,7 @@ public record Condition /// This is the value you want to compare against the parameter. /// [JsonPropertyName("value")] - public object Value { get; set; } = new Dictionary(); + public required string Value { get; set; } /// /// Additional properties received from the response, if any. diff --git a/src/Vapi.Net/Types/ConversationNode.cs b/src/Vapi.Net/Types/ConversationNode.cs new file mode 100644 index 0000000..afd163f --- /dev/null +++ b/src/Vapi.Net/Types/ConversationNode.cs @@ -0,0 +1,72 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record ConversationNode +{ + /// + /// This is the model for the Conversation Task. + /// + [JsonPropertyName("model")] + public object? Model { get; set; } + + /// + /// These are the options for the assistant's transcriber. + /// + [JsonPropertyName("transcriber")] + public object? Transcriber { get; set; } + + /// + /// These are the options for the assistant's voice. + /// + [JsonPropertyName("voice")] + public object? Voice { get; set; } + + [JsonPropertyName("prompt")] + public string? Prompt { get; set; } + + /// + /// This is the plan for the global node. + /// + [JsonPropertyName("globalNodePlan")] + public GlobalNodePlan? GlobalNodePlan { get; set; } + + /// + /// This is the plan that controls the variable extraction from the user's response. + /// + [JsonPropertyName("variableExtractionPlan")] + public VariableExtractionPlan? VariableExtractionPlan { get; set; } + + [JsonPropertyName("name")] + public required string Name { get; set; } + + /// + /// This is whether or not the node is the start of the workflow. + /// + [JsonPropertyName("isStart")] + public bool? IsStart { get; set; } + + /// + /// This is for metadata you want to store on the task. + /// + [JsonPropertyName("metadata")] + public object? Metadata { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/CreateApiRequestToolDto.cs b/src/Vapi.Net/Types/CreateApiRequestToolDto.cs new file mode 100644 index 0000000..ef1db51 --- /dev/null +++ b/src/Vapi.Net/Types/CreateApiRequestToolDto.cs @@ -0,0 +1,113 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record CreateApiRequestToolDto +{ + /// + /// This determines if the tool is async. + /// + /// If async, the assistant will move forward without waiting for your server to respond. This is useful if you just want to trigger something on your server. + /// + /// If sync, the assistant will wait for your server to respond. This is useful if want assistant to respond with the result from your server. + /// + /// Defaults to synchronous (`false`). + /// + [JsonPropertyName("async")] + public bool? Async { get; set; } + + /// + /// These are the messages that will be spoken to the user as the tool is running. + /// + /// For some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured. + /// + [JsonPropertyName("messages")] + public IEnumerable? Messages { get; set; } + + [JsonPropertyName("method")] + public required CreateApiRequestToolDtoMethod Method { get; set; } + + /// + /// This is the timeout in seconds for the request. Defaults to 20 seconds. + /// + /// @default 20 + /// + [JsonPropertyName("timeoutSeconds")] + public double? TimeoutSeconds { get; set; } + + /// + /// This is the name of the tool. This will be passed to the model. + /// + [JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// This is the description of the tool. This will be passed to the model. + /// + [JsonPropertyName("description")] + public string? Description { get; set; } + + /// + /// This is where the request will be sent. + /// + [JsonPropertyName("url")] + public required string Url { get; set; } + + /// + /// This is the body of the request. + /// + [JsonPropertyName("body")] + public required JsonSchema Body { get; set; } + + /// + /// These are the headers to send in the request. + /// + [JsonPropertyName("headers")] + public JsonSchema? Headers { get; set; } + + /// + /// This is the backoff plan if the request fails. Defaults to undefined (the request will not be retried). + /// + /// @default undefined (the request will not be retried) + /// + [JsonPropertyName("backoffPlan")] + public BackoffPlan? BackoffPlan { get; set; } + + /// + /// This is the function definition of the tool. + /// + /// For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + /// + /// An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + /// + [JsonPropertyName("function")] + public OpenAiFunction? Function { get; set; } + + /// + /// This is the server that will be hit when this tool is requested by the model. + /// + /// All requests will be sent with the call object among other things. You can find more details in the Server URL documentation. + /// + /// This overrides the serverUrl set on the org and the phoneNumber. Order of precedence: highest tool.server.url, then assistant.serverUrl, then phoneNumber.serverUrl, then org.serverUrl. + /// + [JsonPropertyName("server")] + public Server? Server { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/ApiRequestMethod.cs b/src/Vapi.Net/Types/CreateApiRequestToolDtoMethod.cs similarity index 64% rename from src/Vapi.Net/Types/ApiRequestMethod.cs rename to src/Vapi.Net/Types/CreateApiRequestToolDtoMethod.cs index e9e5995..851fd8e 100644 --- a/src/Vapi.Net/Types/ApiRequestMethod.cs +++ b/src/Vapi.Net/Types/CreateApiRequestToolDtoMethod.cs @@ -4,8 +4,8 @@ namespace Vapi.Net; -[JsonConverter(typeof(EnumSerializer))] -public enum ApiRequestMethod +[JsonConverter(typeof(EnumSerializer))] +public enum CreateApiRequestToolDtoMethod { [EnumMember(Value = "POST")] Post, diff --git a/src/Vapi.Net/Types/CreateAssistantDto.cs b/src/Vapi.Net/Types/CreateAssistantDto.cs index 06a8c78..30a2485 100644 --- a/src/Vapi.Net/Types/CreateAssistantDto.cs +++ b/src/Vapi.Net/Types/CreateAssistantDto.cs @@ -131,6 +131,12 @@ public record CreateAssistantDto [JsonPropertyName("credentials")] public IEnumerable? Credentials { get; set; } + /// + /// This is a set of actions that will be performed on certain events. + /// + [JsonPropertyName("hooks")] + public IEnumerable? Hooks { get; set; } + /// /// This is the name of the assistant. /// @@ -246,12 +252,6 @@ public record CreateAssistantDto [JsonPropertyName("server")] public Server? Server { get; set; } - /// - /// This is a set of actions that will be performed on certain events. - /// - [JsonPropertyName("hooks")] - public IEnumerable? Hooks { get; set; } - [JsonPropertyName("keypadInputPlan")] public KeypadInputPlan? KeypadInputPlan { get; set; } diff --git a/src/Vapi.Net/Types/CreateAssistantDtoClientMessagesItem.cs b/src/Vapi.Net/Types/CreateAssistantDtoClientMessagesItem.cs index 2368081..374ca9a 100644 --- a/src/Vapi.Net/Types/CreateAssistantDtoClientMessagesItem.cs +++ b/src/Vapi.Net/Types/CreateAssistantDtoClientMessagesItem.cs @@ -43,6 +43,9 @@ public enum CreateAssistantDtoClientMessagesItem [EnumMember(Value = "tool-calls-result")] ToolCallsResult, + [EnumMember(Value = "tool.completed")] + ToolCompleted, + [EnumMember(Value = "transfer-update")] TransferUpdate, diff --git a/src/Vapi.Net/Types/CreateAssistantDtoServerMessagesItem.cs b/src/Vapi.Net/Types/CreateAssistantDtoServerMessagesItem.cs index 7973efe..6574c30 100644 --- a/src/Vapi.Net/Types/CreateAssistantDtoServerMessagesItem.cs +++ b/src/Vapi.Net/Types/CreateAssistantDtoServerMessagesItem.cs @@ -1,60 +1,43 @@ -using System.Runtime.Serialization; using System.Text.Json.Serialization; using Vapi.Net.Core; +using System.Runtime.Serialization; namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] public enum CreateAssistantDtoServerMessagesItem { - [EnumMember(Value = "conversation-update")] - ConversationUpdate, + [EnumMember(Value = "conversation-update")]ConversationUpdate, - [EnumMember(Value = "end-of-call-report")] - EndOfCallReport, + [EnumMember(Value = "end-of-call-report")]EndOfCallReport, - [EnumMember(Value = "function-call")] - FunctionCall, + [EnumMember(Value = "function-call")]FunctionCall, - [EnumMember(Value = "hang")] - Hang, + [EnumMember(Value = "hang")]Hang, - [EnumMember(Value = "language-changed")] - LanguageChanged, + [EnumMember(Value = "language-changed")]LanguageChanged, - [EnumMember(Value = "language-change-detected")] - LanguageChangeDetected, + [EnumMember(Value = "language-change-detected")]LanguageChangeDetected, - [EnumMember(Value = "model-output")] - ModelOutput, + [EnumMember(Value = "model-output")]ModelOutput, - [EnumMember(Value = "phone-call-control")] - PhoneCallControl, + [EnumMember(Value = "phone-call-control")]PhoneCallControl, - [EnumMember(Value = "speech-update")] - SpeechUpdate, + [EnumMember(Value = "speech-update")]SpeechUpdate, - [EnumMember(Value = "status-update")] - StatusUpdate, + [EnumMember(Value = "status-update")]StatusUpdate, - [EnumMember(Value = "transcript")] - Transcript, + [EnumMember(Value = "transcript")]Transcript, - [EnumMember(Value = "transcript[transcriptType='final']")] - TranscriptTranscriptTypeFinal, + [EnumMember(Value = "transcript[transcriptType="final"]")]TranscriptTranscriptTypeFinal, - [EnumMember(Value = "tool-calls")] - ToolCalls, + [EnumMember(Value = "tool-calls")]ToolCalls, - [EnumMember(Value = "transfer-destination-request")] - TransferDestinationRequest, + [EnumMember(Value = "transfer-destination-request")]TransferDestinationRequest, - [EnumMember(Value = "transfer-update")] - TransferUpdate, + [EnumMember(Value = "transfer-update")]TransferUpdate, - [EnumMember(Value = "user-interrupted")] - UserInterrupted, + [EnumMember(Value = "user-interrupted")]UserInterrupted, - [EnumMember(Value = "voice-input")] - VoiceInput, + [EnumMember(Value = "voice-input")]VoiceInput } diff --git a/src/Vapi.Net/Types/CreateAzureOpenAiCredentialDtoModelsItem.cs b/src/Vapi.Net/Types/CreateAzureOpenAiCredentialDtoModelsItem.cs index 72f1898..e699c6a 100644 --- a/src/Vapi.Net/Types/CreateAzureOpenAiCredentialDtoModelsItem.cs +++ b/src/Vapi.Net/Types/CreateAzureOpenAiCredentialDtoModelsItem.cs @@ -7,18 +7,27 @@ namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] public enum CreateAzureOpenAiCredentialDtoModelsItem { + [EnumMember(Value = "gpt-4.1-2025-04-14")] + Gpt4120250414, + + [EnumMember(Value = "gpt-4.1-mini-2025-04-14")] + Gpt41Mini20250414, + + [EnumMember(Value = "gpt-4.1-nano-2025-04-14")] + Gpt41Nano20250414, + [EnumMember(Value = "gpt-4o-2024-11-20")] Gpt4O20241120, [EnumMember(Value = "gpt-4o-2024-08-06")] Gpt4O20240806, - [EnumMember(Value = "gpt-4o-mini-2024-07-18")] - Gpt4OMini20240718, - [EnumMember(Value = "gpt-4o-2024-05-13")] Gpt4O20240513, + [EnumMember(Value = "gpt-4o-mini-2024-07-18")] + Gpt4OMini20240718, + [EnumMember(Value = "gpt-4-turbo-2024-04-09")] Gpt4Turbo20240409, diff --git a/src/Vapi.Net/Types/CreateByoPhoneNumberDto.cs b/src/Vapi.Net/Types/CreateByoPhoneNumberDto.cs index 023f9ad..5620561 100644 --- a/src/Vapi.Net/Types/CreateByoPhoneNumberDto.cs +++ b/src/Vapi.Net/Types/CreateByoPhoneNumberDto.cs @@ -60,15 +60,23 @@ public record CreateByoPhoneNumberDto /// /// This is the assistant that will be used for incoming calls to this phone number. /// - /// If neither `assistantId` nor `squadId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected. + /// If neither `assistantId`, `squadId` nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected. /// [JsonPropertyName("assistantId")] public string? AssistantId { get; set; } + /// + /// This is the workflow that will be used for incoming calls to this phone number. + /// + /// If neither `assistantId`, `squadId`, nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected. + /// + [JsonPropertyName("workflowId")] + public string? WorkflowId { get; set; } + /// /// This is the squad that will be used for incoming calls to this phone number. /// - /// If neither `assistantId` nor `squadId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected. + /// If neither `assistantId`, `squadId`, nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected. /// [JsonPropertyName("squadId")] public string? SquadId { get; set; } diff --git a/src/Vapi.Net/Types/CreateGoHighLevelCalendarAvailabilityToolDto.cs b/src/Vapi.Net/Types/CreateGoHighLevelCalendarAvailabilityToolDto.cs new file mode 100644 index 0000000..403608e --- /dev/null +++ b/src/Vapi.Net/Types/CreateGoHighLevelCalendarAvailabilityToolDto.cs @@ -0,0 +1,64 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record CreateGoHighLevelCalendarAvailabilityToolDto +{ + /// + /// This determines if the tool is async. + /// + /// If async, the assistant will move forward without waiting for your server to respond. This is useful if you just want to trigger something on your server. + /// + /// If sync, the assistant will wait for your server to respond. This is useful if want assistant to respond with the result from your server. + /// + /// Defaults to synchronous (`false`). + /// + [JsonPropertyName("async")] + public bool? Async { get; set; } + + /// + /// These are the messages that will be spoken to the user as the tool is running. + /// + /// For some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured. + /// + [JsonPropertyName("messages")] + public IEnumerable? Messages { get; set; } + + /// + /// This is the function definition of the tool. + /// + /// For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + /// + /// An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + /// + [JsonPropertyName("function")] + public OpenAiFunction? Function { get; set; } + + /// + /// This is the server that will be hit when this tool is requested by the model. + /// + /// All requests will be sent with the call object among other things. You can find more details in the Server URL documentation. + /// + /// This overrides the serverUrl set on the org and the phoneNumber. Order of precedence: highest tool.server.url, then assistant.serverUrl, then phoneNumber.serverUrl, then org.serverUrl. + /// + [JsonPropertyName("server")] + public Server? Server { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/CreateGoHighLevelCalendarEventCreateToolDto.cs b/src/Vapi.Net/Types/CreateGoHighLevelCalendarEventCreateToolDto.cs new file mode 100644 index 0000000..bb824e5 --- /dev/null +++ b/src/Vapi.Net/Types/CreateGoHighLevelCalendarEventCreateToolDto.cs @@ -0,0 +1,64 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record CreateGoHighLevelCalendarEventCreateToolDto +{ + /// + /// This determines if the tool is async. + /// + /// If async, the assistant will move forward without waiting for your server to respond. This is useful if you just want to trigger something on your server. + /// + /// If sync, the assistant will wait for your server to respond. This is useful if want assistant to respond with the result from your server. + /// + /// Defaults to synchronous (`false`). + /// + [JsonPropertyName("async")] + public bool? Async { get; set; } + + /// + /// These are the messages that will be spoken to the user as the tool is running. + /// + /// For some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured. + /// + [JsonPropertyName("messages")] + public IEnumerable? Messages { get; set; } + + /// + /// This is the function definition of the tool. + /// + /// For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + /// + /// An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + /// + [JsonPropertyName("function")] + public OpenAiFunction? Function { get; set; } + + /// + /// This is the server that will be hit when this tool is requested by the model. + /// + /// All requests will be sent with the call object among other things. You can find more details in the Server URL documentation. + /// + /// This overrides the serverUrl set on the org and the phoneNumber. Order of precedence: highest tool.server.url, then assistant.serverUrl, then phoneNumber.serverUrl, then org.serverUrl. + /// + [JsonPropertyName("server")] + public Server? Server { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/CreateGoHighLevelContactCreateToolDto.cs b/src/Vapi.Net/Types/CreateGoHighLevelContactCreateToolDto.cs new file mode 100644 index 0000000..67d6467 --- /dev/null +++ b/src/Vapi.Net/Types/CreateGoHighLevelContactCreateToolDto.cs @@ -0,0 +1,64 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record CreateGoHighLevelContactCreateToolDto +{ + /// + /// This determines if the tool is async. + /// + /// If async, the assistant will move forward without waiting for your server to respond. This is useful if you just want to trigger something on your server. + /// + /// If sync, the assistant will wait for your server to respond. This is useful if want assistant to respond with the result from your server. + /// + /// Defaults to synchronous (`false`). + /// + [JsonPropertyName("async")] + public bool? Async { get; set; } + + /// + /// These are the messages that will be spoken to the user as the tool is running. + /// + /// For some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured. + /// + [JsonPropertyName("messages")] + public IEnumerable? Messages { get; set; } + + /// + /// This is the function definition of the tool. + /// + /// For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + /// + /// An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + /// + [JsonPropertyName("function")] + public OpenAiFunction? Function { get; set; } + + /// + /// This is the server that will be hit when this tool is requested by the model. + /// + /// All requests will be sent with the call object among other things. You can find more details in the Server URL documentation. + /// + /// This overrides the serverUrl set on the org and the phoneNumber. Order of precedence: highest tool.server.url, then assistant.serverUrl, then phoneNumber.serverUrl, then org.serverUrl. + /// + [JsonPropertyName("server")] + public Server? Server { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/CreateGoHighLevelContactGetToolDto.cs b/src/Vapi.Net/Types/CreateGoHighLevelContactGetToolDto.cs new file mode 100644 index 0000000..bb8c766 --- /dev/null +++ b/src/Vapi.Net/Types/CreateGoHighLevelContactGetToolDto.cs @@ -0,0 +1,64 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record CreateGoHighLevelContactGetToolDto +{ + /// + /// This determines if the tool is async. + /// + /// If async, the assistant will move forward without waiting for your server to respond. This is useful if you just want to trigger something on your server. + /// + /// If sync, the assistant will wait for your server to respond. This is useful if want assistant to respond with the result from your server. + /// + /// Defaults to synchronous (`false`). + /// + [JsonPropertyName("async")] + public bool? Async { get; set; } + + /// + /// These are the messages that will be spoken to the user as the tool is running. + /// + /// For some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured. + /// + [JsonPropertyName("messages")] + public IEnumerable? Messages { get; set; } + + /// + /// This is the function definition of the tool. + /// + /// For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + /// + /// An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + /// + [JsonPropertyName("function")] + public OpenAiFunction? Function { get; set; } + + /// + /// This is the server that will be hit when this tool is requested by the model. + /// + /// All requests will be sent with the call object among other things. You can find more details in the Server URL documentation. + /// + /// This overrides the serverUrl set on the org and the phoneNumber. Order of precedence: highest tool.server.url, then assistant.serverUrl, then phoneNumber.serverUrl, then org.serverUrl. + /// + [JsonPropertyName("server")] + public Server? Server { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/CreateGoHighLevelMcpCredentialDto.cs b/src/Vapi.Net/Types/CreateGoHighLevelMcpCredentialDto.cs new file mode 100644 index 0000000..d400671 --- /dev/null +++ b/src/Vapi.Net/Types/CreateGoHighLevelMcpCredentialDto.cs @@ -0,0 +1,36 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record CreateGoHighLevelMcpCredentialDto +{ + /// + /// This is the authentication session for the credential. + /// + [JsonPropertyName("authenticationSession")] + public required Oauth2AuthenticationSession AuthenticationSession { get; set; } + + /// + /// This is the name of credential. This is just for your reference. + /// + [JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/CreateOutboundCallDto.cs b/src/Vapi.Net/Types/CreateOutboundCallDto.cs index 792bb54..7a689fc 100644 --- a/src/Vapi.Net/Types/CreateOutboundCallDto.cs +++ b/src/Vapi.Net/Types/CreateOutboundCallDto.cs @@ -33,13 +33,23 @@ public record CreateOutboundCallDto public object? Transport { get; set; } /// - /// This is the assistant that will be used for the call. To use a transient assistant, use `assistant` instead. + /// This is the assistant ID that will be used for the call. To use a transient assistant, use `assistant` instead. + /// + /// To start a call with: + /// - Assistant, use `assistantId` or `assistant` + /// - Squad, use `squadId` or `squad` + /// - Workflow, use `workflowId` or `workflow` /// [JsonPropertyName("assistantId")] public string? AssistantId { get; set; } /// /// This is the assistant that will be used for the call. To use an existing assistant, use `assistantId` instead. + /// + /// To start a call with: + /// - Assistant, use `assistant` + /// - Squad, use `squad` + /// - Workflow, use `workflow` /// [JsonPropertyName("assistant")] public CreateAssistantDto? Assistant { get; set; } @@ -52,16 +62,52 @@ public record CreateOutboundCallDto /// /// This is the squad that will be used for the call. To use a transient squad, use `squad` instead. + /// + /// To start a call with: + /// - Assistant, use `assistant` or `assistantId` + /// - Squad, use `squad` or `squadId` + /// - Workflow, use `workflow` or `workflowId` /// [JsonPropertyName("squadId")] public string? SquadId { get; set; } /// /// This is a squad that will be used for the call. To use an existing squad, use `squadId` instead. + /// + /// To start a call with: + /// - Assistant, use `assistant` or `assistantId` + /// - Squad, use `squad` or `squadId` + /// - Workflow, use `workflow` or `workflowId` /// [JsonPropertyName("squad")] public CreateSquadDto? Squad { get; set; } + /// + /// [BETA] This feature is in active development. The API and behavior are subject to change as we refine it based on user feedback. + /// + /// This is the workflow that will be used for the call. To use a transient workflow, use `workflow` instead. + /// + /// To start a call with: + /// - Assistant, use `assistant` or `assistantId` + /// - Squad, use `squad` or `squadId` + /// - Workflow, use `workflow` or `workflowId` + /// + [JsonPropertyName("workflowId")] + public string? WorkflowId { get; set; } + + /// + /// [BETA] This feature is in active development. The API and behavior are subject to change as we refine it based on user feedback. + /// + /// This is a workflow that will be used for the call. To use an existing workflow, use `workflowId` instead. + /// + /// To start a call with: + /// - Assistant, use `assistant` or `assistantId` + /// - Squad, use `squad` or `squadId` + /// - Workflow, use `workflow` or `workflowId` + /// + [JsonPropertyName("workflow")] + public CreateWorkflowDto? Workflow { get; set; } + /// /// This is the phone number that will be used for the call. To use a transient number, use `phoneNumber` instead. /// diff --git a/src/Vapi.Net/Types/CreateSesameVoiceDto.cs b/src/Vapi.Net/Types/CreateSesameVoiceDto.cs new file mode 100644 index 0000000..3998f1f --- /dev/null +++ b/src/Vapi.Net/Types/CreateSesameVoiceDto.cs @@ -0,0 +1,36 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record CreateSesameVoiceDto +{ + /// + /// The name of the voice. + /// + [JsonPropertyName("voiceName")] + public string? VoiceName { get; set; } + + /// + /// The transcript of the utterance. + /// + [JsonPropertyName("transcription")] + public string? Transcription { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/CreateSmsSendToolDto.cs b/src/Vapi.Net/Types/CreateSmsToolDto.cs similarity index 98% rename from src/Vapi.Net/Types/CreateSmsSendToolDto.cs rename to src/Vapi.Net/Types/CreateSmsToolDto.cs index f2fcb0d..c1c3a02 100644 --- a/src/Vapi.Net/Types/CreateSmsSendToolDto.cs +++ b/src/Vapi.Net/Types/CreateSmsToolDto.cs @@ -4,7 +4,7 @@ namespace Vapi.Net; -public record CreateSmsSendToolDto +public record CreateSmsToolDto { /// /// This determines if the tool is async. diff --git a/src/Vapi.Net/Types/CreateTelnyxPhoneNumberDto.cs b/src/Vapi.Net/Types/CreateTelnyxPhoneNumberDto.cs index 76660f5..4022f5c 100644 --- a/src/Vapi.Net/Types/CreateTelnyxPhoneNumberDto.cs +++ b/src/Vapi.Net/Types/CreateTelnyxPhoneNumberDto.cs @@ -44,15 +44,23 @@ public record CreateTelnyxPhoneNumberDto /// /// This is the assistant that will be used for incoming calls to this phone number. /// - /// If neither `assistantId` nor `squadId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected. + /// If neither `assistantId`, `squadId` nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected. /// [JsonPropertyName("assistantId")] public string? AssistantId { get; set; } + /// + /// This is the workflow that will be used for incoming calls to this phone number. + /// + /// If neither `assistantId`, `squadId`, nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected. + /// + [JsonPropertyName("workflowId")] + public string? WorkflowId { get; set; } + /// /// This is the squad that will be used for incoming calls to this phone number. /// - /// If neither `assistantId` nor `squadId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected. + /// If neither `assistantId`, `squadId`, nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected. /// [JsonPropertyName("squadId")] public string? SquadId { get; set; } diff --git a/src/Vapi.Net/Types/CreateTwilioCredentialDto.cs b/src/Vapi.Net/Types/CreateTwilioCredentialDto.cs index c04af2e..782e3f1 100644 --- a/src/Vapi.Net/Types/CreateTwilioCredentialDto.cs +++ b/src/Vapi.Net/Types/CreateTwilioCredentialDto.cs @@ -10,7 +10,19 @@ public record CreateTwilioCredentialDto /// This is not returned in the API. /// [JsonPropertyName("authToken")] - public required string AuthToken { get; set; } + public string? AuthToken { get; set; } + + /// + /// This is not returned in the API. + /// + [JsonPropertyName("apiKey")] + public string? ApiKey { get; set; } + + /// + /// This is not returned in the API. + /// + [JsonPropertyName("apiSecret")] + public string? ApiSecret { get; set; } [JsonPropertyName("accountSid")] public required string AccountSid { get; set; } diff --git a/src/Vapi.Net/Types/CreateTwilioPhoneNumberDto.cs b/src/Vapi.Net/Types/CreateTwilioPhoneNumberDto.cs index 6168a16..32d8eb8 100644 --- a/src/Vapi.Net/Types/CreateTwilioPhoneNumberDto.cs +++ b/src/Vapi.Net/Types/CreateTwilioPhoneNumberDto.cs @@ -23,6 +23,17 @@ public record CreateTwilioPhoneNumberDto [JsonPropertyName("hooks")] public IEnumerable? Hooks { get; set; } + /// + /// Controls whether Vapi sets the messaging webhook URL on the Twilio number during import. + /// + /// If set to `false`, Vapi will not update the Twilio messaging URL, leaving it as is. + /// If `true` or omitted (default), Vapi will configure both the voice and messaging URLs. + /// + /// @default true + /// + [JsonPropertyName("smsEnabled")] + public bool? SmsEnabled { get; set; } + /// /// These are the digits of the phone number you own on your Twilio. /// @@ -39,7 +50,19 @@ public record CreateTwilioPhoneNumberDto /// This is the Twilio Auth Token for the phone number. /// [JsonPropertyName("twilioAuthToken")] - public required string TwilioAuthToken { get; set; } + public string? TwilioAuthToken { get; set; } + + /// + /// This is the Twilio API Key for the phone number. + /// + [JsonPropertyName("twilioApiKey")] + public string? TwilioApiKey { get; set; } + + /// + /// This is the Twilio API Secret for the phone number. + /// + [JsonPropertyName("twilioApiSecret")] + public string? TwilioApiSecret { get; set; } /// /// This is the name of the phone number. This is just for your own reference. @@ -50,15 +73,23 @@ public record CreateTwilioPhoneNumberDto /// /// This is the assistant that will be used for incoming calls to this phone number. /// - /// If neither `assistantId` nor `squadId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected. + /// If neither `assistantId`, `squadId` nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected. /// [JsonPropertyName("assistantId")] public string? AssistantId { get; set; } + /// + /// This is the workflow that will be used for incoming calls to this phone number. + /// + /// If neither `assistantId`, `squadId`, nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected. + /// + [JsonPropertyName("workflowId")] + public string? WorkflowId { get; set; } + /// /// This is the squad that will be used for incoming calls to this phone number. /// - /// If neither `assistantId` nor `squadId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected. + /// If neither `assistantId`, `squadId`, nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected. /// [JsonPropertyName("squadId")] public string? SquadId { get; set; } diff --git a/src/Vapi.Net/Types/CreateVapiPhoneNumberDto.cs b/src/Vapi.Net/Types/CreateVapiPhoneNumberDto.cs index 16cc19d..dbff230 100644 --- a/src/Vapi.Net/Types/CreateVapiPhoneNumberDto.cs +++ b/src/Vapi.Net/Types/CreateVapiPhoneNumberDto.cs @@ -54,15 +54,23 @@ public record CreateVapiPhoneNumberDto /// /// This is the assistant that will be used for incoming calls to this phone number. /// - /// If neither `assistantId` nor `squadId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected. + /// If neither `assistantId`, `squadId` nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected. /// [JsonPropertyName("assistantId")] public string? AssistantId { get; set; } + /// + /// This is the workflow that will be used for incoming calls to this phone number. + /// + /// If neither `assistantId`, `squadId`, nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected. + /// + [JsonPropertyName("workflowId")] + public string? WorkflowId { get; set; } + /// /// This is the squad that will be used for incoming calls to this phone number. /// - /// If neither `assistantId` nor `squadId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected. + /// If neither `assistantId`, `squadId`, nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected. /// [JsonPropertyName("squadId")] public string? SquadId { get; set; } diff --git a/src/Vapi.Net/Types/CreateVoicemailToolDto.cs b/src/Vapi.Net/Types/CreateVoicemailToolDto.cs index 6cf830e..664b789 100644 --- a/src/Vapi.Net/Types/CreateVoicemailToolDto.cs +++ b/src/Vapi.Net/Types/CreateVoicemailToolDto.cs @@ -26,6 +26,12 @@ public record CreateVoicemailToolDto [JsonPropertyName("messages")] public IEnumerable? Messages { get; set; } + /// + /// The type of tool. "voicemail". This uses the model itself to determine if a voicemil was reached. Can be used alternatively/alongside with TwilioVoicemailDetection + /// + [JsonPropertyName("type")] + public string Type { get; set; } = "voicemail"; + /// /// This is the function definition of the tool. /// diff --git a/src/Vapi.Net/Types/CreateVonagePhoneNumberDto.cs b/src/Vapi.Net/Types/CreateVonagePhoneNumberDto.cs index 1f02300..96a8f40 100644 --- a/src/Vapi.Net/Types/CreateVonagePhoneNumberDto.cs +++ b/src/Vapi.Net/Types/CreateVonagePhoneNumberDto.cs @@ -44,15 +44,23 @@ public record CreateVonagePhoneNumberDto /// /// This is the assistant that will be used for incoming calls to this phone number. /// - /// If neither `assistantId` nor `squadId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected. + /// If neither `assistantId`, `squadId` nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected. /// [JsonPropertyName("assistantId")] public string? AssistantId { get; set; } + /// + /// This is the workflow that will be used for incoming calls to this phone number. + /// + /// If neither `assistantId`, `squadId`, nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected. + /// + [JsonPropertyName("workflowId")] + public string? WorkflowId { get; set; } + /// /// This is the squad that will be used for incoming calls to this phone number. /// - /// If neither `assistantId` nor `squadId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected. + /// If neither `assistantId`, `squadId`, nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected. /// [JsonPropertyName("squadId")] public string? SquadId { get; set; } diff --git a/src/Vapi.Net/Types/CreateWebCallDto.cs b/src/Vapi.Net/Types/CreateWebCallDto.cs index 839b529..3e8576d 100644 --- a/src/Vapi.Net/Types/CreateWebCallDto.cs +++ b/src/Vapi.Net/Types/CreateWebCallDto.cs @@ -7,13 +7,23 @@ namespace Vapi.Net; public record CreateWebCallDto { /// - /// This is the assistant that will be used for the call. To use a transient assistant, use `assistant` instead. + /// This is the assistant ID that will be used for the call. To use a transient assistant, use `assistant` instead. + /// + /// To start a call with: + /// - Assistant, use `assistantId` or `assistant` + /// - Squad, use `squadId` or `squad` + /// - Workflow, use `workflowId` or `workflow` /// [JsonPropertyName("assistantId")] public string? AssistantId { get; set; } /// /// This is the assistant that will be used for the call. To use an existing assistant, use `assistantId` instead. + /// + /// To start a call with: + /// - Assistant, use `assistant` + /// - Squad, use `squad` + /// - Workflow, use `workflow` /// [JsonPropertyName("assistant")] public CreateAssistantDto? Assistant { get; set; } @@ -26,16 +36,52 @@ public record CreateWebCallDto /// /// This is the squad that will be used for the call. To use a transient squad, use `squad` instead. + /// + /// To start a call with: + /// - Assistant, use `assistant` or `assistantId` + /// - Squad, use `squad` or `squadId` + /// - Workflow, use `workflow` or `workflowId` /// [JsonPropertyName("squadId")] public string? SquadId { get; set; } /// /// This is a squad that will be used for the call. To use an existing squad, use `squadId` instead. + /// + /// To start a call with: + /// - Assistant, use `assistant` or `assistantId` + /// - Squad, use `squad` or `squadId` + /// - Workflow, use `workflow` or `workflowId` /// [JsonPropertyName("squad")] public CreateSquadDto? Squad { get; set; } + /// + /// [BETA] This feature is in active development. The API and behavior are subject to change as we refine it based on user feedback. + /// + /// This is the workflow that will be used for the call. To use a transient workflow, use `workflow` instead. + /// + /// To start a call with: + /// - Assistant, use `assistant` or `assistantId` + /// - Squad, use `squad` or `squadId` + /// - Workflow, use `workflow` or `workflowId` + /// + [JsonPropertyName("workflowId")] + public string? WorkflowId { get; set; } + + /// + /// [BETA] This feature is in active development. The API and behavior are subject to change as we refine it based on user feedback. + /// + /// This is a workflow that will be used for the call. To use an existing workflow, use `workflowId` instead. + /// + /// To start a call with: + /// - Assistant, use `assistant` or `assistantId` + /// - Squad, use `squad` or `squadId` + /// - Workflow, use `workflow` or `workflowId` + /// + [JsonPropertyName("workflow")] + public CreateWorkflowDto? Workflow { get; set; } + /// /// Additional properties received from the response, if any. /// diff --git a/src/Vapi.Net/Types/CustomVoice.cs b/src/Vapi.Net/Types/CustomVoice.cs index f6e06e3..ad893cc 100644 --- a/src/Vapi.Net/Types/CustomVoice.cs +++ b/src/Vapi.Net/Types/CustomVoice.cs @@ -6,6 +6,12 @@ namespace Vapi.Net; public record CustomVoice { + /// + /// This is the flag to toggle voice caching for the assistant. + /// + [JsonPropertyName("cachingEnabled")] + public bool? CachingEnabled { get; set; } + /// /// This is the plan for chunking the model output before it is sent to the voice provider. /// diff --git a/src/Vapi.Net/Types/DeepgramVoice.cs b/src/Vapi.Net/Types/DeepgramVoice.cs index b35266b..f387849 100644 --- a/src/Vapi.Net/Types/DeepgramVoice.cs +++ b/src/Vapi.Net/Types/DeepgramVoice.cs @@ -6,6 +6,12 @@ namespace Vapi.Net; public record DeepgramVoice { + /// + /// This is the flag to toggle voice caching for the assistant. + /// + [JsonPropertyName("cachingEnabled")] + public bool? CachingEnabled { get; set; } + /// /// This is the provider-specific ID that will be used. /// diff --git a/src/Vapi.Net/Types/ElevenLabsVoice.cs b/src/Vapi.Net/Types/ElevenLabsVoice.cs index ae074a6..caa60b1 100644 --- a/src/Vapi.Net/Types/ElevenLabsVoice.cs +++ b/src/Vapi.Net/Types/ElevenLabsVoice.cs @@ -7,6 +7,12 @@ namespace Vapi.Net; public record ElevenLabsVoice { + /// + /// This is the flag to toggle voice caching for the assistant. + /// + [JsonPropertyName("cachingEnabled")] + public bool? CachingEnabled { get; set; } + /// /// This is the provider-specific ID that will be used. Ensure the Voice is present in your 11Labs Voice Library. /// diff --git a/src/Vapi.Net/Types/FallbackAzureVoice.cs b/src/Vapi.Net/Types/FallbackAzureVoice.cs index 3d45d6b..a235bab 100644 --- a/src/Vapi.Net/Types/FallbackAzureVoice.cs +++ b/src/Vapi.Net/Types/FallbackAzureVoice.cs @@ -7,6 +7,12 @@ namespace Vapi.Net; public record FallbackAzureVoice { + /// + /// This is the flag to toggle voice caching for the assistant. + /// + [JsonPropertyName("cachingEnabled")] + public bool? CachingEnabled { get; set; } + /// /// This is the provider-specific ID that will be used. /// diff --git a/src/Vapi.Net/Types/FallbackCartesiaVoice.cs b/src/Vapi.Net/Types/FallbackCartesiaVoice.cs index 2dee560..4b2535d 100644 --- a/src/Vapi.Net/Types/FallbackCartesiaVoice.cs +++ b/src/Vapi.Net/Types/FallbackCartesiaVoice.cs @@ -6,6 +6,12 @@ namespace Vapi.Net; public record FallbackCartesiaVoice { + /// + /// This is the flag to toggle voice caching for the assistant. + /// + [JsonPropertyName("cachingEnabled")] + public bool? CachingEnabled { get; set; } + /// /// The ID of the particular voice you want to use. /// diff --git a/src/Vapi.Net/Types/FallbackCustomVoice.cs b/src/Vapi.Net/Types/FallbackCustomVoice.cs index 3250599..788adc4 100644 --- a/src/Vapi.Net/Types/FallbackCustomVoice.cs +++ b/src/Vapi.Net/Types/FallbackCustomVoice.cs @@ -6,6 +6,12 @@ namespace Vapi.Net; public record FallbackCustomVoice { + /// + /// This is the flag to toggle voice caching for the assistant. + /// + [JsonPropertyName("cachingEnabled")] + public bool? CachingEnabled { get; set; } + /// /// This is where the voice request will be sent. /// diff --git a/src/Vapi.Net/Types/FallbackDeepgramVoice.cs b/src/Vapi.Net/Types/FallbackDeepgramVoice.cs index eda4712..ad6fe78 100644 --- a/src/Vapi.Net/Types/FallbackDeepgramVoice.cs +++ b/src/Vapi.Net/Types/FallbackDeepgramVoice.cs @@ -6,6 +6,12 @@ namespace Vapi.Net; public record FallbackDeepgramVoice { + /// + /// This is the flag to toggle voice caching for the assistant. + /// + [JsonPropertyName("cachingEnabled")] + public bool? CachingEnabled { get; set; } + /// /// This is the provider-specific ID that will be used. /// diff --git a/src/Vapi.Net/Types/FallbackElevenLabsVoice.cs b/src/Vapi.Net/Types/FallbackElevenLabsVoice.cs index b50c2d7..50c085e 100644 --- a/src/Vapi.Net/Types/FallbackElevenLabsVoice.cs +++ b/src/Vapi.Net/Types/FallbackElevenLabsVoice.cs @@ -7,6 +7,12 @@ namespace Vapi.Net; public record FallbackElevenLabsVoice { + /// + /// This is the flag to toggle voice caching for the assistant. + /// + [JsonPropertyName("cachingEnabled")] + public bool? CachingEnabled { get; set; } + /// /// This is the provider-specific ID that will be used. Ensure the Voice is present in your 11Labs Voice Library. /// diff --git a/src/Vapi.Net/Types/FallbackGoogleTranscriberModel.cs b/src/Vapi.Net/Types/FallbackGoogleTranscriberModel.cs index 1bcdfcd..fb37e48 100644 --- a/src/Vapi.Net/Types/FallbackGoogleTranscriberModel.cs +++ b/src/Vapi.Net/Types/FallbackGoogleTranscriberModel.cs @@ -7,6 +7,12 @@ namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] public enum FallbackGoogleTranscriberModel { + [EnumMember(Value = "gemini-2.5-pro-preview-05-06")] + Gemini25ProPreview0506, + + [EnumMember(Value = "gemini-2.5-flash-preview-04-17")] + Gemini25FlashPreview0417, + [EnumMember(Value = "gemini-2.0-flash-thinking-exp")] Gemini20FlashThinkingExp, diff --git a/src/Vapi.Net/Types/FallbackHumeVoice.cs b/src/Vapi.Net/Types/FallbackHumeVoice.cs index 95e101a..9713aa0 100644 --- a/src/Vapi.Net/Types/FallbackHumeVoice.cs +++ b/src/Vapi.Net/Types/FallbackHumeVoice.cs @@ -6,6 +6,12 @@ namespace Vapi.Net; public record FallbackHumeVoice { + /// + /// This is the flag to toggle voice caching for the assistant. + /// + [JsonPropertyName("cachingEnabled")] + public bool? CachingEnabled { get; set; } + /// /// This is the model that will be used. /// diff --git a/src/Vapi.Net/Types/FallbackLmntVoice.cs b/src/Vapi.Net/Types/FallbackLmntVoice.cs index 774c285..a5c4eb3 100644 --- a/src/Vapi.Net/Types/FallbackLmntVoice.cs +++ b/src/Vapi.Net/Types/FallbackLmntVoice.cs @@ -7,6 +7,12 @@ namespace Vapi.Net; public record FallbackLmntVoice { + /// + /// This is the flag to toggle voice caching for the assistant. + /// + [JsonPropertyName("cachingEnabled")] + public bool? CachingEnabled { get; set; } + /// /// This is the provider-specific ID that will be used. /// diff --git a/src/Vapi.Net/Types/FallbackNeuphonicVoice.cs b/src/Vapi.Net/Types/FallbackNeuphonicVoice.cs index fd6dd15..299f6c2 100644 --- a/src/Vapi.Net/Types/FallbackNeuphonicVoice.cs +++ b/src/Vapi.Net/Types/FallbackNeuphonicVoice.cs @@ -6,6 +6,12 @@ namespace Vapi.Net; public record FallbackNeuphonicVoice { + /// + /// This is the flag to toggle voice caching for the assistant. + /// + [JsonPropertyName("cachingEnabled")] + public bool? CachingEnabled { get; set; } + /// /// This is the voice provider that will be used. /// diff --git a/src/Vapi.Net/Types/FallbackOpenAiVoice.cs b/src/Vapi.Net/Types/FallbackOpenAiVoice.cs index 331c811..5e8b2a7 100644 --- a/src/Vapi.Net/Types/FallbackOpenAiVoice.cs +++ b/src/Vapi.Net/Types/FallbackOpenAiVoice.cs @@ -7,6 +7,12 @@ namespace Vapi.Net; public record FallbackOpenAiVoice { + /// + /// This is the flag to toggle voice caching for the assistant. + /// + [JsonPropertyName("cachingEnabled")] + public bool? CachingEnabled { get; set; } + /// /// This is the provider-specific ID that will be used. /// Please note that ash, ballad, coral, sage, and verse may only be used with realtime models. diff --git a/src/Vapi.Net/Types/FallbackPlayHtVoice.cs b/src/Vapi.Net/Types/FallbackPlayHtVoice.cs index e808d23..c0fe1c8 100644 --- a/src/Vapi.Net/Types/FallbackPlayHtVoice.cs +++ b/src/Vapi.Net/Types/FallbackPlayHtVoice.cs @@ -7,6 +7,12 @@ namespace Vapi.Net; public record FallbackPlayHtVoice { + /// + /// This is the flag to toggle voice caching for the assistant. + /// + [JsonPropertyName("cachingEnabled")] + public bool? CachingEnabled { get; set; } + /// /// This is the provider-specific ID that will be used. /// diff --git a/src/Vapi.Net/Types/FallbackRimeAiVoice.cs b/src/Vapi.Net/Types/FallbackRimeAiVoice.cs index 1b5d45b..bb4f004 100644 --- a/src/Vapi.Net/Types/FallbackRimeAiVoice.cs +++ b/src/Vapi.Net/Types/FallbackRimeAiVoice.cs @@ -7,6 +7,12 @@ namespace Vapi.Net; public record FallbackRimeAiVoice { + /// + /// This is the flag to toggle voice caching for the assistant. + /// + [JsonPropertyName("cachingEnabled")] + public bool? CachingEnabled { get; set; } + /// /// This is the provider-specific ID that will be used. /// @@ -26,7 +32,7 @@ public record FallbackRimeAiVoice public double? Speed { get; set; } /// - /// This is a flag that controls whether to add slight pauses using angle brackets. Example: “Hi. <200> I’d love to have a conversation with you.” adds a 200ms pause between the first and second sentences. + /// This is a flag that controls whether to add slight pauses using angle brackets. Example: "Hi. <200> I'd love to have a conversation with you." adds a 200ms pause between the first and second sentences. /// [JsonPropertyName("pauseBetweenBrackets")] public bool? PauseBetweenBrackets { get; set; } diff --git a/src/Vapi.Net/Types/FallbackSesameVoice.cs b/src/Vapi.Net/Types/FallbackSesameVoice.cs new file mode 100644 index 0000000..6f82b13 --- /dev/null +++ b/src/Vapi.Net/Types/FallbackSesameVoice.cs @@ -0,0 +1,54 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record FallbackSesameVoice +{ + /// + /// This is the flag to toggle voice caching for the assistant. + /// + [JsonPropertyName("cachingEnabled")] + public bool? CachingEnabled { get; set; } + + /// + /// This is the voice provider that will be used. + /// + [JsonPropertyName("provider")] + public string Provider { get; set; } = "sesame"; + + /// + /// This is the provider-specific ID that will be used. + /// + [JsonPropertyName("voiceId")] + public required string VoiceId { get; set; } + + /// + /// This is the model that will be used. + /// + [JsonPropertyName("model")] + public string Model { get; set; } = "csm-1b"; + + /// + /// This is the plan for chunking the model output before it is sent to the voice provider. + /// + [JsonPropertyName("chunkPlan")] + public ChunkPlan? ChunkPlan { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/FallbackSmallestAiVoice.cs b/src/Vapi.Net/Types/FallbackSmallestAiVoice.cs index 8d32012..f8a795c 100644 --- a/src/Vapi.Net/Types/FallbackSmallestAiVoice.cs +++ b/src/Vapi.Net/Types/FallbackSmallestAiVoice.cs @@ -7,6 +7,12 @@ namespace Vapi.Net; public record FallbackSmallestAiVoice { + /// + /// This is the flag to toggle voice caching for the assistant. + /// + [JsonPropertyName("cachingEnabled")] + public bool? CachingEnabled { get; set; } + /// /// This is the provider-specific ID that will be used. /// diff --git a/src/Vapi.Net/Types/FallbackTavusVoice.cs b/src/Vapi.Net/Types/FallbackTavusVoice.cs index 02e580c..3128e58 100644 --- a/src/Vapi.Net/Types/FallbackTavusVoice.cs +++ b/src/Vapi.Net/Types/FallbackTavusVoice.cs @@ -7,6 +7,12 @@ namespace Vapi.Net; public record FallbackTavusVoice { + /// + /// This is the flag to toggle voice caching for the assistant. + /// + [JsonPropertyName("cachingEnabled")] + public bool? CachingEnabled { get; set; } + /// /// This is the provider-specific ID that will be used. /// diff --git a/src/Vapi.Net/Types/FallbackVapiVoice.cs b/src/Vapi.Net/Types/FallbackVapiVoice.cs index b8be6e9..dc8e610 100644 --- a/src/Vapi.Net/Types/FallbackVapiVoice.cs +++ b/src/Vapi.Net/Types/FallbackVapiVoice.cs @@ -6,6 +6,12 @@ namespace Vapi.Net; public record FallbackVapiVoice { + /// + /// This is the flag to toggle voice caching for the assistant. + /// + [JsonPropertyName("cachingEnabled")] + public bool? CachingEnabled { get; set; } + /// /// The voices provided by Vapi /// diff --git a/src/Vapi.Net/Types/FallbackVapiVoiceVoiceId.cs b/src/Vapi.Net/Types/FallbackVapiVoiceVoiceId.cs index 7a9f489..67df42e 100644 --- a/src/Vapi.Net/Types/FallbackVapiVoiceVoiceId.cs +++ b/src/Vapi.Net/Types/FallbackVapiVoiceVoiceId.cs @@ -10,6 +10,9 @@ public enum FallbackVapiVoiceVoiceId [EnumMember(Value = "Elliot")] Elliot, + [EnumMember(Value = "Kylie")] + Kylie, + [EnumMember(Value = "Rohan")] Rohan, diff --git a/src/Vapi.Net/Types/FormatPlanFormattersEnabledItem.cs b/src/Vapi.Net/Types/FormatPlanFormattersEnabledItem.cs index 562810c..eb51d17 100644 --- a/src/Vapi.Net/Types/FormatPlanFormattersEnabledItem.cs +++ b/src/Vapi.Net/Types/FormatPlanFormattersEnabledItem.cs @@ -54,4 +54,7 @@ public enum FormatPlanFormattersEnabledItem [EnumMember(Value = "number")] Number, + + [EnumMember(Value = "stripAsterisk")] + StripAsterisk, } diff --git a/src/Vapi.Net/Types/FunctionCallAssistantHookAction.cs b/src/Vapi.Net/Types/FunctionCallAssistantHookAction.cs new file mode 100644 index 0000000..f46421c --- /dev/null +++ b/src/Vapi.Net/Types/FunctionCallAssistantHookAction.cs @@ -0,0 +1,64 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record FunctionCallAssistantHookAction +{ + /// + /// This determines if the tool is async. + /// + /// If async, the assistant will move forward without waiting for your server to respond. This is useful if you just want to trigger something on your server. + /// + /// If sync, the assistant will wait for your server to respond. This is useful if want assistant to respond with the result from your server. + /// + /// Defaults to synchronous (`false`). + /// + [JsonPropertyName("async")] + public bool? Async { get; set; } + + /// + /// These are the messages that will be spoken to the user as the tool is running. + /// + /// For some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured. + /// + [JsonPropertyName("messages")] + public IEnumerable? Messages { get; set; } + + /// + /// This is the function definition of the tool. + /// + /// For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + /// + /// An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + /// + [JsonPropertyName("function")] + public OpenAiFunction? Function { get; set; } + + /// + /// This is the server that will be hit when this tool is requested by the model. + /// + /// All requests will be sent with the call object among other things. You can find more details in the Server URL documentation. + /// + /// This overrides the serverUrl set on the org and the phoneNumber. Order of precedence: highest tool.server.url, then assistant.serverUrl, then phoneNumber.serverUrl, then org.serverUrl. + /// + [JsonPropertyName("server")] + public Server? Server { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/Gather.cs b/src/Vapi.Net/Types/Gather.cs deleted file mode 100644 index 8840ebe..0000000 --- a/src/Vapi.Net/Types/Gather.cs +++ /dev/null @@ -1,62 +0,0 @@ -using System.Text.Json; -using System.Text.Json.Serialization; -using Vapi.Net.Core; - -namespace Vapi.Net; - -public record Gather -{ - [JsonPropertyName("output")] - public required JsonSchema Output { get; set; } - - /// - /// This is whether or not the workflow should read back the gathered data to the user, and ask about its correctness. - /// - [JsonPropertyName("confirmContent")] - public bool? ConfirmContent { get; set; } - - /// - /// This is a list of hooks for a task. - /// Each hook is a list of tasks to run on a trigger (such as on start, on failure, etc). - /// Only Say is supported for now. - /// - [JsonPropertyName("hooks")] - public IEnumerable? Hooks { get; set; } - - /// - /// This is the number of times we should try to gather the information from the user before we failover to the fail path. An example of this would be a user refusing to give their phone number for privacy reasons, and then going down a different path on account of this - /// - [JsonPropertyName("maxRetries")] - public double? MaxRetries { get; set; } - - /// - /// This is a liquid templating string. On the first call to Gather, the template will be filled out with variables from the context, and will be spoken verbatim to the user. An example would be "Base on your zipcode, it looks like you could be in one of these counties: {{ counties | join: ", " }}. Which one do you live in?" - /// - [JsonPropertyName("literalTemplate")] - public string? LiteralTemplate { get; set; } - - [JsonPropertyName("name")] - public required string Name { get; set; } - - /// - /// This is for metadata you want to store on the task. - /// - [JsonPropertyName("metadata")] - public object? Metadata { get; set; } - - /// - /// Additional properties received from the response, if any. - /// - /// - /// [EXPERIMENTAL] This API is experimental and may change in future releases. - /// - [JsonExtensionData] - public IDictionary AdditionalProperties { get; internal set; } = - new Dictionary(); - - /// - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Vapi.Net/Types/GlobalNodePlan.cs b/src/Vapi.Net/Types/GlobalNodePlan.cs new file mode 100644 index 0000000..fe9364a --- /dev/null +++ b/src/Vapi.Net/Types/GlobalNodePlan.cs @@ -0,0 +1,40 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record GlobalNodePlan +{ + /// + /// This is the flag to determine if this node is a global node + /// + /// @default false + /// + [JsonPropertyName("enabled")] + public bool? Enabled { get; set; } + + /// + /// This is the condition that will be checked to determine if the global node should be executed. + /// + /// @default '' + /// + [JsonPropertyName("enterCondition")] + public string? EnterCondition { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/GoHighLevelCalendarAvailabilityTool.cs b/src/Vapi.Net/Types/GoHighLevelCalendarAvailabilityTool.cs new file mode 100644 index 0000000..444ba0a --- /dev/null +++ b/src/Vapi.Net/Types/GoHighLevelCalendarAvailabilityTool.cs @@ -0,0 +1,88 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record GoHighLevelCalendarAvailabilityTool +{ + /// + /// This determines if the tool is async. + /// + /// If async, the assistant will move forward without waiting for your server to respond. This is useful if you just want to trigger something on your server. + /// + /// If sync, the assistant will wait for your server to respond. This is useful if want assistant to respond with the result from your server. + /// + /// Defaults to synchronous (`false`). + /// + [JsonPropertyName("async")] + public bool? Async { get; set; } + + /// + /// These are the messages that will be spoken to the user as the tool is running. + /// + /// For some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured. + /// + [JsonPropertyName("messages")] + public IEnumerable? Messages { get; set; } + + /// + /// This is the unique identifier for the tool. + /// + [JsonPropertyName("id")] + public required string Id { get; set; } + + /// + /// This is the unique identifier for the organization that this tool belongs to. + /// + [JsonPropertyName("orgId")] + public required string OrgId { get; set; } + + /// + /// This is the ISO 8601 date-time string of when the tool was created. + /// + [JsonPropertyName("createdAt")] + public required DateTime CreatedAt { get; set; } + + /// + /// This is the ISO 8601 date-time string of when the tool was last updated. + /// + [JsonPropertyName("updatedAt")] + public required DateTime UpdatedAt { get; set; } + + /// + /// This is the function definition of the tool. + /// + /// For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + /// + /// An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + /// + [JsonPropertyName("function")] + public OpenAiFunction? Function { get; set; } + + /// + /// This is the server that will be hit when this tool is requested by the model. + /// + /// All requests will be sent with the call object among other things. You can find more details in the Server URL documentation. + /// + /// This overrides the serverUrl set on the org and the phoneNumber. Order of precedence: highest tool.server.url, then assistant.serverUrl, then phoneNumber.serverUrl, then org.serverUrl. + /// + [JsonPropertyName("server")] + public Server? Server { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/SayHook.cs b/src/Vapi.Net/Types/GoHighLevelCalendarAvailabilityToolProviderDetails.cs similarity index 63% rename from src/Vapi.Net/Types/SayHook.cs rename to src/Vapi.Net/Types/GoHighLevelCalendarAvailabilityToolProviderDetails.cs index 2524c4e..bc8cde2 100644 --- a/src/Vapi.Net/Types/SayHook.cs +++ b/src/Vapi.Net/Types/GoHighLevelCalendarAvailabilityToolProviderDetails.cs @@ -4,22 +4,16 @@ namespace Vapi.Net; -public record SayHook +public record GoHighLevelCalendarAvailabilityToolProviderDetails { - [JsonPropertyName("type")] - public string Type { get; set; } = "say"; - /// - /// This is for metadata you want to store on the task. + /// This is the Template URL or the Snapshot URL corresponding to the Template. /// - [JsonPropertyName("metadata")] - public object? Metadata { get; set; } - - [JsonPropertyName("exact")] - public string? Exact { get; set; } + [JsonPropertyName("templateUrl")] + public string? TemplateUrl { get; set; } - [JsonPropertyName("prompt")] - public string? Prompt { get; set; } + [JsonPropertyName("setupInstructions")] + public IEnumerable? SetupInstructions { get; set; } /// /// Additional properties received from the response, if any. diff --git a/src/Vapi.Net/Types/GoHighLevelCalendarAvailabilityToolWithToolCall.cs b/src/Vapi.Net/Types/GoHighLevelCalendarAvailabilityToolWithToolCall.cs new file mode 100644 index 0000000..2cd74cf --- /dev/null +++ b/src/Vapi.Net/Types/GoHighLevelCalendarAvailabilityToolWithToolCall.cs @@ -0,0 +1,73 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record GoHighLevelCalendarAvailabilityToolWithToolCall +{ + /// + /// This determines if the tool is async. + /// + /// If async, the assistant will move forward without waiting for your server to respond. This is useful if you just want to trigger something on your server. + /// + /// If sync, the assistant will wait for your server to respond. This is useful if want assistant to respond with the result from your server. + /// + /// Defaults to synchronous (`false`). + /// + [JsonPropertyName("async")] + public bool? Async { get; set; } + + /// + /// These are the messages that will be spoken to the user as the tool is running. + /// + /// For some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured. + /// + [JsonPropertyName("messages")] + public IEnumerable? Messages { get; set; } + + /// + /// The type of tool. "gohighlevel.calendar.availability.check" for GoHighLevel Calendar availability check tool. + /// + [JsonPropertyName("type")] + public string Type { get; set; } = "gohighlevel.calendar.availability.check"; + + [JsonPropertyName("toolCall")] + public required ToolCall ToolCall { get; set; } + + /// + /// This is the function definition of the tool. + /// + /// For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + /// + /// An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + /// + [JsonPropertyName("function")] + public OpenAiFunction? Function { get; set; } + + /// + /// This is the server that will be hit when this tool is requested by the model. + /// + /// All requests will be sent with the call object among other things. You can find more details in the Server URL documentation. + /// + /// This overrides the serverUrl set on the org and the phoneNumber. Order of precedence: highest tool.server.url, then assistant.serverUrl, then phoneNumber.serverUrl, then org.serverUrl. + /// + [JsonPropertyName("server")] + public Server? Server { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/GoHighLevelCalendarEventCreateTool.cs b/src/Vapi.Net/Types/GoHighLevelCalendarEventCreateTool.cs new file mode 100644 index 0000000..1efdf01 --- /dev/null +++ b/src/Vapi.Net/Types/GoHighLevelCalendarEventCreateTool.cs @@ -0,0 +1,88 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record GoHighLevelCalendarEventCreateTool +{ + /// + /// This determines if the tool is async. + /// + /// If async, the assistant will move forward without waiting for your server to respond. This is useful if you just want to trigger something on your server. + /// + /// If sync, the assistant will wait for your server to respond. This is useful if want assistant to respond with the result from your server. + /// + /// Defaults to synchronous (`false`). + /// + [JsonPropertyName("async")] + public bool? Async { get; set; } + + /// + /// These are the messages that will be spoken to the user as the tool is running. + /// + /// For some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured. + /// + [JsonPropertyName("messages")] + public IEnumerable? Messages { get; set; } + + /// + /// This is the unique identifier for the tool. + /// + [JsonPropertyName("id")] + public required string Id { get; set; } + + /// + /// This is the unique identifier for the organization that this tool belongs to. + /// + [JsonPropertyName("orgId")] + public required string OrgId { get; set; } + + /// + /// This is the ISO 8601 date-time string of when the tool was created. + /// + [JsonPropertyName("createdAt")] + public required DateTime CreatedAt { get; set; } + + /// + /// This is the ISO 8601 date-time string of when the tool was last updated. + /// + [JsonPropertyName("updatedAt")] + public required DateTime UpdatedAt { get; set; } + + /// + /// This is the function definition of the tool. + /// + /// For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + /// + /// An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + /// + [JsonPropertyName("function")] + public OpenAiFunction? Function { get; set; } + + /// + /// This is the server that will be hit when this tool is requested by the model. + /// + /// All requests will be sent with the call object among other things. You can find more details in the Server URL documentation. + /// + /// This overrides the serverUrl set on the org and the phoneNumber. Order of precedence: highest tool.server.url, then assistant.serverUrl, then phoneNumber.serverUrl, then org.serverUrl. + /// + [JsonPropertyName("server")] + public Server? Server { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/GoHighLevelCalendarEventCreateToolProviderDetails.cs b/src/Vapi.Net/Types/GoHighLevelCalendarEventCreateToolProviderDetails.cs new file mode 100644 index 0000000..04b3cda --- /dev/null +++ b/src/Vapi.Net/Types/GoHighLevelCalendarEventCreateToolProviderDetails.cs @@ -0,0 +1,33 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record GoHighLevelCalendarEventCreateToolProviderDetails +{ + /// + /// This is the Template URL or the Snapshot URL corresponding to the Template. + /// + [JsonPropertyName("templateUrl")] + public string? TemplateUrl { get; set; } + + [JsonPropertyName("setupInstructions")] + public IEnumerable? SetupInstructions { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/GoHighLevelCalendarEventCreateToolWithToolCall.cs b/src/Vapi.Net/Types/GoHighLevelCalendarEventCreateToolWithToolCall.cs new file mode 100644 index 0000000..b7e2fe6 --- /dev/null +++ b/src/Vapi.Net/Types/GoHighLevelCalendarEventCreateToolWithToolCall.cs @@ -0,0 +1,73 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record GoHighLevelCalendarEventCreateToolWithToolCall +{ + /// + /// This determines if the tool is async. + /// + /// If async, the assistant will move forward without waiting for your server to respond. This is useful if you just want to trigger something on your server. + /// + /// If sync, the assistant will wait for your server to respond. This is useful if want assistant to respond with the result from your server. + /// + /// Defaults to synchronous (`false`). + /// + [JsonPropertyName("async")] + public bool? Async { get; set; } + + /// + /// These are the messages that will be spoken to the user as the tool is running. + /// + /// For some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured. + /// + [JsonPropertyName("messages")] + public IEnumerable? Messages { get; set; } + + /// + /// The type of tool. "gohighlevel.calendar.event.create" for GoHighLevel Calendar event create tool. + /// + [JsonPropertyName("type")] + public string Type { get; set; } = "gohighlevel.calendar.event.create"; + + [JsonPropertyName("toolCall")] + public required ToolCall ToolCall { get; set; } + + /// + /// This is the function definition of the tool. + /// + /// For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + /// + /// An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + /// + [JsonPropertyName("function")] + public OpenAiFunction? Function { get; set; } + + /// + /// This is the server that will be hit when this tool is requested by the model. + /// + /// All requests will be sent with the call object among other things. You can find more details in the Server URL documentation. + /// + /// This overrides the serverUrl set on the org and the phoneNumber. Order of precedence: highest tool.server.url, then assistant.serverUrl, then phoneNumber.serverUrl, then org.serverUrl. + /// + [JsonPropertyName("server")] + public Server? Server { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/GoHighLevelContactCreateTool.cs b/src/Vapi.Net/Types/GoHighLevelContactCreateTool.cs new file mode 100644 index 0000000..434f493 --- /dev/null +++ b/src/Vapi.Net/Types/GoHighLevelContactCreateTool.cs @@ -0,0 +1,88 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record GoHighLevelContactCreateTool +{ + /// + /// This determines if the tool is async. + /// + /// If async, the assistant will move forward without waiting for your server to respond. This is useful if you just want to trigger something on your server. + /// + /// If sync, the assistant will wait for your server to respond. This is useful if want assistant to respond with the result from your server. + /// + /// Defaults to synchronous (`false`). + /// + [JsonPropertyName("async")] + public bool? Async { get; set; } + + /// + /// These are the messages that will be spoken to the user as the tool is running. + /// + /// For some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured. + /// + [JsonPropertyName("messages")] + public IEnumerable? Messages { get; set; } + + /// + /// This is the unique identifier for the tool. + /// + [JsonPropertyName("id")] + public required string Id { get; set; } + + /// + /// This is the unique identifier for the organization that this tool belongs to. + /// + [JsonPropertyName("orgId")] + public required string OrgId { get; set; } + + /// + /// This is the ISO 8601 date-time string of when the tool was created. + /// + [JsonPropertyName("createdAt")] + public required DateTime CreatedAt { get; set; } + + /// + /// This is the ISO 8601 date-time string of when the tool was last updated. + /// + [JsonPropertyName("updatedAt")] + public required DateTime UpdatedAt { get; set; } + + /// + /// This is the function definition of the tool. + /// + /// For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + /// + /// An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + /// + [JsonPropertyName("function")] + public OpenAiFunction? Function { get; set; } + + /// + /// This is the server that will be hit when this tool is requested by the model. + /// + /// All requests will be sent with the call object among other things. You can find more details in the Server URL documentation. + /// + /// This overrides the serverUrl set on the org and the phoneNumber. Order of precedence: highest tool.server.url, then assistant.serverUrl, then phoneNumber.serverUrl, then org.serverUrl. + /// + [JsonPropertyName("server")] + public Server? Server { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/GoHighLevelContactCreateToolProviderDetails.cs b/src/Vapi.Net/Types/GoHighLevelContactCreateToolProviderDetails.cs new file mode 100644 index 0000000..97067ea --- /dev/null +++ b/src/Vapi.Net/Types/GoHighLevelContactCreateToolProviderDetails.cs @@ -0,0 +1,33 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record GoHighLevelContactCreateToolProviderDetails +{ + /// + /// This is the Template URL or the Snapshot URL corresponding to the Template. + /// + [JsonPropertyName("templateUrl")] + public string? TemplateUrl { get; set; } + + [JsonPropertyName("setupInstructions")] + public IEnumerable? SetupInstructions { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/GoHighLevelContactCreateToolWithToolCall.cs b/src/Vapi.Net/Types/GoHighLevelContactCreateToolWithToolCall.cs new file mode 100644 index 0000000..c9333ce --- /dev/null +++ b/src/Vapi.Net/Types/GoHighLevelContactCreateToolWithToolCall.cs @@ -0,0 +1,73 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record GoHighLevelContactCreateToolWithToolCall +{ + /// + /// This determines if the tool is async. + /// + /// If async, the assistant will move forward without waiting for your server to respond. This is useful if you just want to trigger something on your server. + /// + /// If sync, the assistant will wait for your server to respond. This is useful if want assistant to respond with the result from your server. + /// + /// Defaults to synchronous (`false`). + /// + [JsonPropertyName("async")] + public bool? Async { get; set; } + + /// + /// These are the messages that will be spoken to the user as the tool is running. + /// + /// For some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured. + /// + [JsonPropertyName("messages")] + public IEnumerable? Messages { get; set; } + + /// + /// The type of tool. "gohighlevel.contact.create" for GoHighLevel contact create tool. + /// + [JsonPropertyName("type")] + public string Type { get; set; } = "gohighlevel.contact.create"; + + [JsonPropertyName("toolCall")] + public required ToolCall ToolCall { get; set; } + + /// + /// This is the function definition of the tool. + /// + /// For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + /// + /// An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + /// + [JsonPropertyName("function")] + public OpenAiFunction? Function { get; set; } + + /// + /// This is the server that will be hit when this tool is requested by the model. + /// + /// All requests will be sent with the call object among other things. You can find more details in the Server URL documentation. + /// + /// This overrides the serverUrl set on the org and the phoneNumber. Order of precedence: highest tool.server.url, then assistant.serverUrl, then phoneNumber.serverUrl, then org.serverUrl. + /// + [JsonPropertyName("server")] + public Server? Server { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/GoHighLevelContactGetTool.cs b/src/Vapi.Net/Types/GoHighLevelContactGetTool.cs new file mode 100644 index 0000000..059ee5e --- /dev/null +++ b/src/Vapi.Net/Types/GoHighLevelContactGetTool.cs @@ -0,0 +1,88 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record GoHighLevelContactGetTool +{ + /// + /// This determines if the tool is async. + /// + /// If async, the assistant will move forward without waiting for your server to respond. This is useful if you just want to trigger something on your server. + /// + /// If sync, the assistant will wait for your server to respond. This is useful if want assistant to respond with the result from your server. + /// + /// Defaults to synchronous (`false`). + /// + [JsonPropertyName("async")] + public bool? Async { get; set; } + + /// + /// These are the messages that will be spoken to the user as the tool is running. + /// + /// For some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured. + /// + [JsonPropertyName("messages")] + public IEnumerable? Messages { get; set; } + + /// + /// This is the unique identifier for the tool. + /// + [JsonPropertyName("id")] + public required string Id { get; set; } + + /// + /// This is the unique identifier for the organization that this tool belongs to. + /// + [JsonPropertyName("orgId")] + public required string OrgId { get; set; } + + /// + /// This is the ISO 8601 date-time string of when the tool was created. + /// + [JsonPropertyName("createdAt")] + public required DateTime CreatedAt { get; set; } + + /// + /// This is the ISO 8601 date-time string of when the tool was last updated. + /// + [JsonPropertyName("updatedAt")] + public required DateTime UpdatedAt { get; set; } + + /// + /// This is the function definition of the tool. + /// + /// For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + /// + /// An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + /// + [JsonPropertyName("function")] + public OpenAiFunction? Function { get; set; } + + /// + /// This is the server that will be hit when this tool is requested by the model. + /// + /// All requests will be sent with the call object among other things. You can find more details in the Server URL documentation. + /// + /// This overrides the serverUrl set on the org and the phoneNumber. Order of precedence: highest tool.server.url, then assistant.serverUrl, then phoneNumber.serverUrl, then org.serverUrl. + /// + [JsonPropertyName("server")] + public Server? Server { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/GoHighLevelContactGetToolProviderDetails.cs b/src/Vapi.Net/Types/GoHighLevelContactGetToolProviderDetails.cs new file mode 100644 index 0000000..6036b4b --- /dev/null +++ b/src/Vapi.Net/Types/GoHighLevelContactGetToolProviderDetails.cs @@ -0,0 +1,33 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record GoHighLevelContactGetToolProviderDetails +{ + /// + /// This is the Template URL or the Snapshot URL corresponding to the Template. + /// + [JsonPropertyName("templateUrl")] + public string? TemplateUrl { get; set; } + + [JsonPropertyName("setupInstructions")] + public IEnumerable? SetupInstructions { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/GoHighLevelContactGetToolWithToolCall.cs b/src/Vapi.Net/Types/GoHighLevelContactGetToolWithToolCall.cs new file mode 100644 index 0000000..a2338d5 --- /dev/null +++ b/src/Vapi.Net/Types/GoHighLevelContactGetToolWithToolCall.cs @@ -0,0 +1,73 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record GoHighLevelContactGetToolWithToolCall +{ + /// + /// This determines if the tool is async. + /// + /// If async, the assistant will move forward without waiting for your server to respond. This is useful if you just want to trigger something on your server. + /// + /// If sync, the assistant will wait for your server to respond. This is useful if want assistant to respond with the result from your server. + /// + /// Defaults to synchronous (`false`). + /// + [JsonPropertyName("async")] + public bool? Async { get; set; } + + /// + /// These are the messages that will be spoken to the user as the tool is running. + /// + /// For some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured. + /// + [JsonPropertyName("messages")] + public IEnumerable? Messages { get; set; } + + /// + /// The type of tool. "gohighlevel.contact.get" for GoHighLevel contact get tool. + /// + [JsonPropertyName("type")] + public string Type { get; set; } = "gohighlevel.contact.get"; + + [JsonPropertyName("toolCall")] + public required ToolCall ToolCall { get; set; } + + /// + /// This is the function definition of the tool. + /// + /// For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + /// + /// An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + /// + [JsonPropertyName("function")] + public OpenAiFunction? Function { get; set; } + + /// + /// This is the server that will be hit when this tool is requested by the model. + /// + /// All requests will be sent with the call object among other things. You can find more details in the Server URL documentation. + /// + /// This overrides the serverUrl set on the org and the phoneNumber. Order of precedence: highest tool.server.url, then assistant.serverUrl, then phoneNumber.serverUrl, then org.serverUrl. + /// + [JsonPropertyName("server")] + public Server? Server { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/GoHighLevelMcpCredential.cs b/src/Vapi.Net/Types/GoHighLevelMcpCredential.cs new file mode 100644 index 0000000..3304150 --- /dev/null +++ b/src/Vapi.Net/Types/GoHighLevelMcpCredential.cs @@ -0,0 +1,63 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record GoHighLevelMcpCredential +{ + [JsonPropertyName("provider")] + public string Provider { get; set; } = "ghl.oauth2-authorization"; + + /// + /// This is the authentication session for the credential. + /// + [JsonPropertyName("authenticationSession")] + public required Oauth2AuthenticationSession AuthenticationSession { get; set; } + + /// + /// This is the unique identifier for the credential. + /// + [JsonPropertyName("id")] + public required string Id { get; set; } + + /// + /// This is the unique identifier for the org that this credential belongs to. + /// + [JsonPropertyName("orgId")] + public required string OrgId { get; set; } + + /// + /// This is the ISO 8601 date-time string of when the credential was created. + /// + [JsonPropertyName("createdAt")] + public required DateTime CreatedAt { get; set; } + + /// + /// This is the ISO 8601 date-time string of when the assistant was last updated. + /// + [JsonPropertyName("updatedAt")] + public required DateTime UpdatedAt { get; set; } + + /// + /// This is the name of credential. This is just for your reference. + /// + [JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/GoogleModelModel.cs b/src/Vapi.Net/Types/GoogleModelModel.cs index 7b8771c..3798d37 100644 --- a/src/Vapi.Net/Types/GoogleModelModel.cs +++ b/src/Vapi.Net/Types/GoogleModelModel.cs @@ -7,6 +7,12 @@ namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] public enum GoogleModelModel { + [EnumMember(Value = "gemini-2.5-pro-preview-05-06")] + Gemini25ProPreview0506, + + [EnumMember(Value = "gemini-2.5-flash-preview-04-17")] + Gemini25FlashPreview0417, + [EnumMember(Value = "gemini-2.0-flash-thinking-exp")] Gemini20FlashThinkingExp, diff --git a/src/Vapi.Net/Types/GoogleTranscriberModel.cs b/src/Vapi.Net/Types/GoogleTranscriberModel.cs index db833f7..50f63f1 100644 --- a/src/Vapi.Net/Types/GoogleTranscriberModel.cs +++ b/src/Vapi.Net/Types/GoogleTranscriberModel.cs @@ -7,6 +7,12 @@ namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] public enum GoogleTranscriberModel { + [EnumMember(Value = "gemini-2.5-pro-preview-05-06")] + Gemini25ProPreview0506, + + [EnumMember(Value = "gemini-2.5-flash-preview-04-17")] + Gemini25FlashPreview0417, + [EnumMember(Value = "gemini-2.0-flash-thinking-exp")] Gemini20FlashThinkingExp, diff --git a/src/Vapi.Net/Types/GoogleVoicemailDetectionPlan.cs b/src/Vapi.Net/Types/GoogleVoicemailDetectionPlan.cs index 7b7f2ab..1784273 100644 --- a/src/Vapi.Net/Types/GoogleVoicemailDetectionPlan.cs +++ b/src/Vapi.Net/Types/GoogleVoicemailDetectionPlan.cs @@ -7,12 +7,24 @@ namespace Vapi.Net; public record GoogleVoicemailDetectionPlan { /// - /// This is how long should we listen in order to determine if we were sent to voicemail or not? + /// This is the maximum duration from the start of the call that we will wait for a voicemail beep, before speaking our message /// - /// @default 15 + /// - If we detect a voicemail beep before this, we will speak the message at that point. + /// + /// - Setting too low a value means that the bot will start speaking its voicemail message too early. If it does so before the actual beep, it will get cut off. You should definitely tune this to your use case. + /// + /// @default 30 + /// @min 0 + /// @max 60 + /// + [JsonPropertyName("beepMaxAwaitSeconds")] + public double? BeepMaxAwaitSeconds { get; set; } + + /// + /// This is the backoff plan for the voicemail detection. /// - [JsonPropertyName("voicemailExpectedDurationSeconds")] - public required double VoicemailExpectedDurationSeconds { get; set; } + [JsonPropertyName("backoffPlan")] + public VoicemailDetectionBackoffPlan? BackoffPlan { get; set; } /// /// Additional properties received from the response, if any. diff --git a/src/Vapi.Net/Types/GroqModelModel.cs b/src/Vapi.Net/Types/GroqModelModel.cs index b85ef33..2dfc009 100644 --- a/src/Vapi.Net/Types/GroqModelModel.cs +++ b/src/Vapi.Net/Types/GroqModelModel.cs @@ -16,15 +16,9 @@ public enum GroqModelModel [EnumMember(Value = "llama-3.1-405b-reasoning")] Llama31405BReasoning, - [EnumMember(Value = "llama-3.1-70b-versatile")] - Llama3170BVersatile, - [EnumMember(Value = "llama-3.1-8b-instant")] Llama318BInstant, - [EnumMember(Value = "mixtral-8x7b-32768")] - Mixtral8X7B32768, - [EnumMember(Value = "llama3-8b-8192")] Llama38B8192, @@ -33,4 +27,19 @@ public enum GroqModelModel [EnumMember(Value = "gemma2-9b-it")] Gemma29BIt, + + [EnumMember(Value = "meta-llama/llama-4-maverick-17b-128e-instruct")] + MetaLlamaLlama4Maverick17B128EInstruct, + + [EnumMember(Value = "meta-llama/llama-4-scout-17b-16e-instruct")] + MetaLlamaLlama4Scout17B16EInstruct, + + [EnumMember(Value = "mistral-saba-24b")] + MistralSaba24B, + + [EnumMember(Value = "compound-beta")] + CompoundBeta, + + [EnumMember(Value = "compound-beta-mini")] + CompoundBetaMini, } diff --git a/src/Vapi.Net/Types/Say.cs b/src/Vapi.Net/Types/HangupNode.cs similarity index 75% rename from src/Vapi.Net/Types/Say.cs rename to src/Vapi.Net/Types/HangupNode.cs index 011d35f..dba1ea0 100644 --- a/src/Vapi.Net/Types/Say.cs +++ b/src/Vapi.Net/Types/HangupNode.cs @@ -4,17 +4,20 @@ namespace Vapi.Net; -public record Say +public record HangupNode { - [JsonPropertyName("exact")] - public string? Exact { get; set; } - - [JsonPropertyName("prompt")] - public string? Prompt { get; set; } + [JsonPropertyName("type")] + public string Type { get; set; } = "hangup"; [JsonPropertyName("name")] public required string Name { get; set; } + /// + /// This is whether or not the node is the start of the workflow. + /// + [JsonPropertyName("isStart")] + public bool? IsStart { get; set; } + /// /// This is for metadata you want to store on the task. /// diff --git a/src/Vapi.Net/Types/HookOn.cs b/src/Vapi.Net/Types/HookOn.cs deleted file mode 100644 index edcdae2..0000000 --- a/src/Vapi.Net/Types/HookOn.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using Vapi.Net.Core; - -namespace Vapi.Net; - -[JsonConverter(typeof(EnumSerializer))] -public enum HookOn -{ - [EnumMember(Value = "task.start")] - TaskStart, - - [EnumMember(Value = "task.output.confirmation")] - TaskOutputConfirmation, - - [EnumMember(Value = "task.delayed")] - TaskDelayed, -} diff --git a/src/Vapi.Net/Types/HumeVoice.cs b/src/Vapi.Net/Types/HumeVoice.cs index 3a133e6..c8e42f5 100644 --- a/src/Vapi.Net/Types/HumeVoice.cs +++ b/src/Vapi.Net/Types/HumeVoice.cs @@ -6,6 +6,12 @@ namespace Vapi.Net; public record HumeVoice { + /// + /// This is the flag to toggle voice caching for the assistant. + /// + [JsonPropertyName("cachingEnabled")] + public bool? CachingEnabled { get; set; } + /// /// This is the model that will be used. /// diff --git a/src/Vapi.Net/Types/ImportTwilioPhoneNumberDto.cs b/src/Vapi.Net/Types/ImportTwilioPhoneNumberDto.cs index 7345548..b798a58 100644 --- a/src/Vapi.Net/Types/ImportTwilioPhoneNumberDto.cs +++ b/src/Vapi.Net/Types/ImportTwilioPhoneNumberDto.cs @@ -23,6 +23,17 @@ public record ImportTwilioPhoneNumberDto [JsonPropertyName("hooks")] public IEnumerable? Hooks { get; set; } + /// + /// Controls whether Vapi sets the messaging webhook URL on the Twilio number during import. + /// + /// If set to `false`, Vapi will not update the Twilio messaging URL, leaving it as is. + /// If `true` or omitted (default), Vapi will configure both the voice and messaging URLs. + /// + /// @default true + /// + [JsonPropertyName("smsEnabled")] + public bool? SmsEnabled { get; set; } + /// /// These are the digits of the phone number you own on your Twilio. /// @@ -39,7 +50,19 @@ public record ImportTwilioPhoneNumberDto /// This is the Twilio Auth Token that will be used to handle this phone number. /// [JsonPropertyName("twilioAuthToken")] - public required string TwilioAuthToken { get; set; } + public string? TwilioAuthToken { get; set; } + + /// + /// This is the Twilio API Key that will be used to handle this phone number. If AuthToken is provided, this will be ignored. + /// + [JsonPropertyName("twilioApiKey")] + public string? TwilioApiKey { get; set; } + + /// + /// This is the Twilio API Secret that will be used to handle this phone number. If AuthToken is provided, this will be ignored. + /// + [JsonPropertyName("twilioApiSecret")] + public string? TwilioApiSecret { get; set; } /// /// This is the name of the phone number. This is just for your own reference. @@ -50,15 +73,23 @@ public record ImportTwilioPhoneNumberDto /// /// This is the assistant that will be used for incoming calls to this phone number. /// - /// If neither `assistantId` nor `squadId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected. + /// If neither `assistantId`, `squadId` nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected. /// [JsonPropertyName("assistantId")] public string? AssistantId { get; set; } + /// + /// This is the workflow that will be used for incoming calls to this phone number. + /// + /// If neither `assistantId`, `squadId`, nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected. + /// + [JsonPropertyName("workflowId")] + public string? WorkflowId { get; set; } + /// /// This is the squad that will be used for incoming calls to this phone number. /// - /// If neither `assistantId` nor `squadId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected. + /// If neither `assistantId`, `squadId`, nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected. /// [JsonPropertyName("squadId")] public string? SquadId { get; set; } diff --git a/src/Vapi.Net/Types/ImportVonagePhoneNumberDto.cs b/src/Vapi.Net/Types/ImportVonagePhoneNumberDto.cs index d9e56f9..5a528e4 100644 --- a/src/Vapi.Net/Types/ImportVonagePhoneNumberDto.cs +++ b/src/Vapi.Net/Types/ImportVonagePhoneNumberDto.cs @@ -44,15 +44,23 @@ public record ImportVonagePhoneNumberDto /// /// This is the assistant that will be used for incoming calls to this phone number. /// - /// If neither `assistantId` nor `squadId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected. + /// If neither `assistantId`, `squadId` nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected. /// [JsonPropertyName("assistantId")] public string? AssistantId { get; set; } + /// + /// This is the workflow that will be used for incoming calls to this phone number. + /// + /// If neither `assistantId`, `squadId`, nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected. + /// + [JsonPropertyName("workflowId")] + public string? WorkflowId { get; set; } + /// /// This is the squad that will be used for incoming calls to this phone number. /// - /// If neither `assistantId` nor `squadId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected. + /// If neither `assistantId`, `squadId`, nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected. /// [JsonPropertyName("squadId")] public string? SquadId { get; set; } diff --git a/src/Vapi.Net/Types/JwtResponse.cs b/src/Vapi.Net/Types/JwtResponse.cs new file mode 100644 index 0000000..b57703f --- /dev/null +++ b/src/Vapi.Net/Types/JwtResponse.cs @@ -0,0 +1,30 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record JwtResponse +{ + [JsonPropertyName("accessToken")] + public required string AccessToken { get; set; } + + [JsonPropertyName("aud")] + public object Aud { get; set; } = new Dictionary(); + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/KnowledgeBaseCost.cs b/src/Vapi.Net/Types/KnowledgeBaseCost.cs new file mode 100644 index 0000000..5a79af0 --- /dev/null +++ b/src/Vapi.Net/Types/KnowledgeBaseCost.cs @@ -0,0 +1,48 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record KnowledgeBaseCost +{ + /// + /// This is the model that was used for processing the knowledge base. + /// + [JsonPropertyName("model")] + public object Model { get; set; } = new Dictionary(); + + /// + /// This is the number of prompt tokens used in the knowledge base query. + /// + [JsonPropertyName("promptTokens")] + public required double PromptTokens { get; set; } + + /// + /// This is the number of completion tokens generated in the knowledge base query. + /// + [JsonPropertyName("completionTokens")] + public required double CompletionTokens { get; set; } + + /// + /// This is the cost of the component in USD. + /// + [JsonPropertyName("cost")] + public required double Cost { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/KnowledgeBaseModel.cs b/src/Vapi.Net/Types/KnowledgeBaseModel.cs index 6a061cb..d3c729c 100644 --- a/src/Vapi.Net/Types/KnowledgeBaseModel.cs +++ b/src/Vapi.Net/Types/KnowledgeBaseModel.cs @@ -7,6 +7,12 @@ namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] public enum KnowledgeBaseModel { + [EnumMember(Value = "gemini-2.5-pro-preview-05-06")] + Gemini25ProPreview0506, + + [EnumMember(Value = "gemini-2.5-flash-preview-04-17")] + Gemini25FlashPreview0417, + [EnumMember(Value = "gemini-2.0-flash-thinking-exp")] Gemini20FlashThinkingExp, diff --git a/src/Vapi.Net/Types/LivekitSmartEndpointingPlan.cs b/src/Vapi.Net/Types/LivekitSmartEndpointingPlan.cs index f6e182b..f346e8b 100644 --- a/src/Vapi.Net/Types/LivekitSmartEndpointingPlan.cs +++ b/src/Vapi.Net/Types/LivekitSmartEndpointingPlan.cs @@ -21,7 +21,7 @@ public record LivekitSmartEndpointingPlan /// /// Under the hood, this is parsed into a mathjs expression. Whatever you use to write your expression needs to be valid with respect to mathjs /// - /// @default "70 + 4000 * x" + /// @default "20 + 500 * sqrt(x) + 2500 * x^3" /// [JsonPropertyName("waitFunction")] public string? WaitFunction { get; set; } diff --git a/src/Vapi.Net/Types/LmntVoice.cs b/src/Vapi.Net/Types/LmntVoice.cs index e69b51d..3ebe863 100644 --- a/src/Vapi.Net/Types/LmntVoice.cs +++ b/src/Vapi.Net/Types/LmntVoice.cs @@ -7,6 +7,12 @@ namespace Vapi.Net; public record LmntVoice { + /// + /// This is the flag to toggle voice caching for the assistant. + /// + [JsonPropertyName("cachingEnabled")] + public bool? CachingEnabled { get; set; } + /// /// This is the provider-specific ID that will be used. /// diff --git a/src/Vapi.Net/Types/MonitorPlan.cs b/src/Vapi.Net/Types/MonitorPlan.cs index 8247a97..8bfd30d 100644 --- a/src/Vapi.Net/Types/MonitorPlan.cs +++ b/src/Vapi.Net/Types/MonitorPlan.cs @@ -16,6 +16,16 @@ public record MonitorPlan [JsonPropertyName("listenEnabled")] public bool? ListenEnabled { get; set; } + /// + /// This enables authentication on the `call.monitor.listenUrl`. + /// + /// If `listenAuthenticationEnabled` is `true`, the `call.monitor.listenUrl` will require an `Authorization: Bearer <vapi-public-api-key>` header. + /// + /// @default false + /// + [JsonPropertyName("listenAuthenticationEnabled")] + public bool? ListenAuthenticationEnabled { get; set; } + /// /// This determines whether the assistant's calls allow live control. Defaults to true. /// @@ -28,6 +38,16 @@ public record MonitorPlan [JsonPropertyName("controlEnabled")] public bool? ControlEnabled { get; set; } + /// + /// This enables authentication on the `call.monitor.controlUrl`. + /// + /// If `controlAuthenticationEnabled` is `true`, the `call.monitor.controlUrl` will require an `Authorization: Bearer <vapi-public-api-key>` header. + /// + /// @default false + /// + [JsonPropertyName("controlAuthenticationEnabled")] + public bool? ControlAuthenticationEnabled { get; set; } + /// /// Additional properties received from the response, if any. /// diff --git a/src/Vapi.Net/Types/Mono.cs b/src/Vapi.Net/Types/Mono.cs new file mode 100644 index 0000000..5dbd192 --- /dev/null +++ b/src/Vapi.Net/Types/Mono.cs @@ -0,0 +1,42 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record Mono +{ + /// + /// This is the combined recording url for the call. To enable, set `assistant.artifactPlan.recordingEnabled`. + /// + [JsonPropertyName("combinedUrl")] + public string? CombinedUrl { get; set; } + + /// + /// This is the mono recording url for the assistant. To enable, set `assistant.artifactPlan.recordingEnabled`. + /// + [JsonPropertyName("assistantUrl")] + public string? AssistantUrl { get; set; } + + /// + /// This is the mono recording url for the customer. To enable, set `assistant.artifactPlan.recordingEnabled`. + /// + [JsonPropertyName("customerUrl")] + public string? CustomerUrl { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/NeuphonicVoice.cs b/src/Vapi.Net/Types/NeuphonicVoice.cs index b9ff9de..39db5c4 100644 --- a/src/Vapi.Net/Types/NeuphonicVoice.cs +++ b/src/Vapi.Net/Types/NeuphonicVoice.cs @@ -6,6 +6,12 @@ namespace Vapi.Net; public record NeuphonicVoice { + /// + /// This is the flag to toggle voice caching for the assistant. + /// + [JsonPropertyName("cachingEnabled")] + public bool? CachingEnabled { get; set; } + /// /// This is the provider-specific ID that will be used. /// diff --git a/src/Vapi.Net/Types/OAuth2AuthenticationPlan.cs b/src/Vapi.Net/Types/OAuth2AuthenticationPlan.cs index 2d5c62a..aee27d4 100644 --- a/src/Vapi.Net/Types/OAuth2AuthenticationPlan.cs +++ b/src/Vapi.Net/Types/OAuth2AuthenticationPlan.cs @@ -7,7 +7,7 @@ namespace Vapi.Net; public record OAuth2AuthenticationPlan { [JsonPropertyName("type")] - public string Type { get; set; } = "oauth2"; + public required OAuth2AuthenticationPlanType Type { get; set; } /// /// This is the OAuth2 URL. diff --git a/src/Vapi.Net/Types/OAuth2AuthenticationPlanType.cs b/src/Vapi.Net/Types/OAuth2AuthenticationPlanType.cs new file mode 100644 index 0000000..ada4fad --- /dev/null +++ b/src/Vapi.Net/Types/OAuth2AuthenticationPlanType.cs @@ -0,0 +1,15 @@ +using System.Runtime.Serialization; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[JsonConverter(typeof(EnumSerializer))] +public enum OAuth2AuthenticationPlanType +{ + [EnumMember(Value = "oauth2")] + Oauth2, + + [EnumMember(Value = "aws-sts")] + AwsSts, +} diff --git a/src/Vapi.Net/Types/Oauth2AuthenticationSession.cs b/src/Vapi.Net/Types/Oauth2AuthenticationSession.cs index a9e8203..ad87097 100644 --- a/src/Vapi.Net/Types/Oauth2AuthenticationSession.cs +++ b/src/Vapi.Net/Types/Oauth2AuthenticationSession.cs @@ -18,6 +18,12 @@ public record Oauth2AuthenticationSession [JsonPropertyName("expiresAt")] public DateTime? ExpiresAt { get; set; } + /// + /// This is the OAuth2 refresh token. + /// + [JsonPropertyName("refreshToken")] + public string? RefreshToken { get; set; } + /// /// Additional properties received from the response, if any. /// diff --git a/src/Vapi.Net/Types/OpenAiModelFallbackModelsItem.cs b/src/Vapi.Net/Types/OpenAiModelFallbackModelsItem.cs index c34ad69..fbe6205 100644 --- a/src/Vapi.Net/Types/OpenAiModelFallbackModelsItem.cs +++ b/src/Vapi.Net/Types/OpenAiModelFallbackModelsItem.cs @@ -22,9 +22,15 @@ public enum OpenAiModelFallbackModelsItem [EnumMember(Value = "chatgpt-4o-latest")] Chatgpt4OLatest, + [EnumMember(Value = "o3")] + O3, + [EnumMember(Value = "o3-mini")] O3Mini, + [EnumMember(Value = "o4-mini")] + O4Mini, + [EnumMember(Value = "o1-preview")] O1Preview, diff --git a/src/Vapi.Net/Types/OpenAiModelModel.cs b/src/Vapi.Net/Types/OpenAiModelModel.cs index 95e165d..f95bdee 100644 --- a/src/Vapi.Net/Types/OpenAiModelModel.cs +++ b/src/Vapi.Net/Types/OpenAiModelModel.cs @@ -22,9 +22,15 @@ public enum OpenAiModelModel [EnumMember(Value = "chatgpt-4o-latest")] Chatgpt4OLatest, + [EnumMember(Value = "o3")] + O3, + [EnumMember(Value = "o3-mini")] O3Mini, + [EnumMember(Value = "o4-mini")] + O4Mini, + [EnumMember(Value = "o1-preview")] O1Preview, diff --git a/src/Vapi.Net/Types/OpenAiVoice.cs b/src/Vapi.Net/Types/OpenAiVoice.cs index 63ec597..f3a2abc 100644 --- a/src/Vapi.Net/Types/OpenAiVoice.cs +++ b/src/Vapi.Net/Types/OpenAiVoice.cs @@ -7,6 +7,12 @@ namespace Vapi.Net; public record OpenAiVoice { + /// + /// This is the flag to toggle voice caching for the assistant. + /// + [JsonPropertyName("cachingEnabled")] + public bool? CachingEnabled { get; set; } + /// /// This is the provider-specific ID that will be used. /// Please note that ash, ballad, coral, sage, and verse may only be used with realtime models. diff --git a/src/Vapi.Net/Types/OpenAiVoicemailDetectionPlan.cs b/src/Vapi.Net/Types/OpenAiVoicemailDetectionPlan.cs index ad22b76..d894a04 100644 --- a/src/Vapi.Net/Types/OpenAiVoicemailDetectionPlan.cs +++ b/src/Vapi.Net/Types/OpenAiVoicemailDetectionPlan.cs @@ -7,12 +7,24 @@ namespace Vapi.Net; public record OpenAiVoicemailDetectionPlan { /// - /// This is how long should we listen in order to determine if we were sent to voicemail or not? + /// This is the maximum duration from the start of the call that we will wait for a voicemail beep, before speaking our message /// - /// @default 15 + /// - If we detect a voicemail beep before this, we will speak the message at that point. + /// + /// - Setting too low a value means that the bot will start speaking its voicemail message too early. If it does so before the actual beep, it will get cut off. You should definitely tune this to your use case. + /// + /// @default 30 + /// @min 0 + /// @max 60 + /// + [JsonPropertyName("beepMaxAwaitSeconds")] + public double? BeepMaxAwaitSeconds { get; set; } + + /// + /// This is the backoff plan for the voicemail detection. /// - [JsonPropertyName("voicemailExpectedDurationSeconds")] - public required double VoicemailExpectedDurationSeconds { get; set; } + [JsonPropertyName("backoffPlan")] + public VoicemailDetectionBackoffPlan? BackoffPlan { get; set; } /// /// Additional properties received from the response, if any. diff --git a/src/Vapi.Net/Types/Org.cs b/src/Vapi.Net/Types/Org.cs index 027ccfb..d961d27 100644 --- a/src/Vapi.Net/Types/Org.cs +++ b/src/Vapi.Net/Types/Org.cs @@ -77,6 +77,12 @@ public record Org [JsonPropertyName("plan")] public OrgPlan? Plan { get; set; } + /// + /// This is the secret key used for signing JWT tokens for the org. + /// + [JsonPropertyName("jwtSecret")] + public string? JwtSecret { get; set; } + /// /// This is the name of the org. This is just for your own reference. /// diff --git a/src/Vapi.Net/Types/PhoneNumberHookCallRinging.cs b/src/Vapi.Net/Types/PhoneNumberHookCallRinging.cs index edebc09..fade528 100644 --- a/src/Vapi.Net/Types/PhoneNumberHookCallRinging.cs +++ b/src/Vapi.Net/Types/PhoneNumberHookCallRinging.cs @@ -1,6 +1,5 @@ using System.Text.Json; using System.Text.Json.Serialization; -using OneOf; using Vapi.Net.Core; namespace Vapi.Net; @@ -17,7 +16,7 @@ public record PhoneNumberHookCallRinging /// This is the set of actions to perform when the hook triggers /// [JsonPropertyName("do")] - public IEnumerable> Do { get; set; } = new List>(); + public IEnumerable Do { get; set; } = new List(); /// /// Additional properties received from the response, if any. diff --git a/src/Vapi.Net/Types/PlayHtVoice.cs b/src/Vapi.Net/Types/PlayHtVoice.cs index a6c9ad6..70fdcb8 100644 --- a/src/Vapi.Net/Types/PlayHtVoice.cs +++ b/src/Vapi.Net/Types/PlayHtVoice.cs @@ -7,6 +7,12 @@ namespace Vapi.Net; public record PlayHtVoice { + /// + /// This is the flag to toggle voice caching for the assistant. + /// + [JsonPropertyName("cachingEnabled")] + public bool? CachingEnabled { get; set; } + /// /// This is the provider-specific ID that will be used. /// diff --git a/src/Vapi.Net/Types/Recording.cs b/src/Vapi.Net/Types/Recording.cs new file mode 100644 index 0000000..e6a5f36 --- /dev/null +++ b/src/Vapi.Net/Types/Recording.cs @@ -0,0 +1,48 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record Recording +{ + /// + /// This is the stereo recording url for the call. To enable, set `assistant.artifactPlan.recordingEnabled`. + /// + [JsonPropertyName("stereoUrl")] + public string? StereoUrl { get; set; } + + /// + /// This is the video recording url for the call. To enable, set `assistant.artifactPlan.videoRecordingEnabled`. + /// + [JsonPropertyName("videoUrl")] + public string? VideoUrl { get; set; } + + /// + /// This is video recording start delay in ms. To enable, set `assistant.artifactPlan.videoRecordingEnabled`. This can be used to align the playback of the recording with artifact.messages timestamps. + /// + [JsonPropertyName("videoRecordingStartDelaySeconds")] + public double? VideoRecordingStartDelaySeconds { get; set; } + + /// + /// This is the mono recording url for the call. To enable, set `assistant.artifactPlan.recordingEnabled`. + /// + [JsonPropertyName("mono")] + public Mono? Mono { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/RimeAiVoice.cs b/src/Vapi.Net/Types/RimeAiVoice.cs index 0cf7122..1baee14 100644 --- a/src/Vapi.Net/Types/RimeAiVoice.cs +++ b/src/Vapi.Net/Types/RimeAiVoice.cs @@ -7,6 +7,12 @@ namespace Vapi.Net; public record RimeAiVoice { + /// + /// This is the flag to toggle voice caching for the assistant. + /// + [JsonPropertyName("cachingEnabled")] + public bool? CachingEnabled { get; set; } + /// /// This is the provider-specific ID that will be used. /// @@ -26,7 +32,7 @@ public record RimeAiVoice public double? Speed { get; set; } /// - /// This is a flag that controls whether to add slight pauses using angle brackets. Example: “Hi. <200> I’d love to have a conversation with you.” adds a 200ms pause between the first and second sentences. + /// This is a flag that controls whether to add slight pauses using angle brackets. Example: "Hi. <200> I'd love to have a conversation with you." adds a 200ms pause between the first and second sentences. /// [JsonPropertyName("pauseBetweenBrackets")] public bool? PauseBetweenBrackets { get; set; } diff --git a/src/Vapi.Net/Types/SayAssistantHookAction.cs b/src/Vapi.Net/Types/SayAssistantHookAction.cs new file mode 100644 index 0000000..0ee47bf --- /dev/null +++ b/src/Vapi.Net/Types/SayAssistantHookAction.cs @@ -0,0 +1,30 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record SayAssistantHookAction +{ + /// + /// This is the message to say + /// + [JsonPropertyName("exact")] + public object Exact { get; set; } = new Dictionary(); + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/Hook.cs b/src/Vapi.Net/Types/SayPhoneNumberHookAction.cs similarity index 75% rename from src/Vapi.Net/Types/Hook.cs rename to src/Vapi.Net/Types/SayPhoneNumberHookAction.cs index adc82e5..b72d9b9 100644 --- a/src/Vapi.Net/Types/Hook.cs +++ b/src/Vapi.Net/Types/SayPhoneNumberHookAction.cs @@ -4,13 +4,13 @@ namespace Vapi.Net; -public record Hook +public record SayPhoneNumberHookAction { - [JsonPropertyName("on")] - public required HookOn On { get; set; } - - [JsonPropertyName("do")] - public IEnumerable Do { get; set; } = new List(); + /// + /// This is the message to say + /// + [JsonPropertyName("exact")] + public required string Exact { get; set; } /// /// Additional properties received from the response, if any. diff --git a/src/Vapi.Net/Types/Server.cs b/src/Vapi.Net/Types/Server.cs index ac9c644..f28cc78 100644 --- a/src/Vapi.Net/Types/Server.cs +++ b/src/Vapi.Net/Types/Server.cs @@ -7,7 +7,7 @@ namespace Vapi.Net; public record Server { /// - /// This is the timeout in seconds for the request to your server. Defaults to 20 seconds. + /// This is the timeout in seconds for the request. Defaults to 20 seconds. /// /// @default 20 /// @@ -15,21 +15,13 @@ public record Server public double? TimeoutSeconds { get; set; } /// - /// API endpoint to send requests to. + /// This is where the request will be sent. /// [JsonPropertyName("url")] - public required string Url { get; set; } + public string? Url { get; set; } /// - /// This is the secret you can set that Vapi will send with every request to your server. Will be sent as a header called x-vapi-secret. - /// - /// Same precedence logic as server. - /// - [JsonPropertyName("secret")] - public string? Secret { get; set; } - - /// - /// These are the custom headers to include in the request sent to your server. + /// These are the headers to include in the request. /// /// Each key-value pair represents a header name and its value. /// @@ -37,7 +29,9 @@ public record Server public object? Headers { get; set; } /// - /// This is the backoff plan to use if the request fails. + /// This is the backoff plan if the request fails. Defaults to undefined (the request will not be retried). + /// + /// @default undefined (the request will not be retried) /// [JsonPropertyName("backoffPlan")] public BackoffPlan? BackoffPlan { get; set; } diff --git a/src/Vapi.Net/Types/ServerMessageAssistantRequest.cs b/src/Vapi.Net/Types/ServerMessageAssistantRequest.cs index 2a72055..c622b66 100644 --- a/src/Vapi.Net/Types/ServerMessageAssistantRequest.cs +++ b/src/Vapi.Net/Types/ServerMessageAssistantRequest.cs @@ -7,11 +7,7 @@ namespace Vapi.Net; public record ServerMessageAssistantRequest { /// - /// This is the phone number associated with the call. - /// - /// This matches one of the following: - /// - `call.phoneNumber`, - /// - `call.phoneNumberId`. + /// This is the phone number that the message is associated with. /// [JsonPropertyName("phoneNumber")] public object? PhoneNumber { get; set; } @@ -23,7 +19,7 @@ public record ServerMessageAssistantRequest public string Type { get; set; } = "assistant-request"; /// - /// This is the timestamp of when the message was sent in milliseconds since Unix Epoch. + /// This is the timestamp of the message. /// [JsonPropertyName("timestamp")] public double? Timestamp { get; set; } @@ -37,35 +33,19 @@ public record ServerMessageAssistantRequest public Artifact? Artifact { get; set; } /// - /// This is the assistant that is currently active. This is provided for convenience. - /// - /// This matches one of the following: - /// - `call.assistant`, - /// - `call.assistantId`, - /// - `call.squad[n].assistant`, - /// - `call.squad[n].assistantId`, - /// - `call.squadId->[n].assistant`, - /// - `call.squadId->[n].assistantId`. + /// This is the assistant that the message is associated with. /// [JsonPropertyName("assistant")] public CreateAssistantDto? Assistant { get; set; } /// - /// This is the customer associated with the call. - /// - /// This matches one of the following: - /// - `call.customer`, - /// - `call.customerId`. + /// This is the customer that the message is associated with. /// [JsonPropertyName("customer")] public CreateCustomerDto? Customer { get; set; } /// - /// This is the call object. - /// - /// This matches what was returned in POST /call. - /// - /// Note: This might get stale during the call. To get the latest call object, especially after the call is ended, use GET /call/:id. + /// This is the call that the message is associated with. /// [JsonPropertyName("call")] public Call? Call { get; set; } diff --git a/src/Vapi.Net/Types/ServerMessageConversationUpdate.cs b/src/Vapi.Net/Types/ServerMessageConversationUpdate.cs index db05a85..a6089a5 100644 --- a/src/Vapi.Net/Types/ServerMessageConversationUpdate.cs +++ b/src/Vapi.Net/Types/ServerMessageConversationUpdate.cs @@ -8,11 +8,7 @@ namespace Vapi.Net; public record ServerMessageConversationUpdate { /// - /// This is the phone number associated with the call. - /// - /// This matches one of the following: - /// - `call.phoneNumber`, - /// - `call.phoneNumberId`. + /// This is the phone number that the message is associated with. /// [JsonPropertyName("phoneNumber")] public object? PhoneNumber { get; set; } @@ -39,7 +35,7 @@ public IEnumerable< new List(); /// - /// This is the timestamp of when the message was sent in milliseconds since Unix Epoch. + /// This is the timestamp of the message. /// [JsonPropertyName("timestamp")] public double? Timestamp { get; set; } @@ -53,35 +49,19 @@ public IEnumerable< public Artifact? Artifact { get; set; } /// - /// This is the assistant that is currently active. This is provided for convenience. - /// - /// This matches one of the following: - /// - `call.assistant`, - /// - `call.assistantId`, - /// - `call.squad[n].assistant`, - /// - `call.squad[n].assistantId`, - /// - `call.squadId->[n].assistant`, - /// - `call.squadId->[n].assistantId`. + /// This is the assistant that the message is associated with. /// [JsonPropertyName("assistant")] public CreateAssistantDto? Assistant { get; set; } /// - /// This is the customer associated with the call. - /// - /// This matches one of the following: - /// - `call.customer`, - /// - `call.customerId`. + /// This is the customer that the message is associated with. /// [JsonPropertyName("customer")] public CreateCustomerDto? Customer { get; set; } /// - /// This is the call object. - /// - /// This matches what was returned in POST /call. - /// - /// Note: This might get stale during the call. To get the latest call object, especially after the call is ended, use GET /call/:id. + /// This is the call that the message is associated with. /// [JsonPropertyName("call")] public Call? Call { get; set; } diff --git a/src/Vapi.Net/Types/ServerMessageEndOfCallReport.cs b/src/Vapi.Net/Types/ServerMessageEndOfCallReport.cs index 45410d3..6c4f9b2 100644 --- a/src/Vapi.Net/Types/ServerMessageEndOfCallReport.cs +++ b/src/Vapi.Net/Types/ServerMessageEndOfCallReport.cs @@ -7,11 +7,7 @@ namespace Vapi.Net; public record ServerMessageEndOfCallReport { /// - /// This is the phone number associated with the call. - /// - /// This matches one of the following: - /// - `call.phoneNumber`, - /// - `call.phoneNumberId`. + /// This is the phone number that the message is associated with. /// [JsonPropertyName("phoneNumber")] public object? PhoneNumber { get; set; } @@ -41,7 +37,7 @@ public record ServerMessageEndOfCallReport public IEnumerable? Costs { get; set; } /// - /// This is the timestamp of when the message was sent in milliseconds since Unix Epoch. + /// This is the timestamp of the message. /// [JsonPropertyName("timestamp")] public double? Timestamp { get; set; } @@ -53,35 +49,19 @@ public record ServerMessageEndOfCallReport public required Artifact Artifact { get; set; } /// - /// This is the assistant that is currently active. This is provided for convenience. - /// - /// This matches one of the following: - /// - `call.assistant`, - /// - `call.assistantId`, - /// - `call.squad[n].assistant`, - /// - `call.squad[n].assistantId`, - /// - `call.squadId->[n].assistant`, - /// - `call.squadId->[n].assistantId`. + /// This is the assistant that the message is associated with. /// [JsonPropertyName("assistant")] public CreateAssistantDto? Assistant { get; set; } /// - /// This is the customer associated with the call. - /// - /// This matches one of the following: - /// - `call.customer`, - /// - `call.customerId`. + /// This is the customer that the message is associated with. /// [JsonPropertyName("customer")] public CreateCustomerDto? Customer { get; set; } /// - /// This is the call object. - /// - /// This matches what was returned in POST /call. - /// - /// Note: This might get stale during the call. To get the latest call object, especially after the call is ended, use GET /call/:id. + /// This is the call that the message is associated with. /// [JsonPropertyName("call")] public Call? Call { get; set; } diff --git a/src/Vapi.Net/Types/ServerMessageEndOfCallReportEndedReason.cs b/src/Vapi.Net/Types/ServerMessageEndOfCallReportEndedReason.cs index 3bc7fdf..8e39ef1 100644 --- a/src/Vapi.Net/Types/ServerMessageEndOfCallReportEndedReason.cs +++ b/src/Vapi.Net/Types/ServerMessageEndOfCallReportEndedReason.cs @@ -281,6 +281,12 @@ public enum ServerMessageEndOfCallReportEndedReason [EnumMember(Value = "phone-call-provider-bypass-enabled-but-no-call-received")] PhoneCallProviderBypassEnabledButNoCallReceived, + [EnumMember(Value = "call.in-progress.error-providerfault-transport-never-connected")] + CallInProgressErrorProviderfaultTransportNeverConnected, + + [EnumMember(Value = "call.in-progress.error-vapifault-worker-not-available")] + CallInProgressErrorVapifaultWorkerNotAvailable, + [EnumMember(Value = "call.in-progress.error-vapifault-transport-never-connected")] CallInProgressErrorVapifaultTransportNeverConnected, @@ -1559,6 +1565,9 @@ public enum ServerMessageEndOfCallReportEndedReason [EnumMember(Value = "phone-call-provider-closed-websocket")] PhoneCallProviderClosedWebsocket, + [EnumMember(Value = "call.forwarding.operator-busy")] + CallForwardingOperatorBusy, + [EnumMember(Value = "silence-timed-out")] SilenceTimedOut, diff --git a/src/Vapi.Net/Types/ServerMessageHang.cs b/src/Vapi.Net/Types/ServerMessageHang.cs index 252b49a..65e5d2e 100644 --- a/src/Vapi.Net/Types/ServerMessageHang.cs +++ b/src/Vapi.Net/Types/ServerMessageHang.cs @@ -7,11 +7,7 @@ namespace Vapi.Net; public record ServerMessageHang { /// - /// This is the phone number associated with the call. - /// - /// This matches one of the following: - /// - `call.phoneNumber`, - /// - `call.phoneNumberId`. + /// This is the phone number that the message is associated with. /// [JsonPropertyName("phoneNumber")] public object? PhoneNumber { get; set; } @@ -27,7 +23,7 @@ public record ServerMessageHang public string Type { get; set; } = "hang"; /// - /// This is the timestamp of when the message was sent in milliseconds since Unix Epoch. + /// This is the timestamp of the message. /// [JsonPropertyName("timestamp")] public double? Timestamp { get; set; } @@ -41,35 +37,19 @@ public record ServerMessageHang public Artifact? Artifact { get; set; } /// - /// This is the assistant that is currently active. This is provided for convenience. - /// - /// This matches one of the following: - /// - `call.assistant`, - /// - `call.assistantId`, - /// - `call.squad[n].assistant`, - /// - `call.squad[n].assistantId`, - /// - `call.squadId->[n].assistant`, - /// - `call.squadId->[n].assistantId`. + /// This is the assistant that the message is associated with. /// [JsonPropertyName("assistant")] public CreateAssistantDto? Assistant { get; set; } /// - /// This is the customer associated with the call. - /// - /// This matches one of the following: - /// - `call.customer`, - /// - `call.customerId`. + /// This is the customer that the message is associated with. /// [JsonPropertyName("customer")] public CreateCustomerDto? Customer { get; set; } /// - /// This is the call object. - /// - /// This matches what was returned in POST /call. - /// - /// Note: This might get stale during the call. To get the latest call object, especially after the call is ended, use GET /call/:id. + /// This is the call that the message is associated with. /// [JsonPropertyName("call")] public Call? Call { get; set; } diff --git a/src/Vapi.Net/Types/ServerMessageKnowledgeBaseRequest.cs b/src/Vapi.Net/Types/ServerMessageKnowledgeBaseRequest.cs index 7713dfb..fe69423 100644 --- a/src/Vapi.Net/Types/ServerMessageKnowledgeBaseRequest.cs +++ b/src/Vapi.Net/Types/ServerMessageKnowledgeBaseRequest.cs @@ -8,11 +8,7 @@ namespace Vapi.Net; public record ServerMessageKnowledgeBaseRequest { /// - /// This is the phone number associated with the call. - /// - /// This matches one of the following: - /// - `call.phoneNumber`, - /// - `call.phoneNumberId`. + /// This is the phone number that the message is associated with. /// [JsonPropertyName("phoneNumber")] public object? PhoneNumber { get; set; } @@ -39,7 +35,7 @@ public IEnumerable< new List(); /// - /// This is the timestamp of when the message was sent in milliseconds since Unix Epoch. + /// This is the timestamp of the message. /// [JsonPropertyName("timestamp")] public double? Timestamp { get; set; } @@ -53,35 +49,19 @@ public IEnumerable< public Artifact? Artifact { get; set; } /// - /// This is the assistant that is currently active. This is provided for convenience. - /// - /// This matches one of the following: - /// - `call.assistant`, - /// - `call.assistantId`, - /// - `call.squad[n].assistant`, - /// - `call.squad[n].assistantId`, - /// - `call.squadId->[n].assistant`, - /// - `call.squadId->[n].assistantId`. + /// This is the assistant that the message is associated with. /// [JsonPropertyName("assistant")] public CreateAssistantDto? Assistant { get; set; } /// - /// This is the customer associated with the call. - /// - /// This matches one of the following: - /// - `call.customer`, - /// - `call.customerId`. + /// This is the customer that the message is associated with. /// [JsonPropertyName("customer")] public CreateCustomerDto? Customer { get; set; } /// - /// This is the call object. - /// - /// This matches what was returned in POST /call. - /// - /// Note: This might get stale during the call. To get the latest call object, especially after the call is ended, use GET /call/:id. + /// This is the call that the message is associated with. /// [JsonPropertyName("call")] public Call? Call { get; set; } diff --git a/src/Vapi.Net/Types/ServerMessageLanguageChangeDetected.cs b/src/Vapi.Net/Types/ServerMessageLanguageChangeDetected.cs index 59fa137..586138b 100644 --- a/src/Vapi.Net/Types/ServerMessageLanguageChangeDetected.cs +++ b/src/Vapi.Net/Types/ServerMessageLanguageChangeDetected.cs @@ -7,11 +7,7 @@ namespace Vapi.Net; public record ServerMessageLanguageChangeDetected { /// - /// This is the phone number associated with the call. - /// - /// This matches one of the following: - /// - `call.phoneNumber`, - /// - `call.phoneNumberId`. + /// This is the phone number that the message is associated with. /// [JsonPropertyName("phoneNumber")] public object? PhoneNumber { get; set; } @@ -23,7 +19,7 @@ public record ServerMessageLanguageChangeDetected public string Type { get; set; } = "language-change-detected"; /// - /// This is the timestamp of when the message was sent in milliseconds since Unix Epoch. + /// This is the timestamp of the message. /// [JsonPropertyName("timestamp")] public double? Timestamp { get; set; } @@ -37,35 +33,19 @@ public record ServerMessageLanguageChangeDetected public Artifact? Artifact { get; set; } /// - /// This is the assistant that is currently active. This is provided for convenience. - /// - /// This matches one of the following: - /// - `call.assistant`, - /// - `call.assistantId`, - /// - `call.squad[n].assistant`, - /// - `call.squad[n].assistantId`, - /// - `call.squadId->[n].assistant`, - /// - `call.squadId->[n].assistantId`. + /// This is the assistant that the message is associated with. /// [JsonPropertyName("assistant")] public CreateAssistantDto? Assistant { get; set; } /// - /// This is the customer associated with the call. - /// - /// This matches one of the following: - /// - `call.customer`, - /// - `call.customerId`. + /// This is the customer that the message is associated with. /// [JsonPropertyName("customer")] public CreateCustomerDto? Customer { get; set; } /// - /// This is the call object. - /// - /// This matches what was returned in POST /call. - /// - /// Note: This might get stale during the call. To get the latest call object, especially after the call is ended, use GET /call/:id. + /// This is the call that the message is associated with. /// [JsonPropertyName("call")] public Call? Call { get; set; } diff --git a/src/Vapi.Net/Types/ServerMessageModelOutput.cs b/src/Vapi.Net/Types/ServerMessageModelOutput.cs index 116606c..a2d3567 100644 --- a/src/Vapi.Net/Types/ServerMessageModelOutput.cs +++ b/src/Vapi.Net/Types/ServerMessageModelOutput.cs @@ -7,11 +7,7 @@ namespace Vapi.Net; public record ServerMessageModelOutput { /// - /// This is the phone number associated with the call. - /// - /// This matches one of the following: - /// - `call.phoneNumber`, - /// - `call.phoneNumberId`. + /// This is the phone number that the message is associated with. /// [JsonPropertyName("phoneNumber")] public object? PhoneNumber { get; set; } @@ -23,7 +19,7 @@ public record ServerMessageModelOutput public string Type { get; set; } = "model-output"; /// - /// This is the timestamp of when the message was sent in milliseconds since Unix Epoch. + /// This is the timestamp of the message. /// [JsonPropertyName("timestamp")] public double? Timestamp { get; set; } @@ -37,35 +33,19 @@ public record ServerMessageModelOutput public Artifact? Artifact { get; set; } /// - /// This is the assistant that is currently active. This is provided for convenience. - /// - /// This matches one of the following: - /// - `call.assistant`, - /// - `call.assistantId`, - /// - `call.squad[n].assistant`, - /// - `call.squad[n].assistantId`, - /// - `call.squadId->[n].assistant`, - /// - `call.squadId->[n].assistantId`. + /// This is the assistant that the message is associated with. /// [JsonPropertyName("assistant")] public CreateAssistantDto? Assistant { get; set; } /// - /// This is the customer associated with the call. - /// - /// This matches one of the following: - /// - `call.customer`, - /// - `call.customerId`. + /// This is the customer that the message is associated with. /// [JsonPropertyName("customer")] public CreateCustomerDto? Customer { get; set; } /// - /// This is the call object. - /// - /// This matches what was returned in POST /call. - /// - /// Note: This might get stale during the call. To get the latest call object, especially after the call is ended, use GET /call/:id. + /// This is the call that the message is associated with. /// [JsonPropertyName("call")] public Call? Call { get; set; } diff --git a/src/Vapi.Net/Types/ServerMessagePhoneCallControl.cs b/src/Vapi.Net/Types/ServerMessagePhoneCallControl.cs index edfb08a..5a0a5ea 100644 --- a/src/Vapi.Net/Types/ServerMessagePhoneCallControl.cs +++ b/src/Vapi.Net/Types/ServerMessagePhoneCallControl.cs @@ -7,11 +7,7 @@ namespace Vapi.Net; public record ServerMessagePhoneCallControl { /// - /// This is the phone number associated with the call. - /// - /// This matches one of the following: - /// - `call.phoneNumber`, - /// - `call.phoneNumberId`. + /// This is the phone number that the message is associated with. /// [JsonPropertyName("phoneNumber")] public object? PhoneNumber { get; set; } @@ -37,7 +33,7 @@ public record ServerMessagePhoneCallControl public object? Destination { get; set; } /// - /// This is the timestamp of when the message was sent in milliseconds since Unix Epoch. + /// This is the timestamp of the message. /// [JsonPropertyName("timestamp")] public double? Timestamp { get; set; } @@ -51,35 +47,19 @@ public record ServerMessagePhoneCallControl public Artifact? Artifact { get; set; } /// - /// This is the assistant that is currently active. This is provided for convenience. - /// - /// This matches one of the following: - /// - `call.assistant`, - /// - `call.assistantId`, - /// - `call.squad[n].assistant`, - /// - `call.squad[n].assistantId`, - /// - `call.squadId->[n].assistant`, - /// - `call.squadId->[n].assistantId`. + /// This is the assistant that the message is associated with. /// [JsonPropertyName("assistant")] public CreateAssistantDto? Assistant { get; set; } /// - /// This is the customer associated with the call. - /// - /// This matches one of the following: - /// - `call.customer`, - /// - `call.customerId`. + /// This is the customer that the message is associated with. /// [JsonPropertyName("customer")] public CreateCustomerDto? Customer { get; set; } /// - /// This is the call object. - /// - /// This matches what was returned in POST /call. - /// - /// Note: This might get stale during the call. To get the latest call object, especially after the call is ended, use GET /call/:id. + /// This is the call that the message is associated with. /// [JsonPropertyName("call")] public Call? Call { get; set; } diff --git a/src/Vapi.Net/Types/ServerMessageResponseAssistantRequest.cs b/src/Vapi.Net/Types/ServerMessageResponseAssistantRequest.cs index 7042456..ecf676c 100644 --- a/src/Vapi.Net/Types/ServerMessageResponseAssistantRequest.cs +++ b/src/Vapi.Net/Types/ServerMessageResponseAssistantRequest.cs @@ -15,7 +15,12 @@ public record ServerMessageResponseAssistantRequest public object? Destination { get; set; } /// - /// This is the assistant that will be used for the call. To use a transient assistant, use `assistant` instead. + /// This is the assistant ID that will be used for the call. To use a transient assistant, use `assistant` instead. + /// + /// To start a call with: + /// - Assistant, use `assistantId` or `assistant` + /// - Squad, use `squadId` or `squad` + /// - Workflow, use `workflowId` or `workflow` /// [JsonPropertyName("assistantId")] public string? AssistantId { get; set; } @@ -23,7 +28,10 @@ public record ServerMessageResponseAssistantRequest /// /// This is the assistant that will be used for the call. To use an existing assistant, use `assistantId` instead. /// - /// If you're unsure why you're getting an invalid assistant, try logging your response and send the JSON blob to POST /assistant which will return the validation errors. + /// To start a call with: + /// - Assistant, use `assistant` + /// - Squad, use `squad` + /// - Workflow, use `workflow` /// [JsonPropertyName("assistant")] public CreateAssistantDto? Assistant { get; set; } @@ -36,16 +44,52 @@ public record ServerMessageResponseAssistantRequest /// /// This is the squad that will be used for the call. To use a transient squad, use `squad` instead. + /// + /// To start a call with: + /// - Assistant, use `assistant` or `assistantId` + /// - Squad, use `squad` or `squadId` + /// - Workflow, use `workflow` or `workflowId` /// [JsonPropertyName("squadId")] public string? SquadId { get; set; } /// /// This is a squad that will be used for the call. To use an existing squad, use `squadId` instead. + /// + /// To start a call with: + /// - Assistant, use `assistant` or `assistantId` + /// - Squad, use `squad` or `squadId` + /// - Workflow, use `workflow` or `workflowId` /// [JsonPropertyName("squad")] public CreateSquadDto? Squad { get; set; } + /// + /// [BETA] This feature is in active development. The API and behavior are subject to change as we refine it based on user feedback. + /// + /// This is the workflow that will be used for the call. To use a transient workflow, use `workflow` instead. + /// + /// To start a call with: + /// - Assistant, use `assistant` or `assistantId` + /// - Squad, use `squad` or `squadId` + /// - Workflow, use `workflow` or `workflowId` + /// + [JsonPropertyName("workflowId")] + public string? WorkflowId { get; set; } + + /// + /// [BETA] This feature is in active development. The API and behavior are subject to change as we refine it based on user feedback. + /// + /// This is a workflow that will be used for the call. To use an existing workflow, use `workflowId` instead. + /// + /// To start a call with: + /// - Assistant, use `assistant` or `assistantId` + /// - Squad, use `squad` or `squadId` + /// - Workflow, use `workflow` or `workflowId` + /// + [JsonPropertyName("workflow")] + public CreateWorkflowDto? Workflow { get; set; } + /// /// This is the error if the call shouldn't be accepted. This is spoken to the customer. /// diff --git a/src/Vapi.Net/Types/ServerMessageSpeechUpdate.cs b/src/Vapi.Net/Types/ServerMessageSpeechUpdate.cs index 9efb6c7..664f08e 100644 --- a/src/Vapi.Net/Types/ServerMessageSpeechUpdate.cs +++ b/src/Vapi.Net/Types/ServerMessageSpeechUpdate.cs @@ -7,11 +7,7 @@ namespace Vapi.Net; public record ServerMessageSpeechUpdate { /// - /// This is the phone number associated with the call. - /// - /// This matches one of the following: - /// - `call.phoneNumber`, - /// - `call.phoneNumberId`. + /// This is the phone number that the message is associated with. /// [JsonPropertyName("phoneNumber")] public object? PhoneNumber { get; set; } @@ -41,7 +37,7 @@ public record ServerMessageSpeechUpdate public double? Turn { get; set; } /// - /// This is the timestamp of when the message was sent in milliseconds since Unix Epoch. + /// This is the timestamp of the message. /// [JsonPropertyName("timestamp")] public double? Timestamp { get; set; } @@ -55,35 +51,19 @@ public record ServerMessageSpeechUpdate public Artifact? Artifact { get; set; } /// - /// This is the assistant that is currently active. This is provided for convenience. - /// - /// This matches one of the following: - /// - `call.assistant`, - /// - `call.assistantId`, - /// - `call.squad[n].assistant`, - /// - `call.squad[n].assistantId`, - /// - `call.squadId->[n].assistant`, - /// - `call.squadId->[n].assistantId`. + /// This is the assistant that the message is associated with. /// [JsonPropertyName("assistant")] public CreateAssistantDto? Assistant { get; set; } /// - /// This is the customer associated with the call. - /// - /// This matches one of the following: - /// - `call.customer`, - /// - `call.customerId`. + /// This is the customer that the message is associated with. /// [JsonPropertyName("customer")] public CreateCustomerDto? Customer { get; set; } /// - /// This is the call object. - /// - /// This matches what was returned in POST /call. - /// - /// Note: This might get stale during the call. To get the latest call object, especially after the call is ended, use GET /call/:id. + /// This is the call that the message is associated with. /// [JsonPropertyName("call")] public Call? Call { get; set; } diff --git a/src/Vapi.Net/Types/ServerMessageStatusUpdate.cs b/src/Vapi.Net/Types/ServerMessageStatusUpdate.cs index ee2a1f7..8bd45b2 100644 --- a/src/Vapi.Net/Types/ServerMessageStatusUpdate.cs +++ b/src/Vapi.Net/Types/ServerMessageStatusUpdate.cs @@ -8,11 +8,7 @@ namespace Vapi.Net; public record ServerMessageStatusUpdate { /// - /// This is the phone number associated with the call. - /// - /// This matches one of the following: - /// - `call.phoneNumber`, - /// - `call.phoneNumberId`. + /// This is the phone number that the message is associated with. /// [JsonPropertyName("phoneNumber")] public object? PhoneNumber { get; set; } @@ -56,7 +52,7 @@ public IEnumerable< public object? Destination { get; set; } /// - /// This is the timestamp of when the message was sent in milliseconds since Unix Epoch. + /// This is the timestamp of the message. /// [JsonPropertyName("timestamp")] public double? Timestamp { get; set; } @@ -70,35 +66,19 @@ public IEnumerable< public Artifact? Artifact { get; set; } /// - /// This is the assistant that is currently active. This is provided for convenience. - /// - /// This matches one of the following: - /// - `call.assistant`, - /// - `call.assistantId`, - /// - `call.squad[n].assistant`, - /// - `call.squad[n].assistantId`, - /// - `call.squadId->[n].assistant`, - /// - `call.squadId->[n].assistantId`. + /// This is the assistant that the message is associated with. /// [JsonPropertyName("assistant")] public CreateAssistantDto? Assistant { get; set; } /// - /// This is the customer associated with the call. - /// - /// This matches one of the following: - /// - `call.customer`, - /// - `call.customerId`. + /// This is the customer that the message is associated with. /// [JsonPropertyName("customer")] public CreateCustomerDto? Customer { get; set; } /// - /// This is the call object. - /// - /// This matches what was returned in POST /call. - /// - /// Note: This might get stale during the call. To get the latest call object, especially after the call is ended, use GET /call/:id. + /// This is the call that the message is associated with. /// [JsonPropertyName("call")] public Call? Call { get; set; } diff --git a/src/Vapi.Net/Types/ServerMessageStatusUpdateEndedReason.cs b/src/Vapi.Net/Types/ServerMessageStatusUpdateEndedReason.cs index ab1fdce..bb24f7d 100644 --- a/src/Vapi.Net/Types/ServerMessageStatusUpdateEndedReason.cs +++ b/src/Vapi.Net/Types/ServerMessageStatusUpdateEndedReason.cs @@ -281,6 +281,12 @@ public enum ServerMessageStatusUpdateEndedReason [EnumMember(Value = "phone-call-provider-bypass-enabled-but-no-call-received")] PhoneCallProviderBypassEnabledButNoCallReceived, + [EnumMember(Value = "call.in-progress.error-providerfault-transport-never-connected")] + CallInProgressErrorProviderfaultTransportNeverConnected, + + [EnumMember(Value = "call.in-progress.error-vapifault-worker-not-available")] + CallInProgressErrorVapifaultWorkerNotAvailable, + [EnumMember(Value = "call.in-progress.error-vapifault-transport-never-connected")] CallInProgressErrorVapifaultTransportNeverConnected, @@ -1559,6 +1565,9 @@ public enum ServerMessageStatusUpdateEndedReason [EnumMember(Value = "phone-call-provider-closed-websocket")] PhoneCallProviderClosedWebsocket, + [EnumMember(Value = "call.forwarding.operator-busy")] + CallForwardingOperatorBusy, + [EnumMember(Value = "silence-timed-out")] SilenceTimedOut, diff --git a/src/Vapi.Net/Types/ServerMessageToolCalls.cs b/src/Vapi.Net/Types/ServerMessageToolCalls.cs index 20b8077..35cc6ea 100644 --- a/src/Vapi.Net/Types/ServerMessageToolCalls.cs +++ b/src/Vapi.Net/Types/ServerMessageToolCalls.cs @@ -7,11 +7,7 @@ namespace Vapi.Net; public record ServerMessageToolCalls { /// - /// This is the phone number associated with the call. - /// - /// This matches one of the following: - /// - `call.phoneNumber`, - /// - `call.phoneNumberId`. + /// This is the phone number that the message is associated with. /// [JsonPropertyName("phoneNumber")] public object? PhoneNumber { get; set; } @@ -29,7 +25,7 @@ public record ServerMessageToolCalls public IEnumerable ToolWithToolCallList { get; set; } = new List(); /// - /// This is the timestamp of when the message was sent in milliseconds since Unix Epoch. + /// This is the timestamp of the message. /// [JsonPropertyName("timestamp")] public double? Timestamp { get; set; } @@ -43,35 +39,19 @@ public record ServerMessageToolCalls public Artifact? Artifact { get; set; } /// - /// This is the assistant that is currently active. This is provided for convenience. - /// - /// This matches one of the following: - /// - `call.assistant`, - /// - `call.assistantId`, - /// - `call.squad[n].assistant`, - /// - `call.squad[n].assistantId`, - /// - `call.squadId->[n].assistant`, - /// - `call.squadId->[n].assistantId`. + /// This is the assistant that the message is associated with. /// [JsonPropertyName("assistant")] public CreateAssistantDto? Assistant { get; set; } /// - /// This is the customer associated with the call. - /// - /// This matches one of the following: - /// - `call.customer`, - /// - `call.customerId`. + /// This is the customer that the message is associated with. /// [JsonPropertyName("customer")] public CreateCustomerDto? Customer { get; set; } /// - /// This is the call object. - /// - /// This matches what was returned in POST /call. - /// - /// Note: This might get stale during the call. To get the latest call object, especially after the call is ended, use GET /call/:id. + /// This is the call that the message is associated with. /// [JsonPropertyName("call")] public Call? Call { get; set; } diff --git a/src/Vapi.Net/Types/ServerMessageTranscript.cs b/src/Vapi.Net/Types/ServerMessageTranscript.cs index 8d380a8..ec578f6 100644 --- a/src/Vapi.Net/Types/ServerMessageTranscript.cs +++ b/src/Vapi.Net/Types/ServerMessageTranscript.cs @@ -7,11 +7,7 @@ namespace Vapi.Net; public record ServerMessageTranscript { /// - /// This is the phone number associated with the call. - /// - /// This matches one of the following: - /// - `call.phoneNumber`, - /// - `call.phoneNumberId`. + /// This is the phone number that the message is associated with. /// [JsonPropertyName("phoneNumber")] public object? PhoneNumber { get; set; } @@ -23,7 +19,7 @@ public record ServerMessageTranscript public required ServerMessageTranscriptType Type { get; set; } /// - /// This is the timestamp of when the message was sent in milliseconds since Unix Epoch. + /// This is the timestamp of the message. /// [JsonPropertyName("timestamp")] public double? Timestamp { get; set; } @@ -37,35 +33,19 @@ public record ServerMessageTranscript public Artifact? Artifact { get; set; } /// - /// This is the assistant that is currently active. This is provided for convenience. - /// - /// This matches one of the following: - /// - `call.assistant`, - /// - `call.assistantId`, - /// - `call.squad[n].assistant`, - /// - `call.squad[n].assistantId`, - /// - `call.squadId->[n].assistant`, - /// - `call.squadId->[n].assistantId`. + /// This is the assistant that the message is associated with. /// [JsonPropertyName("assistant")] public CreateAssistantDto? Assistant { get; set; } /// - /// This is the customer associated with the call. - /// - /// This matches one of the following: - /// - `call.customer`, - /// - `call.customerId`. + /// This is the customer that the message is associated with. /// [JsonPropertyName("customer")] public CreateCustomerDto? Customer { get; set; } /// - /// This is the call object. - /// - /// This matches what was returned in POST /call. - /// - /// Note: This might get stale during the call. To get the latest call object, especially after the call is ended, use GET /call/:id. + /// This is the call that the message is associated with. /// [JsonPropertyName("call")] public Call? Call { get; set; } diff --git a/src/Vapi.Net/Types/ServerMessageTranscriptType.cs b/src/Vapi.Net/Types/ServerMessageTranscriptType.cs index 6539ebc..1758c7f 100644 --- a/src/Vapi.Net/Types/ServerMessageTranscriptType.cs +++ b/src/Vapi.Net/Types/ServerMessageTranscriptType.cs @@ -1,15 +1,13 @@ -using System.Runtime.Serialization; using System.Text.Json.Serialization; using Vapi.Net.Core; +using System.Runtime.Serialization; namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] public enum ServerMessageTranscriptType { - [EnumMember(Value = "transcript")] - Transcript, + [EnumMember(Value = "transcript")]Transcript, - [EnumMember(Value = "transcript[transcriptType='final']")] - TranscriptTranscriptTypeFinal, + [EnumMember(Value = "transcript[transcriptType="final"]")]TranscriptTranscriptTypeFinal } diff --git a/src/Vapi.Net/Types/ServerMessageTransferDestinationRequest.cs b/src/Vapi.Net/Types/ServerMessageTransferDestinationRequest.cs index 54bbe5d..26b463a 100644 --- a/src/Vapi.Net/Types/ServerMessageTransferDestinationRequest.cs +++ b/src/Vapi.Net/Types/ServerMessageTransferDestinationRequest.cs @@ -7,11 +7,7 @@ namespace Vapi.Net; public record ServerMessageTransferDestinationRequest { /// - /// This is the phone number associated with the call. - /// - /// This matches one of the following: - /// - `call.phoneNumber`, - /// - `call.phoneNumberId`. + /// This is the phone number that the message is associated with. /// [JsonPropertyName("phoneNumber")] public object? PhoneNumber { get; set; } @@ -23,7 +19,7 @@ public record ServerMessageTransferDestinationRequest public string Type { get; set; } = "transfer-destination-request"; /// - /// This is the timestamp of when the message was sent in milliseconds since Unix Epoch. + /// This is the timestamp of the message. /// [JsonPropertyName("timestamp")] public double? Timestamp { get; set; } @@ -37,35 +33,19 @@ public record ServerMessageTransferDestinationRequest public Artifact? Artifact { get; set; } /// - /// This is the assistant that is currently active. This is provided for convenience. - /// - /// This matches one of the following: - /// - `call.assistant`, - /// - `call.assistantId`, - /// - `call.squad[n].assistant`, - /// - `call.squad[n].assistantId`, - /// - `call.squadId->[n].assistant`, - /// - `call.squadId->[n].assistantId`. + /// This is the assistant that the message is associated with. /// [JsonPropertyName("assistant")] public CreateAssistantDto? Assistant { get; set; } /// - /// This is the customer associated with the call. - /// - /// This matches one of the following: - /// - `call.customer`, - /// - `call.customerId`. + /// This is the customer that the message is associated with. /// [JsonPropertyName("customer")] public CreateCustomerDto? Customer { get; set; } /// - /// This is the call object. - /// - /// This matches what was returned in POST /call. - /// - /// Note: This might get stale during the call. To get the latest call object, especially after the call is ended, use GET /call/:id. + /// This is the call that the message is associated with. /// [JsonPropertyName("call")] public Call? Call { get; set; } diff --git a/src/Vapi.Net/Types/ServerMessageTransferUpdate.cs b/src/Vapi.Net/Types/ServerMessageTransferUpdate.cs index ca05fdc..3c42d7b 100644 --- a/src/Vapi.Net/Types/ServerMessageTransferUpdate.cs +++ b/src/Vapi.Net/Types/ServerMessageTransferUpdate.cs @@ -7,11 +7,7 @@ namespace Vapi.Net; public record ServerMessageTransferUpdate { /// - /// This is the phone number associated with the call. - /// - /// This matches one of the following: - /// - `call.phoneNumber`, - /// - `call.phoneNumberId`. + /// This is the phone number that the message is associated with. /// [JsonPropertyName("phoneNumber")] public object? PhoneNumber { get; set; } @@ -29,7 +25,7 @@ public record ServerMessageTransferUpdate public object? Destination { get; set; } /// - /// This is the timestamp of when the message was sent in milliseconds since Unix Epoch. + /// This is the timestamp of the message. /// [JsonPropertyName("timestamp")] public double? Timestamp { get; set; } @@ -43,35 +39,19 @@ public record ServerMessageTransferUpdate public Artifact? Artifact { get; set; } /// - /// This is the assistant that is currently active. This is provided for convenience. - /// - /// This matches one of the following: - /// - `call.assistant`, - /// - `call.assistantId`, - /// - `call.squad[n].assistant`, - /// - `call.squad[n].assistantId`, - /// - `call.squadId->[n].assistant`, - /// - `call.squadId->[n].assistantId`. + /// This is the assistant that the message is associated with. /// [JsonPropertyName("assistant")] public CreateAssistantDto? Assistant { get; set; } /// - /// This is the customer associated with the call. - /// - /// This matches one of the following: - /// - `call.customer`, - /// - `call.customerId`. + /// This is the customer that the message is associated with. /// [JsonPropertyName("customer")] public CreateCustomerDto? Customer { get; set; } /// - /// This is the call object. - /// - /// This matches what was returned in POST /call. - /// - /// Note: This might get stale during the call. To get the latest call object, especially after the call is ended, use GET /call/:id. + /// This is the call that the message is associated with. /// [JsonPropertyName("call")] public Call? Call { get; set; } diff --git a/src/Vapi.Net/Types/ServerMessageUserInterrupted.cs b/src/Vapi.Net/Types/ServerMessageUserInterrupted.cs index 5fac510..de39ab7 100644 --- a/src/Vapi.Net/Types/ServerMessageUserInterrupted.cs +++ b/src/Vapi.Net/Types/ServerMessageUserInterrupted.cs @@ -7,11 +7,7 @@ namespace Vapi.Net; public record ServerMessageUserInterrupted { /// - /// This is the phone number associated with the call. - /// - /// This matches one of the following: - /// - `call.phoneNumber`, - /// - `call.phoneNumberId`. + /// This is the phone number that the message is associated with. /// [JsonPropertyName("phoneNumber")] public object? PhoneNumber { get; set; } @@ -23,7 +19,7 @@ public record ServerMessageUserInterrupted public string Type { get; set; } = "user-interrupted"; /// - /// This is the timestamp of when the message was sent in milliseconds since Unix Epoch. + /// This is the timestamp of the message. /// [JsonPropertyName("timestamp")] public double? Timestamp { get; set; } @@ -37,35 +33,19 @@ public record ServerMessageUserInterrupted public Artifact? Artifact { get; set; } /// - /// This is the assistant that is currently active. This is provided for convenience. - /// - /// This matches one of the following: - /// - `call.assistant`, - /// - `call.assistantId`, - /// - `call.squad[n].assistant`, - /// - `call.squad[n].assistantId`, - /// - `call.squadId->[n].assistant`, - /// - `call.squadId->[n].assistantId`. + /// This is the assistant that the message is associated with. /// [JsonPropertyName("assistant")] public CreateAssistantDto? Assistant { get; set; } /// - /// This is the customer associated with the call. - /// - /// This matches one of the following: - /// - `call.customer`, - /// - `call.customerId`. + /// This is the customer that the message is associated with. /// [JsonPropertyName("customer")] public CreateCustomerDto? Customer { get; set; } /// - /// This is the call object. - /// - /// This matches what was returned in POST /call. - /// - /// Note: This might get stale during the call. To get the latest call object, especially after the call is ended, use GET /call/:id. + /// This is the call that the message is associated with. /// [JsonPropertyName("call")] public Call? Call { get; set; } diff --git a/src/Vapi.Net/Types/ServerMessageVoiceInput.cs b/src/Vapi.Net/Types/ServerMessageVoiceInput.cs index 224e7a8..998906f 100644 --- a/src/Vapi.Net/Types/ServerMessageVoiceInput.cs +++ b/src/Vapi.Net/Types/ServerMessageVoiceInput.cs @@ -7,11 +7,7 @@ namespace Vapi.Net; public record ServerMessageVoiceInput { /// - /// This is the phone number associated with the call. - /// - /// This matches one of the following: - /// - `call.phoneNumber`, - /// - `call.phoneNumberId`. + /// This is the phone number that the message is associated with. /// [JsonPropertyName("phoneNumber")] public object? PhoneNumber { get; set; } @@ -23,7 +19,7 @@ public record ServerMessageVoiceInput public string Type { get; set; } = "voice-input"; /// - /// This is the timestamp of when the message was sent in milliseconds since Unix Epoch. + /// This is the timestamp of the message. /// [JsonPropertyName("timestamp")] public double? Timestamp { get; set; } @@ -37,35 +33,19 @@ public record ServerMessageVoiceInput public Artifact? Artifact { get; set; } /// - /// This is the assistant that is currently active. This is provided for convenience. - /// - /// This matches one of the following: - /// - `call.assistant`, - /// - `call.assistantId`, - /// - `call.squad[n].assistant`, - /// - `call.squad[n].assistantId`, - /// - `call.squadId->[n].assistant`, - /// - `call.squadId->[n].assistantId`. + /// This is the assistant that the message is associated with. /// [JsonPropertyName("assistant")] public CreateAssistantDto? Assistant { get; set; } /// - /// This is the customer associated with the call. - /// - /// This matches one of the following: - /// - `call.customer`, - /// - `call.customerId`. + /// This is the customer that the message is associated with. /// [JsonPropertyName("customer")] public CreateCustomerDto? Customer { get; set; } /// - /// This is the call object. - /// - /// This matches what was returned in POST /call. - /// - /// Note: This might get stale during the call. To get the latest call object, especially after the call is ended, use GET /call/:id. + /// This is the call that the message is associated with. /// [JsonPropertyName("call")] public Call? Call { get; set; } diff --git a/src/Vapi.Net/Types/ServerMessageVoiceRequest.cs b/src/Vapi.Net/Types/ServerMessageVoiceRequest.cs index 7184885..dc406fb 100644 --- a/src/Vapi.Net/Types/ServerMessageVoiceRequest.cs +++ b/src/Vapi.Net/Types/ServerMessageVoiceRequest.cs @@ -7,11 +7,7 @@ namespace Vapi.Net; public record ServerMessageVoiceRequest { /// - /// This is the phone number associated with the call. - /// - /// This matches one of the following: - /// - `call.phoneNumber`, - /// - `call.phoneNumberId`. + /// This is the phone number that the message is associated with. /// [JsonPropertyName("phoneNumber")] public object? PhoneNumber { get; set; } @@ -44,7 +40,7 @@ public record ServerMessageVoiceRequest public string Type { get; set; } = "voice-request"; /// - /// This is the timestamp of when the message was sent in milliseconds since Unix Epoch. + /// This is the timestamp of the message. /// [JsonPropertyName("timestamp")] public double? Timestamp { get; set; } @@ -58,35 +54,19 @@ public record ServerMessageVoiceRequest public Artifact? Artifact { get; set; } /// - /// This is the assistant that is currently active. This is provided for convenience. - /// - /// This matches one of the following: - /// - `call.assistant`, - /// - `call.assistantId`, - /// - `call.squad[n].assistant`, - /// - `call.squad[n].assistantId`, - /// - `call.squadId->[n].assistant`, - /// - `call.squadId->[n].assistantId`. + /// This is the assistant that the message is associated with. /// [JsonPropertyName("assistant")] public CreateAssistantDto? Assistant { get; set; } /// - /// This is the customer associated with the call. - /// - /// This matches one of the following: - /// - `call.customer`, - /// - `call.customerId`. + /// This is the customer that the message is associated with. /// [JsonPropertyName("customer")] public CreateCustomerDto? Customer { get; set; } /// - /// This is the call object. - /// - /// This matches what was returned in POST /call. - /// - /// Note: This might get stale during the call. To get the latest call object, especially after the call is ended, use GET /call/:id. + /// This is the call that the message is associated with. /// [JsonPropertyName("call")] public Call? Call { get; set; } diff --git a/src/Vapi.Net/Types/SesameVoice.cs b/src/Vapi.Net/Types/SesameVoice.cs new file mode 100644 index 0000000..3bbd0f5 --- /dev/null +++ b/src/Vapi.Net/Types/SesameVoice.cs @@ -0,0 +1,54 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record SesameVoice +{ + /// + /// This is the flag to toggle voice caching for the assistant. + /// + [JsonPropertyName("cachingEnabled")] + public bool? CachingEnabled { get; set; } + + /// + /// This is the provider-specific ID that will be used. + /// + [JsonPropertyName("voiceId")] + public required string VoiceId { get; set; } + + /// + /// This is the model that will be used. + /// + [JsonPropertyName("model")] + public string Model { get; set; } = "csm-1b"; + + /// + /// This is the plan for chunking the model output before it is sent to the voice provider. + /// + [JsonPropertyName("chunkPlan")] + public ChunkPlan? ChunkPlan { get; set; } + + /// + /// This is the plan for voice provider fallbacks in the event that the primary voice provider fails. + /// + [JsonPropertyName("fallbackPlan")] + public FallbackPlan? FallbackPlan { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/SmallestAiVoice.cs b/src/Vapi.Net/Types/SmallestAiVoice.cs index 9f93c24..50f8aa2 100644 --- a/src/Vapi.Net/Types/SmallestAiVoice.cs +++ b/src/Vapi.Net/Types/SmallestAiVoice.cs @@ -7,6 +7,12 @@ namespace Vapi.Net; public record SmallestAiVoice { + /// + /// This is the flag to toggle voice caching for the assistant. + /// + [JsonPropertyName("cachingEnabled")] + public bool? CachingEnabled { get; set; } + /// /// This is the provider-specific ID that will be used. /// diff --git a/src/Vapi.Net/Types/SmsSendTool.cs b/src/Vapi.Net/Types/SmsTool.cs similarity index 99% rename from src/Vapi.Net/Types/SmsSendTool.cs rename to src/Vapi.Net/Types/SmsTool.cs index 3c5fde5..418aad1 100644 --- a/src/Vapi.Net/Types/SmsSendTool.cs +++ b/src/Vapi.Net/Types/SmsTool.cs @@ -4,7 +4,7 @@ namespace Vapi.Net; -public record SmsSendTool +public record SmsTool { /// /// This determines if the tool is async. diff --git a/src/Vapi.Net/Types/StartSpeakingPlan.cs b/src/Vapi.Net/Types/StartSpeakingPlan.cs index 3886b7d..2d102ac 100644 --- a/src/Vapi.Net/Types/StartSpeakingPlan.cs +++ b/src/Vapi.Net/Types/StartSpeakingPlan.cs @@ -25,7 +25,7 @@ public record StartSpeakingPlan public double? WaitSeconds { get; set; } [JsonPropertyName("smartEndpointingEnabled")] - public object? SmartEndpointingEnabled { get; set; } + public OneOf? SmartEndpointingEnabled { get; set; } /// /// This is the plan for smart endpointing. Pick between Vapi smart endpointing or LiveKit smart endpointing (or nothing). We strongly recommend using livekit endpointing when working in English. LiveKit endpointing is not supported in other languages, yet. diff --git a/src/Vapi.Net/Types/StructuredDataPlan.cs b/src/Vapi.Net/Types/StructuredDataPlan.cs index a5ceca3..5809aa8 100644 --- a/src/Vapi.Net/Types/StructuredDataPlan.cs +++ b/src/Vapi.Net/Types/StructuredDataPlan.cs @@ -17,14 +17,14 @@ public record StructuredDataPlan /// }, /// { /// "role": "user", - /// "content": "Here is the transcript:\n\n{{transcript}}\n\n" + /// "content": "Here is the transcript:\n\n{{transcript}}\n\n. Here is the ended reason of the call:\n\n{{endedReason}}\n\n" /// } /// ]``` /// /// You can customize by providing any messages you want. /// /// Here are the template variables available: - /// - {{transcript}}: the transcript of the call from `call.artifact.transcript`- {{systemPrompt}}: the system prompt of the call from `assistant.model.messages[type=system].content`- {{schema}}: the schema of the structured data from `structuredDataPlan.schema` + /// - {{transcript}}: the transcript of the call from `call.artifact.transcript`- {{systemPrompt}}: the system prompt of the call from `assistant.model.messages[type=system].content`- {{schema}}: the schema of the structured data from `structuredDataPlan.schema`- {{endedReason}}: the ended reason of the call from `call.endedReason` /// [JsonPropertyName("messages")] public IEnumerable? Messages { get; set; } diff --git a/src/Vapi.Net/Types/SuccessEvaluationPlan.cs b/src/Vapi.Net/Types/SuccessEvaluationPlan.cs index a79a11a..6c6b757 100644 --- a/src/Vapi.Net/Types/SuccessEvaluationPlan.cs +++ b/src/Vapi.Net/Types/SuccessEvaluationPlan.cs @@ -39,14 +39,14 @@ public record SuccessEvaluationPlan /// }, /// { /// "role": "user", - /// "content": "Here was the system prompt of the call:\n\n{{systemPrompt}}\n\n" + /// "content": "Here was the system prompt of the call:\n\n{{systemPrompt}}\n\n. Here is the ended reason of the call:\n\n{{endedReason}}\n\n" /// } /// ]``` /// /// You can customize by providing any messages you want. /// /// Here are the template variables available: - /// - {{transcript}}: the transcript of the call from `call.artifact.transcript`- {{systemPrompt}}: the system prompt of the call from `assistant.model.messages[type=system].content`- {{rubric}}: the rubric of the success evaluation from `successEvaluationPlan.rubric` + /// - {{transcript}}: the transcript of the call from `call.artifact.transcript`- {{systemPrompt}}: the system prompt of the call from `assistant.model.messages[type=system].content`- {{rubric}}: the rubric of the success evaluation from `successEvaluationPlan.rubric`- {{endedReason}}: the ended reason of the call from `call.endedReason` /// [JsonPropertyName("messages")] public IEnumerable? Messages { get; set; } diff --git a/src/Vapi.Net/Types/SummaryPlan.cs b/src/Vapi.Net/Types/SummaryPlan.cs index bf2a421..0687a2d 100644 --- a/src/Vapi.Net/Types/SummaryPlan.cs +++ b/src/Vapi.Net/Types/SummaryPlan.cs @@ -17,14 +17,14 @@ public record SummaryPlan /// }, /// { /// "role": "user", - /// "content": "Here is the transcript:\n\n{{transcript}}\n\n" + /// "content": "Here is the transcript:\n\n{{transcript}}\n\n. Here is the ended reason of the call:\n\n{{endedReason}}\n\n" /// } /// ]``` /// /// You can customize by providing any messages you want. /// /// Here are the template variables available: - /// - {{transcript}}: The transcript of the call from `call.artifact.transcript`- {{systemPrompt}}: The system prompt of the call from `assistant.model.messages[type=system].content` + /// - {{transcript}}: The transcript of the call from `call.artifact.transcript`- {{systemPrompt}}: The system prompt of the call from `assistant.model.messages[type=system].content`- {{endedReason}}: The ended reason of the call from `call.endedReason` /// [JsonPropertyName("messages")] public IEnumerable? Messages { get; set; } diff --git a/src/Vapi.Net/Types/TavusVoice.cs b/src/Vapi.Net/Types/TavusVoice.cs index bc0fb6e..4071371 100644 --- a/src/Vapi.Net/Types/TavusVoice.cs +++ b/src/Vapi.Net/Types/TavusVoice.cs @@ -7,6 +7,12 @@ namespace Vapi.Net; public record TavusVoice { + /// + /// This is the flag to toggle voice caching for the assistant. + /// + [JsonPropertyName("cachingEnabled")] + public bool? CachingEnabled { get; set; } + /// /// This is the provider-specific ID that will be used. /// diff --git a/src/Vapi.Net/Types/TelnyxPhoneNumber.cs b/src/Vapi.Net/Types/TelnyxPhoneNumber.cs index 2b729cc..a027eaa 100644 --- a/src/Vapi.Net/Types/TelnyxPhoneNumber.cs +++ b/src/Vapi.Net/Types/TelnyxPhoneNumber.cs @@ -62,15 +62,23 @@ public record TelnyxPhoneNumber /// /// This is the assistant that will be used for incoming calls to this phone number. /// - /// If neither `assistantId` nor `squadId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected. + /// If neither `assistantId`, `squadId` nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected. /// [JsonPropertyName("assistantId")] public string? AssistantId { get; set; } + /// + /// This is the workflow that will be used for incoming calls to this phone number. + /// + /// If neither `assistantId`, `squadId`, nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected. + /// + [JsonPropertyName("workflowId")] + public string? WorkflowId { get; set; } + /// /// This is the squad that will be used for incoming calls to this phone number. /// - /// If neither `assistantId` nor `squadId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected. + /// If neither `assistantId`, `squadId`, nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected. /// [JsonPropertyName("squadId")] public string? SquadId { get; set; } diff --git a/src/Vapi.Net/Types/ToolCallResult.cs b/src/Vapi.Net/Types/ToolCallResult.cs index 7b88558..3be6d0e 100644 --- a/src/Vapi.Net/Types/ToolCallResult.cs +++ b/src/Vapi.Net/Types/ToolCallResult.cs @@ -14,7 +14,7 @@ public record ToolCallResult /// 2. a response generated by the model, if not /// [JsonPropertyName("message")] - public IEnumerable? Message { get; set; } + public ToolCallResultMessage? Message { get; set; } /// /// This is the name of the function the model called. @@ -50,6 +50,12 @@ public record ToolCallResult [JsonPropertyName("error")] public string? Error { get; set; } + /// + /// This is optional metadata for the tool call result to be sent to the client. + /// + [JsonPropertyName("metadata")] + public object? Metadata { get; set; } + /// /// Additional properties received from the response, if any. /// diff --git a/src/Vapi.Net/Types/ToolCallResultMessage.cs b/src/Vapi.Net/Types/ToolCallResultMessage.cs index ec5f709..1af636a 100644 --- a/src/Vapi.Net/Types/ToolCallResultMessage.cs +++ b/src/Vapi.Net/Types/ToolCallResultMessage.cs @@ -42,6 +42,12 @@ public record ToolCallResultMessage [JsonPropertyName("secondsFromStart")] public required double SecondsFromStart { get; set; } + /// + /// The metadata for the tool call result. + /// + [JsonPropertyName("metadata")] + public object? Metadata { get; set; } + /// /// Additional properties received from the response, if any. /// diff --git a/src/Vapi.Net/Types/ToolNode.cs b/src/Vapi.Net/Types/ToolNode.cs new file mode 100644 index 0000000..5e001e4 --- /dev/null +++ b/src/Vapi.Net/Types/ToolNode.cs @@ -0,0 +1,51 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record ToolNode +{ + /// + /// This is the tool to call. To use an existing tool, send `toolId` instead. + /// + [JsonPropertyName("tool")] + public object? Tool { get; set; } + + /// + /// This is the tool to call. To use a transient tool, send `tool` instead. + /// + [JsonPropertyName("toolId")] + public string? ToolId { get; set; } + + [JsonPropertyName("name")] + public required string Name { get; set; } + + /// + /// This is whether or not the node is the start of the workflow. + /// + [JsonPropertyName("isStart")] + public bool? IsStart { get; set; } + + /// + /// This is for metadata you want to store on the task. + /// + [JsonPropertyName("metadata")] + public object? Metadata { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/TransferAssistantHookAction.cs b/src/Vapi.Net/Types/TransferAssistantHookAction.cs index e3544d9..160aa03 100644 --- a/src/Vapi.Net/Types/TransferAssistantHookAction.cs +++ b/src/Vapi.Net/Types/TransferAssistantHookAction.cs @@ -6,12 +6,6 @@ namespace Vapi.Net; public record TransferAssistantHookAction { - /// - /// This is the type of action - must be "transfer" - /// - [JsonPropertyName("type")] - public string Type { get; set; } = "transfer"; - /// /// This is the destination details for the transfer - can be a phone number or SIP URI /// diff --git a/src/Vapi.Net/Types/TransferDestinationStep.cs b/src/Vapi.Net/Types/TransferDestinationStep.cs deleted file mode 100644 index 666874f..0000000 --- a/src/Vapi.Net/Types/TransferDestinationStep.cs +++ /dev/null @@ -1,49 +0,0 @@ -using System.Text.Json; -using System.Text.Json.Serialization; -using OneOf; -using Vapi.Net.Core; - -namespace Vapi.Net; - -public record TransferDestinationStep -{ - /// - /// This is spoken to the customer before connecting them to the destination. - /// - /// Usage: - /// - If this is not provided and transfer tool messages is not provided, default is "Transferring the call now". - /// - If set to "", nothing is spoken. This is useful when you want to silently transfer. This is especially useful when transferring between assistants in a squad. In this scenario, you likely also want to set `assistant.firstMessageMode=assistant-speaks-first-with-model-generated-message` for the destination assistant. - /// - /// This accepts a string or a ToolMessageStart class. Latter is useful if you want to specify multiple messages for different languages through the `contents` field. - /// - [JsonPropertyName("message")] - public OneOf? Message { get; set; } - - /// - /// This is the step to transfer to. - /// - [JsonPropertyName("stepName")] - public required string StepName { get; set; } - - /// - /// This is the description of the destination, used by the AI to choose when and how to transfer the call. - /// - [JsonPropertyName("description")] - public string? Description { get; set; } - - /// - /// Additional properties received from the response, if any. - /// - /// - /// [EXPERIMENTAL] This API is experimental and may change in future releases. - /// - [JsonExtensionData] - public IDictionary AdditionalProperties { get; internal set; } = - new Dictionary(); - - /// - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Vapi.Net/Types/TransferFallbackPlan.cs b/src/Vapi.Net/Types/TransferFallbackPlan.cs new file mode 100644 index 0000000..8f7fa0b --- /dev/null +++ b/src/Vapi.Net/Types/TransferFallbackPlan.cs @@ -0,0 +1,41 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using OneOf; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record TransferFallbackPlan +{ + /// + /// This is the message the assistant will deliver to the customer if the transfer fails. + /// + [JsonPropertyName("message")] + public required OneOf Message { get; set; } + + /// + /// This controls what happens after delivering the failure message to the customer. + /// - true: End the call after delivering the failure message (default) + /// - false: Keep the assistant on the call to continue handling the customer's request + /// + /// @default true + /// + [JsonPropertyName("endCallEnabled")] + public bool? EndCallEnabled { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/Transfer.cs b/src/Vapi.Net/Types/TransferPhoneNumberHookAction.cs similarity index 68% rename from src/Vapi.Net/Types/Transfer.cs rename to src/Vapi.Net/Types/TransferPhoneNumberHookAction.cs index 3045fd8..dea0dd3 100644 --- a/src/Vapi.Net/Types/Transfer.cs +++ b/src/Vapi.Net/Types/TransferPhoneNumberHookAction.cs @@ -4,19 +4,13 @@ namespace Vapi.Net; -public record Transfer +public record TransferPhoneNumberHookAction { - [JsonPropertyName("destination")] - public object Destination { get; set; } = new Dictionary(); - - [JsonPropertyName("name")] - public required string Name { get; set; } - /// - /// This is for metadata you want to store on the task. + /// This is the destination details for the transfer - can be a phone number or SIP URI /// - [JsonPropertyName("metadata")] - public object? Metadata { get; set; } + [JsonPropertyName("destination")] + public object? Destination { get; set; } /// /// Additional properties received from the response, if any. diff --git a/src/Vapi.Net/Types/TransferPlan.cs b/src/Vapi.Net/Types/TransferPlan.cs index 8c6768b..509f7b0 100644 --- a/src/Vapi.Net/Types/TransferPlan.cs +++ b/src/Vapi.Net/Types/TransferPlan.cs @@ -18,6 +18,7 @@ public record TransferPlan /// - `warm-transfer-wait-for-operator-to-speak-first-and-then-say-message`: The assistant dials the destination, waits for the operator to speak, delivers the `message` to the destination party, and then connects the customer. /// - `warm-transfer-wait-for-operator-to-speak-first-and-then-say-summary`: The assistant dials the destination, waits for the operator to speak, provides a summary of the call to the destination party, and then connects the customer. /// - `warm-transfer-twiml`: The assistant dials the destination, executes the twiml instructions on the destination call leg, connects the customer, and leaves the call. + /// - `warm-transfer-experimental`: The assistant puts the customer on hold, dials the destination, and if the destination answers (and is human), delivers a message or summary before connecting the customer. If the destination is unreachable or not human (e.g., with voicemail detection), the assistant delivers the `fallbackMessage` to the customer and optionally ends the call. /// /// @default 'blind-transfer' /// @@ -28,7 +29,7 @@ public record TransferPlan /// This is the message the assistant will deliver to the destination party before connecting the customer. /// /// Usage: - /// - Used only when `mode` is `blind-transfer-add-summary-to-sip-header`, `warm-transfer-say-message` or `warm-transfer-wait-for-operator-to-speak-first-and-then-say-message`. + /// - Used only when `mode` is `blind-transfer-add-summary-to-sip-header`, `warm-transfer-say-message`, `warm-transfer-wait-for-operator-to-speak-first-and-then-say-message`, or `warm-transfer-experimental`. /// [JsonPropertyName("message")] public OneOf? Message { get; set; } @@ -42,6 +43,19 @@ public record TransferPlan [JsonPropertyName("sipVerb")] public object? SipVerb { get; set; } + /// + /// This is the URL to an audio file played while the customer is on hold during transfer. + /// + /// Usage: + /// - Used only when `mode` is `warm-transfer-experimental`. + /// - Used when transferring calls to play hold audio for the customer. + /// - Must be a publicly accessible URL to an audio file. + /// - Supported formats: MP3 and WAV. + /// - If not provided, the default hold audio will be used. + /// + [JsonPropertyName("holdAudioUrl")] + public string? HoldAudioUrl { get; set; } + /// /// This is the TwiML instructions to execute on the destination call leg before connecting the customer. /// @@ -64,11 +78,29 @@ public record TransferPlan /// This is the plan for generating a summary of the call to present to the destination party. /// /// Usage: - /// - Used only when `mode` is `blind-transfer-add-summary-to-sip-header` or `warm-transfer-say-summary` or `warm-transfer-wait-for-operator-to-speak-first-and-then-say-summary`. + /// - Used only when `mode` is `blind-transfer-add-summary-to-sip-header` or `warm-transfer-say-summary` or `warm-transfer-wait-for-operator-to-speak-first-and-then-say-summary` or `warm-transfer-experimental`. /// [JsonPropertyName("summaryPlan")] public SummaryPlan? SummaryPlan { get; set; } + /// + /// This flag includes the sipHeaders from above in the refer to sip uri as url encoded query params. + /// + /// @default false + /// + [JsonPropertyName("sipHeadersInReferToEnabled")] + public bool? SipHeadersInReferToEnabled { get; set; } + + /// + /// This configures the fallback plan when the transfer fails (destination unreachable, busy, or not human). + /// + /// Usage: + /// - Used only when `mode` is `warm-transfer-experimental`. + /// - If not provided when using `warm-transfer-experimental`, a default message will be used. + /// + [JsonPropertyName("fallbackPlan")] + public TransferFallbackPlan? FallbackPlan { get; set; } + /// /// Additional properties received from the response, if any. /// diff --git a/src/Vapi.Net/Types/TransferPlanMode.cs b/src/Vapi.Net/Types/TransferPlanMode.cs index 3adc789..70a2dee 100644 --- a/src/Vapi.Net/Types/TransferPlanMode.cs +++ b/src/Vapi.Net/Types/TransferPlanMode.cs @@ -27,4 +27,7 @@ public enum TransferPlanMode [EnumMember(Value = "warm-transfer-wait-for-operator-to-speak-first-and-then-say-summary")] WarmTransferWaitForOperatorToSpeakFirstAndThenSaySummary, + + [EnumMember(Value = "warm-transfer-experimental")] + WarmTransferExperimental, } diff --git a/src/Vapi.Net/Types/TwilioCredential.cs b/src/Vapi.Net/Types/TwilioCredential.cs index 7e6b8f5..37390d5 100644 --- a/src/Vapi.Net/Types/TwilioCredential.cs +++ b/src/Vapi.Net/Types/TwilioCredential.cs @@ -13,7 +13,19 @@ public record TwilioCredential /// This is not returned in the API. /// [JsonPropertyName("authToken")] - public required string AuthToken { get; set; } + public string? AuthToken { get; set; } + + /// + /// This is not returned in the API. + /// + [JsonPropertyName("apiKey")] + public string? ApiKey { get; set; } + + /// + /// This is not returned in the API. + /// + [JsonPropertyName("apiSecret")] + public string? ApiSecret { get; set; } /// /// This is the unique identifier for the credential. diff --git a/src/Vapi.Net/Types/TwilioPhoneNumber.cs b/src/Vapi.Net/Types/TwilioPhoneNumber.cs index f6f09d2..d936623 100644 --- a/src/Vapi.Net/Types/TwilioPhoneNumber.cs +++ b/src/Vapi.Net/Types/TwilioPhoneNumber.cs @@ -23,6 +23,17 @@ public record TwilioPhoneNumber [JsonPropertyName("hooks")] public IEnumerable? Hooks { get; set; } + /// + /// Controls whether Vapi sets the messaging webhook URL on the Twilio number during import. + /// + /// If set to `false`, Vapi will not update the Twilio messaging URL, leaving it as is. + /// If `true` or omitted (default), Vapi will configure both the voice and messaging URLs. + /// + /// @default true + /// + [JsonPropertyName("smsEnabled")] + public bool? SmsEnabled { get; set; } + /// /// This is the unique identifier for the phone number. /// @@ -53,6 +64,24 @@ public record TwilioPhoneNumber [JsonPropertyName("status")] public TwilioPhoneNumberStatus? Status { get; set; } + /// + /// This is the Twilio Auth Token for the phone number. + /// + [JsonPropertyName("twilioAuthToken")] + public string? TwilioAuthToken { get; set; } + + /// + /// This is the Twilio API Key for the phone number. + /// + [JsonPropertyName("twilioApiKey")] + public string? TwilioApiKey { get; set; } + + /// + /// This is the Twilio API Secret for the phone number. + /// + [JsonPropertyName("twilioApiSecret")] + public string? TwilioApiSecret { get; set; } + /// /// This is the name of the phone number. This is just for your own reference. /// @@ -62,15 +91,23 @@ public record TwilioPhoneNumber /// /// This is the assistant that will be used for incoming calls to this phone number. /// - /// If neither `assistantId` nor `squadId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected. + /// If neither `assistantId`, `squadId` nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected. /// [JsonPropertyName("assistantId")] public string? AssistantId { get; set; } + /// + /// This is the workflow that will be used for incoming calls to this phone number. + /// + /// If neither `assistantId`, `squadId`, nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected. + /// + [JsonPropertyName("workflowId")] + public string? WorkflowId { get; set; } + /// /// This is the squad that will be used for incoming calls to this phone number. /// - /// If neither `assistantId` nor `squadId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected. + /// If neither `assistantId`, `squadId`, nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected. /// [JsonPropertyName("squadId")] public string? SquadId { get; set; } @@ -99,12 +136,6 @@ public record TwilioPhoneNumber [JsonPropertyName("twilioAccountSid")] public required string TwilioAccountSid { get; set; } - /// - /// This is the Twilio Auth Token for the phone number. - /// - [JsonPropertyName("twilioAuthToken")] - public required string TwilioAuthToken { get; set; } - /// /// Additional properties received from the response, if any. /// diff --git a/src/Vapi.Net/Types/UpdateAzureOpenAiCredentialDtoModelsItem.cs b/src/Vapi.Net/Types/UpdateAzureOpenAiCredentialDtoModelsItem.cs index b68c9f5..dd8296d 100644 --- a/src/Vapi.Net/Types/UpdateAzureOpenAiCredentialDtoModelsItem.cs +++ b/src/Vapi.Net/Types/UpdateAzureOpenAiCredentialDtoModelsItem.cs @@ -7,18 +7,27 @@ namespace Vapi.Net; [JsonConverter(typeof(EnumSerializer))] public enum UpdateAzureOpenAiCredentialDtoModelsItem { + [EnumMember(Value = "gpt-4.1-2025-04-14")] + Gpt4120250414, + + [EnumMember(Value = "gpt-4.1-mini-2025-04-14")] + Gpt41Mini20250414, + + [EnumMember(Value = "gpt-4.1-nano-2025-04-14")] + Gpt41Nano20250414, + [EnumMember(Value = "gpt-4o-2024-11-20")] Gpt4O20241120, [EnumMember(Value = "gpt-4o-2024-08-06")] Gpt4O20240806, - [EnumMember(Value = "gpt-4o-mini-2024-07-18")] - Gpt4OMini20240718, - [EnumMember(Value = "gpt-4o-2024-05-13")] Gpt4O20240513, + [EnumMember(Value = "gpt-4o-mini-2024-07-18")] + Gpt4OMini20240718, + [EnumMember(Value = "gpt-4-turbo-2024-04-09")] Gpt4Turbo20240409, diff --git a/src/Vapi.Net/Types/UpdateByoPhoneNumberDto.cs b/src/Vapi.Net/Types/UpdateByoPhoneNumberDto.cs index 3397696..140431c 100644 --- a/src/Vapi.Net/Types/UpdateByoPhoneNumberDto.cs +++ b/src/Vapi.Net/Types/UpdateByoPhoneNumberDto.cs @@ -46,15 +46,23 @@ public record UpdateByoPhoneNumberDto /// /// This is the assistant that will be used for incoming calls to this phone number. /// - /// If neither `assistantId` nor `squadId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected. + /// If neither `assistantId`, `squadId` nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected. /// [JsonPropertyName("assistantId")] public string? AssistantId { get; set; } + /// + /// This is the workflow that will be used for incoming calls to this phone number. + /// + /// If neither `assistantId`, `squadId`, nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected. + /// + [JsonPropertyName("workflowId")] + public string? WorkflowId { get; set; } + /// /// This is the squad that will be used for incoming calls to this phone number. /// - /// If neither `assistantId` nor `squadId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected. + /// If neither `assistantId`, `squadId`, nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected. /// [JsonPropertyName("squadId")] public string? SquadId { get; set; } diff --git a/src/Vapi.Net/Types/UpdateGoHighLevelCalendarAvailabilityToolDto.cs b/src/Vapi.Net/Types/UpdateGoHighLevelCalendarAvailabilityToolDto.cs new file mode 100644 index 0000000..4e1b6a6 --- /dev/null +++ b/src/Vapi.Net/Types/UpdateGoHighLevelCalendarAvailabilityToolDto.cs @@ -0,0 +1,64 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record UpdateGoHighLevelCalendarAvailabilityToolDto +{ + /// + /// This determines if the tool is async. + /// + /// If async, the assistant will move forward without waiting for your server to respond. This is useful if you just want to trigger something on your server. + /// + /// If sync, the assistant will wait for your server to respond. This is useful if want assistant to respond with the result from your server. + /// + /// Defaults to synchronous (`false`). + /// + [JsonPropertyName("async")] + public bool? Async { get; set; } + + /// + /// These are the messages that will be spoken to the user as the tool is running. + /// + /// For some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured. + /// + [JsonPropertyName("messages")] + public IEnumerable? Messages { get; set; } + + /// + /// This is the function definition of the tool. + /// + /// For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + /// + /// An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + /// + [JsonPropertyName("function")] + public OpenAiFunction? Function { get; set; } + + /// + /// This is the server that will be hit when this tool is requested by the model. + /// + /// All requests will be sent with the call object among other things. You can find more details in the Server URL documentation. + /// + /// This overrides the serverUrl set on the org and the phoneNumber. Order of precedence: highest tool.server.url, then assistant.serverUrl, then phoneNumber.serverUrl, then org.serverUrl. + /// + [JsonPropertyName("server")] + public Server? Server { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/UpdateGoHighLevelCalendarEventCreateToolDto.cs b/src/Vapi.Net/Types/UpdateGoHighLevelCalendarEventCreateToolDto.cs new file mode 100644 index 0000000..e69c5d1 --- /dev/null +++ b/src/Vapi.Net/Types/UpdateGoHighLevelCalendarEventCreateToolDto.cs @@ -0,0 +1,64 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record UpdateGoHighLevelCalendarEventCreateToolDto +{ + /// + /// This determines if the tool is async. + /// + /// If async, the assistant will move forward without waiting for your server to respond. This is useful if you just want to trigger something on your server. + /// + /// If sync, the assistant will wait for your server to respond. This is useful if want assistant to respond with the result from your server. + /// + /// Defaults to synchronous (`false`). + /// + [JsonPropertyName("async")] + public bool? Async { get; set; } + + /// + /// These are the messages that will be spoken to the user as the tool is running. + /// + /// For some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured. + /// + [JsonPropertyName("messages")] + public IEnumerable? Messages { get; set; } + + /// + /// This is the function definition of the tool. + /// + /// For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + /// + /// An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + /// + [JsonPropertyName("function")] + public OpenAiFunction? Function { get; set; } + + /// + /// This is the server that will be hit when this tool is requested by the model. + /// + /// All requests will be sent with the call object among other things. You can find more details in the Server URL documentation. + /// + /// This overrides the serverUrl set on the org and the phoneNumber. Order of precedence: highest tool.server.url, then assistant.serverUrl, then phoneNumber.serverUrl, then org.serverUrl. + /// + [JsonPropertyName("server")] + public Server? Server { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/UpdateGoHighLevelContactCreateToolDto.cs b/src/Vapi.Net/Types/UpdateGoHighLevelContactCreateToolDto.cs new file mode 100644 index 0000000..f3118c7 --- /dev/null +++ b/src/Vapi.Net/Types/UpdateGoHighLevelContactCreateToolDto.cs @@ -0,0 +1,64 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record UpdateGoHighLevelContactCreateToolDto +{ + /// + /// This determines if the tool is async. + /// + /// If async, the assistant will move forward without waiting for your server to respond. This is useful if you just want to trigger something on your server. + /// + /// If sync, the assistant will wait for your server to respond. This is useful if want assistant to respond with the result from your server. + /// + /// Defaults to synchronous (`false`). + /// + [JsonPropertyName("async")] + public bool? Async { get; set; } + + /// + /// These are the messages that will be spoken to the user as the tool is running. + /// + /// For some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured. + /// + [JsonPropertyName("messages")] + public IEnumerable? Messages { get; set; } + + /// + /// This is the function definition of the tool. + /// + /// For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + /// + /// An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + /// + [JsonPropertyName("function")] + public OpenAiFunction? Function { get; set; } + + /// + /// This is the server that will be hit when this tool is requested by the model. + /// + /// All requests will be sent with the call object among other things. You can find more details in the Server URL documentation. + /// + /// This overrides the serverUrl set on the org and the phoneNumber. Order of precedence: highest tool.server.url, then assistant.serverUrl, then phoneNumber.serverUrl, then org.serverUrl. + /// + [JsonPropertyName("server")] + public Server? Server { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/UpdateGoHighLevelContactGetToolDto.cs b/src/Vapi.Net/Types/UpdateGoHighLevelContactGetToolDto.cs new file mode 100644 index 0000000..57e696d --- /dev/null +++ b/src/Vapi.Net/Types/UpdateGoHighLevelContactGetToolDto.cs @@ -0,0 +1,64 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record UpdateGoHighLevelContactGetToolDto +{ + /// + /// This determines if the tool is async. + /// + /// If async, the assistant will move forward without waiting for your server to respond. This is useful if you just want to trigger something on your server. + /// + /// If sync, the assistant will wait for your server to respond. This is useful if want assistant to respond with the result from your server. + /// + /// Defaults to synchronous (`false`). + /// + [JsonPropertyName("async")] + public bool? Async { get; set; } + + /// + /// These are the messages that will be spoken to the user as the tool is running. + /// + /// For some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured. + /// + [JsonPropertyName("messages")] + public IEnumerable? Messages { get; set; } + + /// + /// This is the function definition of the tool. + /// + /// For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + /// + /// An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + /// + [JsonPropertyName("function")] + public OpenAiFunction? Function { get; set; } + + /// + /// This is the server that will be hit when this tool is requested by the model. + /// + /// All requests will be sent with the call object among other things. You can find more details in the Server URL documentation. + /// + /// This overrides the serverUrl set on the org and the phoneNumber. Order of precedence: highest tool.server.url, then assistant.serverUrl, then phoneNumber.serverUrl, then org.serverUrl. + /// + [JsonPropertyName("server")] + public Server? Server { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/UpdateGoHighLevelMcpCredentialDto.cs b/src/Vapi.Net/Types/UpdateGoHighLevelMcpCredentialDto.cs new file mode 100644 index 0000000..a2e5aaa --- /dev/null +++ b/src/Vapi.Net/Types/UpdateGoHighLevelMcpCredentialDto.cs @@ -0,0 +1,36 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record UpdateGoHighLevelMcpCredentialDto +{ + /// + /// This is the authentication session for the credential. + /// + [JsonPropertyName("authenticationSession")] + public Oauth2AuthenticationSession? AuthenticationSession { get; set; } + + /// + /// This is the name of credential. This is just for your reference. + /// + [JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/UpdateSmsSendToolDto.cs b/src/Vapi.Net/Types/UpdateSmsToolDto.cs similarity index 98% rename from src/Vapi.Net/Types/UpdateSmsSendToolDto.cs rename to src/Vapi.Net/Types/UpdateSmsToolDto.cs index 2a43e99..3539395 100644 --- a/src/Vapi.Net/Types/UpdateSmsSendToolDto.cs +++ b/src/Vapi.Net/Types/UpdateSmsToolDto.cs @@ -4,7 +4,7 @@ namespace Vapi.Net; -public record UpdateSmsSendToolDto +public record UpdateSmsToolDto { /// /// This determines if the tool is async. diff --git a/src/Vapi.Net/Types/UpdateTelnyxPhoneNumberDto.cs b/src/Vapi.Net/Types/UpdateTelnyxPhoneNumberDto.cs index e9e309a..cf9be5e 100644 --- a/src/Vapi.Net/Types/UpdateTelnyxPhoneNumberDto.cs +++ b/src/Vapi.Net/Types/UpdateTelnyxPhoneNumberDto.cs @@ -32,15 +32,23 @@ public record UpdateTelnyxPhoneNumberDto /// /// This is the assistant that will be used for incoming calls to this phone number. /// - /// If neither `assistantId` nor `squadId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected. + /// If neither `assistantId`, `squadId` nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected. /// [JsonPropertyName("assistantId")] public string? AssistantId { get; set; } + /// + /// This is the workflow that will be used for incoming calls to this phone number. + /// + /// If neither `assistantId`, `squadId`, nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected. + /// + [JsonPropertyName("workflowId")] + public string? WorkflowId { get; set; } + /// /// This is the squad that will be used for incoming calls to this phone number. /// - /// If neither `assistantId` nor `squadId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected. + /// If neither `assistantId`, `squadId`, nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected. /// [JsonPropertyName("squadId")] public string? SquadId { get; set; } diff --git a/src/Vapi.Net/Types/UpdateTwilioCredentialDto.cs b/src/Vapi.Net/Types/UpdateTwilioCredentialDto.cs index 9c30a42..28e9ccd 100644 --- a/src/Vapi.Net/Types/UpdateTwilioCredentialDto.cs +++ b/src/Vapi.Net/Types/UpdateTwilioCredentialDto.cs @@ -12,6 +12,18 @@ public record UpdateTwilioCredentialDto [JsonPropertyName("authToken")] public string? AuthToken { get; set; } + /// + /// This is not returned in the API. + /// + [JsonPropertyName("apiKey")] + public string? ApiKey { get; set; } + + /// + /// This is not returned in the API. + /// + [JsonPropertyName("apiSecret")] + public string? ApiSecret { get; set; } + /// /// This is the name of credential. This is just for your reference. /// diff --git a/src/Vapi.Net/Types/UpdateTwilioPhoneNumberDto.cs b/src/Vapi.Net/Types/UpdateTwilioPhoneNumberDto.cs index 92a619d..2d527f1 100644 --- a/src/Vapi.Net/Types/UpdateTwilioPhoneNumberDto.cs +++ b/src/Vapi.Net/Types/UpdateTwilioPhoneNumberDto.cs @@ -23,6 +23,17 @@ public record UpdateTwilioPhoneNumberDto [JsonPropertyName("hooks")] public IEnumerable? Hooks { get; set; } + /// + /// Controls whether Vapi sets the messaging webhook URL on the Twilio number during import. + /// + /// If set to `false`, Vapi will not update the Twilio messaging URL, leaving it as is. + /// If `true` or omitted (default), Vapi will configure both the voice and messaging URLs. + /// + /// @default true + /// + [JsonPropertyName("smsEnabled")] + public bool? SmsEnabled { get; set; } + /// /// This is the name of the phone number. This is just for your own reference. /// @@ -32,15 +43,23 @@ public record UpdateTwilioPhoneNumberDto /// /// This is the assistant that will be used for incoming calls to this phone number. /// - /// If neither `assistantId` nor `squadId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected. + /// If neither `assistantId`, `squadId` nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected. /// [JsonPropertyName("assistantId")] public string? AssistantId { get; set; } + /// + /// This is the workflow that will be used for incoming calls to this phone number. + /// + /// If neither `assistantId`, `squadId`, nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected. + /// + [JsonPropertyName("workflowId")] + public string? WorkflowId { get; set; } + /// /// This is the squad that will be used for incoming calls to this phone number. /// - /// If neither `assistantId` nor `squadId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected. + /// If neither `assistantId`, `squadId`, nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected. /// [JsonPropertyName("squadId")] public string? SquadId { get; set; } @@ -75,6 +94,18 @@ public record UpdateTwilioPhoneNumberDto [JsonPropertyName("twilioAuthToken")] public string? TwilioAuthToken { get; set; } + /// + /// This is the Twilio API Key for the phone number. + /// + [JsonPropertyName("twilioApiKey")] + public string? TwilioApiKey { get; set; } + + /// + /// This is the Twilio API Secret for the phone number. + /// + [JsonPropertyName("twilioApiSecret")] + public string? TwilioApiSecret { get; set; } + /// /// Additional properties received from the response, if any. /// diff --git a/src/Vapi.Net/Types/UpdateVapiPhoneNumberDto.cs b/src/Vapi.Net/Types/UpdateVapiPhoneNumberDto.cs index d9d13fb..3a81b4b 100644 --- a/src/Vapi.Net/Types/UpdateVapiPhoneNumberDto.cs +++ b/src/Vapi.Net/Types/UpdateVapiPhoneNumberDto.cs @@ -32,15 +32,23 @@ public record UpdateVapiPhoneNumberDto /// /// This is the assistant that will be used for incoming calls to this phone number. /// - /// If neither `assistantId` nor `squadId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected. + /// If neither `assistantId`, `squadId` nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected. /// [JsonPropertyName("assistantId")] public string? AssistantId { get; set; } + /// + /// This is the workflow that will be used for incoming calls to this phone number. + /// + /// If neither `assistantId`, `squadId`, nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected. + /// + [JsonPropertyName("workflowId")] + public string? WorkflowId { get; set; } + /// /// This is the squad that will be used for incoming calls to this phone number. /// - /// If neither `assistantId` nor `squadId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected. + /// If neither `assistantId`, `squadId`, nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected. /// [JsonPropertyName("squadId")] public string? SquadId { get; set; } diff --git a/src/Vapi.Net/Types/UpdateVonagePhoneNumberDto.cs b/src/Vapi.Net/Types/UpdateVonagePhoneNumberDto.cs index f5fb98d..6543acb 100644 --- a/src/Vapi.Net/Types/UpdateVonagePhoneNumberDto.cs +++ b/src/Vapi.Net/Types/UpdateVonagePhoneNumberDto.cs @@ -32,15 +32,23 @@ public record UpdateVonagePhoneNumberDto /// /// This is the assistant that will be used for incoming calls to this phone number. /// - /// If neither `assistantId` nor `squadId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected. + /// If neither `assistantId`, `squadId` nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected. /// [JsonPropertyName("assistantId")] public string? AssistantId { get; set; } + /// + /// This is the workflow that will be used for incoming calls to this phone number. + /// + /// If neither `assistantId`, `squadId`, nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected. + /// + [JsonPropertyName("workflowId")] + public string? WorkflowId { get; set; } + /// /// This is the squad that will be used for incoming calls to this phone number. /// - /// If neither `assistantId` nor `squadId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected. + /// If neither `assistantId`, `squadId`, nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected. /// [JsonPropertyName("squadId")] public string? SquadId { get; set; } diff --git a/src/Vapi.Net/Types/VapiModel.cs b/src/Vapi.Net/Types/VapiModel.cs index b622fa8..f6492ba 100644 --- a/src/Vapi.Net/Types/VapiModel.cs +++ b/src/Vapi.Net/Types/VapiModel.cs @@ -40,6 +40,9 @@ public record VapiModel [JsonPropertyName("knowledgeBaseId")] public string? KnowledgeBaseId { get; set; } + [JsonPropertyName("provider")] + public string Provider { get; set; } = "vapi"; + /// /// This is the workflow that will be used for the call. To use a transient workflow, use `workflow` instead. /// @@ -50,7 +53,7 @@ public record VapiModel /// This is the workflow that will be used for the call. To use an existing workflow, use `workflowId` instead. /// [JsonPropertyName("workflow")] - public Workflow? Workflow { get; set; } + public WorkflowUserEditable? Workflow { get; set; } /// /// This is the name of the model. Ex. cognitivecomputations/dolphin-mixtral-8x7b diff --git a/src/Vapi.Net/Types/VapiPhoneNumber.cs b/src/Vapi.Net/Types/VapiPhoneNumber.cs index ed38b7e..c54d824 100644 --- a/src/Vapi.Net/Types/VapiPhoneNumber.cs +++ b/src/Vapi.Net/Types/VapiPhoneNumber.cs @@ -68,15 +68,23 @@ public record VapiPhoneNumber /// /// This is the assistant that will be used for incoming calls to this phone number. /// - /// If neither `assistantId` nor `squadId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected. + /// If neither `assistantId`, `squadId` nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected. /// [JsonPropertyName("assistantId")] public string? AssistantId { get; set; } + /// + /// This is the workflow that will be used for incoming calls to this phone number. + /// + /// If neither `assistantId`, `squadId`, nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected. + /// + [JsonPropertyName("workflowId")] + public string? WorkflowId { get; set; } + /// /// This is the squad that will be used for incoming calls to this phone number. /// - /// If neither `assistantId` nor `squadId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected. + /// If neither `assistantId`, `squadId`, nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected. /// [JsonPropertyName("squadId")] public string? SquadId { get; set; } diff --git a/src/Vapi.Net/Types/VapiVoice.cs b/src/Vapi.Net/Types/VapiVoice.cs index ff1fbfb..c66e280 100644 --- a/src/Vapi.Net/Types/VapiVoice.cs +++ b/src/Vapi.Net/Types/VapiVoice.cs @@ -6,6 +6,12 @@ namespace Vapi.Net; public record VapiVoice { + /// + /// This is the flag to toggle voice caching for the assistant. + /// + [JsonPropertyName("cachingEnabled")] + public bool? CachingEnabled { get; set; } + /// /// The voices provided by Vapi /// diff --git a/src/Vapi.Net/Types/VapiVoiceVoiceId.cs b/src/Vapi.Net/Types/VapiVoiceVoiceId.cs index 6bf479f..b83ab10 100644 --- a/src/Vapi.Net/Types/VapiVoiceVoiceId.cs +++ b/src/Vapi.Net/Types/VapiVoiceVoiceId.cs @@ -10,6 +10,9 @@ public enum VapiVoiceVoiceId [EnumMember(Value = "Elliot")] Elliot, + [EnumMember(Value = "Kylie")] + Kylie, + [EnumMember(Value = "Rohan")] Rohan, diff --git a/src/Vapi.Net/Types/VapiVoicemailDetectionPlan.cs b/src/Vapi.Net/Types/VapiVoicemailDetectionPlan.cs new file mode 100644 index 0000000..341caac --- /dev/null +++ b/src/Vapi.Net/Types/VapiVoicemailDetectionPlan.cs @@ -0,0 +1,44 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record VapiVoicemailDetectionPlan +{ + /// + /// This is the maximum duration from the start of the call that we will wait for a voicemail beep, before speaking our message + /// + /// - If we detect a voicemail beep before this, we will speak the message at that point. + /// + /// - Setting too low a value means that the bot will start speaking its voicemail message too early. If it does so before the actual beep, it will get cut off. You should definitely tune this to your use case. + /// + /// @default 30 + /// @min 0 + /// @max 60 + /// + [JsonPropertyName("beepMaxAwaitSeconds")] + public double? BeepMaxAwaitSeconds { get; set; } + + /// + /// This is the backoff plan for the voicemail detection. + /// + [JsonPropertyName("backoffPlan")] + public VoicemailDetectionBackoffPlan? BackoffPlan { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/VariableExtractionPlan.cs b/src/Vapi.Net/Types/VariableExtractionPlan.cs new file mode 100644 index 0000000..9685e7a --- /dev/null +++ b/src/Vapi.Net/Types/VariableExtractionPlan.cs @@ -0,0 +1,28 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record VariableExtractionPlan +{ + [JsonPropertyName("output")] + public IEnumerable Output { get; set; } = + new List(); + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/VariableExtractionSchema.cs b/src/Vapi.Net/Types/VariableExtractionSchema.cs new file mode 100644 index 0000000..29308d7 --- /dev/null +++ b/src/Vapi.Net/Types/VariableExtractionSchema.cs @@ -0,0 +1,52 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record VariableExtractionSchema +{ + /// + /// This is the type of output you'd like. + /// + /// `string`, `number`, `boolean` are primitive types. + /// + [JsonPropertyName("type")] + public required VariableExtractionSchemaType Type { get; set; } + + /// + /// This is the title of the variable. + /// + /// It can only contain letters, numbers, and underscores. + /// + [JsonPropertyName("title")] + public required string Title { get; set; } + + /// + /// This is the description to help the model understand what it needs to output. + /// + [JsonPropertyName("description")] + public required string Description { get; set; } + + /// + /// This is the enum values to choose from. Only used if the type is `string`. + /// + [JsonPropertyName("enum")] + public IEnumerable? Enum { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/VariableExtractionSchemaType.cs b/src/Vapi.Net/Types/VariableExtractionSchemaType.cs new file mode 100644 index 0000000..a43d01f --- /dev/null +++ b/src/Vapi.Net/Types/VariableExtractionSchemaType.cs @@ -0,0 +1,21 @@ +using System.Runtime.Serialization; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[JsonConverter(typeof(EnumSerializer))] +public enum VariableExtractionSchemaType +{ + [EnumMember(Value = "string")] + String, + + [EnumMember(Value = "number")] + Number, + + [EnumMember(Value = "integer")] + Integer, + + [EnumMember(Value = "boolean")] + Boolean, +} diff --git a/src/Vapi.Net/Types/VoicemailDetectionBackoffPlan.cs b/src/Vapi.Net/Types/VoicemailDetectionBackoffPlan.cs new file mode 100644 index 0000000..e046eb0 --- /dev/null +++ b/src/Vapi.Net/Types/VoicemailDetectionBackoffPlan.cs @@ -0,0 +1,42 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record VoicemailDetectionBackoffPlan +{ + /// + /// This is the number of seconds to wait before starting the first retry attempt. + /// + [JsonPropertyName("startAtSeconds")] + public double? StartAtSeconds { get; set; } + + /// + /// This is the interval in seconds between retry attempts. + /// + [JsonPropertyName("frequencySeconds")] + public double? FrequencySeconds { get; set; } + + /// + /// This is the maximum number of retry attempts before giving up. + /// + [JsonPropertyName("maxRetries")] + public double? MaxRetries { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/VoicemailDetectionCostProvider.cs b/src/Vapi.Net/Types/VoicemailDetectionCostProvider.cs index 3572c1a..842c416 100644 --- a/src/Vapi.Net/Types/VoicemailDetectionCostProvider.cs +++ b/src/Vapi.Net/Types/VoicemailDetectionCostProvider.cs @@ -15,4 +15,7 @@ public enum VoicemailDetectionCostProvider [EnumMember(Value = "openai")] Openai, + + [EnumMember(Value = "vapi")] + Vapi, } diff --git a/src/Vapi.Net/Types/VonagePhoneNumber.cs b/src/Vapi.Net/Types/VonagePhoneNumber.cs index fc963ce..58f36e7 100644 --- a/src/Vapi.Net/Types/VonagePhoneNumber.cs +++ b/src/Vapi.Net/Types/VonagePhoneNumber.cs @@ -62,15 +62,23 @@ public record VonagePhoneNumber /// /// This is the assistant that will be used for incoming calls to this phone number. /// - /// If neither `assistantId` nor `squadId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected. + /// If neither `assistantId`, `squadId` nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected. /// [JsonPropertyName("assistantId")] public string? AssistantId { get; set; } + /// + /// This is the workflow that will be used for incoming calls to this phone number. + /// + /// If neither `assistantId`, `squadId`, nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected. + /// + [JsonPropertyName("workflowId")] + public string? WorkflowId { get; set; } + /// /// This is the squad that will be used for incoming calls to this phone number. /// - /// If neither `assistantId` nor `squadId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected. + /// If neither `assistantId`, `squadId`, nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected. /// [JsonPropertyName("squadId")] public string? SquadId { get; set; } diff --git a/src/Vapi.Net/Types/WorkflowAnthropicModel.cs b/src/Vapi.Net/Types/WorkflowAnthropicModel.cs new file mode 100644 index 0000000..6da1307 --- /dev/null +++ b/src/Vapi.Net/Types/WorkflowAnthropicModel.cs @@ -0,0 +1,51 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record WorkflowAnthropicModel +{ + /// + /// This is the specific model that will be used. + /// + [JsonPropertyName("model")] + public required WorkflowAnthropicModelModel Model { get; set; } + + /// + /// This is the optional configuration for Anthropic's thinking feature. + /// + /// - Only applicable for `claude-3-7-sonnet-20250219` model. + /// - If provided, `maxTokens` must be greater than `thinking.budgetTokens`. + /// + [JsonPropertyName("thinking")] + public AnthropicThinkingConfig? Thinking { get; set; } + + /// + /// This is the temperature of the model. + /// + [JsonPropertyName("temperature")] + public double? Temperature { get; set; } + + /// + /// This is the max tokens of the model. + /// + [JsonPropertyName("maxTokens")] + public double? MaxTokens { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/WorkflowAnthropicModelModel.cs b/src/Vapi.Net/Types/WorkflowAnthropicModelModel.cs new file mode 100644 index 0000000..f0c54ca --- /dev/null +++ b/src/Vapi.Net/Types/WorkflowAnthropicModelModel.cs @@ -0,0 +1,36 @@ +using System.Runtime.Serialization; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[JsonConverter(typeof(EnumSerializer))] +public enum WorkflowAnthropicModelModel +{ + [EnumMember(Value = "claude-3-opus-20240229")] + Claude3Opus20240229, + + [EnumMember(Value = "claude-3-sonnet-20240229")] + Claude3Sonnet20240229, + + [EnumMember(Value = "claude-3-haiku-20240307")] + Claude3Haiku20240307, + + [EnumMember(Value = "claude-3-5-sonnet-20240620")] + Claude35Sonnet20240620, + + [EnumMember(Value = "claude-3-5-sonnet-20241022")] + Claude35Sonnet20241022, + + [EnumMember(Value = "claude-3-5-haiku-20241022")] + Claude35Haiku20241022, + + [EnumMember(Value = "claude-3-7-sonnet-20250219")] + Claude37Sonnet20250219, + + [EnumMember(Value = "claude-opus-4-20250514")] + ClaudeOpus420250514, + + [EnumMember(Value = "claude-sonnet-4-20250514")] + ClaudeSonnet420250514, +} diff --git a/src/Vapi.Net/Types/WorkflowOpenAiModel.cs b/src/Vapi.Net/Types/WorkflowOpenAiModel.cs new file mode 100644 index 0000000..46cf1bb --- /dev/null +++ b/src/Vapi.Net/Types/WorkflowOpenAiModel.cs @@ -0,0 +1,42 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record WorkflowOpenAiModel +{ + /// + /// This is the specific OpenAI model that will be used. + /// + [JsonPropertyName("model")] + public required WorkflowOpenAiModelModel Model { get; set; } + + /// + /// This is the temperature of the model. + /// + [JsonPropertyName("temperature")] + public double? Temperature { get; set; } + + /// + /// This is the max tokens of the model. + /// + [JsonPropertyName("maxTokens")] + public double? MaxTokens { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/WorkflowOpenAiModelModel.cs b/src/Vapi.Net/Types/WorkflowOpenAiModelModel.cs new file mode 100644 index 0000000..8a3d541 --- /dev/null +++ b/src/Vapi.Net/Types/WorkflowOpenAiModelModel.cs @@ -0,0 +1,108 @@ +using System.Runtime.Serialization; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[JsonConverter(typeof(EnumSerializer))] +public enum WorkflowOpenAiModelModel +{ + [EnumMember(Value = "gpt-4.1")] + Gpt41, + + [EnumMember(Value = "gpt-4.1-mini")] + Gpt41Mini, + + [EnumMember(Value = "gpt-4.1-nano")] + Gpt41Nano, + + [EnumMember(Value = "gpt-4.5-preview")] + Gpt45Preview, + + [EnumMember(Value = "chatgpt-4o-latest")] + Chatgpt4OLatest, + + [EnumMember(Value = "o3")] + O3, + + [EnumMember(Value = "o3-mini")] + O3Mini, + + [EnumMember(Value = "o4-mini")] + O4Mini, + + [EnumMember(Value = "o1-preview")] + O1Preview, + + [EnumMember(Value = "o1-preview-2024-09-12")] + O1Preview20240912, + + [EnumMember(Value = "o1-mini")] + O1Mini, + + [EnumMember(Value = "o1-mini-2024-09-12")] + O1Mini20240912, + + [EnumMember(Value = "gpt-4o-realtime-preview-2024-10-01")] + Gpt4ORealtimePreview20241001, + + [EnumMember(Value = "gpt-4o-realtime-preview-2024-12-17")] + Gpt4ORealtimePreview20241217, + + [EnumMember(Value = "gpt-4o-mini-realtime-preview-2024-12-17")] + Gpt4OMiniRealtimePreview20241217, + + [EnumMember(Value = "gpt-4o-mini-2024-07-18")] + Gpt4OMini20240718, + + [EnumMember(Value = "gpt-4o-mini")] + Gpt4OMini, + + [EnumMember(Value = "gpt-4o")] + Gpt4O, + + [EnumMember(Value = "gpt-4o-2024-05-13")] + Gpt4O20240513, + + [EnumMember(Value = "gpt-4o-2024-08-06")] + Gpt4O20240806, + + [EnumMember(Value = "gpt-4o-2024-11-20")] + Gpt4O20241120, + + [EnumMember(Value = "gpt-4-turbo")] + Gpt4Turbo, + + [EnumMember(Value = "gpt-4-turbo-2024-04-09")] + Gpt4Turbo20240409, + + [EnumMember(Value = "gpt-4-turbo-preview")] + Gpt4TurboPreview, + + [EnumMember(Value = "gpt-4-0125-preview")] + Gpt40125Preview, + + [EnumMember(Value = "gpt-4-1106-preview")] + Gpt41106Preview, + + [EnumMember(Value = "gpt-4")] + Gpt4, + + [EnumMember(Value = "gpt-4-0613")] + Gpt40613, + + [EnumMember(Value = "gpt-3.5-turbo")] + Gpt35Turbo, + + [EnumMember(Value = "gpt-3.5-turbo-0125")] + Gpt35Turbo0125, + + [EnumMember(Value = "gpt-3.5-turbo-1106")] + Gpt35Turbo1106, + + [EnumMember(Value = "gpt-3.5-turbo-16k")] + Gpt35Turbo16K, + + [EnumMember(Value = "gpt-3.5-turbo-0613")] + Gpt35Turbo0613, +} diff --git a/src/Vapi.Net/Types/WorkflowUserEditable.cs b/src/Vapi.Net/Types/WorkflowUserEditable.cs new file mode 100644 index 0000000..9d9ae24 --- /dev/null +++ b/src/Vapi.Net/Types/WorkflowUserEditable.cs @@ -0,0 +1,39 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public record WorkflowUserEditable +{ + [JsonPropertyName("nodes")] + public IEnumerable Nodes { get; set; } = new List(); + + /// + /// These are the options for the workflow's LLM. + /// + [JsonPropertyName("model")] + public object? Model { get; set; } + + [JsonPropertyName("name")] + public required string Name { get; set; } + + [JsonPropertyName("edges")] + public IEnumerable Edges { get; set; } = new List(); + + /// + /// Additional properties received from the response, if any. + /// + /// + /// [EXPERIMENTAL] This API is experimental and may change in future releases. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Vapi.Net.Custom.props b/src/Vapi.Net/Vapi.Net.Custom.props index 70df284..17a84ca 100644 --- a/src/Vapi.Net/Vapi.Net.Custom.props +++ b/src/Vapi.Net/Vapi.Net.Custom.props @@ -17,4 +17,4 @@ Configure additional MSBuild properties for your project in this file: --> - \ No newline at end of file + diff --git a/src/Vapi.Net/Vapi.Net.csproj b/src/Vapi.Net/Vapi.Net.csproj index 983b0b0..17baa54 100644 --- a/src/Vapi.Net/Vapi.Net.csproj +++ b/src/Vapi.Net/Vapi.Net.csproj @@ -1,53 +1,47 @@ - - - net462;net8.0;net7.0;net6.0;netstandard2.0 - enable - 12 - enable - 0.6.0 - $(Version) - $(Version) - README.md - https://github.com/VapiAI/server-sdk-csharp - true - - - - false - - - $(DefineConstants);USE_PORTABLE_DATE_ONLY - true - - - - - - - - - - - runtime; build; native; contentfiles; analyzers; buildtransitive - all - - - - - - - - - - - - - - - <_Parameter1>Vapi.Net.Test - - - - + + net462;net8.0;net7.0;net6.0;netstandard2.0 + enable + 12 + enable + 0.8.1 + $(Version) + $(Version) + README.md + https://github.com/VapiAI/server-sdk-csharp + true + + + false + + + $(DefineConstants);USE_PORTABLE_DATE_ONLY + true + + + + + + + + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + + + + + + + + + + + <_Parameter1>Vapi.Net.Test + + + diff --git a/src/Vapi.Net/VapiClient.cs b/src/Vapi.Net/VapiClient.cs index 50f147c..e7eafdc 100644 --- a/src/Vapi.Net/VapiClient.cs +++ b/src/Vapi.Net/VapiClient.cs @@ -1,3 +1,6 @@ +using System.Net.Http; +using System.Threading; +using global::System.Threading.Tasks; using Vapi.Net.Core; namespace Vapi.Net; @@ -6,7 +9,7 @@ public partial class VapiClient { private readonly RawClient _client; - public VapiClient(string? token = null, ClientOptions? clientOptions = null) + public VapiClient(string token, ClientOptions? clientOptions = null) { var defaultHeaders = new Headers( new Dictionary() @@ -15,7 +18,7 @@ public VapiClient(string? token = null, ClientOptions? clientOptions = null) { "X-Fern-Language", "C#" }, { "X-Fern-SDK-Name", "Vapi.Net" }, { "X-Fern-SDK-Version", Version.Current }, - { "User-Agent", "Vapi.Net/0.6.0" }, + { "User-Agent", "Vapi.Net/0.8.1" }, } ); clientOptions ??= new ClientOptions(); @@ -67,4 +70,35 @@ public VapiClient(string? token = null, ClientOptions? clientOptions = null) public AnalyticsClient Analytics { get; } public LogsClient Logs { get; } + + public async global::System.Threading.Tasks.Task PrometheusControllerIndexAsync( + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + var response = await _client + .SendRequestAsync( + new JsonRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "prometheus_metrics", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); + if (response.StatusCode is >= 200 and < 400) + { + return; + } + { + var responseBody = await response.Raw.Content.ReadAsStringAsync(); + throw new VapiClientApiException( + $"Error with status code {response.StatusCode}", + response.StatusCode, + responseBody + ); + } + } }