From 5c3d3c960503e1d24ee440f9fed994b77ad6f8eb Mon Sep 17 00:00:00 2001 From: "fern-api[bot]" <115122769+fern-api[bot]@users.noreply.github.com> Date: Fri, 31 Jul 2026 22:05:30 +0000 Subject: [PATCH 1/4] [fern-generated] Update SDK Generated by Fern CLI Version: unknown Generators: - fernapi/fern-csharp-sdk: 2.58.0 --- .fern/metadata.json | 6 +- .fern/replay.lock | 10 + .fernignore | 3 + .gitattributes | 1 + src/Vapi.Net/Analytics/AnalyticsClient.cs | 3 + src/Vapi.Net/Analytics/IAnalyticsClient.cs | 3 + src/Vapi.Net/Assistants/AssistantsClient.cs | 27 + src/Vapi.Net/Assistants/IAssistantsClient.cs | 15 + .../Assistants/Requests/UpdateAssistantDto.cs | 9 + src/Vapi.Net/Board/BoardClient.cs | 503 +++++++++ src/Vapi.Net/Board/IBoardClient.cs | 42 + .../Requests/BoardControllerFindAllRequest.cs | 86 ++ .../Requests/BoardControllerFindOneRequest.cs | 13 + .../Requests/BoardControllerRemoveRequest.cs | 13 + src/Vapi.Net/Board/Requests/CreateBoardDto.cs | 41 + src/Vapi.Net/Board/Requests/UpdateBoardDto.cs | 41 + .../BoardControllerFindAllRequestSortBy.cs | 89 ++ .../BoardControllerFindAllRequestSortOrder.cs | 84 ++ src/Vapi.Net/Calls/CallsClient.cs | 432 ++++++++ src/Vapi.Net/Calls/ICallsClient.cs | 64 ++ ...rollerAssistantRecordingDownloadRequest.cs | 13 + ...tifactControllerCallLogsDownloadRequest.cs | 13 + ...trollerCustomerRecordingDownloadRequest.cs | 13 + ...tControllerMonoRecordingDownloadRequest.cs | 13 + ...llArtifactControllerPcapDownloadRequest.cs | 13 + ...ontrollerStereoRecordingDownloadRequest.cs | 13 + ...ControllerVideoRecordingDownloadRequest.cs | 13 + src/Vapi.Net/Calls/Requests/CreateCallDto.cs | 19 +- src/Vapi.Net/Campaigns/CampaignsClient.cs | 432 +++++++- src/Vapi.Net/Campaigns/ICampaignsClient.cs | 50 +- .../CampaignControllerFindAllRequest.cs | 12 + .../CampaignControllerFindAllV2Request.cs | 92 ++ .../CampaignControllerFindOneV2Request.cs | 13 + .../CampaignControllerRemoveV2Request.cs | 13 + .../CampaignControllerUpdateRequest.cs | 17 + .../CampaignControllerUpdateV2Request.cs | 17 + .../Campaigns/Requests/CreateCampaignDto.cs | 62 -- .../CampaignControllerFindAllRequestSortBy.cs | 89 ++ .../CampaignControllerFindAllRequestStatus.cs | 10 + ...ampaignControllerFindAllV2RequestSortBy.cs | 89 ++ ...aignControllerFindAllV2RequestSortOrder.cs | 84 ++ ...ampaignControllerFindAllV2RequestStatus.cs | 99 ++ src/Vapi.Net/Chats/ChatsClient.cs | 3 +- .../Chats/Requests/ListChatsRequest.cs | 6 + .../Chats/Types/ListChatsRequestSortBy.cs | 89 ++ src/Vapi.Net/Core/Public/Version.cs | 2 +- src/Vapi.Net/Eval/EvalClient.cs | 33 +- src/Vapi.Net/Eval/IEvalClient.cs | 27 + .../EvalControllerGetPaginatedRequest.cs | 9 + .../EvalControllerGetRunsPaginatedRequest.cs | 9 + ...valControllerGetPaginatedRequestSortBy.cs} | 49 +- ...ControllerGetRunsPaginatedRequestSortBy.cs | 89 ++ src/Vapi.Net/Exceptions/ConflictError.cs | 7 + .../Exceptions/ServiceUnavailableError.cs | 8 + src/Vapi.Net/Exceptions/UnauthorizedError.cs | 8 + src/Vapi.Net/Files/FilesClient.cs | 24 +- src/Vapi.Net/Files/IFilesClient.cs | 16 + .../Files/Requests/ListFilesRequest.cs | 17 + src/Vapi.Net/IVapiClient.cs | 1 + src/Vapi.Net/Insight/IInsightClient.cs | 21 + src/Vapi.Net/Insight/InsightClient.cs | 24 +- .../InsightControllerFindAllRequest.cs | 9 + .../Insight/Requests/InsightRunDto.cs | 10 + .../InsightControllerFindAllRequestSortBy.cs | 89 ++ .../IObservabilityScorecardClient.cs | 15 + .../ObservabilityScorecardClient.cs | 18 +- .../ScorecardControllerGetPaginatedRequest.cs | 9 + ...cardControllerGetPaginatedRequestSortBy.cs | 89 ++ .../PhoneNumbers/IPhoneNumbersClient.cs | 18 + .../PhoneNumbers/PhoneNumbersClient.cs | 21 +- ...NumberControllerFindAllPaginatedRequest.cs | 6 + ...ControllerFindAllPaginatedRequestSortBy.cs | 89 ++ .../IProviderResourcesClient.cs | 15 + .../ProviderResourcesClient.cs | 18 +- ...lerGetProviderResourcesPaginatedRequest.cs | 12 + ...ProviderResourcesPaginatedRequestSortBy.cs | 103 ++ .../Sessions/Requests/ListSessionsRequest.cs | 14 + src/Vapi.Net/Sessions/SessionsClient.cs | 4 +- .../Types/ListSessionsRequestSortBy.cs | 89 ++ src/Vapi.Net/Squads/ISquadsClient.cs | 15 + src/Vapi.Net/Squads/SquadsClient.cs | 15 + .../IStructuredOutputsClient.cs | 24 +- ...tructuredOutputControllerFindAllRequest.cs | 6 + .../Requests/UpdateStructuredOutputDto.cs | 9 + .../StructuredOutputsClient.cs | 46 +- ...redOutputControllerFindAllRequestSortBy.cs | 89 ++ ...ructuredOutputControllerRunResponseZero.cs | 33 + src/Vapi.Net/Tools/IToolsClient.cs | 15 + src/Vapi.Net/Tools/ToolsClient.cs | 27 + src/Vapi.Net/Types/AiEdgeCondition.cs | 6 + src/Vapi.Net/Types/Analysis.cs | 3 + src/Vapi.Net/Types/AnalysisCost.cs | 3 + src/Vapi.Net/Types/AnalysisCostBreakdown.cs | 3 + src/Vapi.Net/Types/AnalysisPlan.cs | 3 + src/Vapi.Net/Types/AnalyticsOperation.cs | 3 + src/Vapi.Net/Types/AnalyticsQuery.cs | 3 + src/Vapi.Net/Types/AnalyticsQueryResult.cs | 3 + .../Types/AnthropicBedrockCredentialRegion.cs | 5 + src/Vapi.Net/Types/AnthropicBedrockModel.cs | 14 +- .../Types/AnthropicBedrockModelModel.cs | 11 + src/Vapi.Net/Types/AnthropicModel.cs | 14 +- src/Vapi.Net/Types/AnthropicModelModel.cs | 5 + src/Vapi.Net/Types/AnthropicThinkingConfig.cs | 6 + src/Vapi.Net/Types/AnyscaleModel.cs | 14 +- src/Vapi.Net/Types/ApiRequestTool.cs | 29 +- src/Vapi.Net/Types/Artifact.cs | 86 +- src/Vapi.Net/Types/ArtifactPlan.cs | 9 + src/Vapi.Net/Types/AssemblyAiTranscriber.cs | 3 + src/Vapi.Net/Types/Assistant.cs | 21 + src/Vapi.Net/Types/AssistantActivation.cs | 12 + .../Types/AssistantCustomEndpointingRule.cs | 3 + src/Vapi.Net/Types/AssistantDraft.cs | 309 ++++++ .../AssistantDraftBackgroundSoundZero.cs | 84 ++ .../Types/AssistantDraftClientMessagesItem.cs | 169 +++ .../AssistantDraftConflictResponseDto.cs | 34 + .../Types/AssistantDraftFirstMessageMode.cs | 95 ++ .../Types/AssistantDraftPaginatedMetadata.cs | 34 + .../Types/AssistantDraftPaginatedResponse.cs | 31 + .../Types/AssistantDraftServerMessagesItem.cs | 227 ++++ ...> AssistantDraftVoicemailDetectionZero.cs} | 28 +- src/Vapi.Net/Types/AssistantMessage.cs | 3 + .../AssistantMessageEvaluationContinuePlan.cs | 3 + .../Types/AssistantMessageJudgePlanAi.cs | 3 + .../Types/AssistantMessageJudgePlanExact.cs | 3 + .../Types/AssistantMessageJudgePlanRegex.cs | 3 + src/Vapi.Net/Types/AssistantOverrides.cs | 15 + .../AssistantPinnedConflictResponseDto.cs | 34 + ...AssistantPinnedConflictResponseDtoError.cs | 79 ++ src/Vapi.Net/Types/AssistantVersion.cs | 340 ++++++ .../AssistantVersionBackgroundSoundZero.cs | 84 ++ .../AssistantVersionClientMessagesItem.cs | 169 +++ .../Types/AssistantVersionFirstMessageMode.cs | 95 ++ .../AssistantVersionPaginatedMetadata.cs | 34 + .../AssistantVersionPaginatedResponse.cs | 7 +- .../AssistantVersionServerMessagesItem.cs | 227 ++++ .../AssistantVersionVoicemailDetectionZero.cs | 73 ++ src/Vapi.Net/Types/AudioFormat.cs | 49 + ...delProvider.cs => AudioFormatContainer.cs} | 28 +- .../Types/AwsStsAuthenticationPlan.cs | 3 + .../AwsiamCredentialsAuthenticationPlan.cs | 3 + .../Types/AzureBlobStorageBucketPlan.cs | 3 + src/Vapi.Net/Types/AzureCredentialRegion.cs | 10 + .../Types/AzureOpenAiCredentialModelsItem.cs | 15 + .../Types/AzureOpenAiCredentialRegion.cs | 10 + src/Vapi.Net/Types/AzureSpeechTranscriber.cs | 3 + src/Vapi.Net/Types/AzureVoice.cs | 3 + .../Types/BackgroundSpeechDenoisingPlan.cs | 3 + src/Vapi.Net/Types/BackoffPlan.cs | 8 +- src/Vapi.Net/Types/BarInsight.cs | 12 + src/Vapi.Net/Types/BarInsightMetadata.cs | 18 + src/Vapi.Net/Types/BashTool.cs | 10 +- src/Vapi.Net/Types/BashToolWithToolCall.cs | 4 +- .../Types/BearerAuthenticationPlan.cs | 3 + src/Vapi.Net/Types/Board.cs | 83 ++ src/Vapi.Net/Types/BoardInsightItem.cs | 40 + ...ialProvider.cs => BoardInsightItemType.cs} | 28 +- src/Vapi.Net/Types/BoardItemPosition.cs | 31 + src/Vapi.Net/Types/BoardItemSize.cs | 31 + src/Vapi.Net/Types/BoardLayout.cs | 32 + src/Vapi.Net/Types/BoardMetricWidgetItem.cs | 40 + .../Types/BoardMetricWidgetItemType.cs | 89 ++ src/Vapi.Net/Types/BoardPaginatedResponse.cs | 31 + ...oleanComparatorScorecardMetricCondition.cs | 51 + ...ratorScorecardMetricConditionComparator.cs | 79 ++ ...nComparatorScorecardMetricConditionType.cs | 79 ++ src/Vapi.Net/Types/BotMessage.cs | 18 + .../Types/BothCustomEndpointingRule.cs | 6 + src/Vapi.Net/Types/BucketPlan.cs | 3 + src/Vapi.Net/Types/ByoPhoneNumber.cs | 3 + src/Vapi.Net/Types/ByoSipTrunkCredential.cs | 6 - src/Vapi.Net/Types/Call.cs | 33 +- src/Vapi.Net/Types/CallBatchError.cs | 9 + src/Vapi.Net/Types/CallBatchResponse.cs | 3 + src/Vapi.Net/Types/CallEndedReason.cs | 252 +++++ .../CallHookAssistantSpeechInterrupted.cs | 3 + src/Vapi.Net/Types/CallHookCallEnding.cs | 3 + .../CallHookCustomerSpeechInterrupted.cs | 3 + .../Types/CallHookCustomerSpeechTimeout.cs | 5 +- src/Vapi.Net/Types/CallHookFilter.cs | 3 + .../Types/CallHookModelResponseTimeout.cs | 3 + src/Vapi.Net/Types/Campaign.cs | 41 +- src/Vapi.Net/Types/CampaignContact.cs | 55 + .../Types/CampaignPaginatedResponse.cs | 9 + src/Vapi.Net/Types/CampaignPredialPlan.cs | 31 + .../Types/CampaignServerMessagesItem.cs | 129 +++ src/Vapi.Net/Types/CampaignStatus.cs | 10 + src/Vapi.Net/Types/CartesiaCredential.cs | 6 + .../Types/CartesiaExperimentalControls.cs | 9 + .../Types/CartesiaGenerationConfig.cs | 3 + .../CartesiaGenerationConfigExperimental.cs | 3 + src/Vapi.Net/Types/CartesiaTranscriber.cs | 9 + .../Types/CartesiaTranscriberModel.cs | 15 +- src/Vapi.Net/Types/CartesiaVoice.cs | 3 + src/Vapi.Net/Types/CartesiaVoiceModel.cs | 10 + src/Vapi.Net/Types/CerebrasModel.cs | 14 +- .../ChatEvalAssistantMessageEvaluation.cs | 3 + .../Types/ChatEvalAssistantMessageMock.cs | 3 + .../ChatEvalAssistantMessageMockToolCall.cs | 3 + .../Types/ChatEvalSystemMessageMock.cs | 3 + .../ChatEvalToolResponseMessageEvaluation.cs | 3 + .../Types/ChatEvalToolResponseMessageMock.cs | 3 + src/Vapi.Net/Types/ChatEvalUserMessageMock.cs | 3 + src/Vapi.Net/Types/ChunkPlan.cs | 3 + .../Types/ClientMessageAssistantSpeech.cs | 9 + .../Types/ClientMessageAssistantStarted.cs | 9 + .../Types/ClientMessageCallDeleteFailed.cs | 9 + .../Types/ClientMessageCallDeleted.cs | 9 + .../Types/ClientMessageChatCreated.cs | 9 + .../Types/ClientMessageChatDeleted.cs | 9 + .../Types/ClientMessageConversationUpdate.cs | 11 +- src/Vapi.Net/Types/ClientMessageHang.cs | 9 + .../ClientMessageLanguageChangeDetected.cs | 9 + src/Vapi.Net/Types/ClientMessageMetadata.cs | 9 + .../Types/ClientMessageModelOutput.cs | 9 + .../Types/ClientMessageSessionCreated.cs | 9 + .../Types/ClientMessageSessionDeleted.cs | 9 + .../Types/ClientMessageSessionUpdated.cs | 9 + .../Types/ClientMessageSpeechUpdate.cs | 9 + src/Vapi.Net/Types/ClientMessageToolCalls.cs | 9 + .../Types/ClientMessageToolCallsResult.cs | 9 + src/Vapi.Net/Types/ClientMessageTranscript.cs | 9 + .../Types/ClientMessageTransferUpdate.cs | 9 + .../Types/ClientMessageUserInterrupted.cs | 9 + src/Vapi.Net/Types/ClientMessageVoiceInput.cs | 9 + .../Types/ClientMessageWorkflowNodeStarted.cs | 9 + src/Vapi.Net/Types/CloudflareR2BucketPlan.cs | 3 + src/Vapi.Net/Types/CodeTool.cs | 10 +- .../Types/CodeToolEnvironmentVariable.cs | 3 + src/Vapi.Net/Types/Compliance.cs | 3 + src/Vapi.Net/Types/ComplianceOverride.cs | 3 + src/Vapi.Net/Types/CompliancePlan.cs | 6 + src/Vapi.Net/Types/ComputerTool.cs | 10 +- .../Types/ComputerToolWithToolCall.cs | 4 +- src/Vapi.Net/Types/Condition.cs | 3 + .../Types/ContextEngineeringPlanAll.cs | 3 + .../ContextEngineeringPlanLastNMessages.cs | 3 + .../Types/ContextEngineeringPlanNone.cs | 3 + ...gineeringPlanPreviousAssistantMessages.cs} | 2 +- ...EngineeringPlanUserAndAssistantMessages.cs | 3 + src/Vapi.Net/Types/ConversationNode.cs | 9 + src/Vapi.Net/Types/CostBreakdown.cs | 3 + .../CreateAnthropicBedrockCredentialDto.cs | 3 + ...eateAnthropicBedrockCredentialDtoRegion.cs | 5 + .../Types/CreateAnthropicCredentialDto.cs | 3 + .../Types/CreateAnyscaleCredentialDto.cs | 3 + src/Vapi.Net/Types/CreateApiRequestToolDto.cs | 26 +- .../Types/CreateAssemblyAiCredentialDto.cs | 3 + src/Vapi.Net/Types/CreateAssistantDraftDto.cs | 283 +++++ ...ateAssistantDraftDtoBackgroundSoundZero.cs | 84 ++ ...eateAssistantDraftDtoClientMessagesItem.cs | 175 +++ ...CreateAssistantDraftDtoFirstMessageMode.cs | 101 ++ ...eateAssistantDraftDtoServerMessagesItem.cs | 239 +++++ ...AssistantDraftDtoVoicemailDetectionZero.cs | 73 ++ src/Vapi.Net/Types/CreateAssistantDto.cs | 12 + .../Types/CreateAzureCredentialDto.cs | 3 + .../Types/CreateAzureCredentialDtoRegion.cs | 10 + .../Types/CreateAzureOpenAiCredentialDto.cs | 12 + ...reateAzureOpenAiCredentialDtoModelsItem.cs | 15 + .../CreateAzureOpenAiCredentialDtoRegion.cs | 10 + .../Types/CreateBarInsightFromCallTableDto.cs | 6 + src/Vapi.Net/Types/CreateBashToolDto.cs | 7 +- src/Vapi.Net/Types/CreateByoPhoneNumberDto.cs | 3 + .../Types/CreateByoSipTrunkCredentialDto.cs | 9 +- src/Vapi.Net/Types/CreateCampaignDto.cs | 118 +++ .../CreateCampaignDtoServerMessagesItem.cs | 129 +++ .../Types/CreateCartesiaCredentialDto.cs | 9 + .../Types/CreateCerebrasCredentialDto.cs | 3 + .../Types/CreateCloudflareCredentialDto.cs | 3 + src/Vapi.Net/Types/CreateCodeToolDto.cs | 7 +- src/Vapi.Net/Types/CreateComputerToolDto.cs | 7 +- .../Types/CreateCustomCredentialDto.cs | 3 + .../Types/CreateCustomKnowledgeBaseDto.cs | 3 + .../Types/CreateCustomLlmCredentialDto.cs | 3 + src/Vapi.Net/Types/CreateCustomerDto.cs | 11 + .../Types/CreateDeepInfraCredentialDto.cs | 3 + .../Types/CreateDeepSeekCredentialDto.cs | 3 + .../Types/CreateDeepgramCredentialDto.cs | 3 + src/Vapi.Net/Types/CreateDtmfToolDto.cs | 7 +- .../Types/CreateElevenLabsCredentialDto.cs | 9 + .../CreateElevenLabsCredentialDtoApiUrl.cs | 90 ++ .../Types/CreateEmailCredentialDto.cs | 3 + src/Vapi.Net/Types/CreateEndCallToolDto.cs | 7 +- src/Vapi.Net/Types/CreateEvalDto.cs | 3 + src/Vapi.Net/Types/CreateFunctionToolDto.cs | 7 +- src/Vapi.Net/Types/CreateGcpCredentialDto.cs | 6 + src/Vapi.Net/Types/CreateGhlToolDto.cs | 4 +- .../Types/CreateGladiaCredentialDto.cs | 3 + ...eGoHighLevelCalendarAvailabilityToolDto.cs | 7 +- ...teGoHighLevelCalendarEventCreateToolDto.cs | 7 +- .../CreateGoHighLevelContactCreateToolDto.cs | 7 +- .../CreateGoHighLevelContactGetToolDto.cs | 7 +- .../Types/CreateGoHighLevelCredentialDto.cs | 3 + .../CreateGoHighLevelMcpCredentialDto.cs | 3 + ...eGoogleCalendarCheckAvailabilityToolDto.cs | 7 +- .../CreateGoogleCalendarCreateEventToolDto.cs | 7 +- ...alendarOAuth2AuthorizationCredentialDto.cs | 3 + ...GoogleCalendarOAuth2ClientCredentialDto.cs | 3 + .../Types/CreateGoogleCredentialDto.cs | 3 + ...eSheetsOAuth2AuthorizationCredentialDto.cs | 3 + .../CreateGoogleSheetsRowAppendToolDto.cs | 7 +- src/Vapi.Net/Types/CreateGroqCredentialDto.cs | 3 + src/Vapi.Net/Types/CreateHandoffToolDto.cs | 7 +- src/Vapi.Net/Types/CreateHumeCredentialDto.cs | 3 + .../Types/CreateInflectionAiCredentialDto.cs | 3 + .../Types/CreateInworldCredentialDto.cs | 3 + .../Types/CreateLangfuseCredentialDto.cs | 3 + .../CreateLineInsightFromCallTableDto.cs | 6 + src/Vapi.Net/Types/CreateLmntCredentialDto.cs | 3 + src/Vapi.Net/Types/CreateMakeCredentialDto.cs | 3 + src/Vapi.Net/Types/CreateMakeToolDto.cs | 4 +- src/Vapi.Net/Types/CreateMcpToolDto.cs | 10 +- ...Dto.cs => CreateMicrosoftCredentialDto.cs} | 10 +- .../Types/CreateMinimaxCredentialDto.cs | 3 + .../Types/CreateMistralCredentialDto.cs | 3 + .../Types/CreateNeuphonicCredentialDto.cs | 3 + .../Types/CreateOpenAiCredentialDto.cs | 3 + .../Types/CreateOpenRouterCredentialDto.cs | 3 + src/Vapi.Net/Types/CreateOutboundCallDto.cs | 19 +- src/Vapi.Net/Types/CreateOutputToolDto.cs | 4 +- .../Types/CreatePerplexityAiCredentialDto.cs | 3 + .../Types/CreatePieInsightFromCallTableDto.cs | 6 + .../Types/CreatePlayHtCredentialDto.cs | 6 + src/Vapi.Net/Types/CreateQueryToolDto.cs | 7 +- .../Types/CreateRimeAiCredentialDto.cs | 3 + .../Types/CreateRunpodCredentialDto.cs | 3 + .../Types/CreateS3CompatibleCredentialDto.cs | 40 + src/Vapi.Net/Types/CreateS3CredentialDto.cs | 3 + src/Vapi.Net/Types/CreateScorecardDto.cs | 3 + src/Vapi.Net/Types/CreateSesameVoiceDto.cs | 13 +- .../Types/CreateSimulationRunResponse.cs | 127 +++ .../CreateSimulationRunResponseStatus.cs | 89 ++ .../Types/CreateSimulationSuiteDto.cs | 6 + src/Vapi.Net/Types/CreateSipRequestToolDto.cs | 7 +- ...teSlackOAuth2AuthorizationCredentialDto.cs | 3 + .../Types/CreateSlackSendMessageToolDto.cs | 7 +- .../Types/CreateSlackWebhookCredentialDto.cs | 3 + .../Types/CreateSmallestAiCredentialDto.cs | 3 + src/Vapi.Net/Types/CreateSmsToolDto.cs | 7 +- .../Types/CreateSonioxCredentialDto.cs | 9 + .../Types/CreateSpeechmaticsCredentialDto.cs | 3 + src/Vapi.Net/Types/CreateSquadDto.cs | 3 + .../Types/CreateStructuredOutputDto.cs | 9 + .../Types/CreateSupabaseCredentialDto.cs | 6 + .../Types/CreateTavusCredentialDto.cs | 3 + .../Types/CreateTelnyxPhoneNumberDto.cs | 3 + src/Vapi.Net/Types/CreateTextEditorToolDto.cs | 7 +- .../CreateTextInsightFromCallTableDto.cs | 6 + .../Types/CreateTogetherAiCredentialDto.cs | 3 + src/Vapi.Net/Types/CreateToolDraftDto.cs | 306 ++++++ .../Types/CreateToolDraftDtoMethod.cs | 99 ++ src/Vapi.Net/Types/CreateToolDraftDtoType.cs | 232 ++++ src/Vapi.Net/Types/CreateToolDraftDtoVerb.cs | 89 ++ .../Types/CreateTransferCallToolDto.cs | 7 +- .../Types/CreateTrieveCredentialDto.cs | 15 +- .../Types/CreateTrieveKnowledgeBaseDto.cs | 55 - .../Types/CreateTwilioCredentialDto.cs | 6 + .../Types/CreateTwilioPhoneNumberDto.cs | 3 + .../Types/CreateVapiPhoneNumberDto.cs | 3 + src/Vapi.Net/Types/CreateVoicemailToolDto.cs | 7 +- .../Types/CreateVonageCredentialDto.cs | 6 + .../Types/CreateVonagePhoneNumberDto.cs | 3 + src/Vapi.Net/Types/CreateWebCallDto.cs | 7 + .../Types/CreateWellSaidCredentialDto.cs | 3 + src/Vapi.Net/Types/CreateWorkflowDto.cs | 15 + src/Vapi.Net/Types/CreateXAiCredentialDto.cs | 3 + ...tomEndpointingModelSmartEndpointingPlan.cs | 3 + src/Vapi.Net/Types/CustomLlmModel.cs | 14 +- src/Vapi.Net/Types/CustomMessage.cs | 3 + src/Vapi.Net/Types/CustomTranscriber.cs | 3 + src/Vapi.Net/Types/CustomVoice.cs | 3 + .../Types/CustomerCustomEndpointingRule.cs | 3 + .../Types/CustomerSpeechTimeoutOptions.cs | 19 +- ...merSpeechTimeoutOptionsTriggerResetMode.cs | 84 ++ src/Vapi.Net/Types/DeepInfraModel.cs | 14 +- src/Vapi.Net/Types/DeepSeekModel.cs | 14 +- src/Vapi.Net/Types/DeepgramTranscriber.cs | 34 +- .../Types/DeepgramTranscriberRedactionItem.cs | 94 ++ src/Vapi.Net/Types/DeepgramVoice.cs | 3 + src/Vapi.Net/Types/DeepgramVoiceId.cs | 35 + src/Vapi.Net/Types/DeveloperMessage.cs | 3 + src/Vapi.Net/Types/DialPlanEntry.cs | 3 + src/Vapi.Net/Types/DtmfTool.cs | 10 +- src/Vapi.Net/Types/Edge.cs | 12 + src/Vapi.Net/Types/ElevenLabsCredential.cs | 6 + .../Types/ElevenLabsCredentialApiUrl.cs | 90 ++ ...levenLabsPronunciationDictionaryLocator.cs | 3 + src/Vapi.Net/Types/ElevenLabsTranscriber.cs | 3 + src/Vapi.Net/Types/ElevenLabsVoice.cs | 3 + src/Vapi.Net/Types/EndCallTool.cs | 10 +- src/Vapi.Net/Types/EndedReasonCondition.cs | 43 + .../Types/EndedReasonConditionOperator.cs | 84 ++ src/Vapi.Net/Types/Eval.cs | 15 + src/Vapi.Net/Types/EvalAnthropicModel.cs | 3 + src/Vapi.Net/Types/EvalAnthropicModelModel.cs | 5 + src/Vapi.Net/Types/EvalCustomModel.cs | 3 + src/Vapi.Net/Types/EvalGoogleModel.cs | 3 + src/Vapi.Net/Types/EvalGoogleModelModel.cs | 10 + src/Vapi.Net/Types/EvalGroqModelModel.cs | 11 - src/Vapi.Net/Types/EvalOpenAiModel.cs | 3 + src/Vapi.Net/Types/EvalOpenAiModelModel.cs | 40 + src/Vapi.Net/Types/EvalPaginatedResponse.cs | 9 + src/Vapi.Net/Types/EvalRun.cs | 18 + .../Types/EvalRunPaginatedResponse.cs | 9 + src/Vapi.Net/Types/EvalRunResult.cs | 3 + src/Vapi.Net/Types/EvalRunTargetAssistant.cs | 3 + src/Vapi.Net/Types/EvalRunTargetSquad.cs | 3 + src/Vapi.Net/Types/EvaluationPlanItem.cs | 6 + .../Types/EventsTableBooleanCondition.cs | 3 + .../Types/EventsTableNumberCondition.cs | 3 + .../Types/EventsTableStringCondition.cs | 3 + src/Vapi.Net/Types/ExactReplacement.cs | 3 + src/Vapi.Net/Types/ExportChatDto.cs | 6 + src/Vapi.Net/Types/ExportChatDtoSortBy.cs | 89 ++ src/Vapi.Net/Types/ExportSessionDto.cs | 6 + src/Vapi.Net/Types/ExportSessionDtoSortBy.cs | 89 ++ .../Types/FallbackAssemblyAiTranscriber.cs | 3 + .../Types/FallbackAzureSpeechTranscriber.cs | 3 + src/Vapi.Net/Types/FallbackAzureVoice.cs | 3 + .../Types/FallbackCartesiaTranscriber.cs | 9 + .../Types/FallbackCartesiaTranscriberModel.cs | 15 +- src/Vapi.Net/Types/FallbackCartesiaVoice.cs | 3 + .../Types/FallbackCartesiaVoiceModel.cs | 10 + .../Types/FallbackCustomTranscriber.cs | 3 + src/Vapi.Net/Types/FallbackCustomVoice.cs | 3 + .../Types/FallbackDeepgramTranscriber.cs | 34 +- ...allbackDeepgramTranscriberRedactionItem.cs | 94 ++ src/Vapi.Net/Types/FallbackDeepgramVoice.cs | 3 + src/Vapi.Net/Types/FallbackDeepgramVoiceId.cs | 35 + .../Types/FallbackElevenLabsTranscriber.cs | 3 + src/Vapi.Net/Types/FallbackElevenLabsVoice.cs | 3 + .../Types/FallbackGladiaTranscriber.cs | 5 +- .../FallbackGladiaTranscriberLanguages.cs | 569 ---------- .../FallbackGladiaTranscriberLanguagesItem.cs | 569 ++++++++++ .../Types/FallbackGoogleTranscriber.cs | 3 + .../Types/FallbackGoogleTranscriberModel.cs | 10 + src/Vapi.Net/Types/FallbackHumeVoice.cs | 3 + src/Vapi.Net/Types/FallbackInworldVoice.cs | 3 + src/Vapi.Net/Types/FallbackLmntVoice.cs | 3 + src/Vapi.Net/Types/FallbackMicrosoftVoice.cs | 67 ++ .../Types/FallbackMicrosoftVoiceRole.cs | 114 ++ .../Types/FallbackMicrosoftVoiceStyle.cs | 219 ++++ .../Types/FallbackMicrosoftVoiceVoiceId.cs | 304 ++++++ src/Vapi.Net/Types/FallbackNeuphonicVoice.cs | 3 + .../Types/FallbackOpenAiTranscriber.cs | 3 + src/Vapi.Net/Types/FallbackOpenAiVoice.cs | 3 + src/Vapi.Net/Types/FallbackPlan.cs | 3 + src/Vapi.Net/Types/FallbackPlayHtVoice.cs | 3 + src/Vapi.Net/Types/FallbackRimeAiVoice.cs | 3 + src/Vapi.Net/Types/FallbackSesameVoice.cs | 3 + src/Vapi.Net/Types/FallbackSmallestAiVoice.cs | 3 + .../Types/FallbackSonioxTranscriber.cs | 19 +- .../FallbackSonioxTranscriberLanguagesItem.cs | 999 ++++++++++++++++++ .../Types/FallbackSonioxTranscriberModel.cs | 15 +- .../Types/FallbackSpeechmaticsTranscriber.cs | 9 + .../Types/FallbackTalkscriberTranscriber.cs | 3 + src/Vapi.Net/Types/FallbackTavusVoice.cs | 3 + src/Vapi.Net/Types/FallbackTranscriberPlan.cs | 8 +- src/Vapi.Net/Types/FallbackVapiVoice.cs | 15 + .../Types/FallbackVapiVoiceLanguage.cs | 359 +++++++ .../Types/FallbackVapiVoiceVersion.cs | 89 ++ .../Types/FallbackVapiVoiceVoiceId.cs | 70 +- src/Vapi.Net/Types/FallbackWellSaidVoice.cs | 3 + src/Vapi.Net/Types/FallbackXaiTranscriber.cs | 37 + .../Types/FallbackXaiTranscriberLanguage.cs | 199 ++++ .../Types/FallbackXaiTranscriberModel.cs | 73 ++ src/Vapi.Net/Types/FallbackXaiVoice.cs | 55 + .../Types/FallbackXaiVoiceLanguage.cs | 179 ++++ src/Vapi.Net/Types/FallbackXaiVoiceVoiceId.cs | 99 ++ src/Vapi.Net/Types/File.cs | 42 + .../Types/FilterDateTypeColumnOnCallTable.cs | 3 + .../FilterNumberArrayTypeColumnOnCallTable.cs | 3 + .../FilterNumberTypeColumnOnCallTable.cs | 3 + .../FilterStringArrayTypeColumnOnCallTable.cs | 3 + .../FilterStringTypeColumnOnCallTable.cs | 3 + ...FilterStructuredOutputColumnOnCallTable.cs | 3 + src/Vapi.Net/Types/FormatPlan.cs | 3 + src/Vapi.Net/Types/FourierDenoisingPlan.cs | 3 + src/Vapi.Net/Types/FunctionCallHookAction.cs | 4 +- src/Vapi.Net/Types/FunctionTool.cs | 10 +- .../Types/FunctionToolWithToolCall.cs | 4 +- src/Vapi.Net/Types/GcpKey.cs | 3 + ...GeminiMultimodalLivePrebuiltVoiceConfig.cs | 6 + .../Types/GeminiMultimodalLiveSpeechConfig.cs | 6 + .../Types/GeminiMultimodalLiveVoiceConfig.cs | 6 + src/Vapi.Net/Types/GetChatPaginatedDto.cs | 6 + .../Types/GetChatPaginatedDtoSortBy.cs | 89 ++ src/Vapi.Net/Types/GetEvalPaginatedDto.cs | 6 + .../Types/GetEvalPaginatedDtoSortBy.cs | 89 ++ src/Vapi.Net/Types/GetEvalRunPaginatedDto.cs | 6 + .../Types/GetEvalRunPaginatedDtoSortBy.cs | 89 ++ src/Vapi.Net/Types/GetSessionPaginatedDto.cs | 6 + .../Types/GetSessionPaginatedDtoSortBy.cs | 89 ++ ...ledgeBaseCreate.cs => GetToolDraftsDto.cs} | 18 +- src/Vapi.Net/Types/GhlTool.cs | 7 +- src/Vapi.Net/Types/GhlToolMetadata.cs | 9 + src/Vapi.Net/Types/GhlToolWithToolCall.cs | 4 +- .../Types/GladiaCustomVocabularyConfigDto.cs | 3 + src/Vapi.Net/Types/GladiaTranscriber.cs | 5 +- .../Types/GladiaTranscriberLanguages.cs | 569 ---------- .../Types/GladiaTranscriberLanguagesItem.cs | 569 ++++++++++ src/Vapi.Net/Types/GladiaVocabularyItemDto.cs | 3 + src/Vapi.Net/Types/GlobalNodePlan.cs | 3 + .../GoHighLevelCalendarAvailabilityTool.cs | 10 +- ...velCalendarAvailabilityToolWithToolCall.cs | 4 +- .../GoHighLevelCalendarEventCreateTool.cs | 10 +- ...evelCalendarEventCreateToolWithToolCall.cs | 4 +- .../Types/GoHighLevelContactCreateTool.cs | 10 +- ...oHighLevelContactCreateToolWithToolCall.cs | 4 +- .../Types/GoHighLevelContactGetTool.cs | 10 +- .../GoHighLevelContactGetToolWithToolCall.cs | 4 +- .../GoogleCalendarCheckAvailabilityTool.cs | 10 +- .../Types/GoogleCalendarCreateEventTool.cs | 10 +- ...ogleCalendarCreateEventToolWithToolCall.cs | 4 +- src/Vapi.Net/Types/GoogleModel.cs | 14 +- src/Vapi.Net/Types/GoogleModelModel.cs | 10 + src/Vapi.Net/Types/GoogleRealtimeConfig.cs | 3 + .../Types/GoogleSheetsRowAppendTool.cs | 10 +- .../GoogleSheetsRowAppendToolWithToolCall.cs | 4 +- src/Vapi.Net/Types/GoogleTranscriber.cs | 3 + src/Vapi.Net/Types/GoogleTranscriberModel.cs | 10 + .../Types/GoogleVoicemailDetectionPlan.cs | 3 + src/Vapi.Net/Types/GroqModel.cs | 14 +- src/Vapi.Net/Types/GroqModelModel.cs | 11 - src/Vapi.Net/Types/GroupCondition.cs | 3 + .../Types/HandoffDestinationAssistant.cs | 6 + .../Types/HandoffDestinationDynamic.cs | 3 + src/Vapi.Net/Types/HandoffDestinationSquad.cs | 3 + src/Vapi.Net/Types/HandoffTool.cs | 10 +- src/Vapi.Net/Types/HmacAuthenticationPlan.cs | 3 + src/Vapi.Net/Types/HumeVoice.cs | 3 + .../Types/ImportTwilioPhoneNumberDto.cs | 3 + src/Vapi.Net/Types/InflectionAiModel.cs | 14 +- src/Vapi.Net/Types/Insight.cs | 9 + src/Vapi.Net/Types/InsightFormula.cs | 3 + .../Types/InsightPaginatedResponse.cs | 9 + src/Vapi.Net/Types/InsightRunFormatPlan.cs | 3 + src/Vapi.Net/Types/InsightRunResponse.cs | 18 + src/Vapi.Net/Types/InsightTimeRange.cs | 3 + .../Types/InsightTimeRangeWithStep.cs | 3 + src/Vapi.Net/Types/InviteUserDto.cs | 3 +- ...serDtoRole.cs => InviteUserDtoRoleZero.cs} | 32 +- src/Vapi.Net/Types/InworldVoice.cs | 3 + ...sonQueryOnCallTableWithNumberTypeColumn.cs | 3 + ...sonQueryOnCallTableWithStringTypeColumn.cs | 3 + ...ryOnCallTableWithStructuredOutputColumn.cs | 3 + src/Vapi.Net/Types/JsonQueryOnEventsTable.cs | 3 + .../Types/JsonQueryOnEventsTableOn.cs | 11 + src/Vapi.Net/Types/JsonSchema.cs | 3 + src/Vapi.Net/Types/KeypadInputPlan.cs | 3 + src/Vapi.Net/Types/KnowledgeBase.cs | 3 + src/Vapi.Net/Types/KnowledgeBaseCost.cs | 3 + src/Vapi.Net/Types/KnowledgeBaseModel.cs | 10 + .../Types/LangfuseObservabilityPlan.cs | 6 + src/Vapi.Net/Types/LegacyAssistantVersion.cs | 40 + ...LegacyAssistantVersionPaginatedResponse.cs | 35 + src/Vapi.Net/Types/LineInsight.cs | 12 + src/Vapi.Net/Types/LineInsightMetadata.cs | 18 + src/Vapi.Net/Types/LiquidCondition.cs | 3 + .../Types/LivekitSmartEndpointingPlan.cs | 3 + src/Vapi.Net/Types/LmntVoice.cs | 3 + src/Vapi.Net/Types/MakeTool.cs | 7 +- src/Vapi.Net/Types/MakeToolWithToolCall.cs | 4 +- src/Vapi.Net/Types/McpTool.cs | 13 +- src/Vapi.Net/Types/McpToolMessages.cs | 5 +- src/Vapi.Net/Types/McpToolMetadata.cs | 3 + src/Vapi.Net/Types/MessageAddHookAction.cs | 3 + src/Vapi.Net/Types/MessageTarget.cs | 3 + ...veCredential.cs => MicrosoftCredential.cs} | 10 +- .../Types/MicrosoftCredentialProvider.cs | 73 ++ src/Vapi.Net/Types/MicrosoftVoice.cs | 73 ++ src/Vapi.Net/Types/MicrosoftVoiceRole.cs | 114 ++ src/Vapi.Net/Types/MicrosoftVoiceStyle.cs | 219 ++++ src/Vapi.Net/Types/MicrosoftVoiceVoiceId.cs | 304 ++++++ .../Types/MinCallDurationCondition.cs | 35 + src/Vapi.Net/Types/MinMessagesCondition.cs | 35 + src/Vapi.Net/Types/MinimaxLlmModel.cs | 14 +- src/Vapi.Net/Types/MinimaxVoice.cs | 3 + src/Vapi.Net/Types/ModelCost.cs | 11 + src/Vapi.Net/Types/Monitor.cs | 6 + src/Vapi.Net/Types/MonitorPlan.cs | 9 +- src/Vapi.Net/Types/MonitorResult.cs | 9 + src/Vapi.Net/Types/Mono.cs | 3 + src/Vapi.Net/Types/NeuphonicVoice.cs | 3 + src/Vapi.Net/Types/NodeArtifact.cs | 5 +- ...umberComparatorScorecardMetricCondition.cs | 53 + ...ratorScorecardMetricConditionComparator.cs | 104 ++ ...rComparatorScorecardMetricConditionType.cs | 79 ++ .../Types/OAuth2AuthenticationPlan.cs | 6 + .../Types/Oauth2AuthenticationSession.cs | 3 + src/Vapi.Net/Types/OpenAiFunction.cs | 19 +- .../Types/OpenAiFunctionParameters.cs | 3 + src/Vapi.Net/Types/OpenAiMessage.cs | 9 + src/Vapi.Net/Types/OpenAiModel.cs | 25 +- .../Types/OpenAiModelFallbackModelsItem.cs | 45 + src/Vapi.Net/Types/OpenAiModelModel.cs | 45 + .../Types/OpenAiModelReasoningEffort.cs | 104 ++ src/Vapi.Net/Types/OpenAiTranscriber.cs | 3 + src/Vapi.Net/Types/OpenAiVoice.cs | 3 + .../Types/OpenAiVoicemailDetectionPlan.cs | 3 + src/Vapi.Net/Types/OpenRouterModel.cs | 14 +- src/Vapi.Net/Types/Org.cs | 13 + src/Vapi.Net/Types/OutputTool.cs | 7 +- src/Vapi.Net/Types/PaginationMeta.cs | 38 + src/Vapi.Net/Types/PaginationMetaSortOrder.cs | 84 ++ src/Vapi.Net/Types/PendingInvitationDto.cs | 31 + .../Types/PendingInvitationsResponseDto.cs | 29 + src/Vapi.Net/Types/PerformanceMetrics.cs | 3 + src/Vapi.Net/Types/PerplexityAiModel.cs | 14 +- .../Types/PhoneNumberCallEndingHookFilter.cs | 3 + .../Types/PhoneNumberCallRingingHookFilter.cs | 3 + .../Types/PhoneNumberHookCallEnding.cs | 3 + .../Types/PhoneNumberHookCallRinging.cs | 3 + .../Types/PhoneNumberPaginatedResponse.cs | 3 + src/Vapi.Net/Types/PieInsight.cs | 12 + src/Vapi.Net/Types/PlayHtVoice.cs | 3 + .../Types/PromptInjectionSecurityFilter.cs | 3 + src/Vapi.Net/Types/ProviderResource.cs | 3 + .../ProviderResourcePaginatedResponse.cs | 9 + src/Vapi.Net/Types/PublicKeyEncryptionPlan.cs | 3 + src/Vapi.Net/Types/QueryTool.cs | 10 +- src/Vapi.Net/Types/RceSecurityFilter.cs | 3 + src/Vapi.Net/Types/Recording.cs | 3 + src/Vapi.Net/Types/RecordingConsent.cs | 5 +- .../Types/RecordingConsentPlanStayOnLine.cs | 19 + ...ngConsentPlanStayOnLineFirstMessageMode.cs | 96 ++ .../Types/RecordingConsentPlanVerbal.cs | 19 + ...ordingConsentPlanVerbalFirstMessageMode.cs | 96 ++ src/Vapi.Net/Types/RecordingConsentType.cs | 84 ++ src/Vapi.Net/Types/RegexCondition.cs | 3 + src/Vapi.Net/Types/RegexOption.cs | 3 + src/Vapi.Net/Types/RegexReplacement.cs | 3 + src/Vapi.Net/Types/RegexSecurityFilter.cs | 3 + .../Types/RevokeInvitationResponseDto.cs | 28 + src/Vapi.Net/Types/RimeAiVoice.cs | 3 + src/Vapi.Net/Types/S3CompatibleBucketPlan.cs | 62 ++ .../Types/S3CompatibleStorageCredential.cs | 70 ++ .../S3CompatibleStorageCredentialProvider.cs | 79 ++ src/Vapi.Net/Types/SayHookAction.cs | 15 +- .../Types/SayPhoneNumberHookAction.cs | 3 + src/Vapi.Net/Types/SchedulePlan.cs | 3 + src/Vapi.Net/Types/Scorecard.cs | 3 + src/Vapi.Net/Types/ScorecardMetric.cs | 28 +- .../Types/ScorecardPaginatedResponse.cs | 9 + src/Vapi.Net/Types/SecurityFilterBase.cs | 3 + src/Vapi.Net/Types/SecurityFilterPlan.cs | 3 + src/Vapi.Net/Types/Server.cs | 3 + src/Vapi.Net/Types/ServerMessage.cs | 3 +- .../Types/ServerMessageAssistantRequest.cs | 9 + .../Types/ServerMessageAssistantSpeech.cs | 9 + .../Types/ServerMessageCallDeleteFailed.cs | 9 + .../Types/ServerMessageCallDeleted.cs | 9 + .../ServerMessageCallEndpointingRequest.cs | 11 +- .../Types/ServerMessageCampaignPredial.cs | 96 ++ .../Types/ServerMessageCampaignPredialType.cs | 79 ++ .../Types/ServerMessageChatCreated.cs | 9 + .../Types/ServerMessageChatDeleted.cs | 9 + .../Types/ServerMessageConversationUpdate.cs | 11 +- .../Types/ServerMessageEndOfCallReport.cs | 9 + ...ServerMessageEndOfCallReportEndedReason.cs | 264 +++++ .../ServerMessageHandoffDestinationRequest.cs | 9 + src/Vapi.Net/Types/ServerMessageHang.cs | 9 + .../ServerMessageKnowledgeBaseRequest.cs | 11 +- .../ServerMessageLanguageChangeDetected.cs | 9 + .../Types/ServerMessageModelOutput.cs | 9 + .../Types/ServerMessagePhoneCallControl.cs | 9 + src/Vapi.Net/Types/ServerMessageResponse.cs | 3 +- .../ServerMessageResponseCampaignPredial.cs | 31 + .../Types/ServerMessageSessionCreated.cs | 9 + .../Types/ServerMessageSessionDeleted.cs | 9 + .../Types/ServerMessageSessionUpdated.cs | 9 + .../Types/ServerMessageSpeechUpdate.cs | 9 + .../Types/ServerMessageStatusUpdate.cs | 11 +- .../ServerMessageStatusUpdateEndedReason.cs | 264 +++++ src/Vapi.Net/Types/ServerMessageToolCalls.cs | 9 + src/Vapi.Net/Types/ServerMessageTranscript.cs | 9 + ...ServerMessageTransferDestinationRequest.cs | 9 + .../Types/ServerMessageTransferUpdate.cs | 9 + .../Types/ServerMessageUserInterrupted.cs | 9 + src/Vapi.Net/Types/ServerMessageVoiceInput.cs | 9 + .../Types/ServerMessageVoiceRequest.cs | 9 + src/Vapi.Net/Types/SesameVoice.cs | 3 + src/Vapi.Net/Types/SimulationSuite.cs | 7 + .../Types/SimulationSuiteTargetAssignment.cs | 37 + ...mulationSuiteTargetAssignmentTargetType.cs | 84 ++ src/Vapi.Net/Types/SipAuthentication.cs | 5 +- src/Vapi.Net/Types/SipRequestTool.cs | 10 +- src/Vapi.Net/Types/SipTrunkGateway.cs | 5 +- .../SipTrunkOutboundAuthenticationPlan.cs | 6 + .../Types/SipTrunkOutboundSipRegisterPlan.cs | 12 + src/Vapi.Net/Types/SkippedStructuredOutput.cs | 38 + src/Vapi.Net/Types/SlackSendMessageTool.cs | 10 +- src/Vapi.Net/Types/SmallestAiVoice.cs | 3 + src/Vapi.Net/Types/SmartDenoisingPlan.cs | 3 + src/Vapi.Net/Types/SmsTool.cs | 10 +- .../Types/SonioxContextGeneralItem.cs | 37 + src/Vapi.Net/Types/SonioxCredential.cs | 6 + src/Vapi.Net/Types/SonioxTranscriber.cs | 19 +- .../Types/SonioxTranscriberLanguagesItem.cs | 999 ++++++++++++++++++ src/Vapi.Net/Types/SonioxTranscriberModel.cs | 15 +- .../Types/SpeechmaticsCustomVocabularyItem.cs | 3 + src/Vapi.Net/Types/SpeechmaticsTranscriber.cs | 9 + src/Vapi.Net/Types/SpkiPemPublicKeyConfig.cs | 3 + .../Types/SqlInjectionSecurityFilter.cs | 3 + src/Vapi.Net/Types/Squad.cs | 3 + src/Vapi.Net/Types/SquadMemberDto.cs | 14 + src/Vapi.Net/Types/SsrfSecurityFilter.cs | 3 + src/Vapi.Net/Types/StartSpeakingPlan.cs | 3 + src/Vapi.Net/Types/StopSpeakingPlan.cs | 3 + src/Vapi.Net/Types/StructuredDataMultiPlan.cs | 3 + src/Vapi.Net/Types/StructuredDataPlan.cs | 3 + src/Vapi.Net/Types/StructuredOutput.cs | 9 + .../Types/StructuredOutputEvaluationResult.cs | 18 + .../StructuredOutputPaginatedResponse.cs | 9 + .../Types/StructuredOutputRerunResponse.cs | 34 + .../StructuredOutputRunPreviewResponse.cs | 33 + .../Types/StructuredOutputRunResult.cs | 41 + src/Vapi.Net/Types/SubscriptionLimits.cs | 3 + src/Vapi.Net/Types/SuccessEvaluationPlan.cs | 3 + src/Vapi.Net/Types/SummaryPlan.cs | 3 + src/Vapi.Net/Types/SupabaseBucketPlan.cs | 3 + .../Types/SyncVoiceLibraryDtoProvidersItem.cs | 10 + src/Vapi.Net/Types/SystemMessage.cs | 3 + src/Vapi.Net/Types/TalkscriberTranscriber.cs | 3 + .../Types/TavusConversationProperties.cs | 3 + src/Vapi.Net/Types/TavusVoice.cs | 3 + src/Vapi.Net/Types/TelnyxPhoneNumber.cs | 3 + src/Vapi.Net/Types/TelnyxTransport.cs | 49 + .../Types/TelnyxTransportConversationType.cs | 73 ++ src/Vapi.Net/Types/TextContent.cs | 12 + src/Vapi.Net/Types/TextEditorTool.cs | 10 +- .../Types/TextEditorToolWithToolCall.cs | 4 +- src/Vapi.Net/Types/TextInsight.cs | 12 + src/Vapi.Net/Types/TimeRange.cs | 3 + src/Vapi.Net/Types/TogetherAiModel.cs | 14 +- src/Vapi.Net/Types/ToolCall.cs | 3 + src/Vapi.Net/Types/ToolCallFunction.cs | 3 + src/Vapi.Net/Types/ToolCallHookAction.cs | 3 + src/Vapi.Net/Types/ToolCallMessage.cs | 3 + src/Vapi.Net/Types/ToolCallResult.cs | 2 +- src/Vapi.Net/Types/ToolCallResultMessage.cs | 67 -- .../Types/ToolCallResultMessageWarning.cs | 46 + .../Types/ToolCallResultMessageWarningType.cs | 79 ++ src/Vapi.Net/Types/ToolDraft.cs | 344 ++++++ .../Types/ToolDraftConflictResponseDto.cs | 34 + src/Vapi.Net/Types/ToolDraftMethod.cs | 99 ++ .../Types/ToolDraftPaginatedMetadata.cs | 34 + .../Types/ToolDraftPaginatedResponse.cs | 31 + src/Vapi.Net/Types/ToolDraftType.cs | 220 ++++ src/Vapi.Net/Types/ToolDraftVerb.cs | 89 ++ src/Vapi.Net/Types/ToolMessage.cs | 3 + src/Vapi.Net/Types/ToolMessageComplete.cs | 3 + src/Vapi.Net/Types/ToolMessageDelayed.cs | 5 +- src/Vapi.Net/Types/ToolMessageFailed.cs | 23 + src/Vapi.Net/Types/ToolMessageFailedRole.cs | 84 ++ src/Vapi.Net/Types/ToolMessageStart.cs | 3 + src/Vapi.Net/Types/ToolNode.cs | 6 + src/Vapi.Net/Types/ToolParameter.cs | 3 + .../Types/ToolPinnedConflictResponseDto.cs | 34 + .../ToolPinnedConflictResponseDtoError.cs | 73 ++ ...rieveKnowledgeBaseImport.cs => ToolRef.cs} | 14 +- src/Vapi.Net/Types/ToolRejectionPlan.cs | 3 + src/Vapi.Net/Types/ToolVersion.cs | 194 ++++ .../Types/ToolVersionPaginatedMetadata.cs | 34 + .../Types/ToolVersionPaginatedResponse.cs | 31 + src/Vapi.Net/Types/TranscriberCost.cs | 3 + src/Vapi.Net/Types/TranscriptPlan.cs | 3 + .../Types/TranscriptionEndpointingPlan.cs | 3 + src/Vapi.Net/Types/TransferArtifact.cs | 59 ++ src/Vapi.Net/Types/TransferArtifactMode.cs | 132 +++ src/Vapi.Net/Types/TransferArtifactStatus.cs | 109 ++ src/Vapi.Net/Types/TransferCallTool.cs | 10 +- .../Types/TransferCancelToolUserEditable.cs | 4 +- .../Types/TransferDestinationAssistant.cs | 6 + .../Types/TransferDestinationNumber.cs | 3 + src/Vapi.Net/Types/TransferDestinationSip.cs | 3 + src/Vapi.Net/Types/TransferFallbackPlan.cs | 3 + .../Types/TransferPhoneNumberHookAction.cs | 3 + src/Vapi.Net/Types/TransferPlan.cs | 9 +- .../TransferSuccessfulToolUserEditable.cs | 4 +- .../Types/TransportConfigurationTwilio.cs | 6 + src/Vapi.Net/Types/TransportCost.cs | 6 + src/Vapi.Net/Types/TrieveKnowledgeBase.cs | 67 -- .../Types/TrieveKnowledgeBaseChunkPlan.cs | 55 - .../Types/TrieveKnowledgeBaseSearchPlan.cs | 49 - src/Vapi.Net/Types/TurnLatency.cs | 3 + src/Vapi.Net/Types/TwilioPhoneNumber.cs | 3 + src/Vapi.Net/Types/TwilioTransport.cs | 56 + .../Types/TwilioTransportConversationType.cs | 73 ++ .../Types/TwilioVoicemailDetectionPlan.cs | 3 + .../UpdateAnthropicBedrockCredentialDto.cs | 3 + ...teAnthropicBedrockCredentialDtoProvider.cs | 79 ++ ...dateAnthropicBedrockCredentialDtoRegion.cs | 5 + .../Types/UpdateAnthropicCredentialDto.cs | 3 + .../UpdateAnthropicCredentialDtoProvider.cs | 73 ++ .../Types/UpdateAnyscaleCredentialDto.cs | 3 + .../UpdateAnyscaleCredentialDtoProvider.cs | 73 ++ src/Vapi.Net/Types/UpdateApiRequestToolDto.cs | 26 +- .../Types/UpdateAssemblyAiCredentialDto.cs | 3 + .../UpdateAssemblyAiCredentialDtoProvider.cs | 73 ++ src/Vapi.Net/Types/UpdateAssistantDraftDto.cs | 273 +++++ ...ateAssistantDraftDtoBackgroundSoundZero.cs | 84 ++ ...dateAssistantDraftDtoClientMessagesItem.cs | 175 +++ ...UpdateAssistantDraftDtoFirstMessageMode.cs | 101 ++ ...dateAssistantDraftDtoServerMessagesItem.cs | 239 +++++ ...AssistantDraftDtoVoicemailDetectionZero.cs | 73 ++ .../UpdateAssistantVersionMetadataDto.cs | 37 + .../Types/UpdateAzureCredentialDto.cs | 3 + .../Types/UpdateAzureCredentialDtoProvider.cs | 73 ++ .../Types/UpdateAzureCredentialDtoRegion.cs | 10 + .../Types/UpdateAzureOpenAiCredentialDto.cs | 3 + ...pdateAzureOpenAiCredentialDtoModelsItem.cs | 15 + .../UpdateAzureOpenAiCredentialDtoProvider.cs | 79 ++ .../UpdateAzureOpenAiCredentialDtoRegion.cs | 10 + .../Types/UpdateBarInsightFromCallTableDto.cs | 6 + src/Vapi.Net/Types/UpdateBashToolDto.cs | 7 +- src/Vapi.Net/Types/UpdateByoPhoneNumberDto.cs | 3 + .../Types/UpdateByoSipTrunkCredentialDto.cs | 12 +- .../UpdateByoSipTrunkCredentialDtoProvider.cs | 79 ++ .../Requests => Types}/UpdateCampaignDto.cs | 21 +- .../Types/UpdateCampaignDtoStatus.cs | 15 +- .../Types/UpdateCartesiaCredentialDto.cs | 9 + .../UpdateCartesiaCredentialDtoProvider.cs | 73 ++ .../Types/UpdateCerebrasCredentialDto.cs | 3 + .../UpdateCerebrasCredentialDtoProvider.cs | 73 ++ .../Types/UpdateCloudflareCredentialDto.cs | 6 + .../UpdateCloudflareCredentialDtoProvider.cs | 73 ++ src/Vapi.Net/Types/UpdateCodeToolDto.cs | 10 +- ...seProvider.cs => UpdateCodeToolDtoType.cs} | 28 +- src/Vapi.Net/Types/UpdateComputerToolDto.cs | 7 +- .../Types/UpdateCustomCredentialDto.cs | 3 + .../UpdateCustomCredentialDtoProvider.cs | 79 ++ .../Types/UpdateCustomKnowledgeBaseDto.cs | 6 + .../UpdateCustomKnowledgeBaseDtoProvider.cs | 79 ++ .../Types/UpdateCustomLlmCredentialDto.cs | 3 + .../UpdateCustomLlmCredentialDtoProvider.cs | 73 ++ .../Types/UpdateDeepInfraCredentialDto.cs | 3 + .../UpdateDeepInfraCredentialDtoProvider.cs | 73 ++ .../Types/UpdateDeepSeekCredentialDto.cs | 3 + .../UpdateDeepSeekCredentialDtoProvider.cs | 73 ++ .../Types/UpdateDeepgramCredentialDto.cs | 3 + .../UpdateDeepgramCredentialDtoProvider.cs | 73 ++ src/Vapi.Net/Types/UpdateDtmfToolDto.cs | 7 +- .../Types/UpdateElevenLabsCredentialDto.cs | 12 +- .../UpdateElevenLabsCredentialDtoApiUrl.cs | 90 ++ .../Types/UpdateEmailCredentialDto.cs | 3 + .../Types/UpdateEmailCredentialDtoProvider.cs | 73 ++ src/Vapi.Net/Types/UpdateEndCallToolDto.cs | 7 +- src/Vapi.Net/Types/UpdateFunctionToolDto.cs | 7 +- src/Vapi.Net/Types/UpdateGcpCredentialDto.cs | 3 + .../Types/UpdateGcpCredentialDtoProvider.cs | 73 ++ src/Vapi.Net/Types/UpdateGhlToolDto.cs | 10 +- src/Vapi.Net/Types/UpdateGhlToolDtoType.cs | 73 ++ .../Types/UpdateGladiaCredentialDto.cs | 3 + .../UpdateGladiaCredentialDtoProvider.cs | 73 ++ ...eGoHighLevelCalendarAvailabilityToolDto.cs | 7 +- ...teGoHighLevelCalendarEventCreateToolDto.cs | 7 +- .../UpdateGoHighLevelContactCreateToolDto.cs | 7 +- .../UpdateGoHighLevelContactGetToolDto.cs | 7 +- .../Types/UpdateGoHighLevelCredentialDto.cs | 3 + .../UpdateGoHighLevelCredentialDtoProvider.cs | 79 ++ .../UpdateGoHighLevelMcpCredentialDto.cs | 3 + ...dateGoHighLevelMcpCredentialDtoProvider.cs | 85 ++ ...eGoogleCalendarCheckAvailabilityToolDto.cs | 7 +- .../UpdateGoogleCalendarCreateEventToolDto.cs | 7 +- ...alendarOAuth2AuthorizationCredentialDto.cs | 3 + ...Auth2AuthorizationCredentialDtoProvider.cs | 85 ++ ...GoogleCalendarOAuth2ClientCredentialDto.cs | 3 + ...lendarOAuth2ClientCredentialDtoProvider.cs | 85 ++ .../Types/UpdateGoogleCredentialDto.cs | 6 + .../UpdateGoogleCredentialDtoProvider.cs | 73 ++ ...eSheetsOAuth2AuthorizationCredentialDto.cs | 3 + ...Auth2AuthorizationCredentialDtoProvider.cs | 85 ++ .../UpdateGoogleSheetsRowAppendToolDto.cs | 7 +- src/Vapi.Net/Types/UpdateGroqCredentialDto.cs | 3 + .../Types/UpdateGroqCredentialDtoProvider.cs | 73 ++ src/Vapi.Net/Types/UpdateHandoffToolDto.cs | 7 +- src/Vapi.Net/Types/UpdateHumeCredentialDto.cs | 3 + .../Types/UpdateHumeCredentialDtoProvider.cs | 73 ++ .../Types/UpdateInflectionAiCredentialDto.cs | 6 + ...UpdateInflectionAiCredentialDtoProvider.cs | 79 ++ .../Types/UpdateInworldCredentialDto.cs | 3 + .../UpdateInworldCredentialDtoProvider.cs | 73 ++ .../Types/UpdateLangfuseCredentialDto.cs | 3 + .../UpdateLangfuseCredentialDtoProvider.cs | 73 ++ .../UpdateLineInsightFromCallTableDto.cs | 6 + src/Vapi.Net/Types/UpdateLmntCredentialDto.cs | 3 + .../Types/UpdateLmntCredentialDtoProvider.cs | 73 ++ src/Vapi.Net/Types/UpdateMakeCredentialDto.cs | 3 + .../Types/UpdateMakeCredentialDtoProvider.cs | 73 ++ src/Vapi.Net/Types/UpdateMakeToolDto.cs | 10 +- src/Vapi.Net/Types/UpdateMakeToolDtoType.cs | 73 ++ src/Vapi.Net/Types/UpdateMcpToolDto.cs | 10 +- ...Dto.cs => UpdateMicrosoftCredentialDto.cs} | 27 +- .../UpdateMicrosoftCredentialDtoProvider.cs | 73 ++ .../Types/UpdateMistralCredentialDto.cs | 3 + .../UpdateMistralCredentialDtoProvider.cs | 73 ++ .../Types/UpdateNeuphonicCredentialDto.cs | 3 + .../UpdateNeuphonicCredentialDtoProvider.cs | 73 ++ .../Types/UpdateOpenAiCredentialDto.cs | 3 + .../UpdateOpenAiCredentialDtoProvider.cs | 73 ++ .../Types/UpdateOpenRouterCredentialDto.cs | 3 + .../UpdateOpenRouterCredentialDtoProvider.cs | 73 ++ src/Vapi.Net/Types/UpdateOutputToolDto.cs | 10 +- src/Vapi.Net/Types/UpdateOutputToolDtoType.cs | 73 ++ .../Types/UpdatePerplexityAiCredentialDto.cs | 3 + ...UpdatePerplexityAiCredentialDtoProvider.cs | 79 ++ .../Types/UpdatePieInsightFromCallTableDto.cs | 6 + .../Types/UpdatePlayHtCredentialDto.cs | 3 + .../UpdatePlayHtCredentialDtoProvider.cs | 73 ++ src/Vapi.Net/Types/UpdateQueryToolDto.cs | 7 +- .../Types/UpdateRimeAiCredentialDto.cs | 3 + .../UpdateRimeAiCredentialDtoProvider.cs | 73 ++ .../Types/UpdateRunpodCredentialDto.cs | 3 + .../UpdateRunpodCredentialDtoProvider.cs | 73 ++ .../Types/UpdateS3CompatibleBucketPlanDto.cs | 62 ++ .../Types/UpdateS3CompatibleCredentialDto.cs | 46 + ...UpdateS3CompatibleCredentialDtoProvider.cs | 79 ++ src/Vapi.Net/Types/UpdateS3CredentialDto.cs | 6 + ...pe.cs => UpdateS3CredentialDtoProvider.cs} | 28 +- .../Types/UpdateSimulationSuiteDto.cs | 6 + src/Vapi.Net/Types/UpdateSipRequestToolDto.cs | 7 +- ...teSlackOAuth2AuthorizationCredentialDto.cs | 3 + ...Auth2AuthorizationCredentialDtoProvider.cs | 85 ++ .../Types/UpdateSlackSendMessageToolDto.cs | 7 +- .../Types/UpdateSlackWebhookCredentialDto.cs | 3 + ...UpdateSlackWebhookCredentialDtoProvider.cs | 79 ++ src/Vapi.Net/Types/UpdateSmsToolDto.cs | 7 +- .../Types/UpdateSonioxCredentialDto.cs | 9 + .../UpdateSonioxCredentialDtoProvider.cs | 73 ++ .../Types/UpdateTelnyxPhoneNumberDto.cs | 3 + src/Vapi.Net/Types/UpdateTextEditorToolDto.cs | 7 +- .../UpdateTextInsightFromCallTableDto.cs | 6 + .../Types/UpdateTogetherAiCredentialDto.cs | 3 + .../UpdateTogetherAiCredentialDtoProvider.cs | 73 ++ src/Vapi.Net/Types/UpdateToolDraftDto.cs | 297 ++++++ .../Types/UpdateToolDraftDtoMethod.cs | 99 ++ src/Vapi.Net/Types/UpdateToolDraftDtoType.cs | 232 ++++ src/Vapi.Net/Types/UpdateToolDraftDtoVerb.cs | 89 ++ .../Types/UpdateToolVersionMetadataDto.cs | 37 + .../Types/UpdateTransferCallToolDto.cs | 7 +- .../Types/UpdateTwilioCredentialDto.cs | 3 + .../UpdateTwilioCredentialDtoProvider.cs | 73 ++ .../Types/UpdateTwilioPhoneNumberDto.cs | 3 + src/Vapi.Net/Types/UpdateUserRoleDto.cs | 3 +- ...toRole.cs => UpdateUserRoleDtoRoleZero.cs} | 32 +- .../Types/UpdateVapiPhoneNumberDto.cs | 3 + src/Vapi.Net/Types/UpdateVoicemailToolDto.cs | 7 +- .../Types/UpdateVonageCredentialDto.cs | 3 + .../UpdateVonageCredentialDtoProvider.cs | 73 ++ .../Types/UpdateVonagePhoneNumberDto.cs | 3 + .../Types/UpdateWebhookCredentialDto.cs | 3 + .../UpdateWebhookCredentialDtoProvider.cs | 73 ++ .../Types/UpdateWellSaidCredentialDto.cs | 3 + .../UpdateWellSaidCredentialDtoProvider.cs | 73 ++ src/Vapi.Net/Types/UpdateXAiCredentialDto.cs | 6 + .../Types/UpdateXAiCredentialDtoProvider.cs | 73 ++ src/Vapi.Net/Types/UserMessage.cs | 3 + src/Vapi.Net/Types/VapiCost.cs | 3 + src/Vapi.Net/Types/VapiModel.cs | 44 +- ...eBaseImportType.cs => VapiModelVersion.cs} | 39 +- src/Vapi.Net/Types/VapiPhoneNumber.cs | 3 + .../VapiPronunciationDictionaryLocator.cs | 3 + src/Vapi.Net/Types/VapiSipTransport.cs | 51 + .../Types/VapiSipTransportConversationType.cs | 73 ++ .../Types/VapiSmartEndpointingPlan.cs | 3 + src/Vapi.Net/Types/VapiTranscriber.cs | 68 ++ src/Vapi.Net/Types/VapiTranscriberLanguage.cs | 999 ++++++++++++++++++ .../Types/VapiTranscriberLanguagesItem.cs | 999 ++++++++++++++++++ .../Types/VapiTranscriberTurnTaking.cs | 84 ++ src/Vapi.Net/Types/VapiTranscriberVersion.cs | 84 ++ src/Vapi.Net/Types/VapiVoice.cs | 21 +- src/Vapi.Net/Types/VapiVoiceLanguage.cs | 359 +++++++ src/Vapi.Net/Types/VapiVoiceVersion.cs | 89 ++ src/Vapi.Net/Types/VapiVoiceVoiceId.cs | 70 +- .../Types/VapiVoicemailDetectionPlan.cs | 3 + src/Vapi.Net/Types/VapiWebCallTransport.cs | 53 + .../VapiWebCallTransportConversationType.cs | 73 ++ src/Vapi.Net/Types/VapiWebsocketTransport.cs | 37 + .../VapiWebsocketTransportConversationType.cs | 73 ++ src/Vapi.Net/Types/VariableExtractionAlias.cs | 3 + src/Vapi.Net/Types/VariableExtractionPlan.cs | 3 + src/Vapi.Net/Types/VariableValueGroupBy.cs | 3 + .../Types/VersionPinConflictResponseDto.cs | 41 + .../VersionPinConflictResponseDtoError.cs | 79 ++ src/Vapi.Net/Types/VersionPinReference.cs | 37 + .../Types/VersionPinReferenceSourceType.cs | 89 ++ src/Vapi.Net/Types/VoiceCost.cs | 3 + .../Types/VoiceLibraryVoiceResponse.cs | 7 +- .../Types/VoicemailDetectionBackoffPlan.cs | 3 + src/Vapi.Net/Types/VoicemailDetectionCost.cs | 3 + src/Vapi.Net/Types/VoicemailTool.cs | 10 +- src/Vapi.Net/Types/VonagePhoneNumber.cs | 3 + src/Vapi.Net/Types/VonageTransport.cs | 43 + .../Types/VonageTransportConversationType.cs | 73 ++ src/Vapi.Net/Types/WellSaidVoice.cs | 3 + .../Types/WorkflowAnthropicBedrockModel.cs | 18 + .../WorkflowAnthropicBedrockModelModel.cs | 11 + src/Vapi.Net/Types/WorkflowAnthropicModel.cs | 18 + .../Types/WorkflowAnthropicModelModel.cs | 5 + src/Vapi.Net/Types/WorkflowCustomModel.cs | 18 + src/Vapi.Net/Types/WorkflowGoogleModel.cs | 18 + .../Types/WorkflowGoogleModelModel.cs | 10 + src/Vapi.Net/Types/WorkflowOpenAiModel.cs | 18 + .../Types/WorkflowOpenAiModelModel.cs | 40 + src/Vapi.Net/Types/WorkflowOverrides.cs | 3 + src/Vapi.Net/Types/XaiModel.cs | 14 +- src/Vapi.Net/Types/XaiModelModel.cs | 15 + src/Vapi.Net/Types/XaiTranscriber.cs | 43 + src/Vapi.Net/Types/XaiTranscriberLanguage.cs | 199 ++++ src/Vapi.Net/Types/XaiTranscriberModel.cs | 73 ++ src/Vapi.Net/Types/XaiVoice.cs | 61 ++ src/Vapi.Net/Types/XaiVoiceLanguage.cs | 179 ++++ src/Vapi.Net/Types/XaiVoiceVoiceId.cs | 99 ++ src/Vapi.Net/Types/XssSecurityFilter.cs | 3 + src/Vapi.Net/Vapi.Net.csproj | 2 +- src/Vapi.Net/VapiClient.cs | 5 +- 1016 files changed, 34837 insertions(+), 2295 deletions(-) create mode 100644 .fern/replay.lock create mode 100644 .gitattributes create mode 100644 src/Vapi.Net/Board/BoardClient.cs create mode 100644 src/Vapi.Net/Board/IBoardClient.cs create mode 100644 src/Vapi.Net/Board/Requests/BoardControllerFindAllRequest.cs create mode 100644 src/Vapi.Net/Board/Requests/BoardControllerFindOneRequest.cs create mode 100644 src/Vapi.Net/Board/Requests/BoardControllerRemoveRequest.cs create mode 100644 src/Vapi.Net/Board/Requests/CreateBoardDto.cs create mode 100644 src/Vapi.Net/Board/Requests/UpdateBoardDto.cs create mode 100644 src/Vapi.Net/Board/Types/BoardControllerFindAllRequestSortBy.cs create mode 100644 src/Vapi.Net/Board/Types/BoardControllerFindAllRequestSortOrder.cs create mode 100644 src/Vapi.Net/Calls/Requests/CallArtifactControllerAssistantRecordingDownloadRequest.cs create mode 100644 src/Vapi.Net/Calls/Requests/CallArtifactControllerCallLogsDownloadRequest.cs create mode 100644 src/Vapi.Net/Calls/Requests/CallArtifactControllerCustomerRecordingDownloadRequest.cs create mode 100644 src/Vapi.Net/Calls/Requests/CallArtifactControllerMonoRecordingDownloadRequest.cs create mode 100644 src/Vapi.Net/Calls/Requests/CallArtifactControllerPcapDownloadRequest.cs create mode 100644 src/Vapi.Net/Calls/Requests/CallArtifactControllerStereoRecordingDownloadRequest.cs create mode 100644 src/Vapi.Net/Calls/Requests/CallArtifactControllerVideoRecordingDownloadRequest.cs create mode 100644 src/Vapi.Net/Campaigns/Requests/CampaignControllerFindAllV2Request.cs create mode 100644 src/Vapi.Net/Campaigns/Requests/CampaignControllerFindOneV2Request.cs create mode 100644 src/Vapi.Net/Campaigns/Requests/CampaignControllerRemoveV2Request.cs create mode 100644 src/Vapi.Net/Campaigns/Requests/CampaignControllerUpdateRequest.cs create mode 100644 src/Vapi.Net/Campaigns/Requests/CampaignControllerUpdateV2Request.cs delete mode 100644 src/Vapi.Net/Campaigns/Requests/CreateCampaignDto.cs create mode 100644 src/Vapi.Net/Campaigns/Types/CampaignControllerFindAllRequestSortBy.cs create mode 100644 src/Vapi.Net/Campaigns/Types/CampaignControllerFindAllV2RequestSortBy.cs create mode 100644 src/Vapi.Net/Campaigns/Types/CampaignControllerFindAllV2RequestSortOrder.cs create mode 100644 src/Vapi.Net/Campaigns/Types/CampaignControllerFindAllV2RequestStatus.cs create mode 100644 src/Vapi.Net/Chats/Types/ListChatsRequestSortBy.cs rename src/Vapi.Net/{Types/TrieveKnowledgeBaseSearchPlanSearchType.cs => Eval/Types/EvalControllerGetPaginatedRequestSortBy.cs} (58%) create mode 100644 src/Vapi.Net/Eval/Types/EvalControllerGetRunsPaginatedRequestSortBy.cs create mode 100644 src/Vapi.Net/Exceptions/ConflictError.cs create mode 100644 src/Vapi.Net/Exceptions/ServiceUnavailableError.cs create mode 100644 src/Vapi.Net/Exceptions/UnauthorizedError.cs create mode 100644 src/Vapi.Net/Files/Requests/ListFilesRequest.cs create mode 100644 src/Vapi.Net/Insight/Types/InsightControllerFindAllRequestSortBy.cs create mode 100644 src/Vapi.Net/ObservabilityScorecard/Types/ScorecardControllerGetPaginatedRequestSortBy.cs create mode 100644 src/Vapi.Net/PhoneNumbers/Types/PhoneNumberControllerFindAllPaginatedRequestSortBy.cs create mode 100644 src/Vapi.Net/ProviderResources/Types/ProviderResourceControllerGetProviderResourcesPaginatedRequestSortBy.cs create mode 100644 src/Vapi.Net/Sessions/Types/ListSessionsRequestSortBy.cs create mode 100644 src/Vapi.Net/StructuredOutputs/Types/StructuredOutputControllerFindAllRequestSortBy.cs create mode 100644 src/Vapi.Net/StructuredOutputs/Types/StructuredOutputControllerRunResponseZero.cs create mode 100644 src/Vapi.Net/Types/AssistantDraft.cs create mode 100644 src/Vapi.Net/Types/AssistantDraftBackgroundSoundZero.cs create mode 100644 src/Vapi.Net/Types/AssistantDraftClientMessagesItem.cs create mode 100644 src/Vapi.Net/Types/AssistantDraftConflictResponseDto.cs create mode 100644 src/Vapi.Net/Types/AssistantDraftFirstMessageMode.cs create mode 100644 src/Vapi.Net/Types/AssistantDraftPaginatedMetadata.cs create mode 100644 src/Vapi.Net/Types/AssistantDraftPaginatedResponse.cs create mode 100644 src/Vapi.Net/Types/AssistantDraftServerMessagesItem.cs rename src/Vapi.Net/Types/{CreateTrieveKnowledgeBaseDtoProvider.cs => AssistantDraftVoicemailDetectionZero.cs} (69%) create mode 100644 src/Vapi.Net/Types/AssistantPinnedConflictResponseDto.cs create mode 100644 src/Vapi.Net/Types/AssistantPinnedConflictResponseDtoError.cs create mode 100644 src/Vapi.Net/Types/AssistantVersion.cs create mode 100644 src/Vapi.Net/Types/AssistantVersionBackgroundSoundZero.cs create mode 100644 src/Vapi.Net/Types/AssistantVersionClientMessagesItem.cs create mode 100644 src/Vapi.Net/Types/AssistantVersionFirstMessageMode.cs create mode 100644 src/Vapi.Net/Types/AssistantVersionPaginatedMetadata.cs create mode 100644 src/Vapi.Net/Types/AssistantVersionServerMessagesItem.cs create mode 100644 src/Vapi.Net/Types/AssistantVersionVoicemailDetectionZero.cs create mode 100644 src/Vapi.Net/Types/AudioFormat.cs rename src/Vapi.Net/Types/{VapiModelProvider.cs => AudioFormatContainer.cs} (74%) create mode 100644 src/Vapi.Net/Types/Board.cs create mode 100644 src/Vapi.Net/Types/BoardInsightItem.cs rename src/Vapi.Net/Types/{TrieveCredentialProvider.cs => BoardInsightItemType.cs} (72%) create mode 100644 src/Vapi.Net/Types/BoardItemPosition.cs create mode 100644 src/Vapi.Net/Types/BoardItemSize.cs create mode 100644 src/Vapi.Net/Types/BoardLayout.cs create mode 100644 src/Vapi.Net/Types/BoardMetricWidgetItem.cs create mode 100644 src/Vapi.Net/Types/BoardMetricWidgetItemType.cs create mode 100644 src/Vapi.Net/Types/BoardPaginatedResponse.cs create mode 100644 src/Vapi.Net/Types/BooleanComparatorScorecardMetricCondition.cs create mode 100644 src/Vapi.Net/Types/BooleanComparatorScorecardMetricConditionComparator.cs create mode 100644 src/Vapi.Net/Types/BooleanComparatorScorecardMetricConditionType.cs create mode 100644 src/Vapi.Net/Types/CampaignContact.cs create mode 100644 src/Vapi.Net/Types/CampaignPredialPlan.cs create mode 100644 src/Vapi.Net/Types/CampaignServerMessagesItem.cs rename src/Vapi.Net/Types/{SbcConfiguration.cs => ContextEngineeringPlanPreviousAssistantMessages.cs} (88%) create mode 100644 src/Vapi.Net/Types/CreateAssistantDraftDto.cs create mode 100644 src/Vapi.Net/Types/CreateAssistantDraftDtoBackgroundSoundZero.cs create mode 100644 src/Vapi.Net/Types/CreateAssistantDraftDtoClientMessagesItem.cs create mode 100644 src/Vapi.Net/Types/CreateAssistantDraftDtoFirstMessageMode.cs create mode 100644 src/Vapi.Net/Types/CreateAssistantDraftDtoServerMessagesItem.cs create mode 100644 src/Vapi.Net/Types/CreateAssistantDraftDtoVoicemailDetectionZero.cs create mode 100644 src/Vapi.Net/Types/CreateCampaignDto.cs create mode 100644 src/Vapi.Net/Types/CreateCampaignDtoServerMessagesItem.cs create mode 100644 src/Vapi.Net/Types/CreateElevenLabsCredentialDtoApiUrl.cs rename src/Vapi.Net/Types/{UpdateTrieveCredentialDto.cs => CreateMicrosoftCredentialDto.cs} (72%) create mode 100644 src/Vapi.Net/Types/CreateS3CompatibleCredentialDto.cs create mode 100644 src/Vapi.Net/Types/CreateSimulationRunResponse.cs create mode 100644 src/Vapi.Net/Types/CreateSimulationRunResponseStatus.cs create mode 100644 src/Vapi.Net/Types/CreateToolDraftDto.cs create mode 100644 src/Vapi.Net/Types/CreateToolDraftDtoMethod.cs create mode 100644 src/Vapi.Net/Types/CreateToolDraftDtoType.cs create mode 100644 src/Vapi.Net/Types/CreateToolDraftDtoVerb.cs delete mode 100644 src/Vapi.Net/Types/CreateTrieveKnowledgeBaseDto.cs create mode 100644 src/Vapi.Net/Types/CustomerSpeechTimeoutOptionsTriggerResetMode.cs create mode 100644 src/Vapi.Net/Types/DeepgramTranscriberRedactionItem.cs create mode 100644 src/Vapi.Net/Types/ElevenLabsCredentialApiUrl.cs create mode 100644 src/Vapi.Net/Types/EndedReasonCondition.cs create mode 100644 src/Vapi.Net/Types/EndedReasonConditionOperator.cs create mode 100644 src/Vapi.Net/Types/ExportChatDtoSortBy.cs create mode 100644 src/Vapi.Net/Types/ExportSessionDtoSortBy.cs create mode 100644 src/Vapi.Net/Types/FallbackDeepgramTranscriberRedactionItem.cs delete mode 100644 src/Vapi.Net/Types/FallbackGladiaTranscriberLanguages.cs create mode 100644 src/Vapi.Net/Types/FallbackGladiaTranscriberLanguagesItem.cs create mode 100644 src/Vapi.Net/Types/FallbackMicrosoftVoice.cs create mode 100644 src/Vapi.Net/Types/FallbackMicrosoftVoiceRole.cs create mode 100644 src/Vapi.Net/Types/FallbackMicrosoftVoiceStyle.cs create mode 100644 src/Vapi.Net/Types/FallbackMicrosoftVoiceVoiceId.cs create mode 100644 src/Vapi.Net/Types/FallbackSonioxTranscriberLanguagesItem.cs create mode 100644 src/Vapi.Net/Types/FallbackVapiVoiceLanguage.cs create mode 100644 src/Vapi.Net/Types/FallbackVapiVoiceVersion.cs create mode 100644 src/Vapi.Net/Types/FallbackXaiTranscriber.cs create mode 100644 src/Vapi.Net/Types/FallbackXaiTranscriberLanguage.cs create mode 100644 src/Vapi.Net/Types/FallbackXaiTranscriberModel.cs create mode 100644 src/Vapi.Net/Types/FallbackXaiVoice.cs create mode 100644 src/Vapi.Net/Types/FallbackXaiVoiceLanguage.cs create mode 100644 src/Vapi.Net/Types/FallbackXaiVoiceVoiceId.cs create mode 100644 src/Vapi.Net/Types/GetChatPaginatedDtoSortBy.cs create mode 100644 src/Vapi.Net/Types/GetEvalPaginatedDtoSortBy.cs create mode 100644 src/Vapi.Net/Types/GetEvalRunPaginatedDtoSortBy.cs create mode 100644 src/Vapi.Net/Types/GetSessionPaginatedDtoSortBy.cs rename src/Vapi.Net/Types/{TrieveKnowledgeBaseCreate.cs => GetToolDraftsDto.cs} (61%) delete mode 100644 src/Vapi.Net/Types/GladiaTranscriberLanguages.cs create mode 100644 src/Vapi.Net/Types/GladiaTranscriberLanguagesItem.cs rename src/Vapi.Net/Types/{InviteUserDtoRole.cs => InviteUserDtoRoleZero.cs} (75%) create mode 100644 src/Vapi.Net/Types/LegacyAssistantVersion.cs create mode 100644 src/Vapi.Net/Types/LegacyAssistantVersionPaginatedResponse.cs rename src/Vapi.Net/Types/{TrieveCredential.cs => MicrosoftCredential.cs} (83%) create mode 100644 src/Vapi.Net/Types/MicrosoftCredentialProvider.cs create mode 100644 src/Vapi.Net/Types/MicrosoftVoice.cs create mode 100644 src/Vapi.Net/Types/MicrosoftVoiceRole.cs create mode 100644 src/Vapi.Net/Types/MicrosoftVoiceStyle.cs create mode 100644 src/Vapi.Net/Types/MicrosoftVoiceVoiceId.cs create mode 100644 src/Vapi.Net/Types/MinCallDurationCondition.cs create mode 100644 src/Vapi.Net/Types/MinMessagesCondition.cs create mode 100644 src/Vapi.Net/Types/NumberComparatorScorecardMetricCondition.cs create mode 100644 src/Vapi.Net/Types/NumberComparatorScorecardMetricConditionComparator.cs create mode 100644 src/Vapi.Net/Types/NumberComparatorScorecardMetricConditionType.cs create mode 100644 src/Vapi.Net/Types/OpenAiModelReasoningEffort.cs create mode 100644 src/Vapi.Net/Types/PaginationMetaSortOrder.cs create mode 100644 src/Vapi.Net/Types/PendingInvitationDto.cs create mode 100644 src/Vapi.Net/Types/PendingInvitationsResponseDto.cs create mode 100644 src/Vapi.Net/Types/RecordingConsentPlanStayOnLineFirstMessageMode.cs create mode 100644 src/Vapi.Net/Types/RecordingConsentPlanVerbalFirstMessageMode.cs create mode 100644 src/Vapi.Net/Types/RecordingConsentType.cs create mode 100644 src/Vapi.Net/Types/RevokeInvitationResponseDto.cs create mode 100644 src/Vapi.Net/Types/S3CompatibleBucketPlan.cs create mode 100644 src/Vapi.Net/Types/S3CompatibleStorageCredential.cs create mode 100644 src/Vapi.Net/Types/S3CompatibleStorageCredentialProvider.cs create mode 100644 src/Vapi.Net/Types/ServerMessageCampaignPredial.cs create mode 100644 src/Vapi.Net/Types/ServerMessageCampaignPredialType.cs create mode 100644 src/Vapi.Net/Types/ServerMessageResponseCampaignPredial.cs create mode 100644 src/Vapi.Net/Types/SimulationSuiteTargetAssignment.cs create mode 100644 src/Vapi.Net/Types/SimulationSuiteTargetAssignmentTargetType.cs create mode 100644 src/Vapi.Net/Types/SkippedStructuredOutput.cs create mode 100644 src/Vapi.Net/Types/SonioxContextGeneralItem.cs create mode 100644 src/Vapi.Net/Types/SonioxTranscriberLanguagesItem.cs create mode 100644 src/Vapi.Net/Types/StructuredOutputRerunResponse.cs create mode 100644 src/Vapi.Net/Types/StructuredOutputRunPreviewResponse.cs create mode 100644 src/Vapi.Net/Types/StructuredOutputRunResult.cs create mode 100644 src/Vapi.Net/Types/TelnyxTransport.cs create mode 100644 src/Vapi.Net/Types/TelnyxTransportConversationType.cs delete mode 100644 src/Vapi.Net/Types/ToolCallResultMessage.cs create mode 100644 src/Vapi.Net/Types/ToolCallResultMessageWarning.cs create mode 100644 src/Vapi.Net/Types/ToolCallResultMessageWarningType.cs create mode 100644 src/Vapi.Net/Types/ToolDraft.cs create mode 100644 src/Vapi.Net/Types/ToolDraftConflictResponseDto.cs create mode 100644 src/Vapi.Net/Types/ToolDraftMethod.cs create mode 100644 src/Vapi.Net/Types/ToolDraftPaginatedMetadata.cs create mode 100644 src/Vapi.Net/Types/ToolDraftPaginatedResponse.cs create mode 100644 src/Vapi.Net/Types/ToolDraftType.cs create mode 100644 src/Vapi.Net/Types/ToolDraftVerb.cs create mode 100644 src/Vapi.Net/Types/ToolMessageFailedRole.cs create mode 100644 src/Vapi.Net/Types/ToolPinnedConflictResponseDto.cs create mode 100644 src/Vapi.Net/Types/ToolPinnedConflictResponseDtoError.cs rename src/Vapi.Net/Types/{TrieveKnowledgeBaseImport.cs => ToolRef.cs} (64%) create mode 100644 src/Vapi.Net/Types/ToolVersion.cs create mode 100644 src/Vapi.Net/Types/ToolVersionPaginatedMetadata.cs create mode 100644 src/Vapi.Net/Types/ToolVersionPaginatedResponse.cs create mode 100644 src/Vapi.Net/Types/TransferArtifact.cs create mode 100644 src/Vapi.Net/Types/TransferArtifactMode.cs create mode 100644 src/Vapi.Net/Types/TransferArtifactStatus.cs delete mode 100644 src/Vapi.Net/Types/TrieveKnowledgeBase.cs delete mode 100644 src/Vapi.Net/Types/TrieveKnowledgeBaseChunkPlan.cs delete mode 100644 src/Vapi.Net/Types/TrieveKnowledgeBaseSearchPlan.cs create mode 100644 src/Vapi.Net/Types/TwilioTransport.cs create mode 100644 src/Vapi.Net/Types/TwilioTransportConversationType.cs create mode 100644 src/Vapi.Net/Types/UpdateAnthropicBedrockCredentialDtoProvider.cs create mode 100644 src/Vapi.Net/Types/UpdateAnthropicCredentialDtoProvider.cs create mode 100644 src/Vapi.Net/Types/UpdateAnyscaleCredentialDtoProvider.cs create mode 100644 src/Vapi.Net/Types/UpdateAssemblyAiCredentialDtoProvider.cs create mode 100644 src/Vapi.Net/Types/UpdateAssistantDraftDto.cs create mode 100644 src/Vapi.Net/Types/UpdateAssistantDraftDtoBackgroundSoundZero.cs create mode 100644 src/Vapi.Net/Types/UpdateAssistantDraftDtoClientMessagesItem.cs create mode 100644 src/Vapi.Net/Types/UpdateAssistantDraftDtoFirstMessageMode.cs create mode 100644 src/Vapi.Net/Types/UpdateAssistantDraftDtoServerMessagesItem.cs create mode 100644 src/Vapi.Net/Types/UpdateAssistantDraftDtoVoicemailDetectionZero.cs create mode 100644 src/Vapi.Net/Types/UpdateAssistantVersionMetadataDto.cs create mode 100644 src/Vapi.Net/Types/UpdateAzureCredentialDtoProvider.cs create mode 100644 src/Vapi.Net/Types/UpdateAzureOpenAiCredentialDtoProvider.cs create mode 100644 src/Vapi.Net/Types/UpdateByoSipTrunkCredentialDtoProvider.cs rename src/Vapi.Net/{Campaigns/Requests => Types}/UpdateCampaignDto.cs (74%) rename src/Vapi.Net/{Campaigns => }/Types/UpdateCampaignDtoStatus.cs (86%) create mode 100644 src/Vapi.Net/Types/UpdateCartesiaCredentialDtoProvider.cs create mode 100644 src/Vapi.Net/Types/UpdateCerebrasCredentialDtoProvider.cs create mode 100644 src/Vapi.Net/Types/UpdateCloudflareCredentialDtoProvider.cs rename src/Vapi.Net/Types/{TrieveKnowledgeBaseProvider.cs => UpdateCodeToolDtoType.cs} (71%) create mode 100644 src/Vapi.Net/Types/UpdateCustomCredentialDtoProvider.cs create mode 100644 src/Vapi.Net/Types/UpdateCustomKnowledgeBaseDtoProvider.cs create mode 100644 src/Vapi.Net/Types/UpdateCustomLlmCredentialDtoProvider.cs create mode 100644 src/Vapi.Net/Types/UpdateDeepInfraCredentialDtoProvider.cs create mode 100644 src/Vapi.Net/Types/UpdateDeepSeekCredentialDtoProvider.cs create mode 100644 src/Vapi.Net/Types/UpdateDeepgramCredentialDtoProvider.cs create mode 100644 src/Vapi.Net/Types/UpdateElevenLabsCredentialDtoApiUrl.cs create mode 100644 src/Vapi.Net/Types/UpdateEmailCredentialDtoProvider.cs create mode 100644 src/Vapi.Net/Types/UpdateGcpCredentialDtoProvider.cs create mode 100644 src/Vapi.Net/Types/UpdateGhlToolDtoType.cs create mode 100644 src/Vapi.Net/Types/UpdateGladiaCredentialDtoProvider.cs create mode 100644 src/Vapi.Net/Types/UpdateGoHighLevelCredentialDtoProvider.cs create mode 100644 src/Vapi.Net/Types/UpdateGoHighLevelMcpCredentialDtoProvider.cs create mode 100644 src/Vapi.Net/Types/UpdateGoogleCalendarOAuth2AuthorizationCredentialDtoProvider.cs create mode 100644 src/Vapi.Net/Types/UpdateGoogleCalendarOAuth2ClientCredentialDtoProvider.cs create mode 100644 src/Vapi.Net/Types/UpdateGoogleCredentialDtoProvider.cs create mode 100644 src/Vapi.Net/Types/UpdateGoogleSheetsOAuth2AuthorizationCredentialDtoProvider.cs create mode 100644 src/Vapi.Net/Types/UpdateGroqCredentialDtoProvider.cs create mode 100644 src/Vapi.Net/Types/UpdateHumeCredentialDtoProvider.cs create mode 100644 src/Vapi.Net/Types/UpdateInflectionAiCredentialDtoProvider.cs create mode 100644 src/Vapi.Net/Types/UpdateInworldCredentialDtoProvider.cs create mode 100644 src/Vapi.Net/Types/UpdateLangfuseCredentialDtoProvider.cs create mode 100644 src/Vapi.Net/Types/UpdateLmntCredentialDtoProvider.cs create mode 100644 src/Vapi.Net/Types/UpdateMakeCredentialDtoProvider.cs create mode 100644 src/Vapi.Net/Types/UpdateMakeToolDtoType.cs rename src/Vapi.Net/Types/{UpdateTrieveKnowledgeBaseDto.cs => UpdateMicrosoftCredentialDto.cs} (52%) create mode 100644 src/Vapi.Net/Types/UpdateMicrosoftCredentialDtoProvider.cs create mode 100644 src/Vapi.Net/Types/UpdateMistralCredentialDtoProvider.cs create mode 100644 src/Vapi.Net/Types/UpdateNeuphonicCredentialDtoProvider.cs create mode 100644 src/Vapi.Net/Types/UpdateOpenAiCredentialDtoProvider.cs create mode 100644 src/Vapi.Net/Types/UpdateOpenRouterCredentialDtoProvider.cs create mode 100644 src/Vapi.Net/Types/UpdateOutputToolDtoType.cs create mode 100644 src/Vapi.Net/Types/UpdatePerplexityAiCredentialDtoProvider.cs create mode 100644 src/Vapi.Net/Types/UpdatePlayHtCredentialDtoProvider.cs create mode 100644 src/Vapi.Net/Types/UpdateRimeAiCredentialDtoProvider.cs create mode 100644 src/Vapi.Net/Types/UpdateRunpodCredentialDtoProvider.cs create mode 100644 src/Vapi.Net/Types/UpdateS3CompatibleBucketPlanDto.cs create mode 100644 src/Vapi.Net/Types/UpdateS3CompatibleCredentialDto.cs create mode 100644 src/Vapi.Net/Types/UpdateS3CompatibleCredentialDtoProvider.cs rename src/Vapi.Net/Types/{TrieveKnowledgeBaseCreateType.cs => UpdateS3CredentialDtoProvider.cs} (71%) create mode 100644 src/Vapi.Net/Types/UpdateSlackOAuth2AuthorizationCredentialDtoProvider.cs create mode 100644 src/Vapi.Net/Types/UpdateSlackWebhookCredentialDtoProvider.cs create mode 100644 src/Vapi.Net/Types/UpdateSonioxCredentialDtoProvider.cs create mode 100644 src/Vapi.Net/Types/UpdateTogetherAiCredentialDtoProvider.cs create mode 100644 src/Vapi.Net/Types/UpdateToolDraftDto.cs create mode 100644 src/Vapi.Net/Types/UpdateToolDraftDtoMethod.cs create mode 100644 src/Vapi.Net/Types/UpdateToolDraftDtoType.cs create mode 100644 src/Vapi.Net/Types/UpdateToolDraftDtoVerb.cs create mode 100644 src/Vapi.Net/Types/UpdateToolVersionMetadataDto.cs create mode 100644 src/Vapi.Net/Types/UpdateTwilioCredentialDtoProvider.cs rename src/Vapi.Net/Types/{UpdateUserRoleDtoRole.cs => UpdateUserRoleDtoRoleZero.cs} (73%) create mode 100644 src/Vapi.Net/Types/UpdateVonageCredentialDtoProvider.cs create mode 100644 src/Vapi.Net/Types/UpdateWebhookCredentialDtoProvider.cs create mode 100644 src/Vapi.Net/Types/UpdateWellSaidCredentialDtoProvider.cs create mode 100644 src/Vapi.Net/Types/UpdateXAiCredentialDtoProvider.cs rename src/Vapi.Net/Types/{TrieveKnowledgeBaseImportType.cs => VapiModelVersion.cs} (70%) create mode 100644 src/Vapi.Net/Types/VapiSipTransport.cs create mode 100644 src/Vapi.Net/Types/VapiSipTransportConversationType.cs create mode 100644 src/Vapi.Net/Types/VapiTranscriber.cs create mode 100644 src/Vapi.Net/Types/VapiTranscriberLanguage.cs create mode 100644 src/Vapi.Net/Types/VapiTranscriberLanguagesItem.cs create mode 100644 src/Vapi.Net/Types/VapiTranscriberTurnTaking.cs create mode 100644 src/Vapi.Net/Types/VapiTranscriberVersion.cs create mode 100644 src/Vapi.Net/Types/VapiVoiceLanguage.cs create mode 100644 src/Vapi.Net/Types/VapiVoiceVersion.cs create mode 100644 src/Vapi.Net/Types/VapiWebCallTransport.cs create mode 100644 src/Vapi.Net/Types/VapiWebCallTransportConversationType.cs create mode 100644 src/Vapi.Net/Types/VapiWebsocketTransport.cs create mode 100644 src/Vapi.Net/Types/VapiWebsocketTransportConversationType.cs create mode 100644 src/Vapi.Net/Types/VersionPinConflictResponseDto.cs create mode 100644 src/Vapi.Net/Types/VersionPinConflictResponseDtoError.cs create mode 100644 src/Vapi.Net/Types/VersionPinReference.cs create mode 100644 src/Vapi.Net/Types/VersionPinReferenceSourceType.cs create mode 100644 src/Vapi.Net/Types/VonageTransport.cs create mode 100644 src/Vapi.Net/Types/VonageTransportConversationType.cs create mode 100644 src/Vapi.Net/Types/XaiTranscriber.cs create mode 100644 src/Vapi.Net/Types/XaiTranscriberLanguage.cs create mode 100644 src/Vapi.Net/Types/XaiTranscriberModel.cs create mode 100644 src/Vapi.Net/Types/XaiVoice.cs create mode 100644 src/Vapi.Net/Types/XaiVoiceLanguage.cs create mode 100644 src/Vapi.Net/Types/XaiVoiceVoiceId.cs diff --git a/.fern/metadata.json b/.fern/metadata.json index 7a55a5fc..24ad03f3 100644 --- a/.fern/metadata.json +++ b/.fern/metadata.json @@ -1,5 +1,5 @@ { - "cliVersion": "5.51.2", + "cliVersion": "5.89.2", "generatorName": "fernapi/fern-csharp-sdk", "generatorVersion": "2.58.0", "generatorConfig": { @@ -12,10 +12,10 @@ "simplify-object-dictionaries": true, "use-discriminated-unions": false }, - "originGitCommit": "5a015aa01196915bea6110904c69d5804f457ff5", + "originGitCommit": "548dddb5e7bc17a9e26b0832d0359a988546b0ba", "originGitCommitIsDirty": true, "invokedBy": "ci", "requestedVersion": "AUTO", "ciProvider": "unknown", - "sdkVersion": "2.0.0" + "sdkVersion": "0.0.0-fern-placeholder" } \ No newline at end of file diff --git a/.fern/replay.lock b/.fern/replay.lock new file mode 100644 index 00000000..50d73420 --- /dev/null +++ b/.fern/replay.lock @@ -0,0 +1,10 @@ +# DO NOT EDIT MANUALLY - Managed by Fern Replay +version: "1.0" +generations: + - commit_sha: 6ee2f1cc74dd9f71a5250dc543072a20fe241e05 + tree_hash: b3aa526a34c3de7f3c7c338cd2e7525f57496081 + timestamp: 2026-07-31T22:04:24.075Z + cli_version: unknown + generator_versions: {} +current_generation: 6ee2f1cc74dd9f71a5250dc543072a20fe241e05 +patches: [] diff --git a/.fernignore b/.fernignore index 5cb78eeb..a7e71969 100644 --- a/.fernignore +++ b/.fernignore @@ -3,3 +3,6 @@ .gitignore README.md changelog.md +.fern/replay.lock +.fern/replay.yml +.gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..74928d6a --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +.fern/replay.lock linguist-generated=true diff --git a/src/Vapi.Net/Analytics/AnalyticsClient.cs b/src/Vapi.Net/Analytics/AnalyticsClient.cs index 55fafff5..18f7b190 100644 --- a/src/Vapi.Net/Analytics/AnalyticsClient.cs +++ b/src/Vapi.Net/Analytics/AnalyticsClient.cs @@ -81,6 +81,9 @@ private async Task>> GetAsyncC } } + /// + /// Runs one or more metric queries against call or subscription data using the requested time range, groupings, and aggregate operations. + /// public WithRawResponseTask> GetAsync( AnalyticsQueryDto request, RequestOptions? options = null, diff --git a/src/Vapi.Net/Analytics/IAnalyticsClient.cs b/src/Vapi.Net/Analytics/IAnalyticsClient.cs index ee580002..0f40fd8d 100644 --- a/src/Vapi.Net/Analytics/IAnalyticsClient.cs +++ b/src/Vapi.Net/Analytics/IAnalyticsClient.cs @@ -2,6 +2,9 @@ namespace Vapi.Net; public partial interface IAnalyticsClient { + /// + /// Runs one or more metric queries against call or subscription data using the requested time range, groupings, and aggregate operations. + /// WithRawResponseTask> GetAsync( AnalyticsQueryDto request, RequestOptions? options = null, diff --git a/src/Vapi.Net/Assistants/AssistantsClient.cs b/src/Vapi.Net/Assistants/AssistantsClient.cs index 34d9fcb8..0ff72d2f 100644 --- a/src/Vapi.Net/Assistants/AssistantsClient.cs +++ b/src/Vapi.Net/Assistants/AssistantsClient.cs @@ -280,6 +280,18 @@ private async Task> DeleteAsyncCore( var responseBody = await response .Raw.Content.ReadAsStringAsync(cancellationToken) .ConfigureAwait(false); + try + { + switch (response.StatusCode) + { + case 409: + throw new ConflictError(JsonUtils.Deserialize(responseBody)); + } + } + catch (JsonException) + { + // unable to map error response, throwing generic error + } throw new VapiClientApiException( $"Error with status code {response.StatusCode}", response.StatusCode, @@ -356,6 +368,9 @@ private async Task> UpdateAsyncCore( } } + /// + /// Returns assistants for the authenticated organization. Filter results by creation or update timestamps and limit the number returned. + /// public WithRawResponseTask> ListAsync( ListAssistantsRequest request, RequestOptions? options = null, @@ -367,6 +382,9 @@ public WithRawResponseTask> ListAsync( ); } + /// + /// Creates a reusable assistant configuration containing the model, voice, transcriber, tools, prompts, and call behavior. + /// public WithRawResponseTask CreateAsync( CreateAssistantDto request, RequestOptions? options = null, @@ -378,6 +396,9 @@ public WithRawResponseTask CreateAsync( ); } + /// + /// Returns the assistant identified by its ID. + /// public WithRawResponseTask GetAsync( string id, GetAssistantsRequest request, @@ -390,6 +411,9 @@ public WithRawResponseTask GetAsync( ); } + /// + /// Deletes the assistant identified by its ID. + /// public WithRawResponseTask DeleteAsync( string id, DeleteAssistantsRequest request, @@ -402,6 +426,9 @@ public WithRawResponseTask DeleteAsync( ); } + /// + /// Updates the specified fields of the assistant identified by its ID. + /// public WithRawResponseTask UpdateAsync( string id, UpdateAssistantDto request, diff --git a/src/Vapi.Net/Assistants/IAssistantsClient.cs b/src/Vapi.Net/Assistants/IAssistantsClient.cs index d910d90e..d800bccc 100644 --- a/src/Vapi.Net/Assistants/IAssistantsClient.cs +++ b/src/Vapi.Net/Assistants/IAssistantsClient.cs @@ -2,18 +2,27 @@ namespace Vapi.Net; public partial interface IAssistantsClient { + /// + /// Returns assistants for the authenticated organization. Filter results by creation or update timestamps and limit the number returned. + /// WithRawResponseTask> ListAsync( ListAssistantsRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default ); + /// + /// Creates a reusable assistant configuration containing the model, voice, transcriber, tools, prompts, and call behavior. + /// WithRawResponseTask CreateAsync( CreateAssistantDto request, RequestOptions? options = null, CancellationToken cancellationToken = default ); + /// + /// Returns the assistant identified by its ID. + /// WithRawResponseTask GetAsync( string id, GetAssistantsRequest request, @@ -21,6 +30,9 @@ WithRawResponseTask GetAsync( CancellationToken cancellationToken = default ); + /// + /// Deletes the assistant identified by its ID. + /// WithRawResponseTask DeleteAsync( string id, DeleteAssistantsRequest request, @@ -28,6 +40,9 @@ WithRawResponseTask DeleteAsync( CancellationToken cancellationToken = default ); + /// + /// Updates the specified fields of the assistant identified by its ID. + /// WithRawResponseTask UpdateAsync( string id, UpdateAssistantDto request, diff --git a/src/Vapi.Net/Assistants/Requests/UpdateAssistantDto.cs b/src/Vapi.Net/Assistants/Requests/UpdateAssistantDto.cs index 14717536..1382d15d 100644 --- a/src/Vapi.Net/Assistants/Requests/UpdateAssistantDto.cs +++ b/src/Vapi.Net/Assistants/Requests/UpdateAssistantDto.cs @@ -33,6 +33,9 @@ public record UpdateAssistantDto [JsonPropertyName("firstMessage")] public string? FirstMessage { get; set; } + /// + /// Set to `true` to allow the user to interrupt the assistant while it speaks the first message. Default is `false`. + /// [JsonPropertyName("firstMessageInterruptionsEnabled")] public bool? FirstMessageInterruptionsEnabled { get; set; } @@ -161,6 +164,9 @@ public IEnumerable< [JsonPropertyName("endCallPhrases")] public IEnumerable? EndCallPhrases { get; set; } + /// + /// Compliance settings for the assistant, including HIPAA and PCI behavior, security filtering, and recording consent. + /// [JsonPropertyName("compliancePlan")] public CompliancePlan? CompliancePlan { get; set; } @@ -251,6 +257,9 @@ public IEnumerable< [JsonPropertyName("server")] public Server? Server { get; set; } + /// + /// Configuration for collecting and processing DTMF keypad input during calls. + /// [JsonPropertyName("keypadInputPlan")] public KeypadInputPlan? KeypadInputPlan { get; set; } diff --git a/src/Vapi.Net/Board/BoardClient.cs b/src/Vapi.Net/Board/BoardClient.cs new file mode 100644 index 00000000..ab8c7377 --- /dev/null +++ b/src/Vapi.Net/Board/BoardClient.cs @@ -0,0 +1,503 @@ +using global::System.Text.Json; +using Vapi.Net.Core; + +namespace Vapi.Net; + +public partial class BoardClient : IBoardClient +{ + private readonly RawClient _client; + + internal BoardClient(RawClient client) + { + _client = client; + } + + private async Task> BoardControllerFindAllAsyncCore( + BoardControllerFindAllRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + var _queryString = new Vapi.Net.Core.QueryStringBuilder.Builder(capacity: 12) + .Add("page", request.Page) + .Add("sortOrder", request.SortOrder) + .Add("sortBy", request.SortBy) + .Add("limit", request.Limit) + .Add("createdAtGt", request.CreatedAtGt) + .Add("createdAtLt", request.CreatedAtLt) + .Add("createdAtGe", request.CreatedAtGe) + .Add("createdAtLe", request.CreatedAtLe) + .Add("updatedAtGt", request.UpdatedAtGt) + .Add("updatedAtLt", request.UpdatedAtLt) + .Add("updatedAtGe", request.UpdatedAtGe) + .Add("updatedAtLe", request.UpdatedAtLe) + .MergeAdditional(options?.AdditionalQueryParameters) + .Build(); + var _headers = await new Vapi.Net.Core.HeadersBuilder.Builder() + .Add(_client.Options.Headers) + .Add(_client.Options.AdditionalHeaders) + .Add(options?.AdditionalHeaders) + .BuildAsync() + .ConfigureAwait(false); + var response = await _client + .SendRequestAsync( + new JsonRequest + { + Method = HttpMethod.Get, + Path = "reporting/board", + QueryString = _queryString, + Headers = _headers, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); + if (response.StatusCode is >= 200 and < 400) + { + var responseBody = await response + .Raw.Content.ReadAsStringAsync(cancellationToken) + .ConfigureAwait(false); + try + { + var responseData = JsonUtils.Deserialize(responseBody)!; + return new WithRawResponse() + { + Data = responseData, + RawResponse = new RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + }, + }; + } + catch (JsonException e) + { + throw new VapiClientApiException( + "Failed to deserialize response", + response.StatusCode, + responseBody, + e + ); + } + } + { + var responseBody = await response + .Raw.Content.ReadAsStringAsync(cancellationToken) + .ConfigureAwait(false); + throw new VapiClientApiException( + $"Error with status code {response.StatusCode}", + response.StatusCode, + responseBody + ); + } + } + + private async Task> BoardControllerCreateAsyncCore( + CreateBoardDto request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + var _headers = await new Vapi.Net.Core.HeadersBuilder.Builder() + .Add(_client.Options.Headers) + .Add(_client.Options.AdditionalHeaders) + .Add(options?.AdditionalHeaders) + .BuildAsync() + .ConfigureAwait(false); + var response = await _client + .SendRequestAsync( + new JsonRequest + { + Method = HttpMethod.Post, + Path = "reporting/board", + Body = request, + Headers = _headers, + ContentType = "application/json", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); + if (response.StatusCode is >= 200 and < 400) + { + var responseBody = await response + .Raw.Content.ReadAsStringAsync(cancellationToken) + .ConfigureAwait(false); + try + { + var responseData = JsonUtils.Deserialize(responseBody)!; + return new WithRawResponse() + { + Data = responseData, + RawResponse = new RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + }, + }; + } + catch (JsonException e) + { + throw new VapiClientApiException( + "Failed to deserialize response", + response.StatusCode, + responseBody, + e + ); + } + } + { + var responseBody = await response + .Raw.Content.ReadAsStringAsync(cancellationToken) + .ConfigureAwait(false); + throw new VapiClientApiException( + $"Error with status code {response.StatusCode}", + response.StatusCode, + responseBody + ); + } + } + + private async Task> BoardControllerMetricsOverviewEnsureAsyncCore( + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + var _headers = await new Vapi.Net.Core.HeadersBuilder.Builder() + .Add(_client.Options.Headers) + .Add(_client.Options.AdditionalHeaders) + .Add(options?.AdditionalHeaders) + .BuildAsync() + .ConfigureAwait(false); + var response = await _client + .SendRequestAsync( + new JsonRequest + { + Method = HttpMethod.Get, + Path = "reporting/board/default/metrics-overview", + Headers = _headers, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); + if (response.StatusCode is >= 200 and < 400) + { + var responseBody = await response + .Raw.Content.ReadAsStringAsync(cancellationToken) + .ConfigureAwait(false); + try + { + var responseData = JsonUtils.Deserialize(responseBody)!; + return new WithRawResponse() + { + Data = responseData, + RawResponse = new RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + }, + }; + } + catch (JsonException e) + { + throw new VapiClientApiException( + "Failed to deserialize response", + response.StatusCode, + responseBody, + e + ); + } + } + { + var responseBody = await response + .Raw.Content.ReadAsStringAsync(cancellationToken) + .ConfigureAwait(false); + throw new VapiClientApiException( + $"Error with status code {response.StatusCode}", + response.StatusCode, + responseBody + ); + } + } + + private async Task> BoardControllerFindOneAsyncCore( + string id, + BoardControllerFindOneRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + var _headers = await new Vapi.Net.Core.HeadersBuilder.Builder() + .Add(_client.Options.Headers) + .Add(_client.Options.AdditionalHeaders) + .Add(options?.AdditionalHeaders) + .BuildAsync() + .ConfigureAwait(false); + var response = await _client + .SendRequestAsync( + new JsonRequest + { + Method = HttpMethod.Get, + Path = string.Format( + "reporting/board/{0}", + ValueConvert.ToPathParameterString(id) + ), + Headers = _headers, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); + if (response.StatusCode is >= 200 and < 400) + { + var responseBody = await response + .Raw.Content.ReadAsStringAsync(cancellationToken) + .ConfigureAwait(false); + try + { + var responseData = JsonUtils.Deserialize(responseBody)!; + return new WithRawResponse() + { + Data = responseData, + RawResponse = new RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + }, + }; + } + catch (JsonException e) + { + throw new VapiClientApiException( + "Failed to deserialize response", + response.StatusCode, + responseBody, + e + ); + } + } + { + var responseBody = await response + .Raw.Content.ReadAsStringAsync(cancellationToken) + .ConfigureAwait(false); + throw new VapiClientApiException( + $"Error with status code {response.StatusCode}", + response.StatusCode, + responseBody + ); + } + } + + private async Task> BoardControllerRemoveAsyncCore( + string id, + BoardControllerRemoveRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + var _headers = await new Vapi.Net.Core.HeadersBuilder.Builder() + .Add(_client.Options.Headers) + .Add(_client.Options.AdditionalHeaders) + .Add(options?.AdditionalHeaders) + .BuildAsync() + .ConfigureAwait(false); + var response = await _client + .SendRequestAsync( + new JsonRequest + { + Method = HttpMethod.Delete, + Path = string.Format( + "reporting/board/{0}", + ValueConvert.ToPathParameterString(id) + ), + Headers = _headers, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); + if (response.StatusCode is >= 200 and < 400) + { + var responseBody = await response + .Raw.Content.ReadAsStringAsync(cancellationToken) + .ConfigureAwait(false); + try + { + var responseData = JsonUtils.Deserialize(responseBody)!; + return new WithRawResponse() + { + Data = responseData, + RawResponse = new RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + }, + }; + } + catch (JsonException e) + { + throw new VapiClientApiException( + "Failed to deserialize response", + response.StatusCode, + responseBody, + e + ); + } + } + { + var responseBody = await response + .Raw.Content.ReadAsStringAsync(cancellationToken) + .ConfigureAwait(false); + throw new VapiClientApiException( + $"Error with status code {response.StatusCode}", + response.StatusCode, + responseBody + ); + } + } + + private async Task> BoardControllerUpdateAsyncCore( + string id, + UpdateBoardDto request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + var _headers = await new Vapi.Net.Core.HeadersBuilder.Builder() + .Add(_client.Options.Headers) + .Add(_client.Options.AdditionalHeaders) + .Add(options?.AdditionalHeaders) + .BuildAsync() + .ConfigureAwait(false); + var response = await _client + .SendRequestAsync( + new JsonRequest + { + Method = HttpMethodExtensions.Patch, + Path = string.Format( + "reporting/board/{0}", + ValueConvert.ToPathParameterString(id) + ), + Body = request, + Headers = _headers, + ContentType = "application/json", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); + if (response.StatusCode is >= 200 and < 400) + { + var responseBody = await response + .Raw.Content.ReadAsStringAsync(cancellationToken) + .ConfigureAwait(false); + try + { + var responseData = JsonUtils.Deserialize(responseBody)!; + return new WithRawResponse() + { + Data = responseData, + RawResponse = new RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + }, + }; + } + catch (JsonException e) + { + throw new VapiClientApiException( + "Failed to deserialize response", + response.StatusCode, + responseBody, + e + ); + } + } + { + var responseBody = await response + .Raw.Content.ReadAsStringAsync(cancellationToken) + .ConfigureAwait(false); + throw new VapiClientApiException( + $"Error with status code {response.StatusCode}", + response.StatusCode, + responseBody + ); + } + } + + public WithRawResponseTask BoardControllerFindAllAsync( + BoardControllerFindAllRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + return new WithRawResponseTask( + BoardControllerFindAllAsyncCore(request, options, cancellationToken) + ); + } + + public WithRawResponseTask BoardControllerCreateAsync( + CreateBoardDto request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + return new WithRawResponseTask( + BoardControllerCreateAsyncCore(request, options, cancellationToken) + ); + } + + public WithRawResponseTask BoardControllerMetricsOverviewEnsureAsync( + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + return new WithRawResponseTask( + BoardControllerMetricsOverviewEnsureAsyncCore(options, cancellationToken) + ); + } + + public WithRawResponseTask BoardControllerFindOneAsync( + string id, + BoardControllerFindOneRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + return new WithRawResponseTask( + BoardControllerFindOneAsyncCore(id, request, options, cancellationToken) + ); + } + + public WithRawResponseTask BoardControllerRemoveAsync( + string id, + BoardControllerRemoveRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + return new WithRawResponseTask( + BoardControllerRemoveAsyncCore(id, request, options, cancellationToken) + ); + } + + public WithRawResponseTask BoardControllerUpdateAsync( + string id, + UpdateBoardDto request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + return new WithRawResponseTask( + BoardControllerUpdateAsyncCore(id, request, options, cancellationToken) + ); + } +} diff --git a/src/Vapi.Net/Board/IBoardClient.cs b/src/Vapi.Net/Board/IBoardClient.cs new file mode 100644 index 00000000..f4e1e51d --- /dev/null +++ b/src/Vapi.Net/Board/IBoardClient.cs @@ -0,0 +1,42 @@ +namespace Vapi.Net; + +public partial interface IBoardClient +{ + WithRawResponseTask BoardControllerFindAllAsync( + BoardControllerFindAllRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ); + + WithRawResponseTask BoardControllerCreateAsync( + CreateBoardDto request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ); + + WithRawResponseTask BoardControllerMetricsOverviewEnsureAsync( + RequestOptions? options = null, + CancellationToken cancellationToken = default + ); + + WithRawResponseTask BoardControllerFindOneAsync( + string id, + BoardControllerFindOneRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ); + + WithRawResponseTask BoardControllerRemoveAsync( + string id, + BoardControllerRemoveRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ); + + WithRawResponseTask BoardControllerUpdateAsync( + string id, + UpdateBoardDto request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ); +} diff --git a/src/Vapi.Net/Board/Requests/BoardControllerFindAllRequest.cs b/src/Vapi.Net/Board/Requests/BoardControllerFindAllRequest.cs new file mode 100644 index 00000000..0052d05f --- /dev/null +++ b/src/Vapi.Net/Board/Requests/BoardControllerFindAllRequest.cs @@ -0,0 +1,86 @@ +using global::System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[Serializable] +public record BoardControllerFindAllRequest +{ + /// + /// 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 BoardControllerFindAllRequestSortOrder? SortOrder { get; set; } + + /// + /// This is the column to sort by. Defaults to 'createdAt'. + /// + [JsonIgnore] + public BoardControllerFindAllRequestSortBy? SortBy { 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/Board/Requests/BoardControllerFindOneRequest.cs b/src/Vapi.Net/Board/Requests/BoardControllerFindOneRequest.cs new file mode 100644 index 00000000..e24e502a --- /dev/null +++ b/src/Vapi.Net/Board/Requests/BoardControllerFindOneRequest.cs @@ -0,0 +1,13 @@ +using Vapi.Net.Core; + +namespace Vapi.Net; + +[Serializable] +public record BoardControllerFindOneRequest +{ + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Board/Requests/BoardControllerRemoveRequest.cs b/src/Vapi.Net/Board/Requests/BoardControllerRemoveRequest.cs new file mode 100644 index 00000000..1363dbfb --- /dev/null +++ b/src/Vapi.Net/Board/Requests/BoardControllerRemoveRequest.cs @@ -0,0 +1,13 @@ +using Vapi.Net.Core; + +namespace Vapi.Net; + +[Serializable] +public record BoardControllerRemoveRequest +{ + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Board/Requests/CreateBoardDto.cs b/src/Vapi.Net/Board/Requests/CreateBoardDto.cs new file mode 100644 index 00000000..bc496b4b --- /dev/null +++ b/src/Vapi.Net/Board/Requests/CreateBoardDto.cs @@ -0,0 +1,41 @@ +using global::System.Text.Json.Serialization; +using OneOf; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[Serializable] +public record CreateBoardDto +{ + /// + /// This is the contents of the Board, which is an array of objects defining the type, contents, and position of the widgets on the Board. + /// + [JsonPropertyName("items")] + public IEnumerable>? Items { get; set; } + + /// + /// This is the name of the Board. + /// + [JsonPropertyName("name")] + public required string Name { get; set; } + + /// + /// This is the layout of the Board. + /// + [JsonPropertyName("layout")] + public required BoardLayout Layout { get; set; } + + /// + /// This is the timerange override for the board. + /// By default, individual insights have their own timerange. + /// This is a global override for the board which will be passed to all insights on the board. + /// + [JsonPropertyName("timeRangeOverride")] + public InsightTimeRangeWithStep? TimeRangeOverride { get; set; } + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Board/Requests/UpdateBoardDto.cs b/src/Vapi.Net/Board/Requests/UpdateBoardDto.cs new file mode 100644 index 00000000..5ecddc35 --- /dev/null +++ b/src/Vapi.Net/Board/Requests/UpdateBoardDto.cs @@ -0,0 +1,41 @@ +using global::System.Text.Json.Serialization; +using OneOf; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[Serializable] +public record UpdateBoardDto +{ + /// + /// This is the contents of the Board, which is an array of objects defining the type, contents, and position of the widgets on the Board. + /// + [JsonPropertyName("items")] + public IEnumerable>? Items { get; set; } + + /// + /// This is the name of the Board. + /// + [JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// This is the layout of the Board. + /// + [JsonPropertyName("layout")] + public BoardLayout? Layout { get; set; } + + /// + /// This is the timerange override for the board. + /// By default, individual insights have their own timerange. + /// This is a global override for the board which will be passed to all insights on the board. + /// + [JsonPropertyName("timeRangeOverride")] + public InsightTimeRangeWithStep? TimeRangeOverride { get; set; } + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Board/Types/BoardControllerFindAllRequestSortBy.cs b/src/Vapi.Net/Board/Types/BoardControllerFindAllRequestSortBy.cs new file mode 100644 index 00000000..f65762e8 --- /dev/null +++ b/src/Vapi.Net/Board/Types/BoardControllerFindAllRequestSortBy.cs @@ -0,0 +1,89 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(BoardControllerFindAllRequestSortBySerializer))] +public enum BoardControllerFindAllRequestSortBy +{ + [EnumMember(Value = "createdAt")] + CreatedAt, + + [EnumMember(Value = "duration")] + Duration, + + [EnumMember(Value = "cost")] + Cost, +} + +internal class BoardControllerFindAllRequestSortBySerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + BoardControllerFindAllRequestSortBy + > _stringToEnum = new() + { + { "createdAt", BoardControllerFindAllRequestSortBy.CreatedAt }, + { "duration", BoardControllerFindAllRequestSortBy.Duration }, + { "cost", BoardControllerFindAllRequestSortBy.Cost }, + }; + + private static readonly global::System.Collections.Generic.Dictionary< + BoardControllerFindAllRequestSortBy, + string + > _enumToString = new() + { + { BoardControllerFindAllRequestSortBy.CreatedAt, "createdAt" }, + { BoardControllerFindAllRequestSortBy.Duration, "duration" }, + { BoardControllerFindAllRequestSortBy.Cost, "cost" }, + }; + + public override BoardControllerFindAllRequestSortBy Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + BoardControllerFindAllRequestSortBy value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override BoardControllerFindAllRequestSortBy ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + BoardControllerFindAllRequestSortBy value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Board/Types/BoardControllerFindAllRequestSortOrder.cs b/src/Vapi.Net/Board/Types/BoardControllerFindAllRequestSortOrder.cs new file mode 100644 index 00000000..3e84d75f --- /dev/null +++ b/src/Vapi.Net/Board/Types/BoardControllerFindAllRequestSortOrder.cs @@ -0,0 +1,84 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(BoardControllerFindAllRequestSortOrderSerializer))] +public enum BoardControllerFindAllRequestSortOrder +{ + [EnumMember(Value = "ASC")] + Asc, + + [EnumMember(Value = "DESC")] + Desc, +} + +internal class BoardControllerFindAllRequestSortOrderSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + BoardControllerFindAllRequestSortOrder + > _stringToEnum = new() + { + { "ASC", BoardControllerFindAllRequestSortOrder.Asc }, + { "DESC", BoardControllerFindAllRequestSortOrder.Desc }, + }; + + private static readonly global::System.Collections.Generic.Dictionary< + BoardControllerFindAllRequestSortOrder, + string + > _enumToString = new() + { + { BoardControllerFindAllRequestSortOrder.Asc, "ASC" }, + { BoardControllerFindAllRequestSortOrder.Desc, "DESC" }, + }; + + public override BoardControllerFindAllRequestSortOrder Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + BoardControllerFindAllRequestSortOrder value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override BoardControllerFindAllRequestSortOrder ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + BoardControllerFindAllRequestSortOrder value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Calls/CallsClient.cs b/src/Vapi.Net/Calls/CallsClient.cs index 17ea408b..e672d4bd 100644 --- a/src/Vapi.Net/Calls/CallsClient.cs +++ b/src/Vapi.Net/Calls/CallsClient.cs @@ -289,6 +289,20 @@ private async Task> DeleteAsyncCore( var responseBody = await response .Raw.Content.ReadAsStringAsync(cancellationToken) .ConfigureAwait(false); + try + { + switch (response.StatusCode) + { + case 503: + throw new ServiceUnavailableError( + JsonUtils.Deserialize(responseBody) + ); + } + } + catch (JsonException) + { + // unable to map error response, throwing generic error + } throw new VapiClientApiException( $"Error with status code {response.StatusCode}", response.StatusCode, @@ -365,6 +379,9 @@ private async Task> UpdateAsyncCore( } } + /// + /// Returns calls for the authenticated organization. Filter results by call ID, assistant ID, phone number ID, or creation and update timestamps. + /// public WithRawResponseTask> ListAsync( ListCallsRequest request, RequestOptions? options = null, @@ -376,6 +393,9 @@ public WithRawResponseTask> ListAsync( ); } + /// + /// Creates a call using an assistant or squad. The request can reference saved resources or include transient configurations. + /// public WithRawResponseTask> CreateAsync( CreateCallDto request, RequestOptions? options = null, @@ -387,6 +407,9 @@ public WithRawResponseTask> CreateAsync( ); } + /// + /// Returns the call identified by its ID, including its status, configuration, and available call data. + /// public WithRawResponseTask GetAsync( string id, GetCallsRequest request, @@ -397,6 +420,9 @@ public WithRawResponseTask GetAsync( return new WithRawResponseTask(GetAsyncCore(id, request, options, cancellationToken)); } + /// + /// Deletes the call identified by its ID. + /// public WithRawResponseTask DeleteAsync( string id, DeleteCallDto request, @@ -409,6 +435,9 @@ public WithRawResponseTask DeleteAsync( ); } + /// + /// Updates the call identified by its ID. + /// public WithRawResponseTask UpdateAsync( string id, UpdateCallDto request, @@ -420,4 +449,407 @@ public WithRawResponseTask UpdateAsync( UpdateAsyncCore(id, request, options, cancellationToken) ); } + + public async Task CallArtifactControllerMonoRecordingDownloadAsync( + string id, + CallArtifactControllerMonoRecordingDownloadRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + var _headers = await new Vapi.Net.Core.HeadersBuilder.Builder() + .Add(_client.Options.Headers) + .Add(_client.Options.AdditionalHeaders) + .Add(options?.AdditionalHeaders) + .BuildAsync() + .ConfigureAwait(false); + var response = await _client + .SendRequestAsync( + new JsonRequest + { + Method = HttpMethod.Get, + Path = string.Format( + "call/{0}/mono-recording", + ValueConvert.ToPathParameterString(id) + ), + Headers = _headers, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); + if (response.StatusCode is >= 200 and < 400) + { + return; + } + { + var responseBody = await response + .Raw.Content.ReadAsStringAsync(cancellationToken) + .ConfigureAwait(false); + try + { + switch (response.StatusCode) + { + case 401: + throw new UnauthorizedError(JsonUtils.Deserialize(responseBody)); + case 404: + throw new NotFoundError(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 + ); + } + } + + public async Task CallArtifactControllerStereoRecordingDownloadAsync( + string id, + CallArtifactControllerStereoRecordingDownloadRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + var _headers = await new Vapi.Net.Core.HeadersBuilder.Builder() + .Add(_client.Options.Headers) + .Add(_client.Options.AdditionalHeaders) + .Add(options?.AdditionalHeaders) + .BuildAsync() + .ConfigureAwait(false); + var response = await _client + .SendRequestAsync( + new JsonRequest + { + Method = HttpMethod.Get, + Path = string.Format( + "call/{0}/stereo-recording", + ValueConvert.ToPathParameterString(id) + ), + Headers = _headers, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); + if (response.StatusCode is >= 200 and < 400) + { + return; + } + { + var responseBody = await response + .Raw.Content.ReadAsStringAsync(cancellationToken) + .ConfigureAwait(false); + try + { + switch (response.StatusCode) + { + case 401: + throw new UnauthorizedError(JsonUtils.Deserialize(responseBody)); + case 404: + throw new NotFoundError(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 + ); + } + } + + public async Task CallArtifactControllerVideoRecordingDownloadAsync( + string id, + CallArtifactControllerVideoRecordingDownloadRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + var _headers = await new Vapi.Net.Core.HeadersBuilder.Builder() + .Add(_client.Options.Headers) + .Add(_client.Options.AdditionalHeaders) + .Add(options?.AdditionalHeaders) + .BuildAsync() + .ConfigureAwait(false); + var response = await _client + .SendRequestAsync( + new JsonRequest + { + Method = HttpMethod.Get, + Path = string.Format( + "call/{0}/video-recording", + ValueConvert.ToPathParameterString(id) + ), + Headers = _headers, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); + if (response.StatusCode is >= 200 and < 400) + { + return; + } + { + var responseBody = await response + .Raw.Content.ReadAsStringAsync(cancellationToken) + .ConfigureAwait(false); + try + { + switch (response.StatusCode) + { + case 401: + throw new UnauthorizedError(JsonUtils.Deserialize(responseBody)); + case 404: + throw new NotFoundError(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 + ); + } + } + + public async Task CallArtifactControllerCustomerRecordingDownloadAsync( + string id, + CallArtifactControllerCustomerRecordingDownloadRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + var _headers = await new Vapi.Net.Core.HeadersBuilder.Builder() + .Add(_client.Options.Headers) + .Add(_client.Options.AdditionalHeaders) + .Add(options?.AdditionalHeaders) + .BuildAsync() + .ConfigureAwait(false); + var response = await _client + .SendRequestAsync( + new JsonRequest + { + Method = HttpMethod.Get, + Path = string.Format( + "call/{0}/customer-recording", + ValueConvert.ToPathParameterString(id) + ), + Headers = _headers, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); + if (response.StatusCode is >= 200 and < 400) + { + return; + } + { + var responseBody = await response + .Raw.Content.ReadAsStringAsync(cancellationToken) + .ConfigureAwait(false); + try + { + switch (response.StatusCode) + { + case 401: + throw new UnauthorizedError(JsonUtils.Deserialize(responseBody)); + case 404: + throw new NotFoundError(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 + ); + } + } + + public async Task CallArtifactControllerAssistantRecordingDownloadAsync( + string id, + CallArtifactControllerAssistantRecordingDownloadRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + var _headers = await new Vapi.Net.Core.HeadersBuilder.Builder() + .Add(_client.Options.Headers) + .Add(_client.Options.AdditionalHeaders) + .Add(options?.AdditionalHeaders) + .BuildAsync() + .ConfigureAwait(false); + var response = await _client + .SendRequestAsync( + new JsonRequest + { + Method = HttpMethod.Get, + Path = string.Format( + "call/{0}/assistant-recording", + ValueConvert.ToPathParameterString(id) + ), + Headers = _headers, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); + if (response.StatusCode is >= 200 and < 400) + { + return; + } + { + var responseBody = await response + .Raw.Content.ReadAsStringAsync(cancellationToken) + .ConfigureAwait(false); + try + { + switch (response.StatusCode) + { + case 401: + throw new UnauthorizedError(JsonUtils.Deserialize(responseBody)); + case 404: + throw new NotFoundError(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 + ); + } + } + + public async Task CallArtifactControllerPcapDownloadAsync( + string id, + CallArtifactControllerPcapDownloadRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + var _headers = await new Vapi.Net.Core.HeadersBuilder.Builder() + .Add(_client.Options.Headers) + .Add(_client.Options.AdditionalHeaders) + .Add(options?.AdditionalHeaders) + .BuildAsync() + .ConfigureAwait(false); + var response = await _client + .SendRequestAsync( + new JsonRequest + { + Method = HttpMethod.Get, + Path = string.Format("call/{0}/pcap", ValueConvert.ToPathParameterString(id)), + Headers = _headers, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); + if (response.StatusCode is >= 200 and < 400) + { + return; + } + { + var responseBody = await response + .Raw.Content.ReadAsStringAsync(cancellationToken) + .ConfigureAwait(false); + try + { + switch (response.StatusCode) + { + case 401: + throw new UnauthorizedError(JsonUtils.Deserialize(responseBody)); + case 404: + throw new NotFoundError(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 + ); + } + } + + public async Task CallArtifactControllerCallLogsDownloadAsync( + string id, + CallArtifactControllerCallLogsDownloadRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + var _headers = await new Vapi.Net.Core.HeadersBuilder.Builder() + .Add(_client.Options.Headers) + .Add(_client.Options.AdditionalHeaders) + .Add(options?.AdditionalHeaders) + .BuildAsync() + .ConfigureAwait(false); + var response = await _client + .SendRequestAsync( + new JsonRequest + { + Method = HttpMethod.Get, + Path = string.Format( + "call/{0}/call-logs", + ValueConvert.ToPathParameterString(id) + ), + Headers = _headers, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); + if (response.StatusCode is >= 200 and < 400) + { + return; + } + { + var responseBody = await response + .Raw.Content.ReadAsStringAsync(cancellationToken) + .ConfigureAwait(false); + try + { + switch (response.StatusCode) + { + case 401: + throw new UnauthorizedError(JsonUtils.Deserialize(responseBody)); + case 404: + throw new NotFoundError(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 + ); + } + } } diff --git a/src/Vapi.Net/Calls/ICallsClient.cs b/src/Vapi.Net/Calls/ICallsClient.cs index 9e56929b..0d06933c 100644 --- a/src/Vapi.Net/Calls/ICallsClient.cs +++ b/src/Vapi.Net/Calls/ICallsClient.cs @@ -4,18 +4,27 @@ namespace Vapi.Net; public partial interface ICallsClient { + /// + /// Returns calls for the authenticated organization. Filter results by call ID, assistant ID, phone number ID, or creation and update timestamps. + /// WithRawResponseTask> ListAsync( ListCallsRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default ); + /// + /// Creates a call using an assistant or squad. The request can reference saved resources or include transient configurations. + /// WithRawResponseTask> CreateAsync( CreateCallDto request, RequestOptions? options = null, CancellationToken cancellationToken = default ); + /// + /// Returns the call identified by its ID, including its status, configuration, and available call data. + /// WithRawResponseTask GetAsync( string id, GetCallsRequest request, @@ -23,6 +32,9 @@ WithRawResponseTask GetAsync( CancellationToken cancellationToken = default ); + /// + /// Deletes the call identified by its ID. + /// WithRawResponseTask DeleteAsync( string id, DeleteCallDto request, @@ -30,10 +42,62 @@ WithRawResponseTask DeleteAsync( CancellationToken cancellationToken = default ); + /// + /// Updates the call identified by its ID. + /// WithRawResponseTask UpdateAsync( string id, UpdateCallDto request, RequestOptions? options = null, CancellationToken cancellationToken = default ); + + Task CallArtifactControllerMonoRecordingDownloadAsync( + string id, + CallArtifactControllerMonoRecordingDownloadRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ); + + Task CallArtifactControllerStereoRecordingDownloadAsync( + string id, + CallArtifactControllerStereoRecordingDownloadRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ); + + Task CallArtifactControllerVideoRecordingDownloadAsync( + string id, + CallArtifactControllerVideoRecordingDownloadRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ); + + Task CallArtifactControllerCustomerRecordingDownloadAsync( + string id, + CallArtifactControllerCustomerRecordingDownloadRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ); + + Task CallArtifactControllerAssistantRecordingDownloadAsync( + string id, + CallArtifactControllerAssistantRecordingDownloadRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ); + + Task CallArtifactControllerPcapDownloadAsync( + string id, + CallArtifactControllerPcapDownloadRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ); + + Task CallArtifactControllerCallLogsDownloadAsync( + string id, + CallArtifactControllerCallLogsDownloadRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ); } diff --git a/src/Vapi.Net/Calls/Requests/CallArtifactControllerAssistantRecordingDownloadRequest.cs b/src/Vapi.Net/Calls/Requests/CallArtifactControllerAssistantRecordingDownloadRequest.cs new file mode 100644 index 00000000..8a0e432a --- /dev/null +++ b/src/Vapi.Net/Calls/Requests/CallArtifactControllerAssistantRecordingDownloadRequest.cs @@ -0,0 +1,13 @@ +using Vapi.Net.Core; + +namespace Vapi.Net; + +[Serializable] +public record CallArtifactControllerAssistantRecordingDownloadRequest +{ + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Calls/Requests/CallArtifactControllerCallLogsDownloadRequest.cs b/src/Vapi.Net/Calls/Requests/CallArtifactControllerCallLogsDownloadRequest.cs new file mode 100644 index 00000000..dd247de7 --- /dev/null +++ b/src/Vapi.Net/Calls/Requests/CallArtifactControllerCallLogsDownloadRequest.cs @@ -0,0 +1,13 @@ +using Vapi.Net.Core; + +namespace Vapi.Net; + +[Serializable] +public record CallArtifactControllerCallLogsDownloadRequest +{ + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Calls/Requests/CallArtifactControllerCustomerRecordingDownloadRequest.cs b/src/Vapi.Net/Calls/Requests/CallArtifactControllerCustomerRecordingDownloadRequest.cs new file mode 100644 index 00000000..6bebe24b --- /dev/null +++ b/src/Vapi.Net/Calls/Requests/CallArtifactControllerCustomerRecordingDownloadRequest.cs @@ -0,0 +1,13 @@ +using Vapi.Net.Core; + +namespace Vapi.Net; + +[Serializable] +public record CallArtifactControllerCustomerRecordingDownloadRequest +{ + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Calls/Requests/CallArtifactControllerMonoRecordingDownloadRequest.cs b/src/Vapi.Net/Calls/Requests/CallArtifactControllerMonoRecordingDownloadRequest.cs new file mode 100644 index 00000000..127b6381 --- /dev/null +++ b/src/Vapi.Net/Calls/Requests/CallArtifactControllerMonoRecordingDownloadRequest.cs @@ -0,0 +1,13 @@ +using Vapi.Net.Core; + +namespace Vapi.Net; + +[Serializable] +public record CallArtifactControllerMonoRecordingDownloadRequest +{ + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Calls/Requests/CallArtifactControllerPcapDownloadRequest.cs b/src/Vapi.Net/Calls/Requests/CallArtifactControllerPcapDownloadRequest.cs new file mode 100644 index 00000000..6532ceaa --- /dev/null +++ b/src/Vapi.Net/Calls/Requests/CallArtifactControllerPcapDownloadRequest.cs @@ -0,0 +1,13 @@ +using Vapi.Net.Core; + +namespace Vapi.Net; + +[Serializable] +public record CallArtifactControllerPcapDownloadRequest +{ + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Calls/Requests/CallArtifactControllerStereoRecordingDownloadRequest.cs b/src/Vapi.Net/Calls/Requests/CallArtifactControllerStereoRecordingDownloadRequest.cs new file mode 100644 index 00000000..d09bc7ef --- /dev/null +++ b/src/Vapi.Net/Calls/Requests/CallArtifactControllerStereoRecordingDownloadRequest.cs @@ -0,0 +1,13 @@ +using Vapi.Net.Core; + +namespace Vapi.Net; + +[Serializable] +public record CallArtifactControllerStereoRecordingDownloadRequest +{ + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Calls/Requests/CallArtifactControllerVideoRecordingDownloadRequest.cs b/src/Vapi.Net/Calls/Requests/CallArtifactControllerVideoRecordingDownloadRequest.cs new file mode 100644 index 00000000..2506fd53 --- /dev/null +++ b/src/Vapi.Net/Calls/Requests/CallArtifactControllerVideoRecordingDownloadRequest.cs @@ -0,0 +1,13 @@ +using Vapi.Net.Core; + +namespace Vapi.Net; + +[Serializable] +public record CallArtifactControllerVideoRecordingDownloadRequest +{ + /// + 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 f8a2a51d..ef4127e2 100644 --- a/src/Vapi.Net/Calls/Requests/CreateCallDto.cs +++ b/src/Vapi.Net/Calls/Requests/CreateCallDto.cs @@ -6,6 +6,19 @@ namespace Vapi.Net; [Serializable] public record CreateCallDto { + /// + /// This is the assistant version to use for this call. Supported only with + /// direct `assistantId`. Omit to follow the latest version. + /// + [JsonPropertyName("assistantVersion")] + public string? AssistantVersion { get; set; } + + /// + /// This is the transport of the call. + /// + [JsonPropertyName("transport")] + public object? Transport { get; set; } + /// /// This is used to issue batch calls to multiple customers. /// @@ -26,12 +39,6 @@ public record CreateCallDto [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 ID that will be used for the call. To use a transient assistant, use `assistant` instead. /// diff --git a/src/Vapi.Net/Campaigns/CampaignsClient.cs b/src/Vapi.Net/Campaigns/CampaignsClient.cs index 64f632f3..48fe050f 100644 --- a/src/Vapi.Net/Campaigns/CampaignsClient.cs +++ b/src/Vapi.Net/Campaigns/CampaignsClient.cs @@ -20,11 +20,12 @@ private async Task< CancellationToken cancellationToken = default ) { - var _queryString = new Vapi.Net.Core.QueryStringBuilder.Builder(capacity: 13) + var _queryString = new Vapi.Net.Core.QueryStringBuilder.Builder(capacity: 14) .Add("id", request.Id) .Add("status", request.Status) .Add("page", request.Page) .Add("sortOrder", request.SortOrder) + .Add("sortBy", request.SortBy) .Add("limit", request.Limit) .Add("createdAtGt", request.CreatedAtGt) .Add("createdAtLt", request.CreatedAtLt) @@ -116,6 +117,356 @@ private async Task> CampaignControllerCreateAsyncCore( Path = "campaign", Body = request, Headers = _headers, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); + if (response.StatusCode is >= 200 and < 400) + { + var responseBody = await response + .Raw.Content.ReadAsStringAsync(cancellationToken) + .ConfigureAwait(false); + try + { + var responseData = JsonUtils.Deserialize(responseBody)!; + return new WithRawResponse() + { + Data = responseData, + RawResponse = new RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + }, + }; + } + catch (JsonException e) + { + throw new VapiClientApiException( + "Failed to deserialize response", + response.StatusCode, + responseBody, + e + ); + } + } + { + var responseBody = await response + .Raw.Content.ReadAsStringAsync(cancellationToken) + .ConfigureAwait(false); + throw new VapiClientApiException( + $"Error with status code {response.StatusCode}", + response.StatusCode, + responseBody + ); + } + } + + private async Task< + WithRawResponse + > CampaignControllerFindAllV2AsyncCore( + CampaignControllerFindAllV2Request request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + var _queryString = new Vapi.Net.Core.QueryStringBuilder.Builder(capacity: 14) + .Add("id", request.Id) + .Add("status", request.Status) + .Add("page", request.Page) + .Add("sortOrder", request.SortOrder) + .Add("sortBy", request.SortBy) + .Add("limit", request.Limit) + .Add("createdAtGt", request.CreatedAtGt) + .Add("createdAtLt", request.CreatedAtLt) + .Add("createdAtGe", request.CreatedAtGe) + .Add("createdAtLe", request.CreatedAtLe) + .Add("updatedAtGt", request.UpdatedAtGt) + .Add("updatedAtLt", request.UpdatedAtLt) + .Add("updatedAtGe", request.UpdatedAtGe) + .Add("updatedAtLe", request.UpdatedAtLe) + .MergeAdditional(options?.AdditionalQueryParameters) + .Build(); + var _headers = await new Vapi.Net.Core.HeadersBuilder.Builder() + .Add(_client.Options.Headers) + .Add(_client.Options.AdditionalHeaders) + .Add(options?.AdditionalHeaders) + .BuildAsync() + .ConfigureAwait(false); + var response = await _client + .SendRequestAsync( + new JsonRequest + { + Method = HttpMethod.Get, + Path = "v2/campaign", + QueryString = _queryString, + Headers = _headers, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); + if (response.StatusCode is >= 200 and < 400) + { + var responseBody = await response + .Raw.Content.ReadAsStringAsync(cancellationToken) + .ConfigureAwait(false); + try + { + var responseData = JsonUtils.Deserialize(responseBody)!; + return new WithRawResponse() + { + Data = responseData, + RawResponse = new RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + }, + }; + } + catch (JsonException e) + { + throw new VapiClientApiException( + "Failed to deserialize response", + response.StatusCode, + responseBody, + e + ); + } + } + { + var responseBody = await response + .Raw.Content.ReadAsStringAsync(cancellationToken) + .ConfigureAwait(false); + throw new VapiClientApiException( + $"Error with status code {response.StatusCode}", + response.StatusCode, + responseBody + ); + } + } + + private async Task> CampaignControllerCreateV2AsyncCore( + CreateCampaignDto request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + var _headers = await new Vapi.Net.Core.HeadersBuilder.Builder() + .Add(_client.Options.Headers) + .Add(_client.Options.AdditionalHeaders) + .Add(options?.AdditionalHeaders) + .BuildAsync() + .ConfigureAwait(false); + var response = await _client + .SendRequestAsync( + new JsonRequest + { + Method = HttpMethod.Post, + Path = "v2/campaign", + Body = request, + Headers = _headers, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); + if (response.StatusCode is >= 200 and < 400) + { + var responseBody = await response + .Raw.Content.ReadAsStringAsync(cancellationToken) + .ConfigureAwait(false); + try + { + var responseData = JsonUtils.Deserialize(responseBody)!; + return new WithRawResponse() + { + Data = responseData, + RawResponse = new RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + }, + }; + } + catch (JsonException e) + { + throw new VapiClientApiException( + "Failed to deserialize response", + response.StatusCode, + responseBody, + e + ); + } + } + { + var responseBody = await response + .Raw.Content.ReadAsStringAsync(cancellationToken) + .ConfigureAwait(false); + throw new VapiClientApiException( + $"Error with status code {response.StatusCode}", + response.StatusCode, + responseBody + ); + } + } + + private async Task> CampaignControllerFindOneV2AsyncCore( + string id, + CampaignControllerFindOneV2Request request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + var _headers = await new Vapi.Net.Core.HeadersBuilder.Builder() + .Add(_client.Options.Headers) + .Add(_client.Options.AdditionalHeaders) + .Add(options?.AdditionalHeaders) + .BuildAsync() + .ConfigureAwait(false); + var response = await _client + .SendRequestAsync( + new JsonRequest + { + Method = HttpMethod.Get, + Path = string.Format("v2/campaign/{0}", ValueConvert.ToPathParameterString(id)), + Headers = _headers, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); + if (response.StatusCode is >= 200 and < 400) + { + var responseBody = await response + .Raw.Content.ReadAsStringAsync(cancellationToken) + .ConfigureAwait(false); + try + { + var responseData = JsonUtils.Deserialize(responseBody)!; + return new WithRawResponse() + { + Data = responseData, + RawResponse = new RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + }, + }; + } + catch (JsonException e) + { + throw new VapiClientApiException( + "Failed to deserialize response", + response.StatusCode, + responseBody, + e + ); + } + } + { + var responseBody = await response + .Raw.Content.ReadAsStringAsync(cancellationToken) + .ConfigureAwait(false); + throw new VapiClientApiException( + $"Error with status code {response.StatusCode}", + response.StatusCode, + responseBody + ); + } + } + + private async Task> CampaignControllerRemoveV2AsyncCore( + string id, + CampaignControllerRemoveV2Request request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + var _headers = await new Vapi.Net.Core.HeadersBuilder.Builder() + .Add(_client.Options.Headers) + .Add(_client.Options.AdditionalHeaders) + .Add(options?.AdditionalHeaders) + .BuildAsync() + .ConfigureAwait(false); + var response = await _client + .SendRequestAsync( + new JsonRequest + { + Method = HttpMethod.Delete, + Path = string.Format("v2/campaign/{0}", ValueConvert.ToPathParameterString(id)), + Headers = _headers, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); + if (response.StatusCode is >= 200 and < 400) + { + var responseBody = await response + .Raw.Content.ReadAsStringAsync(cancellationToken) + .ConfigureAwait(false); + try + { + var responseData = JsonUtils.Deserialize(responseBody)!; + return new WithRawResponse() + { + Data = responseData, + RawResponse = new RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + }, + }; + } + catch (JsonException e) + { + throw new VapiClientApiException( + "Failed to deserialize response", + response.StatusCode, + responseBody, + e + ); + } + } + { + var responseBody = await response + .Raw.Content.ReadAsStringAsync(cancellationToken) + .ConfigureAwait(false); + throw new VapiClientApiException( + $"Error with status code {response.StatusCode}", + response.StatusCode, + responseBody + ); + } + } + + private async Task> CampaignControllerUpdateV2AsyncCore( + string id, + CampaignControllerUpdateV2Request request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + var _headers = await new Vapi.Net.Core.HeadersBuilder.Builder() + .Add(_client.Options.Headers) + .Add(_client.Options.AdditionalHeaders) + .Add(options?.AdditionalHeaders) + .BuildAsync() + .ConfigureAwait(false); + var response = await _client + .SendRequestAsync( + new JsonRequest + { + Method = HttpMethodExtensions.Patch, + Path = string.Format("v2/campaign/{0}", ValueConvert.ToPathParameterString(id)), + Body = request.Body, + Headers = _headers, ContentType = "application/json", Options = options, }, @@ -297,7 +648,7 @@ private async Task> CampaignControllerRemoveAsyncCore( private async Task> CampaignControllerUpdateAsyncCore( string id, - UpdateCampaignDto request, + CampaignControllerUpdateRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default ) @@ -314,7 +665,7 @@ private async Task> CampaignControllerUpdateAsyncCore( { Method = HttpMethodExtensions.Patch, Path = string.Format("campaign/{0}", ValueConvert.ToPathParameterString(id)), - Body = request, + Body = request.Body, Headers = _headers, ContentType = "application/json", Options = options, @@ -363,6 +714,9 @@ private async Task> CampaignControllerUpdateAsyncCore( } } + /// + /// Returns outbound calling campaigns for the authenticated organization. Filter results by campaign ID, status, or creation and update timestamps. + /// public WithRawResponseTask CampaignControllerFindAllAsync( CampaignControllerFindAllRequest request, RequestOptions? options = null, @@ -374,6 +728,9 @@ public WithRawResponseTask CampaignControllerFindAllA ); } + /// + /// Creates an outbound calling campaign that calls a set of customers. + /// public WithRawResponseTask CampaignControllerCreateAsync( CreateCampaignDto request, RequestOptions? options = null, @@ -385,6 +742,67 @@ public WithRawResponseTask CampaignControllerCreateAsync( ); } + public WithRawResponseTask CampaignControllerFindAllV2Async( + CampaignControllerFindAllV2Request request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + return new WithRawResponseTask( + CampaignControllerFindAllV2AsyncCore(request, options, cancellationToken) + ); + } + + public WithRawResponseTask CampaignControllerCreateV2Async( + CreateCampaignDto request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + return new WithRawResponseTask( + CampaignControllerCreateV2AsyncCore(request, options, cancellationToken) + ); + } + + public WithRawResponseTask CampaignControllerFindOneV2Async( + string id, + CampaignControllerFindOneV2Request request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + return new WithRawResponseTask( + CampaignControllerFindOneV2AsyncCore(id, request, options, cancellationToken) + ); + } + + public WithRawResponseTask CampaignControllerRemoveV2Async( + string id, + CampaignControllerRemoveV2Request request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + return new WithRawResponseTask( + CampaignControllerRemoveV2AsyncCore(id, request, options, cancellationToken) + ); + } + + public WithRawResponseTask CampaignControllerUpdateV2Async( + string id, + CampaignControllerUpdateV2Request request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + return new WithRawResponseTask( + CampaignControllerUpdateV2AsyncCore(id, request, options, cancellationToken) + ); + } + + /// + /// Returns the outbound calling campaign identified by its ID. + /// public WithRawResponseTask CampaignControllerFindOneAsync( string id, CampaignControllerFindOneRequest request, @@ -397,6 +815,9 @@ public WithRawResponseTask CampaignControllerFindOneAsync( ); } + /// + /// Deletes the outbound calling campaign identified by its ID. + /// public WithRawResponseTask CampaignControllerRemoveAsync( string id, CampaignControllerRemoveRequest request, @@ -409,9 +830,12 @@ public WithRawResponseTask CampaignControllerRemoveAsync( ); } + /// + /// Updates the outbound calling campaign identified by its ID. Campaigns can be ended by updating their status to `ended`. + /// public WithRawResponseTask CampaignControllerUpdateAsync( string id, - UpdateCampaignDto request, + CampaignControllerUpdateRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default ) diff --git a/src/Vapi.Net/Campaigns/ICampaignsClient.cs b/src/Vapi.Net/Campaigns/ICampaignsClient.cs index 8b40bb4f..0ee1f403 100644 --- a/src/Vapi.Net/Campaigns/ICampaignsClient.cs +++ b/src/Vapi.Net/Campaigns/ICampaignsClient.cs @@ -2,18 +2,60 @@ namespace Vapi.Net; public partial interface ICampaignsClient { + /// + /// Returns outbound calling campaigns for the authenticated organization. Filter results by campaign ID, status, or creation and update timestamps. + /// WithRawResponseTask CampaignControllerFindAllAsync( CampaignControllerFindAllRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default ); + /// + /// Creates an outbound calling campaign that calls a set of customers. + /// WithRawResponseTask CampaignControllerCreateAsync( CreateCampaignDto request, RequestOptions? options = null, CancellationToken cancellationToken = default ); + WithRawResponseTask CampaignControllerFindAllV2Async( + CampaignControllerFindAllV2Request request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ); + + WithRawResponseTask CampaignControllerCreateV2Async( + CreateCampaignDto request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ); + + WithRawResponseTask CampaignControllerFindOneV2Async( + string id, + CampaignControllerFindOneV2Request request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ); + + WithRawResponseTask CampaignControllerRemoveV2Async( + string id, + CampaignControllerRemoveV2Request request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ); + + WithRawResponseTask CampaignControllerUpdateV2Async( + string id, + CampaignControllerUpdateV2Request request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ); + + /// + /// Returns the outbound calling campaign identified by its ID. + /// WithRawResponseTask CampaignControllerFindOneAsync( string id, CampaignControllerFindOneRequest request, @@ -21,6 +63,9 @@ WithRawResponseTask CampaignControllerFindOneAsync( CancellationToken cancellationToken = default ); + /// + /// Deletes the outbound calling campaign identified by its ID. + /// WithRawResponseTask CampaignControllerRemoveAsync( string id, CampaignControllerRemoveRequest request, @@ -28,9 +73,12 @@ WithRawResponseTask CampaignControllerRemoveAsync( CancellationToken cancellationToken = default ); + /// + /// Updates the outbound calling campaign identified by its ID. Campaigns can be ended by updating their status to `ended`. + /// WithRawResponseTask CampaignControllerUpdateAsync( string id, - UpdateCampaignDto request, + CampaignControllerUpdateRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default ); diff --git a/src/Vapi.Net/Campaigns/Requests/CampaignControllerFindAllRequest.cs b/src/Vapi.Net/Campaigns/Requests/CampaignControllerFindAllRequest.cs index 070b6b3c..56d647cc 100644 --- a/src/Vapi.Net/Campaigns/Requests/CampaignControllerFindAllRequest.cs +++ b/src/Vapi.Net/Campaigns/Requests/CampaignControllerFindAllRequest.cs @@ -6,9 +6,15 @@ namespace Vapi.Net; [Serializable] public record CampaignControllerFindAllRequest { + /// + /// Filters campaigns by ID. + /// [JsonIgnore] public string? Id { get; set; } + /// + /// Filters campaigns by status. + /// [JsonIgnore] public CampaignControllerFindAllRequestStatus? Status { get; set; } @@ -24,6 +30,12 @@ public record CampaignControllerFindAllRequest [JsonIgnore] public CampaignControllerFindAllRequestSortOrder? SortOrder { get; set; } + /// + /// This is the column to sort by. Defaults to 'createdAt'. + /// + [JsonIgnore] + public CampaignControllerFindAllRequestSortBy? SortBy { get; set; } + /// /// This is the maximum number of items to return. Defaults to 100. /// diff --git a/src/Vapi.Net/Campaigns/Requests/CampaignControllerFindAllV2Request.cs b/src/Vapi.Net/Campaigns/Requests/CampaignControllerFindAllV2Request.cs new file mode 100644 index 00000000..4305dc91 --- /dev/null +++ b/src/Vapi.Net/Campaigns/Requests/CampaignControllerFindAllV2Request.cs @@ -0,0 +1,92 @@ +using global::System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[Serializable] +public record CampaignControllerFindAllV2Request +{ + [JsonIgnore] + public string? Id { get; set; } + + [JsonIgnore] + public CampaignControllerFindAllV2RequestStatus? Status { 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 CampaignControllerFindAllV2RequestSortOrder? SortOrder { get; set; } + + /// + /// This is the column to sort by. Defaults to 'createdAt'. + /// + [JsonIgnore] + public CampaignControllerFindAllV2RequestSortBy? SortBy { 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/Campaigns/Requests/CampaignControllerFindOneV2Request.cs b/src/Vapi.Net/Campaigns/Requests/CampaignControllerFindOneV2Request.cs new file mode 100644 index 00000000..667e9d8c --- /dev/null +++ b/src/Vapi.Net/Campaigns/Requests/CampaignControllerFindOneV2Request.cs @@ -0,0 +1,13 @@ +using Vapi.Net.Core; + +namespace Vapi.Net; + +[Serializable] +public record CampaignControllerFindOneV2Request +{ + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Campaigns/Requests/CampaignControllerRemoveV2Request.cs b/src/Vapi.Net/Campaigns/Requests/CampaignControllerRemoveV2Request.cs new file mode 100644 index 00000000..27b37159 --- /dev/null +++ b/src/Vapi.Net/Campaigns/Requests/CampaignControllerRemoveV2Request.cs @@ -0,0 +1,13 @@ +using Vapi.Net.Core; + +namespace Vapi.Net; + +[Serializable] +public record CampaignControllerRemoveV2Request +{ + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Campaigns/Requests/CampaignControllerUpdateRequest.cs b/src/Vapi.Net/Campaigns/Requests/CampaignControllerUpdateRequest.cs new file mode 100644 index 00000000..2bd11610 --- /dev/null +++ b/src/Vapi.Net/Campaigns/Requests/CampaignControllerUpdateRequest.cs @@ -0,0 +1,17 @@ +using global::System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[Serializable] +public record CampaignControllerUpdateRequest +{ + [JsonIgnore] + public required UpdateCampaignDto Body { get; set; } + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Campaigns/Requests/CampaignControllerUpdateV2Request.cs b/src/Vapi.Net/Campaigns/Requests/CampaignControllerUpdateV2Request.cs new file mode 100644 index 00000000..d2be734a --- /dev/null +++ b/src/Vapi.Net/Campaigns/Requests/CampaignControllerUpdateV2Request.cs @@ -0,0 +1,17 @@ +using global::System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[Serializable] +public record CampaignControllerUpdateV2Request +{ + [JsonIgnore] + public required UpdateCampaignDto Body { get; set; } + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Campaigns/Requests/CreateCampaignDto.cs b/src/Vapi.Net/Campaigns/Requests/CreateCampaignDto.cs deleted file mode 100644 index eff2b1b3..00000000 --- a/src/Vapi.Net/Campaigns/Requests/CreateCampaignDto.cs +++ /dev/null @@ -1,62 +0,0 @@ -using global::System.Text.Json.Serialization; -using Vapi.Net.Core; - -namespace Vapi.Net; - -[Serializable] -public record CreateCampaignDto -{ - /// - /// This is the name of the campaign. This is just for your own reference. - /// - [JsonPropertyName("name")] - public required string Name { get; set; } - - /// - /// This is the assistant ID that will be used for the campaign calls. Note: Only one of assistantId, workflowId, or squadId can be used. - /// - [JsonPropertyName("assistantId")] - public string? AssistantId { get; set; } - - /// - /// This is the workflow ID that will be used for the campaign calls. Note: Only one of assistantId, workflowId, or squadId can be used. - /// - [JsonPropertyName("workflowId")] - public string? WorkflowId { get; set; } - - /// - /// This is the squad ID that will be used for the campaign calls. Note: Only one of assistantId, workflowId, or squadId can be used. - /// - [JsonPropertyName("squadId")] - public string? SquadId { get; set; } - - /// - /// This is the phone number ID that will be used for the campaign calls. Required if dialPlan is not provided. Note: phoneNumberId and dialPlan are mutually exclusive. - /// - [JsonPropertyName("phoneNumberId")] - public string? PhoneNumberId { get; set; } - - /// - /// This is a list of dial entries, each specifying a phone number and the customers to call using that number. Use this when you want different phone numbers to call different sets of customers. Note: phoneNumberId and dialPlan are mutually exclusive. - /// - [JsonPropertyName("dialPlan")] - public IEnumerable? DialPlan { get; set; } - - /// - /// This is the schedule plan for the campaign. Calls will start at startedAt and continue until your organization’s concurrency limit is reached. Any remaining calls will be retried for up to one hour as capacity becomes available. After that hour or after latestAt, whichever comes first, any calls that couldn’t be placed won’t be retried. - /// - [JsonPropertyName("schedulePlan")] - public SchedulePlan? SchedulePlan { get; set; } - - /// - /// These are the customers that will be called in the campaign. Required if dialPlan is not provided. - /// - [JsonPropertyName("customers")] - public IEnumerable? Customers { get; set; } - - /// - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Vapi.Net/Campaigns/Types/CampaignControllerFindAllRequestSortBy.cs b/src/Vapi.Net/Campaigns/Types/CampaignControllerFindAllRequestSortBy.cs new file mode 100644 index 00000000..d2908f8c --- /dev/null +++ b/src/Vapi.Net/Campaigns/Types/CampaignControllerFindAllRequestSortBy.cs @@ -0,0 +1,89 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(CampaignControllerFindAllRequestSortBySerializer))] +public enum CampaignControllerFindAllRequestSortBy +{ + [EnumMember(Value = "createdAt")] + CreatedAt, + + [EnumMember(Value = "duration")] + Duration, + + [EnumMember(Value = "cost")] + Cost, +} + +internal class CampaignControllerFindAllRequestSortBySerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + CampaignControllerFindAllRequestSortBy + > _stringToEnum = new() + { + { "createdAt", CampaignControllerFindAllRequestSortBy.CreatedAt }, + { "duration", CampaignControllerFindAllRequestSortBy.Duration }, + { "cost", CampaignControllerFindAllRequestSortBy.Cost }, + }; + + private static readonly global::System.Collections.Generic.Dictionary< + CampaignControllerFindAllRequestSortBy, + string + > _enumToString = new() + { + { CampaignControllerFindAllRequestSortBy.CreatedAt, "createdAt" }, + { CampaignControllerFindAllRequestSortBy.Duration, "duration" }, + { CampaignControllerFindAllRequestSortBy.Cost, "cost" }, + }; + + public override CampaignControllerFindAllRequestSortBy Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + CampaignControllerFindAllRequestSortBy value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override CampaignControllerFindAllRequestSortBy ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + CampaignControllerFindAllRequestSortBy value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Campaigns/Types/CampaignControllerFindAllRequestStatus.cs b/src/Vapi.Net/Campaigns/Types/CampaignControllerFindAllRequestStatus.cs index 41acc251..3a6232e1 100644 --- a/src/Vapi.Net/Campaigns/Types/CampaignControllerFindAllRequestStatus.cs +++ b/src/Vapi.Net/Campaigns/Types/CampaignControllerFindAllRequestStatus.cs @@ -14,6 +14,12 @@ public enum CampaignControllerFindAllRequestStatus [EnumMember(Value = "ended")] Ended, + + [EnumMember(Value = "cancelled")] + Cancelled, + + [EnumMember(Value = "archived")] + Archived, } internal class CampaignControllerFindAllRequestStatusSerializer @@ -27,6 +33,8 @@ internal class CampaignControllerFindAllRequestStatusSerializer { "scheduled", CampaignControllerFindAllRequestStatus.Scheduled }, { "in-progress", CampaignControllerFindAllRequestStatus.InProgress }, { "ended", CampaignControllerFindAllRequestStatus.Ended }, + { "cancelled", CampaignControllerFindAllRequestStatus.Cancelled }, + { "archived", CampaignControllerFindAllRequestStatus.Archived }, }; private static readonly global::System.Collections.Generic.Dictionary< @@ -37,6 +45,8 @@ internal class CampaignControllerFindAllRequestStatusSerializer { CampaignControllerFindAllRequestStatus.Scheduled, "scheduled" }, { CampaignControllerFindAllRequestStatus.InProgress, "in-progress" }, { CampaignControllerFindAllRequestStatus.Ended, "ended" }, + { CampaignControllerFindAllRequestStatus.Cancelled, "cancelled" }, + { CampaignControllerFindAllRequestStatus.Archived, "archived" }, }; public override CampaignControllerFindAllRequestStatus Read( diff --git a/src/Vapi.Net/Campaigns/Types/CampaignControllerFindAllV2RequestSortBy.cs b/src/Vapi.Net/Campaigns/Types/CampaignControllerFindAllV2RequestSortBy.cs new file mode 100644 index 00000000..412ee933 --- /dev/null +++ b/src/Vapi.Net/Campaigns/Types/CampaignControllerFindAllV2RequestSortBy.cs @@ -0,0 +1,89 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(CampaignControllerFindAllV2RequestSortBySerializer))] +public enum CampaignControllerFindAllV2RequestSortBy +{ + [EnumMember(Value = "createdAt")] + CreatedAt, + + [EnumMember(Value = "duration")] + Duration, + + [EnumMember(Value = "cost")] + Cost, +} + +internal class CampaignControllerFindAllV2RequestSortBySerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + CampaignControllerFindAllV2RequestSortBy + > _stringToEnum = new() + { + { "createdAt", CampaignControllerFindAllV2RequestSortBy.CreatedAt }, + { "duration", CampaignControllerFindAllV2RequestSortBy.Duration }, + { "cost", CampaignControllerFindAllV2RequestSortBy.Cost }, + }; + + private static readonly global::System.Collections.Generic.Dictionary< + CampaignControllerFindAllV2RequestSortBy, + string + > _enumToString = new() + { + { CampaignControllerFindAllV2RequestSortBy.CreatedAt, "createdAt" }, + { CampaignControllerFindAllV2RequestSortBy.Duration, "duration" }, + { CampaignControllerFindAllV2RequestSortBy.Cost, "cost" }, + }; + + public override CampaignControllerFindAllV2RequestSortBy Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + CampaignControllerFindAllV2RequestSortBy value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override CampaignControllerFindAllV2RequestSortBy ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + CampaignControllerFindAllV2RequestSortBy value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Campaigns/Types/CampaignControllerFindAllV2RequestSortOrder.cs b/src/Vapi.Net/Campaigns/Types/CampaignControllerFindAllV2RequestSortOrder.cs new file mode 100644 index 00000000..83a60ab8 --- /dev/null +++ b/src/Vapi.Net/Campaigns/Types/CampaignControllerFindAllV2RequestSortOrder.cs @@ -0,0 +1,84 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(CampaignControllerFindAllV2RequestSortOrderSerializer))] +public enum CampaignControllerFindAllV2RequestSortOrder +{ + [EnumMember(Value = "ASC")] + Asc, + + [EnumMember(Value = "DESC")] + Desc, +} + +internal class CampaignControllerFindAllV2RequestSortOrderSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + CampaignControllerFindAllV2RequestSortOrder + > _stringToEnum = new() + { + { "ASC", CampaignControllerFindAllV2RequestSortOrder.Asc }, + { "DESC", CampaignControllerFindAllV2RequestSortOrder.Desc }, + }; + + private static readonly global::System.Collections.Generic.Dictionary< + CampaignControllerFindAllV2RequestSortOrder, + string + > _enumToString = new() + { + { CampaignControllerFindAllV2RequestSortOrder.Asc, "ASC" }, + { CampaignControllerFindAllV2RequestSortOrder.Desc, "DESC" }, + }; + + public override CampaignControllerFindAllV2RequestSortOrder Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + CampaignControllerFindAllV2RequestSortOrder value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override CampaignControllerFindAllV2RequestSortOrder ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + CampaignControllerFindAllV2RequestSortOrder value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Campaigns/Types/CampaignControllerFindAllV2RequestStatus.cs b/src/Vapi.Net/Campaigns/Types/CampaignControllerFindAllV2RequestStatus.cs new file mode 100644 index 00000000..deb37522 --- /dev/null +++ b/src/Vapi.Net/Campaigns/Types/CampaignControllerFindAllV2RequestStatus.cs @@ -0,0 +1,99 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(CampaignControllerFindAllV2RequestStatusSerializer))] +public enum CampaignControllerFindAllV2RequestStatus +{ + [EnumMember(Value = "scheduled")] + Scheduled, + + [EnumMember(Value = "in-progress")] + InProgress, + + [EnumMember(Value = "ended")] + Ended, + + [EnumMember(Value = "cancelled")] + Cancelled, + + [EnumMember(Value = "archived")] + Archived, +} + +internal class CampaignControllerFindAllV2RequestStatusSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + CampaignControllerFindAllV2RequestStatus + > _stringToEnum = new() + { + { "scheduled", CampaignControllerFindAllV2RequestStatus.Scheduled }, + { "in-progress", CampaignControllerFindAllV2RequestStatus.InProgress }, + { "ended", CampaignControllerFindAllV2RequestStatus.Ended }, + { "cancelled", CampaignControllerFindAllV2RequestStatus.Cancelled }, + { "archived", CampaignControllerFindAllV2RequestStatus.Archived }, + }; + + private static readonly global::System.Collections.Generic.Dictionary< + CampaignControllerFindAllV2RequestStatus, + string + > _enumToString = new() + { + { CampaignControllerFindAllV2RequestStatus.Scheduled, "scheduled" }, + { CampaignControllerFindAllV2RequestStatus.InProgress, "in-progress" }, + { CampaignControllerFindAllV2RequestStatus.Ended, "ended" }, + { CampaignControllerFindAllV2RequestStatus.Cancelled, "cancelled" }, + { CampaignControllerFindAllV2RequestStatus.Archived, "archived" }, + }; + + public override CampaignControllerFindAllV2RequestStatus Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + CampaignControllerFindAllV2RequestStatus value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override CampaignControllerFindAllV2RequestStatus ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + CampaignControllerFindAllV2RequestStatus value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Chats/ChatsClient.cs b/src/Vapi.Net/Chats/ChatsClient.cs index 900c3f66..2b7861b7 100644 --- a/src/Vapi.Net/Chats/ChatsClient.cs +++ b/src/Vapi.Net/Chats/ChatsClient.cs @@ -19,7 +19,7 @@ private async Task> ListAsyncCore( CancellationToken cancellationToken = default ) { - var _queryString = new Vapi.Net.Core.QueryStringBuilder.Builder(capacity: 17) + var _queryString = new Vapi.Net.Core.QueryStringBuilder.Builder(capacity: 18) .Add("id", request.Id) .Add("assistantId", request.AssistantId) .Add("assistantIdAny", request.AssistantIdAny) @@ -28,6 +28,7 @@ private async Task> ListAsyncCore( .Add("previousChatId", request.PreviousChatId) .Add("page", request.Page) .Add("sortOrder", request.SortOrder) + .Add("sortBy", request.SortBy) .Add("limit", request.Limit) .Add("createdAtGt", request.CreatedAtGt) .Add("createdAtLt", request.CreatedAtLt) diff --git a/src/Vapi.Net/Chats/Requests/ListChatsRequest.cs b/src/Vapi.Net/Chats/Requests/ListChatsRequest.cs index 96d6370b..a2fb769f 100644 --- a/src/Vapi.Net/Chats/Requests/ListChatsRequest.cs +++ b/src/Vapi.Net/Chats/Requests/ListChatsRequest.cs @@ -54,6 +54,12 @@ public record ListChatsRequest [JsonIgnore] public ListChatsRequestSortOrder? SortOrder { get; set; } + /// + /// This is the column to sort by. Defaults to 'createdAt'. + /// + [JsonIgnore] + public ListChatsRequestSortBy? SortBy { get; set; } + /// /// This is the maximum number of items to return. Defaults to 100. /// diff --git a/src/Vapi.Net/Chats/Types/ListChatsRequestSortBy.cs b/src/Vapi.Net/Chats/Types/ListChatsRequestSortBy.cs new file mode 100644 index 00000000..f2eebdab --- /dev/null +++ b/src/Vapi.Net/Chats/Types/ListChatsRequestSortBy.cs @@ -0,0 +1,89 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(ListChatsRequestSortBySerializer))] +public enum ListChatsRequestSortBy +{ + [EnumMember(Value = "createdAt")] + CreatedAt, + + [EnumMember(Value = "duration")] + Duration, + + [EnumMember(Value = "cost")] + Cost, +} + +internal class ListChatsRequestSortBySerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + ListChatsRequestSortBy + > _stringToEnum = new() + { + { "createdAt", ListChatsRequestSortBy.CreatedAt }, + { "duration", ListChatsRequestSortBy.Duration }, + { "cost", ListChatsRequestSortBy.Cost }, + }; + + private static readonly global::System.Collections.Generic.Dictionary< + ListChatsRequestSortBy, + string + > _enumToString = new() + { + { ListChatsRequestSortBy.CreatedAt, "createdAt" }, + { ListChatsRequestSortBy.Duration, "duration" }, + { ListChatsRequestSortBy.Cost, "cost" }, + }; + + public override ListChatsRequestSortBy Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + ListChatsRequestSortBy value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override ListChatsRequestSortBy ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + ListChatsRequestSortBy value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Core/Public/Version.cs b/src/Vapi.Net/Core/Public/Version.cs index 641bf59d..38406f35 100644 --- a/src/Vapi.Net/Core/Public/Version.cs +++ b/src/Vapi.Net/Core/Public/Version.cs @@ -3,5 +3,5 @@ namespace Vapi.Net; [Serializable] internal class Version { - public const string Current = "2.0.0"; + public const string Current = "0.0.0-fern-placeholder"; } diff --git a/src/Vapi.Net/Eval/EvalClient.cs b/src/Vapi.Net/Eval/EvalClient.cs index 740e5a1a..0c6e25aa 100644 --- a/src/Vapi.Net/Eval/EvalClient.cs +++ b/src/Vapi.Net/Eval/EvalClient.cs @@ -18,10 +18,11 @@ private async Task> EvalControllerGetPagi CancellationToken cancellationToken = default ) { - var _queryString = new Vapi.Net.Core.QueryStringBuilder.Builder(capacity: 12) + var _queryString = new Vapi.Net.Core.QueryStringBuilder.Builder(capacity: 13) .Add("id", request.Id) .Add("page", request.Page) .Add("sortOrder", request.SortOrder) + .Add("sortBy", request.SortBy) .Add("limit", request.Limit) .Add("createdAtGt", request.CreatedAtGt) .Add("createdAtLt", request.CreatedAtLt) @@ -499,10 +500,11 @@ private async Task< CancellationToken cancellationToken = default ) { - var _queryString = new Vapi.Net.Core.QueryStringBuilder.Builder(capacity: 12) + var _queryString = new Vapi.Net.Core.QueryStringBuilder.Builder(capacity: 13) .Add("id", request.Id) .Add("page", request.Page) .Add("sortOrder", request.SortOrder) + .Add("sortBy", request.SortBy) .Add("limit", request.Limit) .Add("createdAtGt", request.CreatedAtGt) .Add("createdAtLt", request.CreatedAtLt) @@ -641,6 +643,9 @@ private async Task> EvalControllerRunAsyncCore( } } + /// + /// Returns eval definitions for the authenticated organization. Filter results by ID or creation and update timestamps. + /// public WithRawResponseTask EvalControllerGetPaginatedAsync( EvalControllerGetPaginatedRequest request, RequestOptions? options = null, @@ -652,6 +657,9 @@ public WithRawResponseTask EvalControllerGetPaginatedAsyn ); } + /// + /// Creates a reusable eval that defines a mock conversation and checkpoints for evaluating assistant responses and tool calls. + /// public WithRawResponseTask EvalControllerCreateAsync( CreateEvalDto request, RequestOptions? options = null, @@ -663,6 +671,9 @@ public WithRawResponseTask EvalControllerCreateAsync( ); } + /// + /// Returns the eval definition identified by its ID. + /// public WithRawResponseTask EvalControllerGetAsync( string id, EvalControllerGetRequest request, @@ -675,6 +686,9 @@ public WithRawResponseTask EvalControllerGetAsync( ); } + /// + /// Deletes the eval definition identified by its ID. + /// public WithRawResponseTask EvalControllerRemoveAsync( string id, EvalControllerRemoveRequest request, @@ -687,6 +701,9 @@ public WithRawResponseTask EvalControllerRemoveAsync( ); } + /// + /// Updates the eval definition identified by its ID. + /// public WithRawResponseTask EvalControllerUpdateAsync( string id, UpdateEvalDto request, @@ -699,6 +716,9 @@ public WithRawResponseTask EvalControllerUpdateAsync( ); } + /// + /// Returns the eval run identified by its ID. + /// public WithRawResponseTask EvalControllerGetRunAsync( string id, EvalControllerGetRunRequest request, @@ -711,6 +731,9 @@ public WithRawResponseTask EvalControllerGetRunAsync( ); } + /// + /// Deletes the eval run identified by its ID. + /// public WithRawResponseTask EvalControllerRemoveRunAsync( string id, EvalControllerRemoveRunRequest request, @@ -723,6 +746,9 @@ public WithRawResponseTask EvalControllerRemoveRunAsync( ); } + /// + /// Returns eval runs for the authenticated organization. Filter results by ID or creation and update timestamps. + /// public WithRawResponseTask EvalControllerGetRunsPaginatedAsync( EvalControllerGetRunsPaginatedRequest request, RequestOptions? options = null, @@ -734,6 +760,9 @@ public WithRawResponseTask EvalControllerGetRunsPagina ); } + /// + /// Runs a saved or transient eval against an assistant or squad and creates an eval-run record containing the results. + /// public WithRawResponseTask EvalControllerRunAsync( CreateEvalRunDto request, RequestOptions? options = null, diff --git a/src/Vapi.Net/Eval/IEvalClient.cs b/src/Vapi.Net/Eval/IEvalClient.cs index 6b5cf2ec..c20dda0c 100644 --- a/src/Vapi.Net/Eval/IEvalClient.cs +++ b/src/Vapi.Net/Eval/IEvalClient.cs @@ -2,18 +2,27 @@ namespace Vapi.Net; public partial interface IEvalClient { + /// + /// Returns eval definitions for the authenticated organization. Filter results by ID or creation and update timestamps. + /// WithRawResponseTask EvalControllerGetPaginatedAsync( EvalControllerGetPaginatedRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default ); + /// + /// Creates a reusable eval that defines a mock conversation and checkpoints for evaluating assistant responses and tool calls. + /// WithRawResponseTask EvalControllerCreateAsync( CreateEvalDto request, RequestOptions? options = null, CancellationToken cancellationToken = default ); + /// + /// Returns the eval definition identified by its ID. + /// WithRawResponseTask EvalControllerGetAsync( string id, EvalControllerGetRequest request, @@ -21,6 +30,9 @@ WithRawResponseTask EvalControllerGetAsync( CancellationToken cancellationToken = default ); + /// + /// Deletes the eval definition identified by its ID. + /// WithRawResponseTask EvalControllerRemoveAsync( string id, EvalControllerRemoveRequest request, @@ -28,6 +40,9 @@ WithRawResponseTask EvalControllerRemoveAsync( CancellationToken cancellationToken = default ); + /// + /// Updates the eval definition identified by its ID. + /// WithRawResponseTask EvalControllerUpdateAsync( string id, UpdateEvalDto request, @@ -35,6 +50,9 @@ WithRawResponseTask EvalControllerUpdateAsync( CancellationToken cancellationToken = default ); + /// + /// Returns the eval run identified by its ID. + /// WithRawResponseTask EvalControllerGetRunAsync( string id, EvalControllerGetRunRequest request, @@ -42,6 +60,9 @@ WithRawResponseTask EvalControllerGetRunAsync( CancellationToken cancellationToken = default ); + /// + /// Deletes the eval run identified by its ID. + /// WithRawResponseTask EvalControllerRemoveRunAsync( string id, EvalControllerRemoveRunRequest request, @@ -49,12 +70,18 @@ WithRawResponseTask EvalControllerRemoveRunAsync( CancellationToken cancellationToken = default ); + /// + /// Returns eval runs for the authenticated organization. Filter results by ID or creation and update timestamps. + /// WithRawResponseTask EvalControllerGetRunsPaginatedAsync( EvalControllerGetRunsPaginatedRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default ); + /// + /// Runs a saved or transient eval against an assistant or squad and creates an eval-run record containing the results. + /// WithRawResponseTask EvalControllerRunAsync( CreateEvalRunDto request, RequestOptions? options = null, diff --git a/src/Vapi.Net/Eval/Requests/EvalControllerGetPaginatedRequest.cs b/src/Vapi.Net/Eval/Requests/EvalControllerGetPaginatedRequest.cs index 58466bbe..6c42a536 100644 --- a/src/Vapi.Net/Eval/Requests/EvalControllerGetPaginatedRequest.cs +++ b/src/Vapi.Net/Eval/Requests/EvalControllerGetPaginatedRequest.cs @@ -6,6 +6,9 @@ namespace Vapi.Net; [Serializable] public record EvalControllerGetPaginatedRequest { + /// + /// Filters eval definitions by ID. + /// [JsonIgnore] public string? Id { get; set; } @@ -21,6 +24,12 @@ public record EvalControllerGetPaginatedRequest [JsonIgnore] public EvalControllerGetPaginatedRequestSortOrder? SortOrder { get; set; } + /// + /// This is the column to sort by. Defaults to 'createdAt'. + /// + [JsonIgnore] + public EvalControllerGetPaginatedRequestSortBy? SortBy { get; set; } + /// /// This is the maximum number of items to return. Defaults to 100. /// diff --git a/src/Vapi.Net/Eval/Requests/EvalControllerGetRunsPaginatedRequest.cs b/src/Vapi.Net/Eval/Requests/EvalControllerGetRunsPaginatedRequest.cs index 8526f854..95648dd7 100644 --- a/src/Vapi.Net/Eval/Requests/EvalControllerGetRunsPaginatedRequest.cs +++ b/src/Vapi.Net/Eval/Requests/EvalControllerGetRunsPaginatedRequest.cs @@ -6,6 +6,9 @@ namespace Vapi.Net; [Serializable] public record EvalControllerGetRunsPaginatedRequest { + /// + /// Filters eval runs by ID. + /// [JsonIgnore] public string? Id { get; set; } @@ -21,6 +24,12 @@ public record EvalControllerGetRunsPaginatedRequest [JsonIgnore] public EvalControllerGetRunsPaginatedRequestSortOrder? SortOrder { get; set; } + /// + /// This is the column to sort by. Defaults to 'createdAt'. + /// + [JsonIgnore] + public EvalControllerGetRunsPaginatedRequestSortBy? SortBy { get; set; } + /// /// This is the maximum number of items to return. Defaults to 100. /// diff --git a/src/Vapi.Net/Types/TrieveKnowledgeBaseSearchPlanSearchType.cs b/src/Vapi.Net/Eval/Types/EvalControllerGetPaginatedRequestSortBy.cs similarity index 58% rename from src/Vapi.Net/Types/TrieveKnowledgeBaseSearchPlanSearchType.cs rename to src/Vapi.Net/Eval/Types/EvalControllerGetPaginatedRequestSortBy.cs index ac509fcd..950f0354 100644 --- a/src/Vapi.Net/Types/TrieveKnowledgeBaseSearchPlanSearchType.cs +++ b/src/Vapi.Net/Eval/Types/EvalControllerGetPaginatedRequestSortBy.cs @@ -3,48 +3,43 @@ namespace Vapi.Net; -[JsonConverter(typeof(TrieveKnowledgeBaseSearchPlanSearchTypeSerializer))] -public enum TrieveKnowledgeBaseSearchPlanSearchType +[JsonConverter(typeof(EvalControllerGetPaginatedRequestSortBySerializer))] +public enum EvalControllerGetPaginatedRequestSortBy { - [EnumMember(Value = "fulltext")] - Fulltext, + [EnumMember(Value = "createdAt")] + CreatedAt, - [EnumMember(Value = "semantic")] - Semantic, + [EnumMember(Value = "duration")] + Duration, - [EnumMember(Value = "hybrid")] - Hybrid, - - [EnumMember(Value = "bm25")] - Bm25, + [EnumMember(Value = "cost")] + Cost, } -internal class TrieveKnowledgeBaseSearchPlanSearchTypeSerializer - : global::System.Text.Json.Serialization.JsonConverter +internal class EvalControllerGetPaginatedRequestSortBySerializer + : global::System.Text.Json.Serialization.JsonConverter { private static readonly global::System.Collections.Generic.Dictionary< string, - TrieveKnowledgeBaseSearchPlanSearchType + EvalControllerGetPaginatedRequestSortBy > _stringToEnum = new() { - { "fulltext", TrieveKnowledgeBaseSearchPlanSearchType.Fulltext }, - { "semantic", TrieveKnowledgeBaseSearchPlanSearchType.Semantic }, - { "hybrid", TrieveKnowledgeBaseSearchPlanSearchType.Hybrid }, - { "bm25", TrieveKnowledgeBaseSearchPlanSearchType.Bm25 }, + { "createdAt", EvalControllerGetPaginatedRequestSortBy.CreatedAt }, + { "duration", EvalControllerGetPaginatedRequestSortBy.Duration }, + { "cost", EvalControllerGetPaginatedRequestSortBy.Cost }, }; private static readonly global::System.Collections.Generic.Dictionary< - TrieveKnowledgeBaseSearchPlanSearchType, + EvalControllerGetPaginatedRequestSortBy, string > _enumToString = new() { - { TrieveKnowledgeBaseSearchPlanSearchType.Fulltext, "fulltext" }, - { TrieveKnowledgeBaseSearchPlanSearchType.Semantic, "semantic" }, - { TrieveKnowledgeBaseSearchPlanSearchType.Hybrid, "hybrid" }, - { TrieveKnowledgeBaseSearchPlanSearchType.Bm25, "bm25" }, + { EvalControllerGetPaginatedRequestSortBy.CreatedAt, "createdAt" }, + { EvalControllerGetPaginatedRequestSortBy.Duration, "duration" }, + { EvalControllerGetPaginatedRequestSortBy.Cost, "cost" }, }; - public override TrieveKnowledgeBaseSearchPlanSearchType Read( + public override EvalControllerGetPaginatedRequestSortBy Read( ref global::System.Text.Json.Utf8JsonReader reader, global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options @@ -58,7 +53,7 @@ public override TrieveKnowledgeBaseSearchPlanSearchType Read( public override void Write( global::System.Text.Json.Utf8JsonWriter writer, - TrieveKnowledgeBaseSearchPlanSearchType value, + EvalControllerGetPaginatedRequestSortBy value, global::System.Text.Json.JsonSerializerOptions options ) { @@ -67,7 +62,7 @@ public override void Write( ); } - public override TrieveKnowledgeBaseSearchPlanSearchType ReadAsPropertyName( + public override EvalControllerGetPaginatedRequestSortBy ReadAsPropertyName( ref global::System.Text.Json.Utf8JsonReader reader, global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options @@ -83,7 +78,7 @@ public override TrieveKnowledgeBaseSearchPlanSearchType ReadAsPropertyName( public override void WriteAsPropertyName( global::System.Text.Json.Utf8JsonWriter writer, - TrieveKnowledgeBaseSearchPlanSearchType value, + EvalControllerGetPaginatedRequestSortBy value, global::System.Text.Json.JsonSerializerOptions options ) { diff --git a/src/Vapi.Net/Eval/Types/EvalControllerGetRunsPaginatedRequestSortBy.cs b/src/Vapi.Net/Eval/Types/EvalControllerGetRunsPaginatedRequestSortBy.cs new file mode 100644 index 00000000..f2d9f187 --- /dev/null +++ b/src/Vapi.Net/Eval/Types/EvalControllerGetRunsPaginatedRequestSortBy.cs @@ -0,0 +1,89 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(EvalControllerGetRunsPaginatedRequestSortBySerializer))] +public enum EvalControllerGetRunsPaginatedRequestSortBy +{ + [EnumMember(Value = "createdAt")] + CreatedAt, + + [EnumMember(Value = "duration")] + Duration, + + [EnumMember(Value = "cost")] + Cost, +} + +internal class EvalControllerGetRunsPaginatedRequestSortBySerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + EvalControllerGetRunsPaginatedRequestSortBy + > _stringToEnum = new() + { + { "createdAt", EvalControllerGetRunsPaginatedRequestSortBy.CreatedAt }, + { "duration", EvalControllerGetRunsPaginatedRequestSortBy.Duration }, + { "cost", EvalControllerGetRunsPaginatedRequestSortBy.Cost }, + }; + + private static readonly global::System.Collections.Generic.Dictionary< + EvalControllerGetRunsPaginatedRequestSortBy, + string + > _enumToString = new() + { + { EvalControllerGetRunsPaginatedRequestSortBy.CreatedAt, "createdAt" }, + { EvalControllerGetRunsPaginatedRequestSortBy.Duration, "duration" }, + { EvalControllerGetRunsPaginatedRequestSortBy.Cost, "cost" }, + }; + + public override EvalControllerGetRunsPaginatedRequestSortBy Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + EvalControllerGetRunsPaginatedRequestSortBy value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override EvalControllerGetRunsPaginatedRequestSortBy ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + EvalControllerGetRunsPaginatedRequestSortBy value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Exceptions/ConflictError.cs b/src/Vapi.Net/Exceptions/ConflictError.cs new file mode 100644 index 00000000..ce99791d --- /dev/null +++ b/src/Vapi.Net/Exceptions/ConflictError.cs @@ -0,0 +1,7 @@ +namespace Vapi.Net; + +/// +/// This exception type will be thrown for any non-2XX API responses. +/// +[Serializable] +public class ConflictError(object body) : VapiClientApiException("ConflictError", 409, body); diff --git a/src/Vapi.Net/Exceptions/ServiceUnavailableError.cs b/src/Vapi.Net/Exceptions/ServiceUnavailableError.cs new file mode 100644 index 00000000..a659e11f --- /dev/null +++ b/src/Vapi.Net/Exceptions/ServiceUnavailableError.cs @@ -0,0 +1,8 @@ +namespace Vapi.Net; + +/// +/// This exception type will be thrown for any non-2XX API responses. +/// +[Serializable] +public class ServiceUnavailableError(object body) + : VapiClientApiException("ServiceUnavailableError", 503, body); diff --git a/src/Vapi.Net/Exceptions/UnauthorizedError.cs b/src/Vapi.Net/Exceptions/UnauthorizedError.cs new file mode 100644 index 00000000..50fe0d51 --- /dev/null +++ b/src/Vapi.Net/Exceptions/UnauthorizedError.cs @@ -0,0 +1,8 @@ +namespace Vapi.Net; + +/// +/// This exception type will be thrown for any non-2XX API responses. +/// +[Serializable] +public class UnauthorizedError(object body) + : VapiClientApiException("UnauthorizedError", 401, body); diff --git a/src/Vapi.Net/Files/FilesClient.cs b/src/Vapi.Net/Files/FilesClient.cs index f4735751..d7dca7a0 100644 --- a/src/Vapi.Net/Files/FilesClient.cs +++ b/src/Vapi.Net/Files/FilesClient.cs @@ -13,10 +13,15 @@ internal FilesClient(RawClient client) } private async Task>> ListAsyncCore( + ListFilesRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default ) { + var _queryString = new Vapi.Net.Core.QueryStringBuilder.Builder(capacity: 1) + .Add("purpose", request.Purpose) + .MergeAdditional(options?.AdditionalQueryParameters) + .Build(); var _headers = await new Vapi.Net.Core.HeadersBuilder.Builder() .Add(_client.Options.Headers) .Add(_client.Options.AdditionalHeaders) @@ -29,6 +34,7 @@ private async Task>> ListAsyncCore( { Method = HttpMethod.Get, Path = "file", + QueryString = _queryString, Headers = _headers, Options = options, }, @@ -352,16 +358,23 @@ private async Task> UpdateAsyncCore( } } + /// + /// Returns files uploaded to the authenticated organization. + /// public WithRawResponseTask> ListAsync( + ListFilesRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default ) { return new WithRawResponseTask>( - ListAsyncCore(options, cancellationToken) + ListAsyncCore(request, options, cancellationToken) ); } + /// + /// Uploads a file for use with a Vapi knowledge base. + /// public WithRawResponseTask CreateAsync( CreateFileDto request, RequestOptions? options = null, @@ -371,6 +384,9 @@ public WithRawResponseTask CreateAsync( return new WithRawResponseTask(CreateAsyncCore(request, options, cancellationToken)); } + /// + /// Returns the uploaded file identified by its ID. + /// public WithRawResponseTask GetAsync( string id, GetFilesRequest request, @@ -381,6 +397,9 @@ public WithRawResponseTask GetAsync( return new WithRawResponseTask(GetAsyncCore(id, request, options, cancellationToken)); } + /// + /// Deletes the uploaded file identified by its ID. + /// public WithRawResponseTask DeleteAsync( string id, DeleteFilesRequest request, @@ -393,6 +412,9 @@ public WithRawResponseTask DeleteAsync( ); } + /// + /// Updates the name of the uploaded file identified by its ID. + /// public WithRawResponseTask UpdateAsync( string id, UpdateFileDto request, diff --git a/src/Vapi.Net/Files/IFilesClient.cs b/src/Vapi.Net/Files/IFilesClient.cs index 66dff31c..e8967bb6 100644 --- a/src/Vapi.Net/Files/IFilesClient.cs +++ b/src/Vapi.Net/Files/IFilesClient.cs @@ -2,17 +2,27 @@ namespace Vapi.Net; public partial interface IFilesClient { + /// + /// Returns files uploaded to the authenticated organization. + /// WithRawResponseTask> ListAsync( + ListFilesRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default ); + /// + /// Uploads a file for use with a Vapi knowledge base. + /// WithRawResponseTask CreateAsync( CreateFileDto request, RequestOptions? options = null, CancellationToken cancellationToken = default ); + /// + /// Returns the uploaded file identified by its ID. + /// WithRawResponseTask GetAsync( string id, GetFilesRequest request, @@ -20,6 +30,9 @@ WithRawResponseTask GetAsync( CancellationToken cancellationToken = default ); + /// + /// Deletes the uploaded file identified by its ID. + /// WithRawResponseTask DeleteAsync( string id, DeleteFilesRequest request, @@ -27,6 +40,9 @@ WithRawResponseTask DeleteAsync( CancellationToken cancellationToken = default ); + /// + /// Updates the name of the uploaded file identified by its ID. + /// WithRawResponseTask UpdateAsync( string id, UpdateFileDto request, diff --git a/src/Vapi.Net/Files/Requests/ListFilesRequest.cs b/src/Vapi.Net/Files/Requests/ListFilesRequest.cs new file mode 100644 index 00000000..3169c1d9 --- /dev/null +++ b/src/Vapi.Net/Files/Requests/ListFilesRequest.cs @@ -0,0 +1,17 @@ +using global::System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[Serializable] +public record ListFilesRequest +{ + [JsonIgnore] + public required string Purpose { get; set; } + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/IVapiClient.cs b/src/Vapi.Net/IVapiClient.cs index 422112fa..c2d0be38 100644 --- a/src/Vapi.Net/IVapiClient.cs +++ b/src/Vapi.Net/IVapiClient.cs @@ -13,6 +13,7 @@ public partial interface IVapiClient public IFilesClient Files { get; } public IStructuredOutputsClient StructuredOutputs { get; } public IInsightClient Insight { get; } + public IBoardClient Board { get; } public IEvalClient Eval { get; } public IObservabilityScorecardClient ObservabilityScorecard { get; } public IProviderResourcesClient ProviderResources { get; } diff --git a/src/Vapi.Net/Insight/IInsightClient.cs b/src/Vapi.Net/Insight/IInsightClient.cs index 802475f3..18d29b67 100644 --- a/src/Vapi.Net/Insight/IInsightClient.cs +++ b/src/Vapi.Net/Insight/IInsightClient.cs @@ -2,18 +2,27 @@ namespace Vapi.Net; public partial interface IInsightClient { + /// + /// Returns saved reporting insights for the authenticated organization. Filter results by ID or creation and update timestamps. + /// WithRawResponseTask InsightControllerFindAllAsync( InsightControllerFindAllRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default ); + /// + /// Creates a saved reporting insight that queries call data and presents the results as a bar chart, pie chart, line chart, or text value. + /// WithRawResponseTask InsightControllerCreateAsync( object request, RequestOptions? options = null, CancellationToken cancellationToken = default ); + /// + /// Returns the reporting insight identified by its ID. + /// WithRawResponseTask InsightControllerFindOneAsync( string id, InsightControllerFindOneRequest request, @@ -21,6 +30,9 @@ WithRawResponseTask InsightControllerFindOneAsync( CancellationToken cancellationToken = default ); + /// + /// Deletes the reporting insight identified by its ID. + /// WithRawResponseTask InsightControllerRemoveAsync( string id, InsightControllerRemoveRequest request, @@ -28,6 +40,9 @@ WithRawResponseTask InsightControllerRemoveAsync( CancellationToken cancellationToken = default ); + /// + /// Updates the reporting insight identified by its ID. + /// WithRawResponseTask InsightControllerUpdateAsync( string id, InsightControllerUpdateRequest request, @@ -35,6 +50,9 @@ WithRawResponseTask InsightControllerUpdateAsync( CancellationToken cancellationToken = default ); + /// + /// Runs a saved reporting insight, optionally overriding its time range and response format. + /// WithRawResponseTask InsightControllerRunAsync( string id, InsightRunDto request, @@ -42,6 +60,9 @@ WithRawResponseTask InsightControllerRunAsync( CancellationToken cancellationToken = default ); + /// + /// Runs an insight definition without first saving it, returning a preview of the resulting chart or text value. + /// WithRawResponseTask InsightControllerPreviewAsync( object request, RequestOptions? options = null, diff --git a/src/Vapi.Net/Insight/InsightClient.cs b/src/Vapi.Net/Insight/InsightClient.cs index 3ce566df..d541401f 100644 --- a/src/Vapi.Net/Insight/InsightClient.cs +++ b/src/Vapi.Net/Insight/InsightClient.cs @@ -18,10 +18,11 @@ private async Task> InsightControllerF CancellationToken cancellationToken = default ) { - var _queryString = new Vapi.Net.Core.QueryStringBuilder.Builder(capacity: 12) + var _queryString = new Vapi.Net.Core.QueryStringBuilder.Builder(capacity: 13) .Add("id", request.Id) .Add("page", request.Page) .Add("sortOrder", request.SortOrder) + .Add("sortBy", request.SortBy) .Add("limit", request.Limit) .Add("createdAtGt", request.CreatedAtGt) .Add("createdAtLt", request.CreatedAtLt) @@ -505,6 +506,9 @@ private async Task> InsightControllerPreview } } + /// + /// Returns saved reporting insights for the authenticated organization. Filter results by ID or creation and update timestamps. + /// public WithRawResponseTask InsightControllerFindAllAsync( InsightControllerFindAllRequest request, RequestOptions? options = null, @@ -516,6 +520,9 @@ public WithRawResponseTask InsightControllerFindAllAsy ); } + /// + /// Creates a saved reporting insight that queries call data and presents the results as a bar chart, pie chart, line chart, or text value. + /// public WithRawResponseTask InsightControllerCreateAsync( object request, RequestOptions? options = null, @@ -527,6 +534,9 @@ public WithRawResponseTask InsightControllerCreateAsync( ); } + /// + /// Returns the reporting insight identified by its ID. + /// public WithRawResponseTask InsightControllerFindOneAsync( string id, InsightControllerFindOneRequest request, @@ -539,6 +549,9 @@ public WithRawResponseTask InsightControllerFindOneAsync( ); } + /// + /// Deletes the reporting insight identified by its ID. + /// public WithRawResponseTask InsightControllerRemoveAsync( string id, InsightControllerRemoveRequest request, @@ -551,6 +564,9 @@ public WithRawResponseTask InsightControllerRemoveAsync( ); } + /// + /// Updates the reporting insight identified by its ID. + /// public WithRawResponseTask InsightControllerUpdateAsync( string id, InsightControllerUpdateRequest request, @@ -563,6 +579,9 @@ public WithRawResponseTask InsightControllerUpdateAsync( ); } + /// + /// Runs a saved reporting insight, optionally overriding its time range and response format. + /// public WithRawResponseTask InsightControllerRunAsync( string id, InsightRunDto request, @@ -575,6 +594,9 @@ public WithRawResponseTask InsightControllerRunAsync( ); } + /// + /// Runs an insight definition without first saving it, returning a preview of the resulting chart or text value. + /// public WithRawResponseTask InsightControllerPreviewAsync( object request, RequestOptions? options = null, diff --git a/src/Vapi.Net/Insight/Requests/InsightControllerFindAllRequest.cs b/src/Vapi.Net/Insight/Requests/InsightControllerFindAllRequest.cs index d6b502e5..d74d859c 100644 --- a/src/Vapi.Net/Insight/Requests/InsightControllerFindAllRequest.cs +++ b/src/Vapi.Net/Insight/Requests/InsightControllerFindAllRequest.cs @@ -6,6 +6,9 @@ namespace Vapi.Net; [Serializable] public record InsightControllerFindAllRequest { + /// + /// Filters reporting insights by ID. + /// [JsonIgnore] public string? Id { get; set; } @@ -21,6 +24,12 @@ public record InsightControllerFindAllRequest [JsonIgnore] public InsightControllerFindAllRequestSortOrder? SortOrder { get; set; } + /// + /// This is the column to sort by. Defaults to 'createdAt'. + /// + [JsonIgnore] + public InsightControllerFindAllRequestSortBy? SortBy { get; set; } + /// /// This is the maximum number of items to return. Defaults to 100. /// diff --git a/src/Vapi.Net/Insight/Requests/InsightRunDto.cs b/src/Vapi.Net/Insight/Requests/InsightRunDto.cs index cd18d6a1..971f06c3 100644 --- a/src/Vapi.Net/Insight/Requests/InsightRunDto.cs +++ b/src/Vapi.Net/Insight/Requests/InsightRunDto.cs @@ -6,6 +6,9 @@ namespace Vapi.Net; [Serializable] public record InsightRunDto { + /// + /// Output-formatting instructions applied to the insight run. + /// [JsonPropertyName("formatPlan")] public InsightRunFormatPlan? FormatPlan { get; set; } @@ -21,6 +24,13 @@ public record InsightRunDto [JsonPropertyName("timeRangeOverride")] public InsightTimeRangeWithStep? TimeRangeOverride { get; set; } + /// + /// Optional runtime assistant scope for dashboards. + /// This is applied to call-table queries without mutating the saved insight. + /// + [JsonPropertyName("assistantId")] + public string? AssistantId { get; set; } + /// public override string ToString() { diff --git a/src/Vapi.Net/Insight/Types/InsightControllerFindAllRequestSortBy.cs b/src/Vapi.Net/Insight/Types/InsightControllerFindAllRequestSortBy.cs new file mode 100644 index 00000000..a5392308 --- /dev/null +++ b/src/Vapi.Net/Insight/Types/InsightControllerFindAllRequestSortBy.cs @@ -0,0 +1,89 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(InsightControllerFindAllRequestSortBySerializer))] +public enum InsightControllerFindAllRequestSortBy +{ + [EnumMember(Value = "createdAt")] + CreatedAt, + + [EnumMember(Value = "duration")] + Duration, + + [EnumMember(Value = "cost")] + Cost, +} + +internal class InsightControllerFindAllRequestSortBySerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + InsightControllerFindAllRequestSortBy + > _stringToEnum = new() + { + { "createdAt", InsightControllerFindAllRequestSortBy.CreatedAt }, + { "duration", InsightControllerFindAllRequestSortBy.Duration }, + { "cost", InsightControllerFindAllRequestSortBy.Cost }, + }; + + private static readonly global::System.Collections.Generic.Dictionary< + InsightControllerFindAllRequestSortBy, + string + > _enumToString = new() + { + { InsightControllerFindAllRequestSortBy.CreatedAt, "createdAt" }, + { InsightControllerFindAllRequestSortBy.Duration, "duration" }, + { InsightControllerFindAllRequestSortBy.Cost, "cost" }, + }; + + public override InsightControllerFindAllRequestSortBy Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + InsightControllerFindAllRequestSortBy value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override InsightControllerFindAllRequestSortBy ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + InsightControllerFindAllRequestSortBy value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/ObservabilityScorecard/IObservabilityScorecardClient.cs b/src/Vapi.Net/ObservabilityScorecard/IObservabilityScorecardClient.cs index a75ca484..1fff4aab 100644 --- a/src/Vapi.Net/ObservabilityScorecard/IObservabilityScorecardClient.cs +++ b/src/Vapi.Net/ObservabilityScorecard/IObservabilityScorecardClient.cs @@ -2,6 +2,9 @@ namespace Vapi.Net; public partial interface IObservabilityScorecardClient { + /// + /// Returns the scorecard identified by its ID. + /// WithRawResponseTask ScorecardControllerGetAsync( string id, ScorecardControllerGetRequest request, @@ -9,6 +12,9 @@ WithRawResponseTask ScorecardControllerGetAsync( CancellationToken cancellationToken = default ); + /// + /// Deletes the scorecard identified by its ID. + /// WithRawResponseTask ScorecardControllerRemoveAsync( string id, ScorecardControllerRemoveRequest request, @@ -16,6 +22,9 @@ WithRawResponseTask ScorecardControllerRemoveAsync( CancellationToken cancellationToken = default ); + /// + /// Updates the scorecard identified by its ID. + /// WithRawResponseTask ScorecardControllerUpdateAsync( string id, UpdateScorecardDto request, @@ -23,12 +32,18 @@ WithRawResponseTask ScorecardControllerUpdateAsync( CancellationToken cancellationToken = default ); + /// + /// Returns scorecards for the authenticated organization. Filter results by ID or creation and update timestamps. + /// WithRawResponseTask ScorecardControllerGetPaginatedAsync( ScorecardControllerGetPaginatedRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default ); + /// + /// Creates a scorecard containing metrics, scoring conditions, and optional links to assistants whose calls should be evaluated. + /// WithRawResponseTask ScorecardControllerCreateAsync( CreateScorecardDto request, RequestOptions? options = null, diff --git a/src/Vapi.Net/ObservabilityScorecard/ObservabilityScorecardClient.cs b/src/Vapi.Net/ObservabilityScorecard/ObservabilityScorecardClient.cs index 981cdadb..f4a141fb 100644 --- a/src/Vapi.Net/ObservabilityScorecard/ObservabilityScorecardClient.cs +++ b/src/Vapi.Net/ObservabilityScorecard/ObservabilityScorecardClient.cs @@ -229,10 +229,11 @@ private async Task< CancellationToken cancellationToken = default ) { - var _queryString = new Vapi.Net.Core.QueryStringBuilder.Builder(capacity: 12) + var _queryString = new Vapi.Net.Core.QueryStringBuilder.Builder(capacity: 13) .Add("id", request.Id) .Add("page", request.Page) .Add("sortOrder", request.SortOrder) + .Add("sortBy", request.SortBy) .Add("limit", request.Limit) .Add("createdAtGt", request.CreatedAtGt) .Add("createdAtLt", request.CreatedAtLt) @@ -370,6 +371,9 @@ private async Task> ScorecardControllerCreateAsyncCor } } + /// + /// Returns the scorecard identified by its ID. + /// public WithRawResponseTask ScorecardControllerGetAsync( string id, ScorecardControllerGetRequest request, @@ -382,6 +386,9 @@ public WithRawResponseTask ScorecardControllerGetAsync( ); } + /// + /// Deletes the scorecard identified by its ID. + /// public WithRawResponseTask ScorecardControllerRemoveAsync( string id, ScorecardControllerRemoveRequest request, @@ -394,6 +401,9 @@ public WithRawResponseTask ScorecardControllerRemoveAsync( ); } + /// + /// Updates the scorecard identified by its ID. + /// public WithRawResponseTask ScorecardControllerUpdateAsync( string id, UpdateScorecardDto request, @@ -406,6 +416,9 @@ public WithRawResponseTask ScorecardControllerUpdateAsync( ); } + /// + /// Returns scorecards for the authenticated organization. Filter results by ID or creation and update timestamps. + /// public WithRawResponseTask ScorecardControllerGetPaginatedAsync( ScorecardControllerGetPaginatedRequest request, RequestOptions? options = null, @@ -417,6 +430,9 @@ public WithRawResponseTask ScorecardControllerGetPag ); } + /// + /// Creates a scorecard containing metrics, scoring conditions, and optional links to assistants whose calls should be evaluated. + /// public WithRawResponseTask ScorecardControllerCreateAsync( CreateScorecardDto request, RequestOptions? options = null, diff --git a/src/Vapi.Net/ObservabilityScorecard/Requests/ScorecardControllerGetPaginatedRequest.cs b/src/Vapi.Net/ObservabilityScorecard/Requests/ScorecardControllerGetPaginatedRequest.cs index 0ae18025..e9ed8872 100644 --- a/src/Vapi.Net/ObservabilityScorecard/Requests/ScorecardControllerGetPaginatedRequest.cs +++ b/src/Vapi.Net/ObservabilityScorecard/Requests/ScorecardControllerGetPaginatedRequest.cs @@ -6,6 +6,9 @@ namespace Vapi.Net; [Serializable] public record ScorecardControllerGetPaginatedRequest { + /// + /// Filters scorecards by ID. + /// [JsonIgnore] public string? Id { get; set; } @@ -21,6 +24,12 @@ public record ScorecardControllerGetPaginatedRequest [JsonIgnore] public ScorecardControllerGetPaginatedRequestSortOrder? SortOrder { get; set; } + /// + /// This is the column to sort by. Defaults to 'createdAt'. + /// + [JsonIgnore] + public ScorecardControllerGetPaginatedRequestSortBy? SortBy { get; set; } + /// /// This is the maximum number of items to return. Defaults to 100. /// diff --git a/src/Vapi.Net/ObservabilityScorecard/Types/ScorecardControllerGetPaginatedRequestSortBy.cs b/src/Vapi.Net/ObservabilityScorecard/Types/ScorecardControllerGetPaginatedRequestSortBy.cs new file mode 100644 index 00000000..2dffefdd --- /dev/null +++ b/src/Vapi.Net/ObservabilityScorecard/Types/ScorecardControllerGetPaginatedRequestSortBy.cs @@ -0,0 +1,89 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(ScorecardControllerGetPaginatedRequestSortBySerializer))] +public enum ScorecardControllerGetPaginatedRequestSortBy +{ + [EnumMember(Value = "createdAt")] + CreatedAt, + + [EnumMember(Value = "duration")] + Duration, + + [EnumMember(Value = "cost")] + Cost, +} + +internal class ScorecardControllerGetPaginatedRequestSortBySerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + ScorecardControllerGetPaginatedRequestSortBy + > _stringToEnum = new() + { + { "createdAt", ScorecardControllerGetPaginatedRequestSortBy.CreatedAt }, + { "duration", ScorecardControllerGetPaginatedRequestSortBy.Duration }, + { "cost", ScorecardControllerGetPaginatedRequestSortBy.Cost }, + }; + + private static readonly global::System.Collections.Generic.Dictionary< + ScorecardControllerGetPaginatedRequestSortBy, + string + > _enumToString = new() + { + { ScorecardControllerGetPaginatedRequestSortBy.CreatedAt, "createdAt" }, + { ScorecardControllerGetPaginatedRequestSortBy.Duration, "duration" }, + { ScorecardControllerGetPaginatedRequestSortBy.Cost, "cost" }, + }; + + public override ScorecardControllerGetPaginatedRequestSortBy Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + ScorecardControllerGetPaginatedRequestSortBy value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override ScorecardControllerGetPaginatedRequestSortBy ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + ScorecardControllerGetPaginatedRequestSortBy value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/PhoneNumbers/IPhoneNumbersClient.cs b/src/Vapi.Net/PhoneNumbers/IPhoneNumbersClient.cs index 85c66158..3fab79ca 100644 --- a/src/Vapi.Net/PhoneNumbers/IPhoneNumbersClient.cs +++ b/src/Vapi.Net/PhoneNumbers/IPhoneNumbersClient.cs @@ -2,24 +2,36 @@ namespace Vapi.Net; public partial interface IPhoneNumbersClient { + /// + /// Returns phone numbers for the authenticated organization. Filter results by creation or update timestamps and limit the number returned. + /// WithRawResponseTask> ListAsync( ListPhoneNumbersRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default ); + /// + /// Creates a Vapi phone number or imports a phone number from a supported provider, including Twilio, Vonage, Telnyx, or a bring-your-own provider. + /// WithRawResponseTask CreateAsync( object request, RequestOptions? options = null, CancellationToken cancellationToken = default ); + /// + /// Returns a paginated list of phone numbers for the authenticated organization. Search by name, number, or SIP URI using a partial, case-insensitive match, and filter by creation or update timestamps. + /// WithRawResponseTask PhoneNumberControllerFindAllPaginatedAsync( PhoneNumberControllerFindAllPaginatedRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default ); + /// + /// Returns the phone number resource identified by its ID. + /// WithRawResponseTask GetAsync( string id, GetPhoneNumbersRequest request, @@ -27,6 +39,9 @@ WithRawResponseTask GetAsync( CancellationToken cancellationToken = default ); + /// + /// Deletes the phone number resource identified by its ID. + /// WithRawResponseTask DeleteAsync( string id, DeletePhoneNumbersRequest request, @@ -34,6 +49,9 @@ WithRawResponseTask DeleteAsync( CancellationToken cancellationToken = default ); + /// + /// Updates the specified fields of the phone number resource identified by its ID. + /// WithRawResponseTask UpdateAsync( string id, UpdatePhoneNumbersRequest request, diff --git a/src/Vapi.Net/PhoneNumbers/PhoneNumbersClient.cs b/src/Vapi.Net/PhoneNumbers/PhoneNumbersClient.cs index 4d465220..c83f21cc 100644 --- a/src/Vapi.Net/PhoneNumbers/PhoneNumbersClient.cs +++ b/src/Vapi.Net/PhoneNumbers/PhoneNumbersClient.cs @@ -164,10 +164,11 @@ private async Task< CancellationToken cancellationToken = default ) { - var _queryString = new Vapi.Net.Core.QueryStringBuilder.Builder(capacity: 12) + var _queryString = new Vapi.Net.Core.QueryStringBuilder.Builder(capacity: 13) .Add("search", request.Search) .Add("page", request.Page) .Add("sortOrder", request.SortOrder) + .Add("sortBy", request.SortBy) .Add("limit", request.Limit) .Add("createdAtGt", request.CreatedAtGt) .Add("createdAtLt", request.CreatedAtLt) @@ -450,6 +451,9 @@ private async Task> UpdateAsyncCore( } } + /// + /// Returns phone numbers for the authenticated organization. Filter results by creation or update timestamps and limit the number returned. + /// public WithRawResponseTask> ListAsync( ListPhoneNumbersRequest request, RequestOptions? options = null, @@ -461,6 +465,9 @@ public WithRawResponseTask> ListAsync( ); } + /// + /// Creates a Vapi phone number or imports a phone number from a supported provider, including Twilio, Vonage, Telnyx, or a bring-your-own provider. + /// public WithRawResponseTask CreateAsync( object request, RequestOptions? options = null, @@ -472,6 +479,9 @@ public WithRawResponseTask CreateAsync( ); } + /// + /// Returns a paginated list of phone numbers for the authenticated organization. Search by name, number, or SIP URI using a partial, case-insensitive match, and filter by creation or update timestamps. + /// public WithRawResponseTask PhoneNumberControllerFindAllPaginatedAsync( PhoneNumberControllerFindAllPaginatedRequest request, RequestOptions? options = null, @@ -483,6 +493,9 @@ public WithRawResponseTask PhoneNumberControllerFi ); } + /// + /// Returns the phone number resource identified by its ID. + /// public WithRawResponseTask GetAsync( string id, GetPhoneNumbersRequest request, @@ -495,6 +508,9 @@ public WithRawResponseTask GetAsync( ); } + /// + /// Deletes the phone number resource identified by its ID. + /// public WithRawResponseTask DeleteAsync( string id, DeletePhoneNumbersRequest request, @@ -507,6 +523,9 @@ public WithRawResponseTask DeleteAsync( ); } + /// + /// Updates the specified fields of the phone number resource identified by its ID. + /// public WithRawResponseTask UpdateAsync( string id, UpdatePhoneNumbersRequest request, diff --git a/src/Vapi.Net/PhoneNumbers/Requests/PhoneNumberControllerFindAllPaginatedRequest.cs b/src/Vapi.Net/PhoneNumbers/Requests/PhoneNumberControllerFindAllPaginatedRequest.cs index 7ba0d2a8..b7bed617 100644 --- a/src/Vapi.Net/PhoneNumbers/Requests/PhoneNumberControllerFindAllPaginatedRequest.cs +++ b/src/Vapi.Net/PhoneNumbers/Requests/PhoneNumberControllerFindAllPaginatedRequest.cs @@ -24,6 +24,12 @@ public record PhoneNumberControllerFindAllPaginatedRequest [JsonIgnore] public PhoneNumberControllerFindAllPaginatedRequestSortOrder? SortOrder { get; set; } + /// + /// This is the column to sort by. Defaults to 'createdAt'. + /// + [JsonIgnore] + public PhoneNumberControllerFindAllPaginatedRequestSortBy? SortBy { get; set; } + /// /// This is the maximum number of items to return. Defaults to 100. /// diff --git a/src/Vapi.Net/PhoneNumbers/Types/PhoneNumberControllerFindAllPaginatedRequestSortBy.cs b/src/Vapi.Net/PhoneNumbers/Types/PhoneNumberControllerFindAllPaginatedRequestSortBy.cs new file mode 100644 index 00000000..4ed02970 --- /dev/null +++ b/src/Vapi.Net/PhoneNumbers/Types/PhoneNumberControllerFindAllPaginatedRequestSortBy.cs @@ -0,0 +1,89 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(PhoneNumberControllerFindAllPaginatedRequestSortBySerializer))] +public enum PhoneNumberControllerFindAllPaginatedRequestSortBy +{ + [EnumMember(Value = "createdAt")] + CreatedAt, + + [EnumMember(Value = "duration")] + Duration, + + [EnumMember(Value = "cost")] + Cost, +} + +internal class PhoneNumberControllerFindAllPaginatedRequestSortBySerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + PhoneNumberControllerFindAllPaginatedRequestSortBy + > _stringToEnum = new() + { + { "createdAt", PhoneNumberControllerFindAllPaginatedRequestSortBy.CreatedAt }, + { "duration", PhoneNumberControllerFindAllPaginatedRequestSortBy.Duration }, + { "cost", PhoneNumberControllerFindAllPaginatedRequestSortBy.Cost }, + }; + + private static readonly global::System.Collections.Generic.Dictionary< + PhoneNumberControllerFindAllPaginatedRequestSortBy, + string + > _enumToString = new() + { + { PhoneNumberControllerFindAllPaginatedRequestSortBy.CreatedAt, "createdAt" }, + { PhoneNumberControllerFindAllPaginatedRequestSortBy.Duration, "duration" }, + { PhoneNumberControllerFindAllPaginatedRequestSortBy.Cost, "cost" }, + }; + + public override PhoneNumberControllerFindAllPaginatedRequestSortBy Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + PhoneNumberControllerFindAllPaginatedRequestSortBy value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override PhoneNumberControllerFindAllPaginatedRequestSortBy ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + PhoneNumberControllerFindAllPaginatedRequestSortBy value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/ProviderResources/IProviderResourcesClient.cs b/src/Vapi.Net/ProviderResources/IProviderResourcesClient.cs index d7e5faf2..8d80f585 100644 --- a/src/Vapi.Net/ProviderResources/IProviderResourcesClient.cs +++ b/src/Vapi.Net/ProviderResources/IProviderResourcesClient.cs @@ -2,6 +2,9 @@ namespace Vapi.Net; public partial interface IProviderResourcesClient { + /// + /// Returns a paginated list of provider resources for the authenticated organization. Filter pronunciation dictionaries by provider, resource ID, or creation and update timestamps. + /// WithRawResponseTask ProviderResourceControllerGetProviderResourcesPaginatedAsync( ProviderResourceControllerGetProviderResourcesPaginatedRequestProvider provider, ProviderResourceControllerGetProviderResourcesPaginatedRequestResourceName resourceName, @@ -10,6 +13,9 @@ WithRawResponseTask ProviderResourceControlle CancellationToken cancellationToken = default ); + /// + /// Creates a pronunciation-dictionary resource for a supported provider, currently Cartesia or ElevenLabs. + /// WithRawResponseTask ProviderResourceControllerCreateProviderResourceAsync( ProviderResourceControllerCreateProviderResourceRequestProvider provider, ProviderResourceControllerCreateProviderResourceRequestResourceName resourceName, @@ -18,6 +24,9 @@ WithRawResponseTask ProviderResourceControllerCreateProviderRe CancellationToken cancellationToken = default ); + /// + /// Returns the provider resource identified by its Vapi resource ID. + /// WithRawResponseTask ProviderResourceControllerGetProviderResourceAsync( ProviderResourceControllerGetProviderResourceRequestProvider provider, ProviderResourceControllerGetProviderResourceRequestResourceName resourceName, @@ -27,6 +36,9 @@ WithRawResponseTask ProviderResourceControllerGetProviderResou CancellationToken cancellationToken = default ); + /// + /// Deletes the provider resource identified by its Vapi resource ID. + /// WithRawResponseTask ProviderResourceControllerDeleteProviderResourceAsync( ProviderResourceControllerDeleteProviderResourceRequestProvider provider, ProviderResourceControllerDeleteProviderResourceRequestResourceName resourceName, @@ -36,6 +48,9 @@ WithRawResponseTask ProviderResourceControllerDeleteProviderRe CancellationToken cancellationToken = default ); + /// + /// Updates the provider resource identified by its Vapi resource ID. + /// WithRawResponseTask ProviderResourceControllerUpdateProviderResourceAsync( ProviderResourceControllerUpdateProviderResourceRequestProvider provider, ProviderResourceControllerUpdateProviderResourceRequestResourceName resourceName, diff --git a/src/Vapi.Net/ProviderResources/ProviderResourcesClient.cs b/src/Vapi.Net/ProviderResources/ProviderResourcesClient.cs index 96bca57d..600bafcc 100644 --- a/src/Vapi.Net/ProviderResources/ProviderResourcesClient.cs +++ b/src/Vapi.Net/ProviderResources/ProviderResourcesClient.cs @@ -22,11 +22,12 @@ private async Task< CancellationToken cancellationToken = default ) { - var _queryString = new Vapi.Net.Core.QueryStringBuilder.Builder(capacity: 13) + var _queryString = new Vapi.Net.Core.QueryStringBuilder.Builder(capacity: 14) .Add("id", request.Id) .Add("resourceId", request.ResourceId) .Add("page", request.Page) .Add("sortOrder", request.SortOrder) + .Add("sortBy", request.SortBy) .Add("limit", request.Limit) .Add("createdAtGt", request.CreatedAtGt) .Add("createdAtLt", request.CreatedAtLt) @@ -438,6 +439,9 @@ private async Task< } } + /// + /// Returns a paginated list of provider resources for the authenticated organization. Filter pronunciation dictionaries by provider, resource ID, or creation and update timestamps. + /// public WithRawResponseTask ProviderResourceControllerGetProviderResourcesPaginatedAsync( ProviderResourceControllerGetProviderResourcesPaginatedRequestProvider provider, ProviderResourceControllerGetProviderResourcesPaginatedRequestResourceName resourceName, @@ -457,6 +461,9 @@ public WithRawResponseTask ProviderResourceCo ); } + /// + /// Creates a pronunciation-dictionary resource for a supported provider, currently Cartesia or ElevenLabs. + /// public WithRawResponseTask ProviderResourceControllerCreateProviderResourceAsync( ProviderResourceControllerCreateProviderResourceRequestProvider provider, ProviderResourceControllerCreateProviderResourceRequestResourceName resourceName, @@ -476,6 +483,9 @@ public WithRawResponseTask ProviderResourceControllerCreatePro ); } + /// + /// Returns the provider resource identified by its Vapi resource ID. + /// public WithRawResponseTask ProviderResourceControllerGetProviderResourceAsync( ProviderResourceControllerGetProviderResourceRequestProvider provider, ProviderResourceControllerGetProviderResourceRequestResourceName resourceName, @@ -497,6 +507,9 @@ public WithRawResponseTask ProviderResourceControllerGetProvid ); } + /// + /// Deletes the provider resource identified by its Vapi resource ID. + /// public WithRawResponseTask ProviderResourceControllerDeleteProviderResourceAsync( ProviderResourceControllerDeleteProviderResourceRequestProvider provider, ProviderResourceControllerDeleteProviderResourceRequestResourceName resourceName, @@ -518,6 +531,9 @@ public WithRawResponseTask ProviderResourceControllerDeletePro ); } + /// + /// Updates the provider resource identified by its Vapi resource ID. + /// public WithRawResponseTask ProviderResourceControllerUpdateProviderResourceAsync( ProviderResourceControllerUpdateProviderResourceRequestProvider provider, ProviderResourceControllerUpdateProviderResourceRequestResourceName resourceName, diff --git a/src/Vapi.Net/ProviderResources/Requests/ProviderResourceControllerGetProviderResourcesPaginatedRequest.cs b/src/Vapi.Net/ProviderResources/Requests/ProviderResourceControllerGetProviderResourcesPaginatedRequest.cs index dff9fdc2..c420e6b9 100644 --- a/src/Vapi.Net/ProviderResources/Requests/ProviderResourceControllerGetProviderResourcesPaginatedRequest.cs +++ b/src/Vapi.Net/ProviderResources/Requests/ProviderResourceControllerGetProviderResourcesPaginatedRequest.cs @@ -6,9 +6,15 @@ namespace Vapi.Net; [Serializable] public record ProviderResourceControllerGetProviderResourcesPaginatedRequest { + /// + /// Filters provider resources by their resource ID. + /// [JsonIgnore] public string? Id { get; set; } + /// + /// Filters provider resources by their provider-specific resource ID. + /// [JsonIgnore] public string? ResourceId { get; set; } @@ -24,6 +30,12 @@ public record ProviderResourceControllerGetProviderResourcesPaginatedRequest [JsonIgnore] public ProviderResourceControllerGetProviderResourcesPaginatedRequestSortOrder? SortOrder { get; set; } + /// + /// This is the column to sort by. Defaults to 'createdAt'. + /// + [JsonIgnore] + public ProviderResourceControllerGetProviderResourcesPaginatedRequestSortBy? SortBy { get; set; } + /// /// This is the maximum number of items to return. Defaults to 100. /// diff --git a/src/Vapi.Net/ProviderResources/Types/ProviderResourceControllerGetProviderResourcesPaginatedRequestSortBy.cs b/src/Vapi.Net/ProviderResources/Types/ProviderResourceControllerGetProviderResourcesPaginatedRequestSortBy.cs new file mode 100644 index 00000000..7668e818 --- /dev/null +++ b/src/Vapi.Net/ProviderResources/Types/ProviderResourceControllerGetProviderResourcesPaginatedRequestSortBy.cs @@ -0,0 +1,103 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter( + typeof(ProviderResourceControllerGetProviderResourcesPaginatedRequestSortBySerializer) +)] +public enum ProviderResourceControllerGetProviderResourcesPaginatedRequestSortBy +{ + [EnumMember(Value = "createdAt")] + CreatedAt, + + [EnumMember(Value = "duration")] + Duration, + + [EnumMember(Value = "cost")] + Cost, +} + +internal class ProviderResourceControllerGetProviderResourcesPaginatedRequestSortBySerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + ProviderResourceControllerGetProviderResourcesPaginatedRequestSortBy + > _stringToEnum = new() + { + { + "createdAt", + ProviderResourceControllerGetProviderResourcesPaginatedRequestSortBy.CreatedAt + }, + { + "duration", + ProviderResourceControllerGetProviderResourcesPaginatedRequestSortBy.Duration + }, + { "cost", ProviderResourceControllerGetProviderResourcesPaginatedRequestSortBy.Cost }, + }; + + private static readonly global::System.Collections.Generic.Dictionary< + ProviderResourceControllerGetProviderResourcesPaginatedRequestSortBy, + string + > _enumToString = new() + { + { + ProviderResourceControllerGetProviderResourcesPaginatedRequestSortBy.CreatedAt, + "createdAt" + }, + { + ProviderResourceControllerGetProviderResourcesPaginatedRequestSortBy.Duration, + "duration" + }, + { ProviderResourceControllerGetProviderResourcesPaginatedRequestSortBy.Cost, "cost" }, + }; + + public override ProviderResourceControllerGetProviderResourcesPaginatedRequestSortBy Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + ProviderResourceControllerGetProviderResourcesPaginatedRequestSortBy value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override ProviderResourceControllerGetProviderResourcesPaginatedRequestSortBy ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + ProviderResourceControllerGetProviderResourcesPaginatedRequestSortBy value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Sessions/Requests/ListSessionsRequest.cs b/src/Vapi.Net/Sessions/Requests/ListSessionsRequest.cs index adf62b0c..f58a4479 100644 --- a/src/Vapi.Net/Sessions/Requests/ListSessionsRequest.cs +++ b/src/Vapi.Net/Sessions/Requests/ListSessionsRequest.cs @@ -71,6 +71,14 @@ public record ListSessionsRequest [JsonIgnore] public string? AssistantOverrides { get; set; } + /// + /// These are the overrides applied when the call targets a `squadId`. Mirrors + /// the call-level `squadOverrides` — use this instead of `assistantOverrides` + /// when the campaign or call is squad-based. + /// + [JsonIgnore] + public string? SquadOverrides { get; set; } + /// /// This is the number of the customer. /// @@ -125,6 +133,12 @@ public record ListSessionsRequest [JsonIgnore] public ListSessionsRequestSortOrder? SortOrder { get; set; } + /// + /// This is the column to sort by. Defaults to 'createdAt'. + /// + [JsonIgnore] + public ListSessionsRequestSortBy? SortBy { get; set; } + /// /// This is the maximum number of items to return. Defaults to 100. /// diff --git a/src/Vapi.Net/Sessions/SessionsClient.cs b/src/Vapi.Net/Sessions/SessionsClient.cs index a4b5f806..d1ae1bb7 100644 --- a/src/Vapi.Net/Sessions/SessionsClient.cs +++ b/src/Vapi.Net/Sessions/SessionsClient.cs @@ -18,7 +18,7 @@ private async Task> ListAsyncCore( CancellationToken cancellationToken = default ) { - var _queryString = new Vapi.Net.Core.QueryStringBuilder.Builder(capacity: 27) + var _queryString = new Vapi.Net.Core.QueryStringBuilder.Builder(capacity: 29) .Add("id", request.Id) .Add("name", request.Name) .Add("assistantId", request.AssistantId) @@ -28,6 +28,7 @@ private async Task> ListAsyncCore( .Add("numberE164CheckEnabled", request.NumberE164CheckEnabled) .Add("extension", request.Extension) .Add("assistantOverrides", request.AssistantOverrides) + .Add("squadOverrides", request.SquadOverrides) .Add("number", request.Number) .Add("sipUri", request.SipUri) .Add("email", request.Email) @@ -37,6 +38,7 @@ private async Task> ListAsyncCore( .Add("phoneNumberIdAny", request.PhoneNumberIdAny) .Add("page", request.Page) .Add("sortOrder", request.SortOrder) + .Add("sortBy", request.SortBy) .Add("limit", request.Limit) .Add("createdAtGt", request.CreatedAtGt) .Add("createdAtLt", request.CreatedAtLt) diff --git a/src/Vapi.Net/Sessions/Types/ListSessionsRequestSortBy.cs b/src/Vapi.Net/Sessions/Types/ListSessionsRequestSortBy.cs new file mode 100644 index 00000000..4e7439b4 --- /dev/null +++ b/src/Vapi.Net/Sessions/Types/ListSessionsRequestSortBy.cs @@ -0,0 +1,89 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(ListSessionsRequestSortBySerializer))] +public enum ListSessionsRequestSortBy +{ + [EnumMember(Value = "createdAt")] + CreatedAt, + + [EnumMember(Value = "duration")] + Duration, + + [EnumMember(Value = "cost")] + Cost, +} + +internal class ListSessionsRequestSortBySerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + ListSessionsRequestSortBy + > _stringToEnum = new() + { + { "createdAt", ListSessionsRequestSortBy.CreatedAt }, + { "duration", ListSessionsRequestSortBy.Duration }, + { "cost", ListSessionsRequestSortBy.Cost }, + }; + + private static readonly global::System.Collections.Generic.Dictionary< + ListSessionsRequestSortBy, + string + > _enumToString = new() + { + { ListSessionsRequestSortBy.CreatedAt, "createdAt" }, + { ListSessionsRequestSortBy.Duration, "duration" }, + { ListSessionsRequestSortBy.Cost, "cost" }, + }; + + public override ListSessionsRequestSortBy Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + ListSessionsRequestSortBy value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override ListSessionsRequestSortBy ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + ListSessionsRequestSortBy value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Squads/ISquadsClient.cs b/src/Vapi.Net/Squads/ISquadsClient.cs index de35c477..4fc1a966 100644 --- a/src/Vapi.Net/Squads/ISquadsClient.cs +++ b/src/Vapi.Net/Squads/ISquadsClient.cs @@ -2,18 +2,27 @@ namespace Vapi.Net; public partial interface ISquadsClient { + /// + /// Returns squads for the authenticated organization. Filter results by creation or update timestamps and limit the number returned. + /// WithRawResponseTask> ListAsync( ListSquadsRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default ); + /// + /// Creates a squad that coordinates multiple assistants and their handoffs during a conversation. + /// WithRawResponseTask CreateAsync( CreateSquadDto request, RequestOptions? options = null, CancellationToken cancellationToken = default ); + /// + /// Returns the squad identified by its ID. + /// WithRawResponseTask GetAsync( string id, GetSquadsRequest request, @@ -21,6 +30,9 @@ WithRawResponseTask GetAsync( CancellationToken cancellationToken = default ); + /// + /// Deletes the squad identified by its ID. + /// WithRawResponseTask DeleteAsync( string id, DeleteSquadsRequest request, @@ -28,6 +40,9 @@ WithRawResponseTask DeleteAsync( CancellationToken cancellationToken = default ); + /// + /// Updates the specified fields of the squad identified by its ID. + /// WithRawResponseTask UpdateAsync( string id, UpdateSquadDto request, diff --git a/src/Vapi.Net/Squads/SquadsClient.cs b/src/Vapi.Net/Squads/SquadsClient.cs index 88fa8e8c..c44e411c 100644 --- a/src/Vapi.Net/Squads/SquadsClient.cs +++ b/src/Vapi.Net/Squads/SquadsClient.cs @@ -356,6 +356,9 @@ private async Task> UpdateAsyncCore( } } + /// + /// Returns squads for the authenticated organization. Filter results by creation or update timestamps and limit the number returned. + /// public WithRawResponseTask> ListAsync( ListSquadsRequest request, RequestOptions? options = null, @@ -367,6 +370,9 @@ public WithRawResponseTask> ListAsync( ); } + /// + /// Creates a squad that coordinates multiple assistants and their handoffs during a conversation. + /// public WithRawResponseTask CreateAsync( CreateSquadDto request, RequestOptions? options = null, @@ -376,6 +382,9 @@ public WithRawResponseTask CreateAsync( return new WithRawResponseTask(CreateAsyncCore(request, options, cancellationToken)); } + /// + /// Returns the squad identified by its ID. + /// public WithRawResponseTask GetAsync( string id, GetSquadsRequest request, @@ -388,6 +397,9 @@ public WithRawResponseTask GetAsync( ); } + /// + /// Deletes the squad identified by its ID. + /// public WithRawResponseTask DeleteAsync( string id, DeleteSquadsRequest request, @@ -400,6 +412,9 @@ public WithRawResponseTask DeleteAsync( ); } + /// + /// Updates the specified fields of the squad identified by its ID. + /// public WithRawResponseTask UpdateAsync( string id, UpdateSquadDto request, diff --git a/src/Vapi.Net/StructuredOutputs/IStructuredOutputsClient.cs b/src/Vapi.Net/StructuredOutputs/IStructuredOutputsClient.cs index 6cc231a1..d7db2422 100644 --- a/src/Vapi.Net/StructuredOutputs/IStructuredOutputsClient.cs +++ b/src/Vapi.Net/StructuredOutputs/IStructuredOutputsClient.cs @@ -1,19 +1,30 @@ +using OneOf; + namespace Vapi.Net; public partial interface IStructuredOutputsClient { + /// + /// Returns structured-output definitions for the authenticated organization. Filter results by ID, name, or creation and update timestamps. + /// WithRawResponseTask StructuredOutputControllerFindAllAsync( StructuredOutputControllerFindAllRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default ); + /// + /// Creates a reusable definition for extracting validated data from conversations using an AI model or regular expression. + /// WithRawResponseTask StructuredOutputControllerCreateAsync( CreateStructuredOutputDto request, RequestOptions? options = null, CancellationToken cancellationToken = default ); + /// + /// Returns the structured-output definition identified by its ID. + /// WithRawResponseTask StructuredOutputControllerFindOneAsync( string id, StructuredOutputControllerFindOneRequest request, @@ -21,6 +32,9 @@ WithRawResponseTask StructuredOutputControllerFindOneAsync( CancellationToken cancellationToken = default ); + /// + /// Deletes the structured-output definition identified by its ID. + /// WithRawResponseTask StructuredOutputControllerRemoveAsync( string id, StructuredOutputControllerRemoveRequest request, @@ -28,6 +42,9 @@ WithRawResponseTask StructuredOutputControllerRemoveAsync( CancellationToken cancellationToken = default ); + /// + /// Updates the structured-output definition identified by its ID. + /// WithRawResponseTask StructuredOutputControllerUpdateAsync( string id, UpdateStructuredOutputDto request, @@ -35,7 +52,12 @@ WithRawResponseTask StructuredOutputControllerUpdateAsync( CancellationToken cancellationToken = default ); - WithRawResponseTask StructuredOutputControllerRunAsync( + /// + /// Runs a saved or transient structured-output definition against one or more calls, optionally returning a preview without updating call artifacts. + /// + WithRawResponseTask< + OneOf + > StructuredOutputControllerRunAsync( StructuredOutputRunDto request, RequestOptions? options = null, CancellationToken cancellationToken = default diff --git a/src/Vapi.Net/StructuredOutputs/Requests/StructuredOutputControllerFindAllRequest.cs b/src/Vapi.Net/StructuredOutputs/Requests/StructuredOutputControllerFindAllRequest.cs index 2723d5be..d9768302 100644 --- a/src/Vapi.Net/StructuredOutputs/Requests/StructuredOutputControllerFindAllRequest.cs +++ b/src/Vapi.Net/StructuredOutputs/Requests/StructuredOutputControllerFindAllRequest.cs @@ -30,6 +30,12 @@ public record StructuredOutputControllerFindAllRequest [JsonIgnore] public StructuredOutputControllerFindAllRequestSortOrder? SortOrder { get; set; } + /// + /// This is the column to sort by. Defaults to 'createdAt'. + /// + [JsonIgnore] + public StructuredOutputControllerFindAllRequestSortBy? SortBy { get; set; } + /// /// This is the maximum number of items to return. Defaults to 100. /// diff --git a/src/Vapi.Net/StructuredOutputs/Requests/UpdateStructuredOutputDto.cs b/src/Vapi.Net/StructuredOutputs/Requests/UpdateStructuredOutputDto.cs index 82164ffb..1a0b575b 100644 --- a/src/Vapi.Net/StructuredOutputs/Requests/UpdateStructuredOutputDto.cs +++ b/src/Vapi.Net/StructuredOutputs/Requests/UpdateStructuredOutputDto.cs @@ -6,6 +6,9 @@ namespace Vapi.Net; [Serializable] public record UpdateStructuredOutputDto { + /// + /// Set to the string `true` to allow changing the schema's top-level type. Other values do not enable schema type changes. + /// [JsonIgnore] public required string SchemaOverride { get; set; } @@ -57,6 +60,12 @@ public record UpdateStructuredOutputDto [JsonPropertyName("compliancePlan")] public ComplianceOverride? CompliancePlan { get; set; } + /// + /// These are the conditions that gate the execution of this structured output. Every condition must pass for the structured output to run (AND semantics). When omitted or empty, no user-defined conditions gate this output. Send null to clear a previously saved gate. + /// + [JsonPropertyName("conditions")] + public IEnumerable? Conditions { get; set; } + /// /// This is the name of the structured output. /// diff --git a/src/Vapi.Net/StructuredOutputs/StructuredOutputsClient.cs b/src/Vapi.Net/StructuredOutputs/StructuredOutputsClient.cs index cba70979..4e2dc396 100644 --- a/src/Vapi.Net/StructuredOutputs/StructuredOutputsClient.cs +++ b/src/Vapi.Net/StructuredOutputs/StructuredOutputsClient.cs @@ -1,4 +1,5 @@ using global::System.Text.Json; +using OneOf; using Vapi.Net.Core; namespace Vapi.Net; @@ -20,11 +21,12 @@ private async Task< CancellationToken cancellationToken = default ) { - var _queryString = new Vapi.Net.Core.QueryStringBuilder.Builder(capacity: 13) + var _queryString = new Vapi.Net.Core.QueryStringBuilder.Builder(capacity: 14) .Add("id", request.Id) .Add("name", request.Name) .Add("page", request.Page) .Add("sortOrder", request.SortOrder) + .Add("sortBy", request.SortBy) .Add("limit", request.Limit) .Add("createdAtGt", request.CreatedAtGt) .Add("createdAtLt", request.CreatedAtLt) @@ -380,7 +382,11 @@ private async Task> StructuredOutputController } } - private async Task> StructuredOutputControllerRunAsyncCore( + private async Task< + WithRawResponse< + OneOf + > + > StructuredOutputControllerRunAsyncCore( StructuredOutputRunDto request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -413,8 +419,12 @@ private async Task> StructuredOutputController .ConfigureAwait(false); try { - var responseData = JsonUtils.Deserialize(responseBody)!; - return new WithRawResponse() + var responseData = JsonUtils.Deserialize< + OneOf + >(responseBody)!; + return new WithRawResponse< + OneOf + >() { Data = responseData, RawResponse = new RawResponse() @@ -447,6 +457,9 @@ private async Task> StructuredOutputController } } + /// + /// Returns structured-output definitions for the authenticated organization. Filter results by ID, name, or creation and update timestamps. + /// public WithRawResponseTask StructuredOutputControllerFindAllAsync( StructuredOutputControllerFindAllRequest request, RequestOptions? options = null, @@ -458,6 +471,9 @@ public WithRawResponseTask StructuredOutputCo ); } + /// + /// Creates a reusable definition for extracting validated data from conversations using an AI model or regular expression. + /// public WithRawResponseTask StructuredOutputControllerCreateAsync( CreateStructuredOutputDto request, RequestOptions? options = null, @@ -469,6 +485,9 @@ public WithRawResponseTask StructuredOutputControllerCreateAsy ); } + /// + /// Returns the structured-output definition identified by its ID. + /// public WithRawResponseTask StructuredOutputControllerFindOneAsync( string id, StructuredOutputControllerFindOneRequest request, @@ -481,6 +500,9 @@ public WithRawResponseTask StructuredOutputControllerFindOneAs ); } + /// + /// Deletes the structured-output definition identified by its ID. + /// public WithRawResponseTask StructuredOutputControllerRemoveAsync( string id, StructuredOutputControllerRemoveRequest request, @@ -493,6 +515,9 @@ public WithRawResponseTask StructuredOutputControllerRemoveAsy ); } + /// + /// Updates the structured-output definition identified by its ID. + /// public WithRawResponseTask StructuredOutputControllerUpdateAsync( string id, UpdateStructuredOutputDto request, @@ -505,14 +530,19 @@ public WithRawResponseTask StructuredOutputControllerUpdateAsy ); } - public WithRawResponseTask StructuredOutputControllerRunAsync( + /// + /// Runs a saved or transient structured-output definition against one or more calls, optionally returning a preview without updating call artifacts. + /// + public WithRawResponseTask< + OneOf + > StructuredOutputControllerRunAsync( StructuredOutputRunDto request, RequestOptions? options = null, CancellationToken cancellationToken = default ) { - return new WithRawResponseTask( - StructuredOutputControllerRunAsyncCore(request, options, cancellationToken) - ); + return new WithRawResponseTask< + OneOf + >(StructuredOutputControllerRunAsyncCore(request, options, cancellationToken)); } } diff --git a/src/Vapi.Net/StructuredOutputs/Types/StructuredOutputControllerFindAllRequestSortBy.cs b/src/Vapi.Net/StructuredOutputs/Types/StructuredOutputControllerFindAllRequestSortBy.cs new file mode 100644 index 00000000..28bd775a --- /dev/null +++ b/src/Vapi.Net/StructuredOutputs/Types/StructuredOutputControllerFindAllRequestSortBy.cs @@ -0,0 +1,89 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(StructuredOutputControllerFindAllRequestSortBySerializer))] +public enum StructuredOutputControllerFindAllRequestSortBy +{ + [EnumMember(Value = "createdAt")] + CreatedAt, + + [EnumMember(Value = "duration")] + Duration, + + [EnumMember(Value = "cost")] + Cost, +} + +internal class StructuredOutputControllerFindAllRequestSortBySerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + StructuredOutputControllerFindAllRequestSortBy + > _stringToEnum = new() + { + { "createdAt", StructuredOutputControllerFindAllRequestSortBy.CreatedAt }, + { "duration", StructuredOutputControllerFindAllRequestSortBy.Duration }, + { "cost", StructuredOutputControllerFindAllRequestSortBy.Cost }, + }; + + private static readonly global::System.Collections.Generic.Dictionary< + StructuredOutputControllerFindAllRequestSortBy, + string + > _enumToString = new() + { + { StructuredOutputControllerFindAllRequestSortBy.CreatedAt, "createdAt" }, + { StructuredOutputControllerFindAllRequestSortBy.Duration, "duration" }, + { StructuredOutputControllerFindAllRequestSortBy.Cost, "cost" }, + }; + + public override StructuredOutputControllerFindAllRequestSortBy Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + StructuredOutputControllerFindAllRequestSortBy value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override StructuredOutputControllerFindAllRequestSortBy ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + StructuredOutputControllerFindAllRequestSortBy value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/StructuredOutputs/Types/StructuredOutputControllerRunResponseZero.cs b/src/Vapi.Net/StructuredOutputs/Types/StructuredOutputControllerRunResponseZero.cs new file mode 100644 index 00000000..a1e3a1c9 --- /dev/null +++ b/src/Vapi.Net/StructuredOutputs/Types/StructuredOutputControllerRunResponseZero.cs @@ -0,0 +1,33 @@ +using global::System.Text.Json; +using global::System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[Serializable] +public record StructuredOutputControllerRunResponseZero : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + /// + /// These are the structured outputs whose conditions gated them, keyed by + /// structured output id. Absent when nothing was skipped. An entry here means + /// no extraction ran and no cost was incurred for that output. + /// + [JsonPropertyName("skipped")] + public Dictionary? Skipped { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Tools/IToolsClient.cs b/src/Vapi.Net/Tools/IToolsClient.cs index 1d735bbc..1579fcf5 100644 --- a/src/Vapi.Net/Tools/IToolsClient.cs +++ b/src/Vapi.Net/Tools/IToolsClient.cs @@ -2,18 +2,27 @@ namespace Vapi.Net; public partial interface IToolsClient { + /// + /// Returns reusable tools for the authenticated organization. Filter results by creation or update timestamps and limit the number returned. + /// WithRawResponseTask> ListAsync( ListToolsRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default ); + /// + /// Creates a reusable tool that assistants can invoke during conversations. + /// WithRawResponseTask CreateAsync( object request, RequestOptions? options = null, CancellationToken cancellationToken = default ); + /// + /// Returns the tool identified by its ID. + /// WithRawResponseTask GetAsync( string id, GetToolsRequest request, @@ -21,6 +30,9 @@ WithRawResponseTask GetAsync( CancellationToken cancellationToken = default ); + /// + /// Deletes the tool identified by its ID. + /// WithRawResponseTask DeleteAsync( string id, DeleteToolsRequest request, @@ -28,6 +40,9 @@ WithRawResponseTask DeleteAsync( CancellationToken cancellationToken = default ); + /// + /// Updates the specified fields of the tool identified by its ID. + /// WithRawResponseTask UpdateAsync( string id, UpdateToolsRequest request, diff --git a/src/Vapi.Net/Tools/ToolsClient.cs b/src/Vapi.Net/Tools/ToolsClient.cs index 0fc0651c..cadfa614 100644 --- a/src/Vapi.Net/Tools/ToolsClient.cs +++ b/src/Vapi.Net/Tools/ToolsClient.cs @@ -280,6 +280,18 @@ private async Task> DeleteAsyncCore( var responseBody = await response .Raw.Content.ReadAsStringAsync(cancellationToken) .ConfigureAwait(false); + try + { + switch (response.StatusCode) + { + case 409: + throw new ConflictError(JsonUtils.Deserialize(responseBody)); + } + } + catch (JsonException) + { + // unable to map error response, throwing generic error + } throw new VapiClientApiException( $"Error with status code {response.StatusCode}", response.StatusCode, @@ -356,6 +368,9 @@ private async Task> UpdateAsyncCore( } } + /// + /// Returns reusable tools for the authenticated organization. Filter results by creation or update timestamps and limit the number returned. + /// public WithRawResponseTask> ListAsync( ListToolsRequest request, RequestOptions? options = null, @@ -367,6 +382,9 @@ public WithRawResponseTask> ListAsync( ); } + /// + /// Creates a reusable tool that assistants can invoke during conversations. + /// public WithRawResponseTask CreateAsync( object request, RequestOptions? options = null, @@ -378,6 +396,9 @@ public WithRawResponseTask CreateAsync( ); } + /// + /// Returns the tool identified by its ID. + /// public WithRawResponseTask GetAsync( string id, GetToolsRequest request, @@ -390,6 +411,9 @@ public WithRawResponseTask GetAsync( ); } + /// + /// Deletes the tool identified by its ID. + /// public WithRawResponseTask DeleteAsync( string id, DeleteToolsRequest request, @@ -402,6 +426,9 @@ public WithRawResponseTask DeleteAsync( ); } + /// + /// Updates the specified fields of the tool identified by its ID. + /// public WithRawResponseTask UpdateAsync( string id, UpdateToolsRequest request, diff --git a/src/Vapi.Net/Types/AiEdgeCondition.cs b/src/Vapi.Net/Types/AiEdgeCondition.cs index 1e62cdc7..ada74982 100644 --- a/src/Vapi.Net/Types/AiEdgeCondition.cs +++ b/src/Vapi.Net/Types/AiEdgeCondition.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// An AI-evaluated boolean condition that determines whether a workflow follows an edge. +/// [Serializable] public record AiEdgeCondition : IJsonOnDeserialized { @@ -11,6 +14,9 @@ public record AiEdgeCondition : IJsonOnDeserialized private readonly IDictionary _extensionData = new Dictionary(); + /// + /// Selects an AI-evaluated workflow edge condition. + /// [JsonPropertyName("type")] public required AiEdgeConditionType Type { get; set; } diff --git a/src/Vapi.Net/Types/Analysis.cs b/src/Vapi.Net/Types/Analysis.cs index a49ca5f8..b5c9ecf7 100644 --- a/src/Vapi.Net/Types/Analysis.cs +++ b/src/Vapi.Net/Types/Analysis.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Post-call analysis results, including summary, structured data, and success evaluation outputs. +/// [Serializable] public record Analysis : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/AnalysisCost.cs b/src/Vapi.Net/Types/AnalysisCost.cs index 07ae84e5..bd43947c 100644 --- a/src/Vapi.Net/Types/AnalysisCost.cs +++ b/src/Vapi.Net/Types/AnalysisCost.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Cost for an individual analysis request, including analysis type, model, token usage, and amount. +/// [Serializable] public record AnalysisCost : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/AnalysisCostBreakdown.cs b/src/Vapi.Net/Types/AnalysisCostBreakdown.cs index 0fd00f52..333078b6 100644 --- a/src/Vapi.Net/Types/AnalysisCostBreakdown.cs +++ b/src/Vapi.Net/Types/AnalysisCostBreakdown.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Analysis costs and token usage grouped by summary, structured data, success evaluation, and structured-output generation. +/// [Serializable] public record AnalysisCostBreakdown : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/AnalysisPlan.cs b/src/Vapi.Net/Types/AnalysisPlan.cs index 77519564..f325af74 100644 --- a/src/Vapi.Net/Types/AnalysisPlan.cs +++ b/src/Vapi.Net/Types/AnalysisPlan.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Configuration for post-call analysis of summaries, structured-data extraction, success evaluation, and outcomes. +/// [Serializable] public record AnalysisPlan : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/AnalyticsOperation.cs b/src/Vapi.Net/Types/AnalyticsOperation.cs index a8a0c189..6be7eb12 100644 --- a/src/Vapi.Net/Types/AnalyticsOperation.cs +++ b/src/Vapi.Net/Types/AnalyticsOperation.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// An aggregation or history operation applied to an analytics column, with an optional response alias. +/// [Serializable] public record AnalyticsOperation : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/AnalyticsQuery.cs b/src/Vapi.Net/Types/AnalyticsQuery.cs index 9eaab578..0c2c27a6 100644 --- a/src/Vapi.Net/Types/AnalyticsQuery.cs +++ b/src/Vapi.Net/Types/AnalyticsQuery.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// A named analytics query against call or subscription data, including grouping, time range, and aggregation operations. +/// [Serializable] public record AnalyticsQuery : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/AnalyticsQueryResult.cs b/src/Vapi.Net/Types/AnalyticsQueryResult.cs index ad202f67..06d4507c 100644 --- a/src/Vapi.Net/Types/AnalyticsQueryResult.cs +++ b/src/Vapi.Net/Types/AnalyticsQueryResult.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// The result of a named analytics query, including the evaluated time range and returned metric data. +/// [Serializable] public record AnalyticsQueryResult : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/AnthropicBedrockCredentialRegion.cs b/src/Vapi.Net/Types/AnthropicBedrockCredentialRegion.cs index 3b1b390c..0e4a2f7b 100644 --- a/src/Vapi.Net/Types/AnthropicBedrockCredentialRegion.cs +++ b/src/Vapi.Net/Types/AnthropicBedrockCredentialRegion.cs @@ -12,6 +12,9 @@ public enum AnthropicBedrockCredentialRegion [EnumMember(Value = "us-west-2")] UsWest2, + [EnumMember(Value = "eu-central-1")] + EuCentral1, + [EnumMember(Value = "eu-west-1")] EuWest1, @@ -35,6 +38,7 @@ internal class AnthropicBedrockCredentialRegionSerializer { { "us-east-1", AnthropicBedrockCredentialRegion.UsEast1 }, { "us-west-2", AnthropicBedrockCredentialRegion.UsWest2 }, + { "eu-central-1", AnthropicBedrockCredentialRegion.EuCentral1 }, { "eu-west-1", AnthropicBedrockCredentialRegion.EuWest1 }, { "eu-west-3", AnthropicBedrockCredentialRegion.EuWest3 }, { "ap-northeast-1", AnthropicBedrockCredentialRegion.ApNortheast1 }, @@ -48,6 +52,7 @@ internal class AnthropicBedrockCredentialRegionSerializer { { AnthropicBedrockCredentialRegion.UsEast1, "us-east-1" }, { AnthropicBedrockCredentialRegion.UsWest2, "us-west-2" }, + { AnthropicBedrockCredentialRegion.EuCentral1, "eu-central-1" }, { AnthropicBedrockCredentialRegion.EuWest1, "eu-west-1" }, { AnthropicBedrockCredentialRegion.EuWest3, "eu-west-3" }, { AnthropicBedrockCredentialRegion.ApNortheast1, "ap-northeast-1" }, diff --git a/src/Vapi.Net/Types/AnthropicBedrockModel.cs b/src/Vapi.Net/Types/AnthropicBedrockModel.cs index 1beb6bc7..a65b26d8 100644 --- a/src/Vapi.Net/Types/AnthropicBedrockModel.cs +++ b/src/Vapi.Net/Types/AnthropicBedrockModel.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Configuration for generating assistant responses with Anthropic models through Amazon Bedrock, including model, prompts, tools, knowledge-base access, reasoning, and generation settings. +/// [Serializable] public record AnthropicBedrockModel : IJsonOnDeserialized { @@ -33,6 +36,15 @@ public record AnthropicBedrockModel : IJsonOnDeserialized [JsonPropertyName("toolIds")] public IEnumerable? ToolIds { get; set; } + /// + /// These are version-pinned references to tools. Each entry pins a specific + /// version of a tool by `(toolId, version)`. When the same `toolId` appears + /// in both `toolIds` and `toolRefs[]`, the `toolRefs` pin wins (the + /// `toolIds` entry is dropped at write time). + /// + [JsonPropertyName("toolRefs")] + public IEnumerable? ToolRefs { get; set; } + /// /// These are the options for the knowledge base. /// @@ -54,7 +66,7 @@ public record AnthropicBedrockModel : IJsonOnDeserialized public AnthropicThinkingConfig? Thinking { get; set; } /// - /// This is the temperature that will be used for calls. Default is 0 to leverage caching for lower latency. + /// This is the temperature that will be used for calls. Default is 0.5. /// [JsonPropertyName("temperature")] public double? Temperature { get; set; } diff --git a/src/Vapi.Net/Types/AnthropicBedrockModelModel.cs b/src/Vapi.Net/Types/AnthropicBedrockModelModel.cs index 9b90d384..7bf60b81 100644 --- a/src/Vapi.Net/Types/AnthropicBedrockModelModel.cs +++ b/src/Vapi.Net/Types/AnthropicBedrockModelModel.cs @@ -47,6 +47,9 @@ public enum AnthropicBedrockModelModel [EnumMember(Value = "claude-haiku-4-5-20251001")] ClaudeHaiku4520251001, + + [EnumMember(Value = "global.anthropic.claude-haiku-4-5-20251001-v1:0")] + GlobalAnthropicClaudeHaiku4520251001V10, } internal class AnthropicBedrockModelModelSerializer @@ -71,6 +74,10 @@ internal class AnthropicBedrockModelModelSerializer { "claude-sonnet-4-5-20250929", AnthropicBedrockModelModel.ClaudeSonnet4520250929 }, { "claude-sonnet-4-6", AnthropicBedrockModelModel.ClaudeSonnet46 }, { "claude-haiku-4-5-20251001", AnthropicBedrockModelModel.ClaudeHaiku4520251001 }, + { + "global.anthropic.claude-haiku-4-5-20251001-v1:0", + AnthropicBedrockModelModel.GlobalAnthropicClaudeHaiku4520251001V10 + }, }; private static readonly global::System.Collections.Generic.Dictionary< @@ -92,6 +99,10 @@ internal class AnthropicBedrockModelModelSerializer { AnthropicBedrockModelModel.ClaudeSonnet4520250929, "claude-sonnet-4-5-20250929" }, { AnthropicBedrockModelModel.ClaudeSonnet46, "claude-sonnet-4-6" }, { AnthropicBedrockModelModel.ClaudeHaiku4520251001, "claude-haiku-4-5-20251001" }, + { + AnthropicBedrockModelModel.GlobalAnthropicClaudeHaiku4520251001V10, + "global.anthropic.claude-haiku-4-5-20251001-v1:0" + }, }; public override AnthropicBedrockModelModel Read( diff --git a/src/Vapi.Net/Types/AnthropicModel.cs b/src/Vapi.Net/Types/AnthropicModel.cs index 8886855e..607b2573 100644 --- a/src/Vapi.Net/Types/AnthropicModel.cs +++ b/src/Vapi.Net/Types/AnthropicModel.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Configuration for generating assistant responses with Anthropic, including model, prompts, tools, knowledge-base access, reasoning, and generation settings. +/// [Serializable] public record AnthropicModel : IJsonOnDeserialized { @@ -33,6 +36,15 @@ public record AnthropicModel : IJsonOnDeserialized [JsonPropertyName("toolIds")] public IEnumerable? ToolIds { get; set; } + /// + /// These are version-pinned references to tools. Each entry pins a specific + /// version of a tool by `(toolId, version)`. When the same `toolId` appears + /// in both `toolIds` and `toolRefs[]`, the `toolRefs` pin wins (the + /// `toolIds` entry is dropped at write time). + /// + [JsonPropertyName("toolRefs")] + public IEnumerable? ToolRefs { get; set; } + /// /// These are the options for the knowledge base. /// @@ -54,7 +66,7 @@ public record AnthropicModel : IJsonOnDeserialized public AnthropicThinkingConfig? Thinking { get; set; } /// - /// This is the temperature that will be used for calls. Default is 0 to leverage caching for lower latency. + /// This is the temperature that will be used for calls. Default is 0.5. /// [JsonPropertyName("temperature")] public double? Temperature { get; set; } diff --git a/src/Vapi.Net/Types/AnthropicModelModel.cs b/src/Vapi.Net/Types/AnthropicModelModel.cs index 3282480a..514b7789 100644 --- a/src/Vapi.Net/Types/AnthropicModelModel.cs +++ b/src/Vapi.Net/Types/AnthropicModelModel.cs @@ -45,6 +45,9 @@ public enum AnthropicModelModel [EnumMember(Value = "claude-sonnet-4-6")] ClaudeSonnet46, + [EnumMember(Value = "claude-sonnet-5")] + ClaudeSonnet5, + [EnumMember(Value = "claude-haiku-4-5-20251001")] ClaudeHaiku4520251001, } @@ -70,6 +73,7 @@ internal class AnthropicModelModelSerializer { "claude-sonnet-4-20250514", AnthropicModelModel.ClaudeSonnet420250514 }, { "claude-sonnet-4-5-20250929", AnthropicModelModel.ClaudeSonnet4520250929 }, { "claude-sonnet-4-6", AnthropicModelModel.ClaudeSonnet46 }, + { "claude-sonnet-5", AnthropicModelModel.ClaudeSonnet5 }, { "claude-haiku-4-5-20251001", AnthropicModelModel.ClaudeHaiku4520251001 }, }; @@ -91,6 +95,7 @@ internal class AnthropicModelModelSerializer { AnthropicModelModel.ClaudeSonnet420250514, "claude-sonnet-4-20250514" }, { AnthropicModelModel.ClaudeSonnet4520250929, "claude-sonnet-4-5-20250929" }, { AnthropicModelModel.ClaudeSonnet46, "claude-sonnet-4-6" }, + { AnthropicModelModel.ClaudeSonnet5, "claude-sonnet-5" }, { AnthropicModelModel.ClaudeHaiku4520251001, "claude-haiku-4-5-20251001" }, }; diff --git a/src/Vapi.Net/Types/AnthropicThinkingConfig.cs b/src/Vapi.Net/Types/AnthropicThinkingConfig.cs index 8253a81f..3051dff6 100644 --- a/src/Vapi.Net/Types/AnthropicThinkingConfig.cs +++ b/src/Vapi.Net/Types/AnthropicThinkingConfig.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Enables Anthropic extended thinking with a maximum thinking-token budget. +/// [Serializable] public record AnthropicThinkingConfig : IJsonOnDeserialized { @@ -11,6 +14,9 @@ public record AnthropicThinkingConfig : IJsonOnDeserialized private readonly IDictionary _extensionData = new Dictionary(); + /// + /// Enables Anthropic extended thinking. + /// [JsonPropertyName("type")] public required AnthropicThinkingConfigType Type { get; set; } diff --git a/src/Vapi.Net/Types/AnyscaleModel.cs b/src/Vapi.Net/Types/AnyscaleModel.cs index 514b1188..d45cbad2 100644 --- a/src/Vapi.Net/Types/AnyscaleModel.cs +++ b/src/Vapi.Net/Types/AnyscaleModel.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Configuration for generating assistant responses with Anyscale, including model, prompts, tools, knowledge-base access, and generation settings. +/// [Serializable] public record AnyscaleModel : IJsonOnDeserialized { @@ -33,6 +36,15 @@ public record AnyscaleModel : IJsonOnDeserialized [JsonPropertyName("toolIds")] public IEnumerable? ToolIds { get; set; } + /// + /// These are version-pinned references to tools. Each entry pins a specific + /// version of a tool by `(toolId, version)`. When the same `toolId` appears + /// in both `toolIds` and `toolRefs[]`, the `toolRefs` pin wins (the + /// `toolIds` entry is dropped at write time). + /// + [JsonPropertyName("toolRefs")] + public IEnumerable? ToolRefs { get; set; } + /// /// These are the options for the knowledge base. /// @@ -46,7 +58,7 @@ public record AnyscaleModel : IJsonOnDeserialized public required string Model { get; set; } /// - /// This is the temperature that will be used for calls. Default is 0 to leverage caching for lower latency. + /// This is the temperature that will be used for calls. Default is 0.5. /// [JsonPropertyName("temperature")] public double? Temperature { get; set; } diff --git a/src/Vapi.Net/Types/ApiRequestTool.cs b/src/Vapi.Net/Types/ApiRequestTool.cs index 3fbe40ea..679ec9ca 100644 --- a/src/Vapi.Net/Types/ApiRequestTool.cs +++ b/src/Vapi.Net/Types/ApiRequestTool.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// A reusable tool that sends HTTP requests to a configured API and can authenticate, retry failures, and extract variables from responses. +/// [Serializable] public record ApiRequestTool : IJsonOnDeserialized { @@ -11,14 +14,26 @@ public record ApiRequestTool : IJsonOnDeserialized private readonly IDictionary _extensionData = new Dictionary(); + [JsonPropertyName("latestVersion")] + public string? LatestVersion { 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. + /// Messages spoken while the tool is running. Multiple request-start messages are variants. For request-response-delayed, same timing means variants and different timings mean staged updates. /// [JsonPropertyName("messages")] public IEnumerable? Messages { get; set; } + /// + /// This is the name of the tool. This will be passed to the model. + /// + /// Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 40. + /// + [JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// The HTTP method used for the API request. + /// [JsonPropertyName("method")] public required ApiRequestToolMethod Method { get; set; } @@ -155,14 +170,6 @@ public record ApiRequestTool : IJsonOnDeserialized [JsonPropertyName("rejectionPlan")] public ToolRejectionPlan? RejectionPlan { get; set; } - /// - /// This is the name of the tool. This will be passed to the model. - /// - /// Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 40. - /// - [JsonPropertyName("name")] - public string? Name { get; set; } - /// /// This is the description of the tool. This will be passed to the model. /// diff --git a/src/Vapi.Net/Types/Artifact.cs b/src/Vapi.Net/Types/Artifact.cs index 23335bd6..b39d5682 100644 --- a/src/Vapi.Net/Types/Artifact.cs +++ b/src/Vapi.Net/Types/Artifact.cs @@ -5,6 +5,9 @@ namespace Vapi.Net; +/// +/// Artifacts generated during a call, including messages, recordings, transcript, logs, packet capture, workflow-node data, variables, performance metrics, structured outputs, scorecards, and transfers. +/// [Serializable] public record Artifact : IJsonOnDeserialized { @@ -17,7 +20,7 @@ public record Artifact : IJsonOnDeserialized /// [JsonPropertyName("messages")] public IEnumerable< - OneOf + OneOf >? Messages { get; set; } /// @@ -26,6 +29,19 @@ public IEnumerable< [JsonPropertyName("messagesOpenAIFormatted")] public IEnumerable? MessagesOpenAiFormatted { get; set; } + /// + /// Structured outputs skipped because their conditions were not met, keyed by saved or runtime output ID. + /// + [JsonPropertyName("skippedStructuredOutputs")] + public Dictionary? SkippedStructuredOutputs { get; set; } + + /// + /// These are the transfer records for the call's transfer attempts (warm and blind), including + /// destination, mode, and status. Warm transfer records also include transcripts and messages. + /// + [JsonPropertyName("transfers")] + public IEnumerable? Transfers { get; set; } + /// /// This is the recording url for the call. To enable, set `assistant.artifactPlan.recordingEnabled`. /// @@ -112,18 +128,74 @@ public IEnumerable< [JsonPropertyName("scorecards")] public object? Scorecards { get; set; } - /// - /// These are the transfer records from warm transfers, including destinations, transcripts, and status. - /// - [JsonPropertyName("transfers")] - public IEnumerable? Transfers { get; set; } - /// /// This is when the structured outputs were last updated /// [JsonPropertyName("structuredOutputsLastUpdatedAt")] public DateTime? StructuredOutputsLastUpdatedAt { get; set; } + /// + /// This is a presigned URL to download the mono recording without + /// authentication. Populated on API responses and server messages; never + /// stored. Expires at `presignedUrlsExpiresAt` — after that, use + /// `GET /call/{id}/mono-recording`. + /// + [JsonPropertyName("presignedMonoUrl")] + public string? PresignedMonoUrl { get; set; } + + /// + /// This is a presigned URL to download the stereo recording without + /// authentication. Expires at `presignedUrlsExpiresAt` — after that, use + /// `GET /call/{id}/stereo-recording`. + /// + [JsonPropertyName("presignedStereoUrl")] + public string? PresignedStereoUrl { get; set; } + + /// + /// This is a presigned URL to download the video recording without + /// authentication. Expires at `presignedUrlsExpiresAt` — after that, use + /// `GET /call/{id}/video-recording`. + /// + [JsonPropertyName("presignedVideoUrl")] + public string? PresignedVideoUrl { get; set; } + + /// + /// This is a presigned URL to download the assistant-channel mono recording + /// without authentication. Expires at `presignedUrlsExpiresAt`. + /// + [JsonPropertyName("presignedAssistantUrl")] + public string? PresignedAssistantUrl { get; set; } + + /// + /// This is a presigned URL to download the customer-channel mono recording + /// without authentication. Expires at `presignedUrlsExpiresAt`. + /// + [JsonPropertyName("presignedCustomerUrl")] + public string? PresignedCustomerUrl { get; set; } + + /// + /// This is a presigned URL to download the packet capture without + /// authentication. Expires at `presignedUrlsExpiresAt`. + /// + [JsonPropertyName("presignedPcapUrl")] + public string? PresignedPcapUrl { get; set; } + + /// + /// This is a presigned URL to download the call logs without + /// authentication. Expires at `presignedUrlsExpiresAt`. + /// + [JsonPropertyName("presignedLogUrl")] + public string? PresignedLogUrl { get; set; } + + /// + /// This is when the presigned URLs above expire, as an ISO 8601 timestamp. + /// The raw `*Url` fields remain the stable identifiers and do not expire. + /// Presigned URLs are regenerated per response and per webhook delivery, so + /// values differ across retries. + /// + [JsonPropertyName("presignedUrlsExpiresAt")] + public string? PresignedUrlsExpiresAt { get; set; } + [JsonIgnore] public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); diff --git a/src/Vapi.Net/Types/ArtifactPlan.cs b/src/Vapi.Net/Types/ArtifactPlan.cs index 8be0dce7..0fd86c62 100644 --- a/src/Vapi.Net/Types/ArtifactPlan.cs +++ b/src/Vapi.Net/Types/ArtifactPlan.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Controls artifacts generated and stored for calls, including recordings, packet captures, logs, transcripts, structured outputs, scorecards, and custom storage paths. +/// [Serializable] public record ArtifactPlan : IJsonOnDeserialized { @@ -42,6 +45,8 @@ public record ArtifactPlan : IJsonOnDeserialized /// - Set to false if you have custom storage configured but want to store recordings on Vapi's storage for this assistant. /// - Set to true (or leave unset) to use your custom storage for recordings when available. /// + /// If your organization has ZDR (zero data retention) or PCI enabled, recordings are never written to Vapi storage. In that case, false means "do not use my custom storage", so nothing is stored at all. + /// /// @default true /// [JsonPropertyName("recordingUseCustomStorageEnabled")] @@ -96,6 +101,8 @@ public record ArtifactPlan : IJsonOnDeserialized /// - Set to false if you have custom storage configured but want to store packet captures on Vapi's storage for this assistant. /// - Set to true (or leave unset) to use your custom storage for packet captures when available. /// + /// If your organization has ZDR (zero data retention) or PCI enabled, packet captures are never written to Vapi storage. In that case, false means "do not use my custom storage", so nothing is stored at all. + /// /// @default true /// [JsonPropertyName("pcapUseCustomStorageEnabled")] @@ -118,6 +125,8 @@ public record ArtifactPlan : IJsonOnDeserialized /// - Set to false if you have custom storage configured but want to store logs on Vapi's storage for this assistant. /// - Set to true (or leave unset) to use your custom storage for logs when available. /// + /// If your organization has ZDR (zero data retention) or PCI enabled, logs are never written to Vapi storage. In that case, false means "do not use my custom storage", so nothing is stored at all. + /// /// @default true /// [JsonPropertyName("loggingUseCustomStorageEnabled")] diff --git a/src/Vapi.Net/Types/AssemblyAiTranscriber.cs b/src/Vapi.Net/Types/AssemblyAiTranscriber.cs index 51562e49..d2485c1e 100644 --- a/src/Vapi.Net/Types/AssemblyAiTranscriber.cs +++ b/src/Vapi.Net/Types/AssemblyAiTranscriber.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Configuration for transcribing speech during assistant conversations with AssemblyAI, including language, streaming model, endpointing, vocabulary, and fallback settings. +/// [Serializable] public record AssemblyAiTranscriber : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/Assistant.cs b/src/Vapi.Net/Types/Assistant.cs index ebc1ed27..5df33d96 100644 --- a/src/Vapi.Net/Types/Assistant.cs +++ b/src/Vapi.Net/Types/Assistant.cs @@ -5,6 +5,9 @@ namespace Vapi.Net; +/// +/// A saved assistant configuration returned by the Vapi API. It defines how the assistant listens, reasons, speaks, handles conversations, sends events, and produces artifacts and analysis. +/// [Serializable] public record Assistant : IJsonOnDeserialized { @@ -38,6 +41,9 @@ public record Assistant : IJsonOnDeserialized [JsonPropertyName("firstMessage")] public string? FirstMessage { get; set; } + /// + /// Set to `true` to allow the user to interrupt the assistant while it speaks the first message. Default is `false`. + /// [JsonPropertyName("firstMessageInterruptionsEnabled")] public bool? FirstMessageInterruptionsEnabled { get; set; } @@ -136,6 +142,15 @@ public IEnumerable< > >? Hooks { get; set; } + /// + /// This is the latest version label (e.g. `v3`) of the assistant in the + /// version history. `null` while the org is not yet + /// onboarded to versioning, or for assistants that have not yet been + /// published under it. + /// + [JsonPropertyName("latestVersion")] + public string? LatestVersion { get; set; } + /// /// This is the name of the assistant. /// @@ -166,6 +181,9 @@ public IEnumerable< [JsonPropertyName("endCallPhrases")] public IEnumerable? EndCallPhrases { get; set; } + /// + /// Compliance settings for the assistant, including HIPAA and PCI behavior, security filtering, and recording consent. + /// [JsonPropertyName("compliancePlan")] public CompliancePlan? CompliancePlan { get; set; } @@ -256,6 +274,9 @@ public IEnumerable< [JsonPropertyName("server")] public Server? Server { get; set; } + /// + /// Configuration for collecting and processing DTMF keypad input during calls. + /// [JsonPropertyName("keypadInputPlan")] public KeypadInputPlan? KeypadInputPlan { get; set; } diff --git a/src/Vapi.Net/Types/AssistantActivation.cs b/src/Vapi.Net/Types/AssistantActivation.cs index 31f87a0c..220ca9f3 100644 --- a/src/Vapi.Net/Types/AssistantActivation.cs +++ b/src/Vapi.Net/Types/AssistantActivation.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Identifies an assistant that became active during a call. +/// [Serializable] public record AssistantActivation : IJsonOnDeserialized { @@ -11,6 +14,15 @@ public record AssistantActivation : IJsonOnDeserialized private readonly IDictionary _extensionData = new Dictionary(); + /// + /// This is the version label (e.g. `v3`) of the assistant active when + /// the activation row was recorded. `null` for inline assistants, + /// orgs not on assistant versioning, and parent assistants that have + /// not yet been published under it. + /// + [JsonPropertyName("assistantVersion")] + public string? AssistantVersion { get; set; } + /// /// This is the name of the assistant that was active during the call. /// diff --git a/src/Vapi.Net/Types/AssistantCustomEndpointingRule.cs b/src/Vapi.Net/Types/AssistantCustomEndpointingRule.cs index 0672f04a..3bddf593 100644 --- a/src/Vapi.Net/Types/AssistantCustomEndpointingRule.cs +++ b/src/Vapi.Net/Types/AssistantCustomEndpointingRule.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// A custom endpointing rule that matches the assistant's last message and applies a configured timeout. +/// [Serializable] public record AssistantCustomEndpointingRule : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/AssistantDraft.cs b/src/Vapi.Net/Types/AssistantDraft.cs new file mode 100644 index 00000000..aa8d80ef --- /dev/null +++ b/src/Vapi.Net/Types/AssistantDraft.cs @@ -0,0 +1,309 @@ +using global::System.Text.Json; +using global::System.Text.Json.Serialization; +using OneOf; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[Serializable] +public record AssistantDraft : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + /// + /// These are the options for the assistant's transcriber. + /// + [JsonPropertyName("transcriber")] + public object? Transcriber { get; set; } + + /// + /// These are the options for the assistant's LLM. + /// + [JsonPropertyName("model")] + public object? Model { get; set; } + + /// + /// These are the options for the assistant's voice. + /// + [JsonPropertyName("voice")] + public object? Voice { get; set; } + + /// + /// This is the first message that the assistant will say. This can also be a URL to a containerized audio file (mp3, wav, etc.). + /// + /// If unspecified, assistant will wait for user to speak and use the model to respond once they speak. + /// + [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'. + /// + /// Use: + /// - 'assistant-speaks-first' to have the assistant speak first. + /// - 'assistant-waits-for-user' to have the assistant wait for the user to speak first. + /// - 'assistant-speaks-first-with-model-generated-message' to have the assistant speak first with a message generated by the model based on the conversation state. (`assistant.model.messages` at call start, `call.messages` at squad transfer points). + /// + /// @default 'assistant-speaks-first' + /// + [JsonPropertyName("firstMessageMode")] + public AssistantDraftFirstMessageMode? FirstMessageMode { get; set; } + + /// + /// These are the settings to configure or disable voicemail detection. Alternatively, voicemail detection can be configured using the model.tools=[VoicemailTool]. + /// By default, voicemail detection is disabled. + /// + [JsonPropertyName("voicemailDetection")] + public OneOf< + AssistantDraftVoicemailDetectionZero, + GoogleVoicemailDetectionPlan, + OpenAiVoicemailDetectionPlan, + TwilioVoicemailDetectionPlan, + VapiVoicemailDetectionPlan + >? 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,assistant.started. You can check the shape of the messages in ClientMessage schema. + /// + [JsonPropertyName("clientMessages")] + public IEnumerable? ClientMessages { get; set; } + + /// + /// These are the messages that will be sent to your Server URL. Default is conversation-update,end-of-call-report,function-call,hang,speech-update,status-update,tool-calls,transfer-destination-request,handoff-destination-request,user-interrupted,assistant.started. You can check the shape of the messages in ServerMessage schema. + /// + [JsonPropertyName("serverMessages")] + public IEnumerable? ServerMessages { get; set; } + + /// + /// This is the maximum number of seconds that the call will last. When the call reaches this duration, it will be ended. + /// + /// @default 600 (10 minutes) + /// + [JsonPropertyName("maxDurationSeconds")] + public double? MaxDurationSeconds { get; set; } + + /// + /// 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 OneOf? BackgroundSound { get; set; } + + /// + /// This determines whether the model's output is used in conversation history rather than the transcription of assistant's speech. + /// + /// @default false + /// + [JsonPropertyName("modelOutputInMessagesEnabled")] + public bool? ModelOutputInMessagesEnabled { get; set; } + + /// + /// These are the configurations to be passed to the transport providers of assistant's calls, like Twilio. You can store multiple configurations for different transport providers. For a call, only the configuration matching the call transport provider is used. + /// + [JsonPropertyName("transportConfigurations")] + public IEnumerable? TransportConfigurations { get; set; } + + /// + /// This is the plan for observability of assistant's calls. + /// + /// Currently, only Langfuse is supported. + /// + [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. + /// + [JsonPropertyName("credentials")] + public IEnumerable? Credentials { get; set; } + + /// + /// This is a set of actions that will be performed on certain events. + /// + [JsonPropertyName("hooks")] + public IEnumerable< + OneOf< + CallHookCallEnding, + CallHookAssistantSpeechInterrupted, + CallHookCustomerSpeechInterrupted, + CallHookCustomerSpeechTimeout, + SessionCreatedHook + > + >? Hooks { get; set; } + + /// + /// This is the name of the assistant. + /// + /// This is required when you want to transfer between assistants in a call. + /// + [JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// This is the message that the assistant will say if the call is forwarded to voicemail. + /// + /// If unspecified, it will hang up. + /// + [JsonPropertyName("voicemailMessage")] + public string? VoicemailMessage { get; set; } + + /// + /// This is the message that the assistant will say if it ends the call. + /// + /// If unspecified, it will hang up without saying anything. + /// + [JsonPropertyName("endCallMessage")] + public string? EndCallMessage { get; set; } + + /// + /// This list contains phrases that, if spoken by the assistant, will trigger the call to be hung up. Case insensitive. + /// + [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. + /// + [JsonPropertyName("metadata")] + public object? Metadata { get; set; } + + /// + /// This enables filtering of noise and background speech while the user is talking. + /// + /// Features: + /// - Smart denoising using Krisp + /// - Fourier denoising + /// + /// Smart denoising can be combined with or used independently of Fourier denoising. + /// + /// Order of precedence: + /// - Smart denoising + /// - Fourier denoising + /// + [JsonPropertyName("backgroundSpeechDenoisingPlan")] + public BackgroundSpeechDenoisingPlan? BackgroundSpeechDenoisingPlan { get; set; } + + /// + /// This is the plan for analysis of assistant's calls. Stored in `call.analysis`. + /// + [JsonPropertyName("analysisPlan")] + public AnalysisPlan? AnalysisPlan { get; set; } + + /// + /// This is the plan for artifacts generated during assistant's calls. Stored in `call.artifact`. + /// + [JsonPropertyName("artifactPlan")] + public ArtifactPlan? ArtifactPlan { get; set; } + + /// + /// This is the plan for when the assistant should start talking. + /// + /// You should configure this if you're running into these issues: + /// - The assistant is too slow to start talking after the customer is done speaking. + /// - The assistant is too fast to start talking after the customer is done speaking. + /// - The assistant is so fast that it's actually interrupting the customer. + /// + [JsonPropertyName("startSpeakingPlan")] + public StartSpeakingPlan? StartSpeakingPlan { get; set; } + + /// + /// This is the plan for when assistant should stop talking on customer interruption. + /// + /// You should configure this if you're running into these issues: + /// - The assistant is too slow to recognize customer's interruption. + /// - The assistant is too fast to recognize customer's interruption. + /// - The assistant is getting interrupted by phrases that are just acknowledgments. + /// - The assistant is getting interrupted by background noises. + /// - The assistant is not properly stopping -- it starts talking right after getting interrupted. + /// + [JsonPropertyName("stopSpeakingPlan")] + public StopSpeakingPlan? StopSpeakingPlan { get; set; } + + /// + /// This is the plan for real-time monitoring of the assistant's calls. + /// + /// Usage: + /// - To enable live listening of the assistant's calls, set `monitorPlan.listenEnabled` to `true`. + /// - To enable live control of the assistant's calls, set `monitorPlan.controlEnabled` to `true`. + /// - To attach monitors to the assistant, set `monitorPlan.monitorIds` to the set of monitor ids. + /// + [JsonPropertyName("monitorPlan")] + public MonitorPlan? MonitorPlan { get; set; } + + /// + /// These are the credentials that will be used for the assistant calls. By default, all the credentials are available for use in the call but you can provide a subset using this. + /// + [JsonPropertyName("credentialIds")] + public IEnumerable? CredentialIds { 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.url + /// 2. phoneNumber.serverUrl + /// 3. org.serverUrl + /// + [JsonPropertyName("server")] + public Server? Server { get; set; } + + [JsonPropertyName("keypadInputPlan")] + public KeypadInputPlan? KeypadInputPlan { get; set; } + + /// + /// Server-resolved baseVersion (always set after POST). + /// + [JsonPropertyName("baseVersion")] + public required string BaseVersion { get; set; } + + /// + /// Surrogate key used as `draftId` in URLs. + /// + [JsonPropertyName("id")] + public required string Id { get; set; } + + /// + /// Org this draft belongs to. + /// + [JsonPropertyName("orgId")] + public required string OrgId { get; set; } + + /// + /// Parent assistant the draft was forked from. FK to assistant.id ON DELETE CASCADE. + /// + [JsonPropertyName("assistantId")] + public required string AssistantId { get; set; } + + /// + /// Email when JWT, null when API or external JWT. Set on POST, never rewritten on PATCH. + /// + [JsonPropertyName("createdBy")] + public string? CreatedBy { get; set; } + + [JsonPropertyName("createdAt")] + public required DateTime CreatedAt { get; set; } + + [JsonPropertyName("updatedAt")] + public required DateTime UpdatedAt { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/AssistantDraftBackgroundSoundZero.cs b/src/Vapi.Net/Types/AssistantDraftBackgroundSoundZero.cs new file mode 100644 index 00000000..2219fed0 --- /dev/null +++ b/src/Vapi.Net/Types/AssistantDraftBackgroundSoundZero.cs @@ -0,0 +1,84 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(AssistantDraftBackgroundSoundZeroSerializer))] +public enum AssistantDraftBackgroundSoundZero +{ + [EnumMember(Value = "off")] + Off, + + [EnumMember(Value = "office")] + Office, +} + +internal class AssistantDraftBackgroundSoundZeroSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + AssistantDraftBackgroundSoundZero + > _stringToEnum = new() + { + { "off", AssistantDraftBackgroundSoundZero.Off }, + { "office", AssistantDraftBackgroundSoundZero.Office }, + }; + + private static readonly global::System.Collections.Generic.Dictionary< + AssistantDraftBackgroundSoundZero, + string + > _enumToString = new() + { + { AssistantDraftBackgroundSoundZero.Off, "off" }, + { AssistantDraftBackgroundSoundZero.Office, "office" }, + }; + + public override AssistantDraftBackgroundSoundZero Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + AssistantDraftBackgroundSoundZero value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override AssistantDraftBackgroundSoundZero ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + AssistantDraftBackgroundSoundZero value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/AssistantDraftClientMessagesItem.cs b/src/Vapi.Net/Types/AssistantDraftClientMessagesItem.cs new file mode 100644 index 00000000..525f55c7 --- /dev/null +++ b/src/Vapi.Net/Types/AssistantDraftClientMessagesItem.cs @@ -0,0 +1,169 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(AssistantDraftClientMessagesItemSerializer))] +public enum AssistantDraftClientMessagesItem +{ + [EnumMember(Value = "conversation-update")] + ConversationUpdate, + + [EnumMember(Value = "assistant.speechStarted")] + AssistantSpeechStarted, + + [EnumMember(Value = "function-call")] + FunctionCall, + + [EnumMember(Value = "function-call-result")] + FunctionCallResult, + + [EnumMember(Value = "hang")] + Hang, + + [EnumMember(Value = "language-changed")] + LanguageChanged, + + [EnumMember(Value = "metadata")] + Metadata, + + [EnumMember(Value = "model-output")] + ModelOutput, + + [EnumMember(Value = "speech-update")] + SpeechUpdate, + + [EnumMember(Value = "status-update")] + StatusUpdate, + + [EnumMember(Value = "transcript")] + Transcript, + + [EnumMember(Value = "tool-calls")] + ToolCalls, + + [EnumMember(Value = "tool-calls-result")] + ToolCallsResult, + + [EnumMember(Value = "tool.completed")] + ToolCompleted, + + [EnumMember(Value = "transfer-update")] + TransferUpdate, + + [EnumMember(Value = "user-interrupted")] + UserInterrupted, + + [EnumMember(Value = "voice-input")] + VoiceInput, + + [EnumMember(Value = "workflow.node.started")] + WorkflowNodeStarted, + + [EnumMember(Value = "assistant.started")] + AssistantStarted, +} + +internal class AssistantDraftClientMessagesItemSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + AssistantDraftClientMessagesItem + > _stringToEnum = new() + { + { "conversation-update", AssistantDraftClientMessagesItem.ConversationUpdate }, + { "assistant.speechStarted", AssistantDraftClientMessagesItem.AssistantSpeechStarted }, + { "function-call", AssistantDraftClientMessagesItem.FunctionCall }, + { "function-call-result", AssistantDraftClientMessagesItem.FunctionCallResult }, + { "hang", AssistantDraftClientMessagesItem.Hang }, + { "language-changed", AssistantDraftClientMessagesItem.LanguageChanged }, + { "metadata", AssistantDraftClientMessagesItem.Metadata }, + { "model-output", AssistantDraftClientMessagesItem.ModelOutput }, + { "speech-update", AssistantDraftClientMessagesItem.SpeechUpdate }, + { "status-update", AssistantDraftClientMessagesItem.StatusUpdate }, + { "transcript", AssistantDraftClientMessagesItem.Transcript }, + { "tool-calls", AssistantDraftClientMessagesItem.ToolCalls }, + { "tool-calls-result", AssistantDraftClientMessagesItem.ToolCallsResult }, + { "tool.completed", AssistantDraftClientMessagesItem.ToolCompleted }, + { "transfer-update", AssistantDraftClientMessagesItem.TransferUpdate }, + { "user-interrupted", AssistantDraftClientMessagesItem.UserInterrupted }, + { "voice-input", AssistantDraftClientMessagesItem.VoiceInput }, + { "workflow.node.started", AssistantDraftClientMessagesItem.WorkflowNodeStarted }, + { "assistant.started", AssistantDraftClientMessagesItem.AssistantStarted }, + }; + + private static readonly global::System.Collections.Generic.Dictionary< + AssistantDraftClientMessagesItem, + string + > _enumToString = new() + { + { AssistantDraftClientMessagesItem.ConversationUpdate, "conversation-update" }, + { AssistantDraftClientMessagesItem.AssistantSpeechStarted, "assistant.speechStarted" }, + { AssistantDraftClientMessagesItem.FunctionCall, "function-call" }, + { AssistantDraftClientMessagesItem.FunctionCallResult, "function-call-result" }, + { AssistantDraftClientMessagesItem.Hang, "hang" }, + { AssistantDraftClientMessagesItem.LanguageChanged, "language-changed" }, + { AssistantDraftClientMessagesItem.Metadata, "metadata" }, + { AssistantDraftClientMessagesItem.ModelOutput, "model-output" }, + { AssistantDraftClientMessagesItem.SpeechUpdate, "speech-update" }, + { AssistantDraftClientMessagesItem.StatusUpdate, "status-update" }, + { AssistantDraftClientMessagesItem.Transcript, "transcript" }, + { AssistantDraftClientMessagesItem.ToolCalls, "tool-calls" }, + { AssistantDraftClientMessagesItem.ToolCallsResult, "tool-calls-result" }, + { AssistantDraftClientMessagesItem.ToolCompleted, "tool.completed" }, + { AssistantDraftClientMessagesItem.TransferUpdate, "transfer-update" }, + { AssistantDraftClientMessagesItem.UserInterrupted, "user-interrupted" }, + { AssistantDraftClientMessagesItem.VoiceInput, "voice-input" }, + { AssistantDraftClientMessagesItem.WorkflowNodeStarted, "workflow.node.started" }, + { AssistantDraftClientMessagesItem.AssistantStarted, "assistant.started" }, + }; + + public override AssistantDraftClientMessagesItem Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + AssistantDraftClientMessagesItem value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override AssistantDraftClientMessagesItem ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + AssistantDraftClientMessagesItem value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/AssistantDraftConflictResponseDto.cs b/src/Vapi.Net/Types/AssistantDraftConflictResponseDto.cs new file mode 100644 index 00000000..3c845e37 --- /dev/null +++ b/src/Vapi.Net/Types/AssistantDraftConflictResponseDto.cs @@ -0,0 +1,34 @@ +using global::System.Text.Json; +using global::System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[Serializable] +public record AssistantDraftConflictResponseDto : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("existingDraftId")] + public string? ExistingDraftId { get; set; } + + [JsonPropertyName("error")] + public required string Error { get; set; } + + [JsonPropertyName("message")] + public required string Message { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/AssistantDraftFirstMessageMode.cs b/src/Vapi.Net/Types/AssistantDraftFirstMessageMode.cs new file mode 100644 index 00000000..38e2ac8f --- /dev/null +++ b/src/Vapi.Net/Types/AssistantDraftFirstMessageMode.cs @@ -0,0 +1,95 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(AssistantDraftFirstMessageModeSerializer))] +public enum AssistantDraftFirstMessageMode +{ + [EnumMember(Value = "assistant-speaks-first")] + AssistantSpeaksFirst, + + [EnumMember(Value = "assistant-speaks-first-with-model-generated-message")] + AssistantSpeaksFirstWithModelGeneratedMessage, + + [EnumMember(Value = "assistant-waits-for-user")] + AssistantWaitsForUser, +} + +internal class AssistantDraftFirstMessageModeSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + AssistantDraftFirstMessageMode + > _stringToEnum = new() + { + { "assistant-speaks-first", AssistantDraftFirstMessageMode.AssistantSpeaksFirst }, + { + "assistant-speaks-first-with-model-generated-message", + AssistantDraftFirstMessageMode.AssistantSpeaksFirstWithModelGeneratedMessage + }, + { "assistant-waits-for-user", AssistantDraftFirstMessageMode.AssistantWaitsForUser }, + }; + + private static readonly global::System.Collections.Generic.Dictionary< + AssistantDraftFirstMessageMode, + string + > _enumToString = new() + { + { AssistantDraftFirstMessageMode.AssistantSpeaksFirst, "assistant-speaks-first" }, + { + AssistantDraftFirstMessageMode.AssistantSpeaksFirstWithModelGeneratedMessage, + "assistant-speaks-first-with-model-generated-message" + }, + { AssistantDraftFirstMessageMode.AssistantWaitsForUser, "assistant-waits-for-user" }, + }; + + public override AssistantDraftFirstMessageMode Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + AssistantDraftFirstMessageMode value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override AssistantDraftFirstMessageMode ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + AssistantDraftFirstMessageMode value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/AssistantDraftPaginatedMetadata.cs b/src/Vapi.Net/Types/AssistantDraftPaginatedMetadata.cs new file mode 100644 index 00000000..88b8f86e --- /dev/null +++ b/src/Vapi.Net/Types/AssistantDraftPaginatedMetadata.cs @@ -0,0 +1,34 @@ +using global::System.Text.Json; +using global::System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[Serializable] +public record AssistantDraftPaginatedMetadata : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("nextCursor")] + public string? NextCursor { get; set; } + + [JsonPropertyName("hasNextPage")] + public required bool HasNextPage { get; set; } + + [JsonPropertyName("limit")] + public required double Limit { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/AssistantDraftPaginatedResponse.cs b/src/Vapi.Net/Types/AssistantDraftPaginatedResponse.cs new file mode 100644 index 00000000..aa7f9135 --- /dev/null +++ b/src/Vapi.Net/Types/AssistantDraftPaginatedResponse.cs @@ -0,0 +1,31 @@ +using global::System.Text.Json; +using global::System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[Serializable] +public record AssistantDraftPaginatedResponse : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("results")] + public IEnumerable Results { get; set; } = new List(); + + [JsonPropertyName("metadata")] + public required AssistantDraftPaginatedMetadata Metadata { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/AssistantDraftServerMessagesItem.cs b/src/Vapi.Net/Types/AssistantDraftServerMessagesItem.cs new file mode 100644 index 00000000..d3447978 --- /dev/null +++ b/src/Vapi.Net/Types/AssistantDraftServerMessagesItem.cs @@ -0,0 +1,227 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(AssistantDraftServerMessagesItemSerializer))] +public enum AssistantDraftServerMessagesItem +{ + [EnumMember(Value = "assistant.started")] + AssistantStarted, + + [EnumMember(Value = "assistant.speechStarted")] + AssistantSpeechStarted, + + [EnumMember(Value = "conversation-update")] + ConversationUpdate, + + [EnumMember(Value = "end-of-call-report")] + EndOfCallReport, + + [EnumMember(Value = "function-call")] + FunctionCall, + + [EnumMember(Value = "hang")] + Hang, + + [EnumMember(Value = "language-changed")] + LanguageChanged, + + [EnumMember(Value = "language-change-detected")] + LanguageChangeDetected, + + [EnumMember(Value = "model-output")] + ModelOutput, + + [EnumMember(Value = "phone-call-control")] + PhoneCallControl, + + [EnumMember(Value = "speech-update")] + SpeechUpdate, + + [EnumMember(Value = "status-update")] + StatusUpdate, + + [EnumMember(Value = "transcript")] + Transcript, + + [EnumMember(Value = "transcript[transcriptType=\"final\"]")] + TranscriptTranscriptTypeFinal, + + [EnumMember(Value = "tool-calls")] + ToolCalls, + + [EnumMember(Value = "transfer-destination-request")] + TransferDestinationRequest, + + [EnumMember(Value = "handoff-destination-request")] + HandoffDestinationRequest, + + [EnumMember(Value = "transfer-update")] + TransferUpdate, + + [EnumMember(Value = "user-interrupted")] + UserInterrupted, + + [EnumMember(Value = "voice-input")] + VoiceInput, + + [EnumMember(Value = "chat.created")] + ChatCreated, + + [EnumMember(Value = "chat.deleted")] + ChatDeleted, + + [EnumMember(Value = "session.created")] + SessionCreated, + + [EnumMember(Value = "session.updated")] + SessionUpdated, + + [EnumMember(Value = "session.deleted")] + SessionDeleted, + + [EnumMember(Value = "call.deleted")] + CallDeleted, + + [EnumMember(Value = "call.delete.failed")] + CallDeleteFailed, +} + +internal class AssistantDraftServerMessagesItemSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + AssistantDraftServerMessagesItem + > _stringToEnum = new() + { + { "assistant.started", AssistantDraftServerMessagesItem.AssistantStarted }, + { "assistant.speechStarted", AssistantDraftServerMessagesItem.AssistantSpeechStarted }, + { "conversation-update", AssistantDraftServerMessagesItem.ConversationUpdate }, + { "end-of-call-report", AssistantDraftServerMessagesItem.EndOfCallReport }, + { "function-call", AssistantDraftServerMessagesItem.FunctionCall }, + { "hang", AssistantDraftServerMessagesItem.Hang }, + { "language-changed", AssistantDraftServerMessagesItem.LanguageChanged }, + { "language-change-detected", AssistantDraftServerMessagesItem.LanguageChangeDetected }, + { "model-output", AssistantDraftServerMessagesItem.ModelOutput }, + { "phone-call-control", AssistantDraftServerMessagesItem.PhoneCallControl }, + { "speech-update", AssistantDraftServerMessagesItem.SpeechUpdate }, + { "status-update", AssistantDraftServerMessagesItem.StatusUpdate }, + { "transcript", AssistantDraftServerMessagesItem.Transcript }, + { + "transcript[transcriptType=\"final\"]", + AssistantDraftServerMessagesItem.TranscriptTranscriptTypeFinal + }, + { "tool-calls", AssistantDraftServerMessagesItem.ToolCalls }, + { + "transfer-destination-request", + AssistantDraftServerMessagesItem.TransferDestinationRequest + }, + { + "handoff-destination-request", + AssistantDraftServerMessagesItem.HandoffDestinationRequest + }, + { "transfer-update", AssistantDraftServerMessagesItem.TransferUpdate }, + { "user-interrupted", AssistantDraftServerMessagesItem.UserInterrupted }, + { "voice-input", AssistantDraftServerMessagesItem.VoiceInput }, + { "chat.created", AssistantDraftServerMessagesItem.ChatCreated }, + { "chat.deleted", AssistantDraftServerMessagesItem.ChatDeleted }, + { "session.created", AssistantDraftServerMessagesItem.SessionCreated }, + { "session.updated", AssistantDraftServerMessagesItem.SessionUpdated }, + { "session.deleted", AssistantDraftServerMessagesItem.SessionDeleted }, + { "call.deleted", AssistantDraftServerMessagesItem.CallDeleted }, + { "call.delete.failed", AssistantDraftServerMessagesItem.CallDeleteFailed }, + }; + + private static readonly global::System.Collections.Generic.Dictionary< + AssistantDraftServerMessagesItem, + string + > _enumToString = new() + { + { AssistantDraftServerMessagesItem.AssistantStarted, "assistant.started" }, + { AssistantDraftServerMessagesItem.AssistantSpeechStarted, "assistant.speechStarted" }, + { AssistantDraftServerMessagesItem.ConversationUpdate, "conversation-update" }, + { AssistantDraftServerMessagesItem.EndOfCallReport, "end-of-call-report" }, + { AssistantDraftServerMessagesItem.FunctionCall, "function-call" }, + { AssistantDraftServerMessagesItem.Hang, "hang" }, + { AssistantDraftServerMessagesItem.LanguageChanged, "language-changed" }, + { AssistantDraftServerMessagesItem.LanguageChangeDetected, "language-change-detected" }, + { AssistantDraftServerMessagesItem.ModelOutput, "model-output" }, + { AssistantDraftServerMessagesItem.PhoneCallControl, "phone-call-control" }, + { AssistantDraftServerMessagesItem.SpeechUpdate, "speech-update" }, + { AssistantDraftServerMessagesItem.StatusUpdate, "status-update" }, + { AssistantDraftServerMessagesItem.Transcript, "transcript" }, + { + AssistantDraftServerMessagesItem.TranscriptTranscriptTypeFinal, + "transcript[transcriptType=\"final\"]" + }, + { AssistantDraftServerMessagesItem.ToolCalls, "tool-calls" }, + { + AssistantDraftServerMessagesItem.TransferDestinationRequest, + "transfer-destination-request" + }, + { + AssistantDraftServerMessagesItem.HandoffDestinationRequest, + "handoff-destination-request" + }, + { AssistantDraftServerMessagesItem.TransferUpdate, "transfer-update" }, + { AssistantDraftServerMessagesItem.UserInterrupted, "user-interrupted" }, + { AssistantDraftServerMessagesItem.VoiceInput, "voice-input" }, + { AssistantDraftServerMessagesItem.ChatCreated, "chat.created" }, + { AssistantDraftServerMessagesItem.ChatDeleted, "chat.deleted" }, + { AssistantDraftServerMessagesItem.SessionCreated, "session.created" }, + { AssistantDraftServerMessagesItem.SessionUpdated, "session.updated" }, + { AssistantDraftServerMessagesItem.SessionDeleted, "session.deleted" }, + { AssistantDraftServerMessagesItem.CallDeleted, "call.deleted" }, + { AssistantDraftServerMessagesItem.CallDeleteFailed, "call.delete.failed" }, + }; + + public override AssistantDraftServerMessagesItem Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + AssistantDraftServerMessagesItem value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override AssistantDraftServerMessagesItem ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + AssistantDraftServerMessagesItem value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/CreateTrieveKnowledgeBaseDtoProvider.cs b/src/Vapi.Net/Types/AssistantDraftVoicemailDetectionZero.cs similarity index 69% rename from src/Vapi.Net/Types/CreateTrieveKnowledgeBaseDtoProvider.cs rename to src/Vapi.Net/Types/AssistantDraftVoicemailDetectionZero.cs index 91aaa243..427f8edb 100644 --- a/src/Vapi.Net/Types/CreateTrieveKnowledgeBaseDtoProvider.cs +++ b/src/Vapi.Net/Types/AssistantDraftVoicemailDetectionZero.cs @@ -3,27 +3,27 @@ namespace Vapi.Net; -[JsonConverter(typeof(CreateTrieveKnowledgeBaseDtoProviderSerializer))] -public enum CreateTrieveKnowledgeBaseDtoProvider +[JsonConverter(typeof(AssistantDraftVoicemailDetectionZeroSerializer))] +public enum AssistantDraftVoicemailDetectionZero { - [EnumMember(Value = "trieve")] - Trieve, + [EnumMember(Value = "off")] + Off, } -internal class CreateTrieveKnowledgeBaseDtoProviderSerializer - : global::System.Text.Json.Serialization.JsonConverter +internal class AssistantDraftVoicemailDetectionZeroSerializer + : global::System.Text.Json.Serialization.JsonConverter { private static readonly global::System.Collections.Generic.Dictionary< string, - CreateTrieveKnowledgeBaseDtoProvider - > _stringToEnum = new() { { "trieve", CreateTrieveKnowledgeBaseDtoProvider.Trieve } }; + AssistantDraftVoicemailDetectionZero + > _stringToEnum = new() { { "off", AssistantDraftVoicemailDetectionZero.Off } }; private static readonly global::System.Collections.Generic.Dictionary< - CreateTrieveKnowledgeBaseDtoProvider, + AssistantDraftVoicemailDetectionZero, string - > _enumToString = new() { { CreateTrieveKnowledgeBaseDtoProvider.Trieve, "trieve" } }; + > _enumToString = new() { { AssistantDraftVoicemailDetectionZero.Off, "off" } }; - public override CreateTrieveKnowledgeBaseDtoProvider Read( + public override AssistantDraftVoicemailDetectionZero Read( ref global::System.Text.Json.Utf8JsonReader reader, global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options @@ -37,7 +37,7 @@ public override CreateTrieveKnowledgeBaseDtoProvider Read( public override void Write( global::System.Text.Json.Utf8JsonWriter writer, - CreateTrieveKnowledgeBaseDtoProvider value, + AssistantDraftVoicemailDetectionZero value, global::System.Text.Json.JsonSerializerOptions options ) { @@ -46,7 +46,7 @@ public override void Write( ); } - public override CreateTrieveKnowledgeBaseDtoProvider ReadAsPropertyName( + public override AssistantDraftVoicemailDetectionZero ReadAsPropertyName( ref global::System.Text.Json.Utf8JsonReader reader, global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options @@ -62,7 +62,7 @@ public override CreateTrieveKnowledgeBaseDtoProvider ReadAsPropertyName( public override void WriteAsPropertyName( global::System.Text.Json.Utf8JsonWriter writer, - CreateTrieveKnowledgeBaseDtoProvider value, + AssistantDraftVoicemailDetectionZero value, global::System.Text.Json.JsonSerializerOptions options ) { diff --git a/src/Vapi.Net/Types/AssistantMessage.cs b/src/Vapi.Net/Types/AssistantMessage.cs index 43feeeee..41e8d991 100644 --- a/src/Vapi.Net/Types/AssistantMessage.cs +++ b/src/Vapi.Net/Types/AssistantMessage.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// An assistant-authored message, including content, refusal text, tool calls, participant name, and metadata. +/// [Serializable] public record AssistantMessage : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/AssistantMessageEvaluationContinuePlan.cs b/src/Vapi.Net/Types/AssistantMessageEvaluationContinuePlan.cs index b42f170e..a9965b55 100644 --- a/src/Vapi.Net/Types/AssistantMessageEvaluationContinuePlan.cs +++ b/src/Vapi.Net/Types/AssistantMessageEvaluationContinuePlan.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Controls how an evaluation proceeds after judging an assistant message, including failure handling and optional message overrides. +/// [Serializable] public record AssistantMessageEvaluationContinuePlan : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/AssistantMessageJudgePlanAi.cs b/src/Vapi.Net/Types/AssistantMessageJudgePlanAi.cs index 2c1348ae..307ffd8e 100644 --- a/src/Vapi.Net/Types/AssistantMessageJudgePlanAi.cs +++ b/src/Vapi.Net/Types/AssistantMessageJudgePlanAi.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Evaluates an assistant message with an LLM judge and a configured evaluation model. +/// [Serializable] public record AssistantMessageJudgePlanAi : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/AssistantMessageJudgePlanExact.cs b/src/Vapi.Net/Types/AssistantMessageJudgePlanExact.cs index 6b310673..263cd030 100644 --- a/src/Vapi.Net/Types/AssistantMessageJudgePlanExact.cs +++ b/src/Vapi.Net/Types/AssistantMessageJudgePlanExact.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Evaluates an assistant message using case-insensitive exact content matching and expected tool calls. +/// [Serializable] public record AssistantMessageJudgePlanExact : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/AssistantMessageJudgePlanRegex.cs b/src/Vapi.Net/Types/AssistantMessageJudgePlanRegex.cs index eec0afa9..9093ef28 100644 --- a/src/Vapi.Net/Types/AssistantMessageJudgePlanRegex.cs +++ b/src/Vapi.Net/Types/AssistantMessageJudgePlanRegex.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Evaluates assistant-message content and tool-call arguments using regular-expression patterns. +/// [Serializable] public record AssistantMessageJudgePlanRegex : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/AssistantOverrides.cs b/src/Vapi.Net/Types/AssistantOverrides.cs index f23046d5..07977401 100644 --- a/src/Vapi.Net/Types/AssistantOverrides.cs +++ b/src/Vapi.Net/Types/AssistantOverrides.cs @@ -5,6 +5,9 @@ namespace Vapi.Net; +/// +/// Per-call or handoff overrides for an assistant's providers, messages, tools, credentials, call behavior, and server configuration. +/// [Serializable] public record AssistantOverrides : IJsonOnDeserialized { @@ -38,6 +41,9 @@ public record AssistantOverrides : IJsonOnDeserialized [JsonPropertyName("firstMessage")] public string? FirstMessage { get; set; } + /// + /// Set to `true` to allow the user to interrupt the assistant while it speaks the first message. Default is `false`. + /// [JsonPropertyName("firstMessageInterruptionsEnabled")] public bool? FirstMessageInterruptionsEnabled { get; set; } @@ -136,6 +142,9 @@ public IEnumerable< > >? Hooks { get; set; } + /// + /// Tools to append to the assistant's existing tool configuration. + /// [JsonPropertyName("tools:append")] public IEnumerable? ToolsAppend { get; set; } @@ -181,6 +190,9 @@ public IEnumerable< [JsonPropertyName("endCallPhrases")] public IEnumerable? EndCallPhrases { get; set; } + /// + /// Compliance settings to apply, including HIPAA and PCI behavior, security filtering, and recording consent. + /// [JsonPropertyName("compliancePlan")] public CompliancePlan? CompliancePlan { get; set; } @@ -271,6 +283,9 @@ public IEnumerable< [JsonPropertyName("server")] public Server? Server { get; set; } + /// + /// Configuration for collecting and processing DTMF keypad input. + /// [JsonPropertyName("keypadInputPlan")] public KeypadInputPlan? KeypadInputPlan { get; set; } diff --git a/src/Vapi.Net/Types/AssistantPinnedConflictResponseDto.cs b/src/Vapi.Net/Types/AssistantPinnedConflictResponseDto.cs new file mode 100644 index 00000000..bdd1eae3 --- /dev/null +++ b/src/Vapi.Net/Types/AssistantPinnedConflictResponseDto.cs @@ -0,0 +1,34 @@ +using global::System.Text.Json; +using global::System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[Serializable] +public record AssistantPinnedConflictResponseDto : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("error")] + public required AssistantPinnedConflictResponseDtoError Error { get; set; } + + /// + /// Human-readable reason the parent-assistant delete was rejected. + /// + [JsonPropertyName("message")] + public required string Message { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/AssistantPinnedConflictResponseDtoError.cs b/src/Vapi.Net/Types/AssistantPinnedConflictResponseDtoError.cs new file mode 100644 index 00000000..dcae994e --- /dev/null +++ b/src/Vapi.Net/Types/AssistantPinnedConflictResponseDtoError.cs @@ -0,0 +1,79 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(AssistantPinnedConflictResponseDtoErrorSerializer))] +public enum AssistantPinnedConflictResponseDtoError +{ + [EnumMember(Value = "assistant_pinned")] + AssistantPinned, +} + +internal class AssistantPinnedConflictResponseDtoErrorSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + AssistantPinnedConflictResponseDtoError + > _stringToEnum = new() + { + { "assistant_pinned", AssistantPinnedConflictResponseDtoError.AssistantPinned }, + }; + + private static readonly global::System.Collections.Generic.Dictionary< + AssistantPinnedConflictResponseDtoError, + string + > _enumToString = new() + { + { AssistantPinnedConflictResponseDtoError.AssistantPinned, "assistant_pinned" }, + }; + + public override AssistantPinnedConflictResponseDtoError Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + AssistantPinnedConflictResponseDtoError value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override AssistantPinnedConflictResponseDtoError ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + AssistantPinnedConflictResponseDtoError value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/AssistantVersion.cs b/src/Vapi.Net/Types/AssistantVersion.cs new file mode 100644 index 00000000..962c7f73 --- /dev/null +++ b/src/Vapi.Net/Types/AssistantVersion.cs @@ -0,0 +1,340 @@ +using global::System.Text.Json; +using global::System.Text.Json.Serialization; +using OneOf; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[Serializable] +public record AssistantVersion : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + /// + /// These are the options for the assistant's transcriber. + /// + [JsonPropertyName("transcriber")] + public object? Transcriber { get; set; } + + /// + /// These are the options for the assistant's LLM. + /// + [JsonPropertyName("model")] + public object? Model { get; set; } + + /// + /// These are the options for the assistant's voice. + /// + [JsonPropertyName("voice")] + public object? Voice { get; set; } + + /// + /// This is the first message that the assistant will say. This can also be a URL to a containerized audio file (mp3, wav, etc.). + /// + /// If unspecified, assistant will wait for user to speak and use the model to respond once they speak. + /// + [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'. + /// + /// Use: + /// - 'assistant-speaks-first' to have the assistant speak first. + /// - 'assistant-waits-for-user' to have the assistant wait for the user to speak first. + /// - 'assistant-speaks-first-with-model-generated-message' to have the assistant speak first with a message generated by the model based on the conversation state. (`assistant.model.messages` at call start, `call.messages` at squad transfer points). + /// + /// @default 'assistant-speaks-first' + /// + [JsonPropertyName("firstMessageMode")] + public AssistantVersionFirstMessageMode? FirstMessageMode { get; set; } + + /// + /// These are the settings to configure or disable voicemail detection. Alternatively, voicemail detection can be configured using the model.tools=[VoicemailTool]. + /// By default, voicemail detection is disabled. + /// + [JsonPropertyName("voicemailDetection")] + public OneOf< + AssistantVersionVoicemailDetectionZero, + GoogleVoicemailDetectionPlan, + OpenAiVoicemailDetectionPlan, + TwilioVoicemailDetectionPlan, + VapiVoicemailDetectionPlan + >? 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,assistant.started. You can check the shape of the messages in ClientMessage schema. + /// + [JsonPropertyName("clientMessages")] + public IEnumerable? ClientMessages { get; set; } + + /// + /// These are the messages that will be sent to your Server URL. Default is conversation-update,end-of-call-report,function-call,hang,speech-update,status-update,tool-calls,transfer-destination-request,handoff-destination-request,user-interrupted,assistant.started. You can check the shape of the messages in ServerMessage schema. + /// + [JsonPropertyName("serverMessages")] + public IEnumerable? ServerMessages { get; set; } + + /// + /// This is the maximum number of seconds that the call will last. When the call reaches this duration, it will be ended. + /// + /// @default 600 (10 minutes) + /// + [JsonPropertyName("maxDurationSeconds")] + public double? MaxDurationSeconds { get; set; } + + /// + /// 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 OneOf? BackgroundSound { get; set; } + + /// + /// This determines whether the model's output is used in conversation history rather than the transcription of assistant's speech. + /// + /// @default false + /// + [JsonPropertyName("modelOutputInMessagesEnabled")] + public bool? ModelOutputInMessagesEnabled { get; set; } + + /// + /// These are the configurations to be passed to the transport providers of assistant's calls, like Twilio. You can store multiple configurations for different transport providers. For a call, only the configuration matching the call transport provider is used. + /// + [JsonPropertyName("transportConfigurations")] + public IEnumerable? TransportConfigurations { get; set; } + + /// + /// This is the plan for observability of assistant's calls. + /// + /// Currently, only Langfuse is supported. + /// + [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. + /// + [JsonPropertyName("credentials")] + public IEnumerable? Credentials { get; set; } + + /// + /// This is a set of actions that will be performed on certain events. + /// + [JsonPropertyName("hooks")] + public IEnumerable< + OneOf< + CallHookCallEnding, + CallHookAssistantSpeechInterrupted, + CallHookCustomerSpeechInterrupted, + CallHookCustomerSpeechTimeout, + SessionCreatedHook + > + >? Hooks { get; set; } + + /// + /// Optional human-readable label for this version. Pass `null` to clear. + /// + [JsonPropertyName("versionName")] + public string? VersionName { get; set; } + + /// + /// Optional description for this version. Pass `null` to clear. + /// + [JsonPropertyName("versionDescription")] + public string? VersionDescription { get; set; } + + /// + /// This is the unique identifier for the version row. + /// + [JsonPropertyName("id")] + public required string Id { get; set; } + + /// + /// This is the unique identifier for the org that owns this version. + /// + [JsonPropertyName("orgId")] + public required string OrgId { get; set; } + + /// + /// This is the unique identifier for the assistant this version was snapshotted from. + /// + [JsonPropertyName("assistantId")] + public required string AssistantId { get; set; } + + /// + /// This is the public monotonic version label, e.g. "v1". + /// System-owned and incremented per assistant; never user-supplied. + /// + [JsonPropertyName("version")] + public required string Version { get; set; } + + /// + /// This is the SHA-256 hex of the snapshotted content used for no-op detection. + /// + [JsonPropertyName("configHash")] + public required string ConfigHash { get; set; } + + /// + /// This is the prior version label (vN-1). Null on v1 or for branch roots. + /// + [JsonPropertyName("parentVersion")] + public string? ParentVersion { get; set; } + + /// + /// This is the actor that wrote this version. Email when created via JWT, null when created via API. + /// + [JsonPropertyName("createdBy")] + public string? CreatedBy { get; set; } + + /// + /// This is the soft-delete timestamp. Null when active. + /// + [JsonPropertyName("deletedAt")] + public DateTime? DeletedAt { get; set; } + + /// + /// This is the ISO 8601 date-time string of when the version was created. + /// + [JsonPropertyName("createdAt")] + public required DateTime CreatedAt { get; set; } + + /// + /// This is the name of the assistant. + /// + /// This is required when you want to transfer between assistants in a call. + /// + [JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// This is the message that the assistant will say if the call is forwarded to voicemail. + /// + /// If unspecified, it will hang up. + /// + [JsonPropertyName("voicemailMessage")] + public string? VoicemailMessage { get; set; } + + /// + /// This is the message that the assistant will say if it ends the call. + /// + /// If unspecified, it will hang up without saying anything. + /// + [JsonPropertyName("endCallMessage")] + public string? EndCallMessage { get; set; } + + /// + /// This list contains phrases that, if spoken by the assistant, will trigger the call to be hung up. Case insensitive. + /// + [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. + /// + [JsonPropertyName("metadata")] + public object? Metadata { get; set; } + + /// + /// This enables filtering of noise and background speech while the user is talking. + /// + /// Features: + /// - Smart denoising using Krisp + /// - Fourier denoising + /// + /// Smart denoising can be combined with or used independently of Fourier denoising. + /// + /// Order of precedence: + /// - Smart denoising + /// - Fourier denoising + /// + [JsonPropertyName("backgroundSpeechDenoisingPlan")] + public BackgroundSpeechDenoisingPlan? BackgroundSpeechDenoisingPlan { get; set; } + + /// + /// This is the plan for analysis of assistant's calls. Stored in `call.analysis`. + /// + [JsonPropertyName("analysisPlan")] + public AnalysisPlan? AnalysisPlan { get; set; } + + /// + /// This is the plan for artifacts generated during assistant's calls. Stored in `call.artifact`. + /// + [JsonPropertyName("artifactPlan")] + public ArtifactPlan? ArtifactPlan { get; set; } + + /// + /// This is the plan for when the assistant should start talking. + /// + /// You should configure this if you're running into these issues: + /// - The assistant is too slow to start talking after the customer is done speaking. + /// - The assistant is too fast to start talking after the customer is done speaking. + /// - The assistant is so fast that it's actually interrupting the customer. + /// + [JsonPropertyName("startSpeakingPlan")] + public StartSpeakingPlan? StartSpeakingPlan { get; set; } + + /// + /// This is the plan for when assistant should stop talking on customer interruption. + /// + /// You should configure this if you're running into these issues: + /// - The assistant is too slow to recognize customer's interruption. + /// - The assistant is too fast to recognize customer's interruption. + /// - The assistant is getting interrupted by phrases that are just acknowledgments. + /// - The assistant is getting interrupted by background noises. + /// - The assistant is not properly stopping -- it starts talking right after getting interrupted. + /// + [JsonPropertyName("stopSpeakingPlan")] + public StopSpeakingPlan? StopSpeakingPlan { get; set; } + + /// + /// This is the plan for real-time monitoring of the assistant's calls. + /// + /// Usage: + /// - To enable live listening of the assistant's calls, set `monitorPlan.listenEnabled` to `true`. + /// - To enable live control of the assistant's calls, set `monitorPlan.controlEnabled` to `true`. + /// - To attach monitors to the assistant, set `monitorPlan.monitorIds` to the set of monitor ids. + /// + [JsonPropertyName("monitorPlan")] + public MonitorPlan? MonitorPlan { get; set; } + + /// + /// These are the credentials that will be used for the assistant calls. By default, all the credentials are available for use in the call but you can provide a subset using this. + /// + [JsonPropertyName("credentialIds")] + public IEnumerable? CredentialIds { 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.url + /// 2. phoneNumber.serverUrl + /// 3. org.serverUrl + /// + [JsonPropertyName("server")] + public Server? Server { get; set; } + + [JsonPropertyName("keypadInputPlan")] + public KeypadInputPlan? KeypadInputPlan { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/AssistantVersionBackgroundSoundZero.cs b/src/Vapi.Net/Types/AssistantVersionBackgroundSoundZero.cs new file mode 100644 index 00000000..62ed87ba --- /dev/null +++ b/src/Vapi.Net/Types/AssistantVersionBackgroundSoundZero.cs @@ -0,0 +1,84 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(AssistantVersionBackgroundSoundZeroSerializer))] +public enum AssistantVersionBackgroundSoundZero +{ + [EnumMember(Value = "off")] + Off, + + [EnumMember(Value = "office")] + Office, +} + +internal class AssistantVersionBackgroundSoundZeroSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + AssistantVersionBackgroundSoundZero + > _stringToEnum = new() + { + { "off", AssistantVersionBackgroundSoundZero.Off }, + { "office", AssistantVersionBackgroundSoundZero.Office }, + }; + + private static readonly global::System.Collections.Generic.Dictionary< + AssistantVersionBackgroundSoundZero, + string + > _enumToString = new() + { + { AssistantVersionBackgroundSoundZero.Off, "off" }, + { AssistantVersionBackgroundSoundZero.Office, "office" }, + }; + + public override AssistantVersionBackgroundSoundZero Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + AssistantVersionBackgroundSoundZero value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override AssistantVersionBackgroundSoundZero ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + AssistantVersionBackgroundSoundZero value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/AssistantVersionClientMessagesItem.cs b/src/Vapi.Net/Types/AssistantVersionClientMessagesItem.cs new file mode 100644 index 00000000..5ac6350f --- /dev/null +++ b/src/Vapi.Net/Types/AssistantVersionClientMessagesItem.cs @@ -0,0 +1,169 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(AssistantVersionClientMessagesItemSerializer))] +public enum AssistantVersionClientMessagesItem +{ + [EnumMember(Value = "conversation-update")] + ConversationUpdate, + + [EnumMember(Value = "assistant.speechStarted")] + AssistantSpeechStarted, + + [EnumMember(Value = "function-call")] + FunctionCall, + + [EnumMember(Value = "function-call-result")] + FunctionCallResult, + + [EnumMember(Value = "hang")] + Hang, + + [EnumMember(Value = "language-changed")] + LanguageChanged, + + [EnumMember(Value = "metadata")] + Metadata, + + [EnumMember(Value = "model-output")] + ModelOutput, + + [EnumMember(Value = "speech-update")] + SpeechUpdate, + + [EnumMember(Value = "status-update")] + StatusUpdate, + + [EnumMember(Value = "transcript")] + Transcript, + + [EnumMember(Value = "tool-calls")] + ToolCalls, + + [EnumMember(Value = "tool-calls-result")] + ToolCallsResult, + + [EnumMember(Value = "tool.completed")] + ToolCompleted, + + [EnumMember(Value = "transfer-update")] + TransferUpdate, + + [EnumMember(Value = "user-interrupted")] + UserInterrupted, + + [EnumMember(Value = "voice-input")] + VoiceInput, + + [EnumMember(Value = "workflow.node.started")] + WorkflowNodeStarted, + + [EnumMember(Value = "assistant.started")] + AssistantStarted, +} + +internal class AssistantVersionClientMessagesItemSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + AssistantVersionClientMessagesItem + > _stringToEnum = new() + { + { "conversation-update", AssistantVersionClientMessagesItem.ConversationUpdate }, + { "assistant.speechStarted", AssistantVersionClientMessagesItem.AssistantSpeechStarted }, + { "function-call", AssistantVersionClientMessagesItem.FunctionCall }, + { "function-call-result", AssistantVersionClientMessagesItem.FunctionCallResult }, + { "hang", AssistantVersionClientMessagesItem.Hang }, + { "language-changed", AssistantVersionClientMessagesItem.LanguageChanged }, + { "metadata", AssistantVersionClientMessagesItem.Metadata }, + { "model-output", AssistantVersionClientMessagesItem.ModelOutput }, + { "speech-update", AssistantVersionClientMessagesItem.SpeechUpdate }, + { "status-update", AssistantVersionClientMessagesItem.StatusUpdate }, + { "transcript", AssistantVersionClientMessagesItem.Transcript }, + { "tool-calls", AssistantVersionClientMessagesItem.ToolCalls }, + { "tool-calls-result", AssistantVersionClientMessagesItem.ToolCallsResult }, + { "tool.completed", AssistantVersionClientMessagesItem.ToolCompleted }, + { "transfer-update", AssistantVersionClientMessagesItem.TransferUpdate }, + { "user-interrupted", AssistantVersionClientMessagesItem.UserInterrupted }, + { "voice-input", AssistantVersionClientMessagesItem.VoiceInput }, + { "workflow.node.started", AssistantVersionClientMessagesItem.WorkflowNodeStarted }, + { "assistant.started", AssistantVersionClientMessagesItem.AssistantStarted }, + }; + + private static readonly global::System.Collections.Generic.Dictionary< + AssistantVersionClientMessagesItem, + string + > _enumToString = new() + { + { AssistantVersionClientMessagesItem.ConversationUpdate, "conversation-update" }, + { AssistantVersionClientMessagesItem.AssistantSpeechStarted, "assistant.speechStarted" }, + { AssistantVersionClientMessagesItem.FunctionCall, "function-call" }, + { AssistantVersionClientMessagesItem.FunctionCallResult, "function-call-result" }, + { AssistantVersionClientMessagesItem.Hang, "hang" }, + { AssistantVersionClientMessagesItem.LanguageChanged, "language-changed" }, + { AssistantVersionClientMessagesItem.Metadata, "metadata" }, + { AssistantVersionClientMessagesItem.ModelOutput, "model-output" }, + { AssistantVersionClientMessagesItem.SpeechUpdate, "speech-update" }, + { AssistantVersionClientMessagesItem.StatusUpdate, "status-update" }, + { AssistantVersionClientMessagesItem.Transcript, "transcript" }, + { AssistantVersionClientMessagesItem.ToolCalls, "tool-calls" }, + { AssistantVersionClientMessagesItem.ToolCallsResult, "tool-calls-result" }, + { AssistantVersionClientMessagesItem.ToolCompleted, "tool.completed" }, + { AssistantVersionClientMessagesItem.TransferUpdate, "transfer-update" }, + { AssistantVersionClientMessagesItem.UserInterrupted, "user-interrupted" }, + { AssistantVersionClientMessagesItem.VoiceInput, "voice-input" }, + { AssistantVersionClientMessagesItem.WorkflowNodeStarted, "workflow.node.started" }, + { AssistantVersionClientMessagesItem.AssistantStarted, "assistant.started" }, + }; + + public override AssistantVersionClientMessagesItem Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + AssistantVersionClientMessagesItem value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override AssistantVersionClientMessagesItem ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + AssistantVersionClientMessagesItem value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/AssistantVersionFirstMessageMode.cs b/src/Vapi.Net/Types/AssistantVersionFirstMessageMode.cs new file mode 100644 index 00000000..c1fa532a --- /dev/null +++ b/src/Vapi.Net/Types/AssistantVersionFirstMessageMode.cs @@ -0,0 +1,95 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(AssistantVersionFirstMessageModeSerializer))] +public enum AssistantVersionFirstMessageMode +{ + [EnumMember(Value = "assistant-speaks-first")] + AssistantSpeaksFirst, + + [EnumMember(Value = "assistant-speaks-first-with-model-generated-message")] + AssistantSpeaksFirstWithModelGeneratedMessage, + + [EnumMember(Value = "assistant-waits-for-user")] + AssistantWaitsForUser, +} + +internal class AssistantVersionFirstMessageModeSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + AssistantVersionFirstMessageMode + > _stringToEnum = new() + { + { "assistant-speaks-first", AssistantVersionFirstMessageMode.AssistantSpeaksFirst }, + { + "assistant-speaks-first-with-model-generated-message", + AssistantVersionFirstMessageMode.AssistantSpeaksFirstWithModelGeneratedMessage + }, + { "assistant-waits-for-user", AssistantVersionFirstMessageMode.AssistantWaitsForUser }, + }; + + private static readonly global::System.Collections.Generic.Dictionary< + AssistantVersionFirstMessageMode, + string + > _enumToString = new() + { + { AssistantVersionFirstMessageMode.AssistantSpeaksFirst, "assistant-speaks-first" }, + { + AssistantVersionFirstMessageMode.AssistantSpeaksFirstWithModelGeneratedMessage, + "assistant-speaks-first-with-model-generated-message" + }, + { AssistantVersionFirstMessageMode.AssistantWaitsForUser, "assistant-waits-for-user" }, + }; + + public override AssistantVersionFirstMessageMode Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + AssistantVersionFirstMessageMode value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override AssistantVersionFirstMessageMode ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + AssistantVersionFirstMessageMode value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/AssistantVersionPaginatedMetadata.cs b/src/Vapi.Net/Types/AssistantVersionPaginatedMetadata.cs new file mode 100644 index 00000000..c9b7ea78 --- /dev/null +++ b/src/Vapi.Net/Types/AssistantVersionPaginatedMetadata.cs @@ -0,0 +1,34 @@ +using global::System.Text.Json; +using global::System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[Serializable] +public record AssistantVersionPaginatedMetadata : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("nextCursor")] + public string? NextCursor { get; set; } + + [JsonPropertyName("hasNextPage")] + public required bool HasNextPage { get; set; } + + [JsonPropertyName("limit")] + public required double Limit { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/AssistantVersionPaginatedResponse.cs b/src/Vapi.Net/Types/AssistantVersionPaginatedResponse.cs index 350104e3..c544b6f2 100644 --- a/src/Vapi.Net/Types/AssistantVersionPaginatedResponse.cs +++ b/src/Vapi.Net/Types/AssistantVersionPaginatedResponse.cs @@ -12,13 +12,10 @@ public record AssistantVersionPaginatedResponse : IJsonOnDeserialized new Dictionary(); [JsonPropertyName("results")] - public IEnumerable Results { get; set; } = new List(); + public IEnumerable Results { get; set; } = new List(); [JsonPropertyName("metadata")] - public required PaginationMeta Metadata { get; set; } - - [JsonPropertyName("nextPageState")] - public string? NextPageState { get; set; } + public required AssistantVersionPaginatedMetadata Metadata { get; set; } [JsonIgnore] public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); diff --git a/src/Vapi.Net/Types/AssistantVersionServerMessagesItem.cs b/src/Vapi.Net/Types/AssistantVersionServerMessagesItem.cs new file mode 100644 index 00000000..f1b0ba4b --- /dev/null +++ b/src/Vapi.Net/Types/AssistantVersionServerMessagesItem.cs @@ -0,0 +1,227 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(AssistantVersionServerMessagesItemSerializer))] +public enum AssistantVersionServerMessagesItem +{ + [EnumMember(Value = "assistant.started")] + AssistantStarted, + + [EnumMember(Value = "assistant.speechStarted")] + AssistantSpeechStarted, + + [EnumMember(Value = "conversation-update")] + ConversationUpdate, + + [EnumMember(Value = "end-of-call-report")] + EndOfCallReport, + + [EnumMember(Value = "function-call")] + FunctionCall, + + [EnumMember(Value = "hang")] + Hang, + + [EnumMember(Value = "language-changed")] + LanguageChanged, + + [EnumMember(Value = "language-change-detected")] + LanguageChangeDetected, + + [EnumMember(Value = "model-output")] + ModelOutput, + + [EnumMember(Value = "phone-call-control")] + PhoneCallControl, + + [EnumMember(Value = "speech-update")] + SpeechUpdate, + + [EnumMember(Value = "status-update")] + StatusUpdate, + + [EnumMember(Value = "transcript")] + Transcript, + + [EnumMember(Value = "transcript[transcriptType=\"final\"]")] + TranscriptTranscriptTypeFinal, + + [EnumMember(Value = "tool-calls")] + ToolCalls, + + [EnumMember(Value = "transfer-destination-request")] + TransferDestinationRequest, + + [EnumMember(Value = "handoff-destination-request")] + HandoffDestinationRequest, + + [EnumMember(Value = "transfer-update")] + TransferUpdate, + + [EnumMember(Value = "user-interrupted")] + UserInterrupted, + + [EnumMember(Value = "voice-input")] + VoiceInput, + + [EnumMember(Value = "chat.created")] + ChatCreated, + + [EnumMember(Value = "chat.deleted")] + ChatDeleted, + + [EnumMember(Value = "session.created")] + SessionCreated, + + [EnumMember(Value = "session.updated")] + SessionUpdated, + + [EnumMember(Value = "session.deleted")] + SessionDeleted, + + [EnumMember(Value = "call.deleted")] + CallDeleted, + + [EnumMember(Value = "call.delete.failed")] + CallDeleteFailed, +} + +internal class AssistantVersionServerMessagesItemSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + AssistantVersionServerMessagesItem + > _stringToEnum = new() + { + { "assistant.started", AssistantVersionServerMessagesItem.AssistantStarted }, + { "assistant.speechStarted", AssistantVersionServerMessagesItem.AssistantSpeechStarted }, + { "conversation-update", AssistantVersionServerMessagesItem.ConversationUpdate }, + { "end-of-call-report", AssistantVersionServerMessagesItem.EndOfCallReport }, + { "function-call", AssistantVersionServerMessagesItem.FunctionCall }, + { "hang", AssistantVersionServerMessagesItem.Hang }, + { "language-changed", AssistantVersionServerMessagesItem.LanguageChanged }, + { "language-change-detected", AssistantVersionServerMessagesItem.LanguageChangeDetected }, + { "model-output", AssistantVersionServerMessagesItem.ModelOutput }, + { "phone-call-control", AssistantVersionServerMessagesItem.PhoneCallControl }, + { "speech-update", AssistantVersionServerMessagesItem.SpeechUpdate }, + { "status-update", AssistantVersionServerMessagesItem.StatusUpdate }, + { "transcript", AssistantVersionServerMessagesItem.Transcript }, + { + "transcript[transcriptType=\"final\"]", + AssistantVersionServerMessagesItem.TranscriptTranscriptTypeFinal + }, + { "tool-calls", AssistantVersionServerMessagesItem.ToolCalls }, + { + "transfer-destination-request", + AssistantVersionServerMessagesItem.TransferDestinationRequest + }, + { + "handoff-destination-request", + AssistantVersionServerMessagesItem.HandoffDestinationRequest + }, + { "transfer-update", AssistantVersionServerMessagesItem.TransferUpdate }, + { "user-interrupted", AssistantVersionServerMessagesItem.UserInterrupted }, + { "voice-input", AssistantVersionServerMessagesItem.VoiceInput }, + { "chat.created", AssistantVersionServerMessagesItem.ChatCreated }, + { "chat.deleted", AssistantVersionServerMessagesItem.ChatDeleted }, + { "session.created", AssistantVersionServerMessagesItem.SessionCreated }, + { "session.updated", AssistantVersionServerMessagesItem.SessionUpdated }, + { "session.deleted", AssistantVersionServerMessagesItem.SessionDeleted }, + { "call.deleted", AssistantVersionServerMessagesItem.CallDeleted }, + { "call.delete.failed", AssistantVersionServerMessagesItem.CallDeleteFailed }, + }; + + private static readonly global::System.Collections.Generic.Dictionary< + AssistantVersionServerMessagesItem, + string + > _enumToString = new() + { + { AssistantVersionServerMessagesItem.AssistantStarted, "assistant.started" }, + { AssistantVersionServerMessagesItem.AssistantSpeechStarted, "assistant.speechStarted" }, + { AssistantVersionServerMessagesItem.ConversationUpdate, "conversation-update" }, + { AssistantVersionServerMessagesItem.EndOfCallReport, "end-of-call-report" }, + { AssistantVersionServerMessagesItem.FunctionCall, "function-call" }, + { AssistantVersionServerMessagesItem.Hang, "hang" }, + { AssistantVersionServerMessagesItem.LanguageChanged, "language-changed" }, + { AssistantVersionServerMessagesItem.LanguageChangeDetected, "language-change-detected" }, + { AssistantVersionServerMessagesItem.ModelOutput, "model-output" }, + { AssistantVersionServerMessagesItem.PhoneCallControl, "phone-call-control" }, + { AssistantVersionServerMessagesItem.SpeechUpdate, "speech-update" }, + { AssistantVersionServerMessagesItem.StatusUpdate, "status-update" }, + { AssistantVersionServerMessagesItem.Transcript, "transcript" }, + { + AssistantVersionServerMessagesItem.TranscriptTranscriptTypeFinal, + "transcript[transcriptType=\"final\"]" + }, + { AssistantVersionServerMessagesItem.ToolCalls, "tool-calls" }, + { + AssistantVersionServerMessagesItem.TransferDestinationRequest, + "transfer-destination-request" + }, + { + AssistantVersionServerMessagesItem.HandoffDestinationRequest, + "handoff-destination-request" + }, + { AssistantVersionServerMessagesItem.TransferUpdate, "transfer-update" }, + { AssistantVersionServerMessagesItem.UserInterrupted, "user-interrupted" }, + { AssistantVersionServerMessagesItem.VoiceInput, "voice-input" }, + { AssistantVersionServerMessagesItem.ChatCreated, "chat.created" }, + { AssistantVersionServerMessagesItem.ChatDeleted, "chat.deleted" }, + { AssistantVersionServerMessagesItem.SessionCreated, "session.created" }, + { AssistantVersionServerMessagesItem.SessionUpdated, "session.updated" }, + { AssistantVersionServerMessagesItem.SessionDeleted, "session.deleted" }, + { AssistantVersionServerMessagesItem.CallDeleted, "call.deleted" }, + { AssistantVersionServerMessagesItem.CallDeleteFailed, "call.delete.failed" }, + }; + + public override AssistantVersionServerMessagesItem Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + AssistantVersionServerMessagesItem value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override AssistantVersionServerMessagesItem ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + AssistantVersionServerMessagesItem value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/AssistantVersionVoicemailDetectionZero.cs b/src/Vapi.Net/Types/AssistantVersionVoicemailDetectionZero.cs new file mode 100644 index 00000000..f9c8a599 --- /dev/null +++ b/src/Vapi.Net/Types/AssistantVersionVoicemailDetectionZero.cs @@ -0,0 +1,73 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(AssistantVersionVoicemailDetectionZeroSerializer))] +public enum AssistantVersionVoicemailDetectionZero +{ + [EnumMember(Value = "off")] + Off, +} + +internal class AssistantVersionVoicemailDetectionZeroSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + AssistantVersionVoicemailDetectionZero + > _stringToEnum = new() { { "off", AssistantVersionVoicemailDetectionZero.Off } }; + + private static readonly global::System.Collections.Generic.Dictionary< + AssistantVersionVoicemailDetectionZero, + string + > _enumToString = new() { { AssistantVersionVoicemailDetectionZero.Off, "off" } }; + + public override AssistantVersionVoicemailDetectionZero Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + AssistantVersionVoicemailDetectionZero value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override AssistantVersionVoicemailDetectionZero ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + AssistantVersionVoicemailDetectionZero value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/AudioFormat.cs b/src/Vapi.Net/Types/AudioFormat.cs new file mode 100644 index 00000000..e4075ba2 --- /dev/null +++ b/src/Vapi.Net/Types/AudioFormat.cs @@ -0,0 +1,49 @@ +using global::System.Text.Json; +using global::System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[Serializable] +public record AudioFormat : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + /// + /// This is the sample rate of the call. + /// + /// @default 16000 + /// + [JsonPropertyName("sampleRate")] + public required double SampleRate { get; set; } + + /// + /// This is the audio format of the call. + /// + /// @default 'pcm_s16le' + /// + [JsonPropertyName("format")] + public object Format { get; set; } = new Dictionary(); + + /// + /// This is the container format of the call. + /// + /// @default 'raw' + /// + [JsonPropertyName("container")] + public AudioFormatContainer? Container { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/VapiModelProvider.cs b/src/Vapi.Net/Types/AudioFormatContainer.cs similarity index 74% rename from src/Vapi.Net/Types/VapiModelProvider.cs rename to src/Vapi.Net/Types/AudioFormatContainer.cs index 5c303481..5dd17ae3 100644 --- a/src/Vapi.Net/Types/VapiModelProvider.cs +++ b/src/Vapi.Net/Types/AudioFormatContainer.cs @@ -3,27 +3,27 @@ namespace Vapi.Net; -[JsonConverter(typeof(VapiModelProviderSerializer))] -public enum VapiModelProvider +[JsonConverter(typeof(AudioFormatContainerSerializer))] +public enum AudioFormatContainer { - [EnumMember(Value = "vapi")] - Vapi, + [EnumMember(Value = "raw")] + Raw, } -internal class VapiModelProviderSerializer - : global::System.Text.Json.Serialization.JsonConverter +internal class AudioFormatContainerSerializer + : global::System.Text.Json.Serialization.JsonConverter { private static readonly global::System.Collections.Generic.Dictionary< string, - VapiModelProvider - > _stringToEnum = new() { { "vapi", VapiModelProvider.Vapi } }; + AudioFormatContainer + > _stringToEnum = new() { { "raw", AudioFormatContainer.Raw } }; private static readonly global::System.Collections.Generic.Dictionary< - VapiModelProvider, + AudioFormatContainer, string - > _enumToString = new() { { VapiModelProvider.Vapi, "vapi" } }; + > _enumToString = new() { { AudioFormatContainer.Raw, "raw" } }; - public override VapiModelProvider Read( + public override AudioFormatContainer Read( ref global::System.Text.Json.Utf8JsonReader reader, global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options @@ -37,7 +37,7 @@ public override VapiModelProvider Read( public override void Write( global::System.Text.Json.Utf8JsonWriter writer, - VapiModelProvider value, + AudioFormatContainer value, global::System.Text.Json.JsonSerializerOptions options ) { @@ -46,7 +46,7 @@ public override void Write( ); } - public override VapiModelProvider ReadAsPropertyName( + public override AudioFormatContainer ReadAsPropertyName( ref global::System.Text.Json.Utf8JsonReader reader, global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options @@ -62,7 +62,7 @@ public override VapiModelProvider ReadAsPropertyName( public override void WriteAsPropertyName( global::System.Text.Json.Utf8JsonWriter writer, - VapiModelProvider value, + AudioFormatContainer value, global::System.Text.Json.JsonSerializerOptions options ) { diff --git a/src/Vapi.Net/Types/AwsStsAuthenticationPlan.cs b/src/Vapi.Net/Types/AwsStsAuthenticationPlan.cs index d369df49..3bc5b705 100644 --- a/src/Vapi.Net/Types/AwsStsAuthenticationPlan.cs +++ b/src/Vapi.Net/Types/AwsStsAuthenticationPlan.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// AWS Security Token Service role-assumption configuration used to authenticate requests. +/// [Serializable] public record AwsStsAuthenticationPlan : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/AwsiamCredentialsAuthenticationPlan.cs b/src/Vapi.Net/Types/AwsiamCredentialsAuthenticationPlan.cs index 1df97bfc..1c32c14c 100644 --- a/src/Vapi.Net/Types/AwsiamCredentialsAuthenticationPlan.cs +++ b/src/Vapi.Net/Types/AwsiamCredentialsAuthenticationPlan.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Direct AWS IAM credentials used to authenticate requests. +/// [Serializable] public record AwsiamCredentialsAuthenticationPlan : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/AzureBlobStorageBucketPlan.cs b/src/Vapi.Net/Types/AzureBlobStorageBucketPlan.cs index 54b4cd87..c2730a93 100644 --- a/src/Vapi.Net/Types/AzureBlobStorageBucketPlan.cs +++ b/src/Vapi.Net/Types/AzureBlobStorageBucketPlan.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Azure Blob Storage container configuration for call artifacts, including its connection string, container name, and storage path. +/// [Serializable] public record AzureBlobStorageBucketPlan : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/AzureCredentialRegion.cs b/src/Vapi.Net/Types/AzureCredentialRegion.cs index 4a4dcd91..7b034e14 100644 --- a/src/Vapi.Net/Types/AzureCredentialRegion.cs +++ b/src/Vapi.Net/Types/AzureCredentialRegion.cs @@ -60,6 +60,12 @@ public enum AzureCredentialRegion [EnumMember(Value = "switzerland")] Switzerland, + [EnumMember(Value = "switzerlandnorth")] + Switzerlandnorth, + + [EnumMember(Value = "switzerlandwest")] + Switzerlandwest, + [EnumMember(Value = "uaenorth")] Uaenorth, @@ -102,6 +108,8 @@ internal class AzureCredentialRegionSerializer { "spaincentral", AzureCredentialRegion.Spaincentral }, { "swedencentral", AzureCredentialRegion.Swedencentral }, { "switzerland", AzureCredentialRegion.Switzerland }, + { "switzerlandnorth", AzureCredentialRegion.Switzerlandnorth }, + { "switzerlandwest", AzureCredentialRegion.Switzerlandwest }, { "uaenorth", AzureCredentialRegion.Uaenorth }, { "uk", AzureCredentialRegion.Uk }, { "westeurope", AzureCredentialRegion.Westeurope }, @@ -132,6 +140,8 @@ internal class AzureCredentialRegionSerializer { AzureCredentialRegion.Spaincentral, "spaincentral" }, { AzureCredentialRegion.Swedencentral, "swedencentral" }, { AzureCredentialRegion.Switzerland, "switzerland" }, + { AzureCredentialRegion.Switzerlandnorth, "switzerlandnorth" }, + { AzureCredentialRegion.Switzerlandwest, "switzerlandwest" }, { AzureCredentialRegion.Uaenorth, "uaenorth" }, { AzureCredentialRegion.Uk, "uk" }, { AzureCredentialRegion.Westeurope, "westeurope" }, diff --git a/src/Vapi.Net/Types/AzureOpenAiCredentialModelsItem.cs b/src/Vapi.Net/Types/AzureOpenAiCredentialModelsItem.cs index 62b781c7..f7c124af 100644 --- a/src/Vapi.Net/Types/AzureOpenAiCredentialModelsItem.cs +++ b/src/Vapi.Net/Types/AzureOpenAiCredentialModelsItem.cs @@ -74,6 +74,15 @@ public enum AzureOpenAiCredentialModelsItem [EnumMember(Value = "gpt-35-turbo-1106")] Gpt35Turbo1106, + + [EnumMember(Value = "gpt-4o")] + Gpt4O, + + [EnumMember(Value = "gpt-4.1")] + Gpt41, + + [EnumMember(Value = "gpt-5.4-mini-2026-03-17")] + Gpt54Mini20260317, } internal class AzureOpenAiCredentialModelsItemSerializer @@ -107,6 +116,9 @@ internal class AzureOpenAiCredentialModelsItemSerializer { "gpt-4-0613", AzureOpenAiCredentialModelsItem.Gpt40613 }, { "gpt-35-turbo-0125", AzureOpenAiCredentialModelsItem.Gpt35Turbo0125 }, { "gpt-35-turbo-1106", AzureOpenAiCredentialModelsItem.Gpt35Turbo1106 }, + { "gpt-4o", AzureOpenAiCredentialModelsItem.Gpt4O }, + { "gpt-4.1", AzureOpenAiCredentialModelsItem.Gpt41 }, + { "gpt-5.4-mini-2026-03-17", AzureOpenAiCredentialModelsItem.Gpt54Mini20260317 }, }; private static readonly global::System.Collections.Generic.Dictionary< @@ -137,6 +149,9 @@ internal class AzureOpenAiCredentialModelsItemSerializer { AzureOpenAiCredentialModelsItem.Gpt40613, "gpt-4-0613" }, { AzureOpenAiCredentialModelsItem.Gpt35Turbo0125, "gpt-35-turbo-0125" }, { AzureOpenAiCredentialModelsItem.Gpt35Turbo1106, "gpt-35-turbo-1106" }, + { AzureOpenAiCredentialModelsItem.Gpt4O, "gpt-4o" }, + { AzureOpenAiCredentialModelsItem.Gpt41, "gpt-4.1" }, + { AzureOpenAiCredentialModelsItem.Gpt54Mini20260317, "gpt-5.4-mini-2026-03-17" }, }; public override AzureOpenAiCredentialModelsItem Read( diff --git a/src/Vapi.Net/Types/AzureOpenAiCredentialRegion.cs b/src/Vapi.Net/Types/AzureOpenAiCredentialRegion.cs index 617a0e2f..c0c94b5b 100644 --- a/src/Vapi.Net/Types/AzureOpenAiCredentialRegion.cs +++ b/src/Vapi.Net/Types/AzureOpenAiCredentialRegion.cs @@ -60,6 +60,12 @@ public enum AzureOpenAiCredentialRegion [EnumMember(Value = "switzerland")] Switzerland, + [EnumMember(Value = "switzerlandnorth")] + Switzerlandnorth, + + [EnumMember(Value = "switzerlandwest")] + Switzerlandwest, + [EnumMember(Value = "uaenorth")] Uaenorth, @@ -102,6 +108,8 @@ internal class AzureOpenAiCredentialRegionSerializer { "spaincentral", AzureOpenAiCredentialRegion.Spaincentral }, { "swedencentral", AzureOpenAiCredentialRegion.Swedencentral }, { "switzerland", AzureOpenAiCredentialRegion.Switzerland }, + { "switzerlandnorth", AzureOpenAiCredentialRegion.Switzerlandnorth }, + { "switzerlandwest", AzureOpenAiCredentialRegion.Switzerlandwest }, { "uaenorth", AzureOpenAiCredentialRegion.Uaenorth }, { "uk", AzureOpenAiCredentialRegion.Uk }, { "westeurope", AzureOpenAiCredentialRegion.Westeurope }, @@ -132,6 +140,8 @@ internal class AzureOpenAiCredentialRegionSerializer { AzureOpenAiCredentialRegion.Spaincentral, "spaincentral" }, { AzureOpenAiCredentialRegion.Swedencentral, "swedencentral" }, { AzureOpenAiCredentialRegion.Switzerland, "switzerland" }, + { AzureOpenAiCredentialRegion.Switzerlandnorth, "switzerlandnorth" }, + { AzureOpenAiCredentialRegion.Switzerlandwest, "switzerlandwest" }, { AzureOpenAiCredentialRegion.Uaenorth, "uaenorth" }, { AzureOpenAiCredentialRegion.Uk, "uk" }, { AzureOpenAiCredentialRegion.Westeurope, "westeurope" }, diff --git a/src/Vapi.Net/Types/AzureSpeechTranscriber.cs b/src/Vapi.Net/Types/AzureSpeechTranscriber.cs index 24fe1bdd..3507340d 100644 --- a/src/Vapi.Net/Types/AzureSpeechTranscriber.cs +++ b/src/Vapi.Net/Types/AzureSpeechTranscriber.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Configuration for transcribing speech during assistant conversations with Azure Speech, including language, segmentation, and fallback settings. +/// [Serializable] public record AzureSpeechTranscriber : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/AzureVoice.cs b/src/Vapi.Net/Types/AzureVoice.cs index 61ee50a2..e5696fb8 100644 --- a/src/Vapi.Net/Types/AzureVoice.cs +++ b/src/Vapi.Net/Types/AzureVoice.cs @@ -5,6 +5,9 @@ namespace Vapi.Net; +/// +/// Configuration for synthesizing assistant speech with Azure, including voice selection, speed, chunking, caching, and fallback settings. +/// [Serializable] public record AzureVoice : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/BackgroundSpeechDenoisingPlan.cs b/src/Vapi.Net/Types/BackgroundSpeechDenoisingPlan.cs index f28b09d8..843c9175 100644 --- a/src/Vapi.Net/Types/BackgroundSpeechDenoisingPlan.cs +++ b/src/Vapi.Net/Types/BackgroundSpeechDenoisingPlan.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Controls smart and Fourier denoising applied to customer audio before transcription. +/// [Serializable] public record BackgroundSpeechDenoisingPlan : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/BackoffPlan.cs b/src/Vapi.Net/Types/BackoffPlan.cs index fb50929c..3b91aa3a 100644 --- a/src/Vapi.Net/Types/BackoffPlan.cs +++ b/src/Vapi.Net/Types/BackoffPlan.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Controls retry behavior for failed server requests, including strategy, maximum retries, base delay, and status codes excluded from retries. +/// [Serializable] public record BackoffPlan : IJsonOnDeserialized { @@ -28,14 +31,13 @@ public record BackoffPlan : IJsonOnDeserialized 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. + /// Base delay in seconds. For fixed backoff, this is the delay between retries. For exponential backoff, this is the initial delay. /// [JsonPropertyName("baseDelaySeconds")] public required double BaseDelaySeconds { get; set; } /// - /// This is the excluded status codes. If the response status code is in this list, the request will not be retried. - /// By default, the request will be retried for any non-2xx status code. + /// HTTP status codes that should not trigger a retry. By default, any non-2xx status code not listed here can be retried. /// [JsonPropertyName("excludedStatusCodes")] public IEnumerable? ExcludedStatusCodes { get; set; } diff --git a/src/Vapi.Net/Types/BarInsight.cs b/src/Vapi.Net/Types/BarInsight.cs index 16e4e8d6..bd2c865d 100644 --- a/src/Vapi.Net/Types/BarInsight.cs +++ b/src/Vapi.Net/Types/BarInsight.cs @@ -5,6 +5,9 @@ namespace Vapi.Net; +/// +/// A saved bar-chart insight containing its call-data queries, formulas, grouping, stepped time range, metadata, and lifecycle information. +/// [Serializable] public record BarInsight : IJsonOnDeserialized { @@ -44,6 +47,9 @@ public record BarInsight : IJsonOnDeserialized [JsonPropertyName("metadata")] public BarInsightMetadata? Metadata { get; set; } + /// + /// The time range and interval used to aggregate the bar-chart data. + /// [JsonPropertyName("timeRange")] public InsightTimeRangeWithStep? TimeRange { get; set; } @@ -100,6 +106,12 @@ public IEnumerable< [JsonPropertyName("updatedAt")] public required DateTime UpdatedAt { get; set; } + /// + /// Stable server-owned identifier for system-created insights. + /// + [JsonPropertyName("systemKey")] + public string? SystemKey { get; set; } + [JsonIgnore] public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); diff --git a/src/Vapi.Net/Types/BarInsightMetadata.cs b/src/Vapi.Net/Types/BarInsightMetadata.cs index c3948d4b..5c833dbd 100644 --- a/src/Vapi.Net/Types/BarInsightMetadata.cs +++ b/src/Vapi.Net/Types/BarInsightMetadata.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Display settings for a bar insight, including chart name, axis labels, and optional y-axis bounds. +/// [Serializable] public record BarInsightMetadata : IJsonOnDeserialized { @@ -11,18 +14,33 @@ public record BarInsightMetadata : IJsonOnDeserialized private readonly IDictionary _extensionData = new Dictionary(); + /// + /// Label displayed on the chart's x-axis. + /// [JsonPropertyName("xAxisLabel")] public string? XAxisLabel { get; set; } + /// + /// Label displayed on the chart's y-axis. + /// [JsonPropertyName("yAxisLabel")] public string? YAxisLabel { get; set; } + /// + /// Minimum value displayed on the chart's y-axis. + /// [JsonPropertyName("yAxisMin")] public double? YAxisMin { get; set; } + /// + /// Maximum value displayed on the chart's y-axis. + /// [JsonPropertyName("yAxisMax")] public double? YAxisMax { get; set; } + /// + /// Display name for the insight chart. + /// [JsonPropertyName("name")] public string? Name { get; set; } diff --git a/src/Vapi.Net/Types/BashTool.cs b/src/Vapi.Net/Types/BashTool.cs index 869968a4..c332df7c 100644 --- a/src/Vapi.Net/Types/BashTool.cs +++ b/src/Vapi.Net/Types/BashTool.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// A reusable tool that executes shell commands in a configured environment. +/// [Serializable] public record BashTool : IJsonOnDeserialized { @@ -11,10 +14,11 @@ public record BashTool : IJsonOnDeserialized private readonly IDictionary _extensionData = new Dictionary(); + [JsonPropertyName("latestVersion")] + public string? LatestVersion { 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. + /// Messages spoken while the tool is running. Multiple request-start messages are variants. For request-response-delayed, same timing means variants and different timings mean staged updates. /// [JsonPropertyName("messages")] public IEnumerable? Messages { get; set; } diff --git a/src/Vapi.Net/Types/BashToolWithToolCall.cs b/src/Vapi.Net/Types/BashToolWithToolCall.cs index 3aefae9b..e859059c 100644 --- a/src/Vapi.Net/Types/BashToolWithToolCall.cs +++ b/src/Vapi.Net/Types/BashToolWithToolCall.cs @@ -12,9 +12,7 @@ public record BashToolWithToolCall : IJsonOnDeserialized new Dictionary(); /// - /// 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. + /// Messages spoken while the tool is running. Multiple request-start messages are variants. For request-response-delayed, same timing means variants and different timings mean staged updates. /// [JsonPropertyName("messages")] public IEnumerable? Messages { get; set; } diff --git a/src/Vapi.Net/Types/BearerAuthenticationPlan.cs b/src/Vapi.Net/Types/BearerAuthenticationPlan.cs index db69ea69..0563906f 100644 --- a/src/Vapi.Net/Types/BearerAuthenticationPlan.cs +++ b/src/Vapi.Net/Types/BearerAuthenticationPlan.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Configuration for authenticating outbound requests with a bearer token, including header name and optional `Bearer` prefix. +/// [Serializable] public record BearerAuthenticationPlan : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/Board.cs b/src/Vapi.Net/Types/Board.cs new file mode 100644 index 00000000..7485c963 --- /dev/null +++ b/src/Vapi.Net/Types/Board.cs @@ -0,0 +1,83 @@ +using global::System.Text.Json; +using global::System.Text.Json.Serialization; +using OneOf; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[Serializable] +public record Board : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + /// + /// This is the contents of the Board, which is an array of objects defining the type, contents, and position of the widgets on the Board. + /// + [JsonPropertyName("items")] + public IEnumerable>? Items { get; set; } + + /// + /// This is the unique identifier for the Board. + /// + [JsonPropertyName("id")] + public required string Id { get; set; } + + /// + /// This is the unique identifier for the org that this Board belongs to. + /// + [JsonPropertyName("orgId")] + public required string OrgId { get; set; } + + /// + /// This is the ISO 8601 date-time string of when the Board was created. + /// + [JsonPropertyName("createdAt")] + public required DateTime CreatedAt { get; set; } + + /// + /// This is the ISO 8601 date-time string of when the Board was last updated. + /// + [JsonPropertyName("updatedAt")] + public required DateTime UpdatedAt { get; set; } + + /// + /// Server-owned key for system-provisioned boards. User create/update DTOs do + /// not accept this field. + /// + [JsonPropertyName("systemKey")] + public string? SystemKey { get; set; } + + /// + /// This is the name of the Board. + /// + [JsonPropertyName("name")] + public required string Name { get; set; } + + /// + /// This is the layout of the Board. + /// + [JsonPropertyName("layout")] + public required BoardLayout Layout { get; set; } + + /// + /// This is the timerange override for the board. + /// By default, individual insights have their own timerange. + /// This is a global override for the board which will be passed to all insights on the board. + /// + [JsonPropertyName("timeRangeOverride")] + public InsightTimeRangeWithStep? TimeRangeOverride { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/BoardInsightItem.cs b/src/Vapi.Net/Types/BoardInsightItem.cs new file mode 100644 index 00000000..ccc0d151 --- /dev/null +++ b/src/Vapi.Net/Types/BoardInsightItem.cs @@ -0,0 +1,40 @@ +using global::System.Text.Json; +using global::System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[Serializable] +public record BoardInsightItem : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("type")] + public required BoardInsightItemType Type { get; set; } + + [JsonPropertyName("insightId")] + public required string InsightId { get; set; } + + [JsonPropertyName("systemKey")] + public string? SystemKey { get; set; } + + [JsonPropertyName("position")] + public required BoardItemPosition Position { get; set; } + + [JsonPropertyName("size")] + public required BoardItemSize Size { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/TrieveCredentialProvider.cs b/src/Vapi.Net/Types/BoardInsightItemType.cs similarity index 72% rename from src/Vapi.Net/Types/TrieveCredentialProvider.cs rename to src/Vapi.Net/Types/BoardInsightItemType.cs index b9e2375d..a024c300 100644 --- a/src/Vapi.Net/Types/TrieveCredentialProvider.cs +++ b/src/Vapi.Net/Types/BoardInsightItemType.cs @@ -3,27 +3,27 @@ namespace Vapi.Net; -[JsonConverter(typeof(TrieveCredentialProviderSerializer))] -public enum TrieveCredentialProvider +[JsonConverter(typeof(BoardInsightItemTypeSerializer))] +public enum BoardInsightItemType { - [EnumMember(Value = "trieve")] - Trieve, + [EnumMember(Value = "insight")] + Insight, } -internal class TrieveCredentialProviderSerializer - : global::System.Text.Json.Serialization.JsonConverter +internal class BoardInsightItemTypeSerializer + : global::System.Text.Json.Serialization.JsonConverter { private static readonly global::System.Collections.Generic.Dictionary< string, - TrieveCredentialProvider - > _stringToEnum = new() { { "trieve", TrieveCredentialProvider.Trieve } }; + BoardInsightItemType + > _stringToEnum = new() { { "insight", BoardInsightItemType.Insight } }; private static readonly global::System.Collections.Generic.Dictionary< - TrieveCredentialProvider, + BoardInsightItemType, string - > _enumToString = new() { { TrieveCredentialProvider.Trieve, "trieve" } }; + > _enumToString = new() { { BoardInsightItemType.Insight, "insight" } }; - public override TrieveCredentialProvider Read( + public override BoardInsightItemType Read( ref global::System.Text.Json.Utf8JsonReader reader, global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options @@ -37,7 +37,7 @@ public override TrieveCredentialProvider Read( public override void Write( global::System.Text.Json.Utf8JsonWriter writer, - TrieveCredentialProvider value, + BoardInsightItemType value, global::System.Text.Json.JsonSerializerOptions options ) { @@ -46,7 +46,7 @@ public override void Write( ); } - public override TrieveCredentialProvider ReadAsPropertyName( + public override BoardInsightItemType ReadAsPropertyName( ref global::System.Text.Json.Utf8JsonReader reader, global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options @@ -62,7 +62,7 @@ public override TrieveCredentialProvider ReadAsPropertyName( public override void WriteAsPropertyName( global::System.Text.Json.Utf8JsonWriter writer, - TrieveCredentialProvider value, + BoardInsightItemType value, global::System.Text.Json.JsonSerializerOptions options ) { diff --git a/src/Vapi.Net/Types/BoardItemPosition.cs b/src/Vapi.Net/Types/BoardItemPosition.cs new file mode 100644 index 00000000..59394e46 --- /dev/null +++ b/src/Vapi.Net/Types/BoardItemPosition.cs @@ -0,0 +1,31 @@ +using global::System.Text.Json; +using global::System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[Serializable] +public record BoardItemPosition : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("x")] + public required double X { get; set; } + + [JsonPropertyName("y")] + public required double Y { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/BoardItemSize.cs b/src/Vapi.Net/Types/BoardItemSize.cs new file mode 100644 index 00000000..a6012125 --- /dev/null +++ b/src/Vapi.Net/Types/BoardItemSize.cs @@ -0,0 +1,31 @@ +using global::System.Text.Json; +using global::System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[Serializable] +public record BoardItemSize : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("width")] + public required double Width { get; set; } + + [JsonPropertyName("height")] + public required double Height { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/BoardLayout.cs b/src/Vapi.Net/Types/BoardLayout.cs new file mode 100644 index 00000000..029c3006 --- /dev/null +++ b/src/Vapi.Net/Types/BoardLayout.cs @@ -0,0 +1,32 @@ +using global::System.Text.Json; +using global::System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[Serializable] +public record BoardLayout : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + /// + /// This is the number of columns in the Board. + /// For now, it is fixed to 6. + /// + [JsonPropertyName("columns")] + public required double Columns { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/BoardMetricWidgetItem.cs b/src/Vapi.Net/Types/BoardMetricWidgetItem.cs new file mode 100644 index 00000000..f9f4e902 --- /dev/null +++ b/src/Vapi.Net/Types/BoardMetricWidgetItem.cs @@ -0,0 +1,40 @@ +using global::System.Text.Json; +using global::System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[Serializable] +public record BoardMetricWidgetItem : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("type")] + public required BoardMetricWidgetItemType Type { get; set; } + + [JsonPropertyName("position")] + public required BoardItemPosition Position { get; set; } + + [JsonPropertyName("size")] + public required BoardItemSize Size { get; set; } + + [JsonPropertyName("insightId")] + public string? InsightId { get; set; } + + [JsonPropertyName("systemKey")] + public string? SystemKey { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/BoardMetricWidgetItemType.cs b/src/Vapi.Net/Types/BoardMetricWidgetItemType.cs new file mode 100644 index 00000000..4ff3fd9a --- /dev/null +++ b/src/Vapi.Net/Types/BoardMetricWidgetItemType.cs @@ -0,0 +1,89 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(BoardMetricWidgetItemTypeSerializer))] +public enum BoardMetricWidgetItemType +{ + [EnumMember(Value = "failed_calls_list")] + FailedCallsList, + + [EnumMember(Value = "concurrency_chart")] + ConcurrencyChart, + + [EnumMember(Value = "average_cost_breakdown_chart")] + AverageCostBreakdownChart, +} + +internal class BoardMetricWidgetItemTypeSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + BoardMetricWidgetItemType + > _stringToEnum = new() + { + { "failed_calls_list", BoardMetricWidgetItemType.FailedCallsList }, + { "concurrency_chart", BoardMetricWidgetItemType.ConcurrencyChart }, + { "average_cost_breakdown_chart", BoardMetricWidgetItemType.AverageCostBreakdownChart }, + }; + + private static readonly global::System.Collections.Generic.Dictionary< + BoardMetricWidgetItemType, + string + > _enumToString = new() + { + { BoardMetricWidgetItemType.FailedCallsList, "failed_calls_list" }, + { BoardMetricWidgetItemType.ConcurrencyChart, "concurrency_chart" }, + { BoardMetricWidgetItemType.AverageCostBreakdownChart, "average_cost_breakdown_chart" }, + }; + + public override BoardMetricWidgetItemType Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + BoardMetricWidgetItemType value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override BoardMetricWidgetItemType ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + BoardMetricWidgetItemType value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/BoardPaginatedResponse.cs b/src/Vapi.Net/Types/BoardPaginatedResponse.cs new file mode 100644 index 00000000..eaa50951 --- /dev/null +++ b/src/Vapi.Net/Types/BoardPaginatedResponse.cs @@ -0,0 +1,31 @@ +using global::System.Text.Json; +using global::System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[Serializable] +public record BoardPaginatedResponse : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("results")] + public IEnumerable Results { get; set; } = new List(); + + [JsonPropertyName("metadata")] + public required PaginationMeta Metadata { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/BooleanComparatorScorecardMetricCondition.cs b/src/Vapi.Net/Types/BooleanComparatorScorecardMetricCondition.cs new file mode 100644 index 00000000..6abe85c8 --- /dev/null +++ b/src/Vapi.Net/Types/BooleanComparatorScorecardMetricCondition.cs @@ -0,0 +1,51 @@ +using global::System.Text.Json; +using global::System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[Serializable] +public record BooleanComparatorScorecardMetricCondition : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + /// + /// This is the type of the condition. Currently only 'comparator' is supported. + /// + [JsonPropertyName("type")] + public required BooleanComparatorScorecardMetricConditionType Type { get; set; } + + /// + /// The comparator can only be '=' for boolean conditions. + /// + [JsonPropertyName("comparator")] + public required BooleanComparatorScorecardMetricConditionComparator Comparator { get; set; } + + /// + /// This is the value that will be used to compare the result of the structured output with the comparator. + /// If the result of the comparison is true, the points will be added to the overall score. + /// + [JsonPropertyName("value")] + public required bool Value { get; set; } + + /// + /// These are the points that will be added to the overall score if the condition is met. + /// The points must be between 0 and 100. + /// + [JsonPropertyName("points")] + public required double Points { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/BooleanComparatorScorecardMetricConditionComparator.cs b/src/Vapi.Net/Types/BooleanComparatorScorecardMetricConditionComparator.cs new file mode 100644 index 00000000..b4bcf21b --- /dev/null +++ b/src/Vapi.Net/Types/BooleanComparatorScorecardMetricConditionComparator.cs @@ -0,0 +1,79 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(BooleanComparatorScorecardMetricConditionComparatorSerializer))] +public enum BooleanComparatorScorecardMetricConditionComparator +{ + [EnumMember(Value = "=")] + EqualTo, +} + +internal class BooleanComparatorScorecardMetricConditionComparatorSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + BooleanComparatorScorecardMetricConditionComparator + > _stringToEnum = new() + { + { "=", BooleanComparatorScorecardMetricConditionComparator.EqualTo }, + }; + + private static readonly global::System.Collections.Generic.Dictionary< + BooleanComparatorScorecardMetricConditionComparator, + string + > _enumToString = new() + { + { BooleanComparatorScorecardMetricConditionComparator.EqualTo, "=" }, + }; + + public override BooleanComparatorScorecardMetricConditionComparator Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + BooleanComparatorScorecardMetricConditionComparator value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override BooleanComparatorScorecardMetricConditionComparator ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + BooleanComparatorScorecardMetricConditionComparator value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/BooleanComparatorScorecardMetricConditionType.cs b/src/Vapi.Net/Types/BooleanComparatorScorecardMetricConditionType.cs new file mode 100644 index 00000000..1ca70ddf --- /dev/null +++ b/src/Vapi.Net/Types/BooleanComparatorScorecardMetricConditionType.cs @@ -0,0 +1,79 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(BooleanComparatorScorecardMetricConditionTypeSerializer))] +public enum BooleanComparatorScorecardMetricConditionType +{ + [EnumMember(Value = "comparator")] + Comparator, +} + +internal class BooleanComparatorScorecardMetricConditionTypeSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + BooleanComparatorScorecardMetricConditionType + > _stringToEnum = new() + { + { "comparator", BooleanComparatorScorecardMetricConditionType.Comparator }, + }; + + private static readonly global::System.Collections.Generic.Dictionary< + BooleanComparatorScorecardMetricConditionType, + string + > _enumToString = new() + { + { BooleanComparatorScorecardMetricConditionType.Comparator, "comparator" }, + }; + + public override BooleanComparatorScorecardMetricConditionType Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + BooleanComparatorScorecardMetricConditionType value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override BooleanComparatorScorecardMetricConditionType ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + BooleanComparatorScorecardMetricConditionType value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/BotMessage.cs b/src/Vapi.Net/Types/BotMessage.cs index 8bcda6c5..17051378 100644 --- a/src/Vapi.Net/Types/BotMessage.cs +++ b/src/Vapi.Net/Types/BotMessage.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// An assistant-authored entry in the call message history, including content, timing, source, and duration. +/// [Serializable] public record BotMessage : IJsonOnDeserialized { @@ -53,6 +56,21 @@ public record BotMessage : IJsonOnDeserialized [JsonPropertyName("duration")] public double? Duration { get; set; } + /// + /// The name of the assistant that produced this message. In a squad or + /// handoff call this is the specific sub-agent active when the message was + /// spoken, letting the transcript label each message by speaker. + /// + [JsonPropertyName("assistantName")] + public string? AssistantName { get; set; } + + /// + /// The ID of the assistant that produced this message. Stable reference for + /// the assistant named in `assistantName`. + /// + [JsonPropertyName("assistantId")] + public string? AssistantId { get; set; } + [JsonIgnore] public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); diff --git a/src/Vapi.Net/Types/BothCustomEndpointingRule.cs b/src/Vapi.Net/Types/BothCustomEndpointingRule.cs index 93db3a26..c1bc98aa 100644 --- a/src/Vapi.Net/Types/BothCustomEndpointingRule.cs +++ b/src/Vapi.Net/Types/BothCustomEndpointingRule.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// A custom endpointing rule that matches both the assistant's last message and the customer's current speech before applying a configured timeout. +/// [Serializable] public record BothCustomEndpointingRule : IJsonOnDeserialized { @@ -32,6 +35,9 @@ public record BothCustomEndpointingRule : IJsonOnDeserialized [JsonPropertyName("assistantRegexOptions")] public IEnumerable? AssistantRegexOptions { get; set; } + /// + /// The regular expression pattern matched against the customer's speech. + /// [JsonPropertyName("customerRegex")] public required string CustomerRegex { get; set; } diff --git a/src/Vapi.Net/Types/BucketPlan.cs b/src/Vapi.Net/Types/BucketPlan.cs index f0c1c8b4..0a79931e 100644 --- a/src/Vapi.Net/Types/BucketPlan.cs +++ b/src/Vapi.Net/Types/BucketPlan.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Google Cloud Storage bucket configuration for call artifacts, including bucket name, region, path, and optional HMAC credentials. +/// [Serializable] public record BucketPlan : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/ByoPhoneNumber.cs b/src/Vapi.Net/Types/ByoPhoneNumber.cs index e9a2ed76..dea325ec 100644 --- a/src/Vapi.Net/Types/ByoPhoneNumber.cs +++ b/src/Vapi.Net/Types/ByoPhoneNumber.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// A phone number connected to Vapi through a bring-your-own telephony provider, including its credential, routing, hooks, server settings, and lifecycle metadata. +/// [Serializable] public record ByoPhoneNumber : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/ByoSipTrunkCredential.cs b/src/Vapi.Net/Types/ByoSipTrunkCredential.cs index 82bd0c97..161ac025 100644 --- a/src/Vapi.Net/Types/ByoSipTrunkCredential.cs +++ b/src/Vapi.Net/Types/ByoSipTrunkCredential.cs @@ -82,12 +82,6 @@ public record ByoSipTrunkCredential : IJsonOnDeserialized [JsonPropertyName("sipDiversionHeader")] public string? SipDiversionHeader { get; set; } - /// - /// This is an advanced configuration for enterprise deployments. This uses the onprem SBC to trunk into the SIP trunk's `gateways`, rather than the managed SBC provided by Vapi. - /// - [JsonPropertyName("sbcConfiguration")] - public SbcConfiguration? SbcConfiguration { get; set; } - [JsonIgnore] public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); diff --git a/src/Vapi.Net/Types/Call.cs b/src/Vapi.Net/Types/Call.cs index 9dafa1f8..4230d2d5 100644 --- a/src/Vapi.Net/Types/Call.cs +++ b/src/Vapi.Net/Types/Call.cs @@ -5,6 +5,9 @@ namespace Vapi.Net; +/// +/// A call record returned by Vapi. It contains the configuration and resources used for the call, its lifecycle status and timestamps, conversation messages, artifacts, analysis, and costs. +/// [Serializable] public record Call : IJsonOnDeserialized { @@ -24,9 +27,12 @@ public record Call : IJsonOnDeserialized [JsonPropertyName("costs")] public IEnumerable? Costs { get; set; } + /// + /// Messages exchanged during the call, including user, assistant, system, tool-call, and tool-result messages. + /// [JsonPropertyName("messages")] public IEnumerable< - OneOf + OneOf >? Messages { get; set; } /// @@ -69,6 +75,19 @@ public IEnumerable< [JsonPropertyName("destination")] public object? Destination { get; set; } + /// + /// This is the assistant version to use for this call. Supported only with + /// direct `assistantId`. Omit to follow the latest version. + /// + [JsonPropertyName("assistantVersion")] + public string? AssistantVersion { get; set; } + + /// + /// This is the transport of the call. + /// + [JsonPropertyName("transport")] + public object? Transport { get; set; } + /// /// This is the unique identifier for the call. /// @@ -290,18 +309,6 @@ public IEnumerable< [JsonPropertyName("schedulePlan")] public SchedulePlan? SchedulePlan { get; set; } - /// - /// This is the transport of the call. - /// - [JsonPropertyName("transport")] - public object? Transport { get; set; } - - /// - /// These are the subscription limits for the org at the time of the call. Includes concurrency limit information. - /// - [JsonPropertyName("subscriptionLimits")] - public SubscriptionLimits? SubscriptionLimits { get; set; } - [JsonIgnore] public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); diff --git a/src/Vapi.Net/Types/CallBatchError.cs b/src/Vapi.Net/Types/CallBatchError.cs index 1a42c808..634c03dd 100644 --- a/src/Vapi.Net/Types/CallBatchError.cs +++ b/src/Vapi.Net/Types/CallBatchError.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Error returned for one customer entry in a batch call request. +/// [Serializable] public record CallBatchError : IJsonOnDeserialized { @@ -11,9 +14,15 @@ public record CallBatchError : IJsonOnDeserialized private readonly IDictionary _extensionData = new Dictionary(); + /// + /// Customer configuration associated with the failed call. + /// [JsonPropertyName("customer")] public required CreateCustomerDto Customer { get; set; } + /// + /// Error message explaining why the call could not be created. + /// [JsonPropertyName("error")] public required string Error { get; set; } diff --git a/src/Vapi.Net/Types/CallBatchResponse.cs b/src/Vapi.Net/Types/CallBatchResponse.cs index ad032e67..ff3fbc54 100644 --- a/src/Vapi.Net/Types/CallBatchResponse.cs +++ b/src/Vapi.Net/Types/CallBatchResponse.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// The result of a batch call creation request, containing successfully created calls, per-call failures, and subscription limits recorded at the end of the batch. +/// [Serializable] public record CallBatchResponse : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/CallEndedReason.cs b/src/Vapi.Net/Types/CallEndedReason.cs index 33c01a88..27e38023 100644 --- a/src/Vapi.Net/Types/CallEndedReason.cs +++ b/src/Vapi.Net/Types/CallEndedReason.cs @@ -78,6 +78,9 @@ public enum CallEndedReason [EnumMember(Value = "call.start.error-enterprise-feature-not-available-recording-consent")] CallStartErrorEnterpriseFeatureNotAvailableRecordingConsent, + [EnumMember(Value = "call.start.assistant-version-error-validation")] + CallStartAssistantVersionErrorValidation, + [EnumMember(Value = "assistant-not-valid")] AssistantNotValid, @@ -135,6 +138,15 @@ public enum CallEndedReason [EnumMember(Value = "pipeline-error-wellsaid-voice-failed")] PipelineErrorWellsaidVoiceFailed, + [EnumMember(Value = "pipeline-error-xai-voice-failed")] + PipelineErrorXaiVoiceFailed, + + [EnumMember(Value = "pipeline-error-microsoft-voice-failed")] + PipelineErrorMicrosoftVoiceFailed, + + [EnumMember(Value = "pipeline-error-microsoft-voice-request-canceled")] + PipelineErrorMicrosoftVoiceRequestCanceled, + [EnumMember(Value = "pipeline-error-tavus-video-failed")] PipelineErrorTavusVideoFailed, @@ -186,6 +198,12 @@ public enum CallEndedReason [EnumMember(Value = "call.in-progress.error-vapifault-wellsaid-voice-failed")] CallInProgressErrorVapifaultWellsaidVoiceFailed, + [EnumMember(Value = "call.in-progress.error-vapifault-xai-voice-failed")] + CallInProgressErrorVapifaultXaiVoiceFailed, + + [EnumMember(Value = "call.in-progress.error-vapifault-microsoft-voice-failed")] + CallInProgressErrorVapifaultMicrosoftVoiceFailed, + [EnumMember(Value = "call.in-progress.error-vapifault-tavus-video-failed")] CallInProgressErrorVapifaultTavusVideoFailed, @@ -213,6 +231,9 @@ public enum CallEndedReason [EnumMember(Value = "call.in-progress.error-providerfault-vapi-llm-failed")] CallInProgressErrorProviderfaultVapiLlmFailed, + [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, @@ -231,6 +252,18 @@ public enum CallEndedReason [EnumMember(Value = "call.in-progress.error-providerfault-vapi-503-server-overloaded-error")] CallInProgressErrorProviderfaultVapi503ServerOverloadedError, + [EnumMember(Value = "pipeline-error-vapi-transcriber-failed")] + PipelineErrorVapiTranscriberFailed, + + [EnumMember(Value = "call.in-progress.error-vapifault-vapi-transcriber-failed")] + CallInProgressErrorVapifaultVapiTranscriberFailed, + + [EnumMember(Value = "call.in-progress.error-providerfault-vapi-transcriber-failed")] + CallInProgressErrorProviderfaultVapiTranscriberFailed, + + [EnumMember(Value = "call.in-progress.error-providerfault-vapi-voice-failed")] + CallInProgressErrorProviderfaultVapiVoiceFailed, + [EnumMember(Value = "pipeline-error-deepgram-transcriber-failed")] PipelineErrorDeepgramTranscriberFailed, @@ -358,6 +391,42 @@ public enum CallEndedReason [EnumMember(Value = "call.in-progress.error-vapifault-soniox-transcriber-failed")] CallInProgressErrorVapifaultSonioxTranscriberFailed, + [EnumMember(Value = "pipeline-error-xai-transcriber-auth-failed")] + PipelineErrorXaiTranscriberAuthFailed, + + [EnumMember(Value = "pipeline-error-xai-transcriber-rate-limited")] + PipelineErrorXaiTranscriberRateLimited, + + [EnumMember(Value = "pipeline-error-xai-transcriber-invalid-config")] + PipelineErrorXaiTranscriberInvalidConfig, + + [EnumMember(Value = "pipeline-error-xai-transcriber-server-error")] + PipelineErrorXaiTranscriberServerError, + + [EnumMember(Value = "pipeline-error-xai-transcriber-failed")] + PipelineErrorXaiTranscriberFailed, + + [EnumMember(Value = "call.in-progress.error-vapifault-xai-transcriber-auth-failed")] + CallInProgressErrorVapifaultXaiTranscriberAuthFailed, + + [EnumMember(Value = "call.in-progress.error-vapifault-xai-transcriber-rate-limited")] + CallInProgressErrorVapifaultXaiTranscriberRateLimited, + + [EnumMember(Value = "call.in-progress.error-vapifault-xai-transcriber-invalid-config")] + CallInProgressErrorVapifaultXaiTranscriberInvalidConfig, + + [EnumMember(Value = "call.in-progress.error-vapifault-xai-transcriber-server-error")] + CallInProgressErrorVapifaultXaiTranscriberServerError, + + [EnumMember(Value = "call.in-progress.error-vapifault-xai-transcriber-failed")] + CallInProgressErrorVapifaultXaiTranscriberFailed, + + [EnumMember(Value = "pipeline-error-cartesia-transcriber-failed")] + PipelineErrorCartesiaTranscriberFailed, + + [EnumMember(Value = "call.in-progress.error-vapifault-cartesia-transcriber-failed")] + CallInProgressErrorVapifaultCartesiaTranscriberFailed, + [EnumMember(Value = "call.in-progress.error-pipeline-no-available-llm-model")] CallInProgressErrorPipelineNoAvailableLlmModel, @@ -1806,6 +1875,9 @@ public enum CallEndedReason [EnumMember(Value = "call.forwarding.operator-busy")] CallForwardingOperatorBusy, + [EnumMember(Value = "call.forwarding.no-answer")] + CallForwardingNoAnswer, + [EnumMember(Value = "silence-timed-out")] SilenceTimedOut, @@ -1933,6 +2005,10 @@ internal class CallEndedReasonSerializer "call.start.error-enterprise-feature-not-available-recording-consent", CallEndedReason.CallStartErrorEnterpriseFeatureNotAvailableRecordingConsent }, + { + "call.start.assistant-version-error-validation", + CallEndedReason.CallStartAssistantVersionErrorValidation + }, { "assistant-not-valid", CallEndedReason.AssistantNotValid }, { "call.start.error-vapifault-database-error", @@ -1973,6 +2049,15 @@ internal class CallEndedReasonSerializer "pipeline-error-wellsaid-voice-failed", CallEndedReason.PipelineErrorWellsaidVoiceFailed }, + { "pipeline-error-xai-voice-failed", CallEndedReason.PipelineErrorXaiVoiceFailed }, + { + "pipeline-error-microsoft-voice-failed", + CallEndedReason.PipelineErrorMicrosoftVoiceFailed + }, + { + "pipeline-error-microsoft-voice-request-canceled", + CallEndedReason.PipelineErrorMicrosoftVoiceRequestCanceled + }, { "pipeline-error-tavus-video-failed", CallEndedReason.PipelineErrorTavusVideoFailed }, { "call.in-progress.error-vapifault-openai-voice-failed", @@ -2038,6 +2123,14 @@ internal class CallEndedReasonSerializer "call.in-progress.error-vapifault-wellsaid-voice-failed", CallEndedReason.CallInProgressErrorVapifaultWellsaidVoiceFailed }, + { + "call.in-progress.error-vapifault-xai-voice-failed", + CallEndedReason.CallInProgressErrorVapifaultXaiVoiceFailed + }, + { + "call.in-progress.error-vapifault-microsoft-voice-failed", + CallEndedReason.CallInProgressErrorVapifaultMicrosoftVoiceFailed + }, { "call.in-progress.error-vapifault-tavus-video-failed", CallEndedReason.CallInProgressErrorVapifaultTavusVideoFailed @@ -2068,6 +2161,10 @@ internal class CallEndedReasonSerializer "call.in-progress.error-providerfault-vapi-llm-failed", CallEndedReason.CallInProgressErrorProviderfaultVapiLlmFailed }, + { + "call.in-progress.error-vapifault-vapi-llm-failed", + CallEndedReason.CallInProgressErrorVapifaultVapiLlmFailed + }, { "call.in-progress.error-vapifault-vapi-400-bad-request-validation-failed", CallEndedReason.CallInProgressErrorVapifaultVapi400BadRequestValidationFailed @@ -2092,6 +2189,22 @@ internal class CallEndedReasonSerializer "call.in-progress.error-providerfault-vapi-503-server-overloaded-error", CallEndedReason.CallInProgressErrorProviderfaultVapi503ServerOverloadedError }, + { + "pipeline-error-vapi-transcriber-failed", + CallEndedReason.PipelineErrorVapiTranscriberFailed + }, + { + "call.in-progress.error-vapifault-vapi-transcriber-failed", + CallEndedReason.CallInProgressErrorVapifaultVapiTranscriberFailed + }, + { + "call.in-progress.error-providerfault-vapi-transcriber-failed", + CallEndedReason.CallInProgressErrorProviderfaultVapiTranscriberFailed + }, + { + "call.in-progress.error-providerfault-vapi-voice-failed", + CallEndedReason.CallInProgressErrorProviderfaultVapiVoiceFailed + }, { "pipeline-error-deepgram-transcriber-failed", CallEndedReason.PipelineErrorDeepgramTranscriberFailed @@ -2248,6 +2361,54 @@ internal class CallEndedReasonSerializer "call.in-progress.error-vapifault-soniox-transcriber-failed", CallEndedReason.CallInProgressErrorVapifaultSonioxTranscriberFailed }, + { + "pipeline-error-xai-transcriber-auth-failed", + CallEndedReason.PipelineErrorXaiTranscriberAuthFailed + }, + { + "pipeline-error-xai-transcriber-rate-limited", + CallEndedReason.PipelineErrorXaiTranscriberRateLimited + }, + { + "pipeline-error-xai-transcriber-invalid-config", + CallEndedReason.PipelineErrorXaiTranscriberInvalidConfig + }, + { + "pipeline-error-xai-transcriber-server-error", + CallEndedReason.PipelineErrorXaiTranscriberServerError + }, + { + "pipeline-error-xai-transcriber-failed", + CallEndedReason.PipelineErrorXaiTranscriberFailed + }, + { + "call.in-progress.error-vapifault-xai-transcriber-auth-failed", + CallEndedReason.CallInProgressErrorVapifaultXaiTranscriberAuthFailed + }, + { + "call.in-progress.error-vapifault-xai-transcriber-rate-limited", + CallEndedReason.CallInProgressErrorVapifaultXaiTranscriberRateLimited + }, + { + "call.in-progress.error-vapifault-xai-transcriber-invalid-config", + CallEndedReason.CallInProgressErrorVapifaultXaiTranscriberInvalidConfig + }, + { + "call.in-progress.error-vapifault-xai-transcriber-server-error", + CallEndedReason.CallInProgressErrorVapifaultXaiTranscriberServerError + }, + { + "call.in-progress.error-vapifault-xai-transcriber-failed", + CallEndedReason.CallInProgressErrorVapifaultXaiTranscriberFailed + }, + { + "pipeline-error-cartesia-transcriber-failed", + CallEndedReason.PipelineErrorCartesiaTranscriberFailed + }, + { + "call.in-progress.error-vapifault-cartesia-transcriber-failed", + CallEndedReason.CallInProgressErrorVapifaultCartesiaTranscriberFailed + }, { "call.in-progress.error-pipeline-no-available-llm-model", CallEndedReason.CallInProgressErrorPipelineNoAvailableLlmModel @@ -3908,6 +4069,7 @@ internal class CallEndedReasonSerializer CallEndedReason.PhoneCallProviderClosedWebsocket }, { "call.forwarding.operator-busy", CallEndedReason.CallForwardingOperatorBusy }, + { "call.forwarding.no-answer", CallEndedReason.CallForwardingNoAnswer }, { "silence-timed-out", CallEndedReason.SilenceTimedOut }, { "call.in-progress.error-providerfault-outbound-sip-403-forbidden", @@ -4014,6 +4176,10 @@ internal class CallEndedReasonSerializer CallEndedReason.CallStartErrorEnterpriseFeatureNotAvailableRecordingConsent, "call.start.error-enterprise-feature-not-available-recording-consent" }, + { + CallEndedReason.CallStartAssistantVersionErrorValidation, + "call.start.assistant-version-error-validation" + }, { CallEndedReason.AssistantNotValid, "assistant-not-valid" }, { CallEndedReason.CallStartErrorVapifaultDatabaseError, @@ -4054,6 +4220,15 @@ internal class CallEndedReasonSerializer CallEndedReason.PipelineErrorWellsaidVoiceFailed, "pipeline-error-wellsaid-voice-failed" }, + { CallEndedReason.PipelineErrorXaiVoiceFailed, "pipeline-error-xai-voice-failed" }, + { + CallEndedReason.PipelineErrorMicrosoftVoiceFailed, + "pipeline-error-microsoft-voice-failed" + }, + { + CallEndedReason.PipelineErrorMicrosoftVoiceRequestCanceled, + "pipeline-error-microsoft-voice-request-canceled" + }, { CallEndedReason.PipelineErrorTavusVideoFailed, "pipeline-error-tavus-video-failed" }, { CallEndedReason.CallInProgressErrorVapifaultOpenaiVoiceFailed, @@ -4119,6 +4294,14 @@ internal class CallEndedReasonSerializer CallEndedReason.CallInProgressErrorVapifaultWellsaidVoiceFailed, "call.in-progress.error-vapifault-wellsaid-voice-failed" }, + { + CallEndedReason.CallInProgressErrorVapifaultXaiVoiceFailed, + "call.in-progress.error-vapifault-xai-voice-failed" + }, + { + CallEndedReason.CallInProgressErrorVapifaultMicrosoftVoiceFailed, + "call.in-progress.error-vapifault-microsoft-voice-failed" + }, { CallEndedReason.CallInProgressErrorVapifaultTavusVideoFailed, "call.in-progress.error-vapifault-tavus-video-failed" @@ -4149,6 +4332,10 @@ internal class CallEndedReasonSerializer CallEndedReason.CallInProgressErrorProviderfaultVapiLlmFailed, "call.in-progress.error-providerfault-vapi-llm-failed" }, + { + CallEndedReason.CallInProgressErrorVapifaultVapiLlmFailed, + "call.in-progress.error-vapifault-vapi-llm-failed" + }, { CallEndedReason.CallInProgressErrorVapifaultVapi400BadRequestValidationFailed, "call.in-progress.error-vapifault-vapi-400-bad-request-validation-failed" @@ -4173,6 +4360,22 @@ internal class CallEndedReasonSerializer CallEndedReason.CallInProgressErrorProviderfaultVapi503ServerOverloadedError, "call.in-progress.error-providerfault-vapi-503-server-overloaded-error" }, + { + CallEndedReason.PipelineErrorVapiTranscriberFailed, + "pipeline-error-vapi-transcriber-failed" + }, + { + CallEndedReason.CallInProgressErrorVapifaultVapiTranscriberFailed, + "call.in-progress.error-vapifault-vapi-transcriber-failed" + }, + { + CallEndedReason.CallInProgressErrorProviderfaultVapiTranscriberFailed, + "call.in-progress.error-providerfault-vapi-transcriber-failed" + }, + { + CallEndedReason.CallInProgressErrorProviderfaultVapiVoiceFailed, + "call.in-progress.error-providerfault-vapi-voice-failed" + }, { CallEndedReason.PipelineErrorDeepgramTranscriberFailed, "pipeline-error-deepgram-transcriber-failed" @@ -4329,6 +4532,54 @@ internal class CallEndedReasonSerializer CallEndedReason.CallInProgressErrorVapifaultSonioxTranscriberFailed, "call.in-progress.error-vapifault-soniox-transcriber-failed" }, + { + CallEndedReason.PipelineErrorXaiTranscriberAuthFailed, + "pipeline-error-xai-transcriber-auth-failed" + }, + { + CallEndedReason.PipelineErrorXaiTranscriberRateLimited, + "pipeline-error-xai-transcriber-rate-limited" + }, + { + CallEndedReason.PipelineErrorXaiTranscriberInvalidConfig, + "pipeline-error-xai-transcriber-invalid-config" + }, + { + CallEndedReason.PipelineErrorXaiTranscriberServerError, + "pipeline-error-xai-transcriber-server-error" + }, + { + CallEndedReason.PipelineErrorXaiTranscriberFailed, + "pipeline-error-xai-transcriber-failed" + }, + { + CallEndedReason.CallInProgressErrorVapifaultXaiTranscriberAuthFailed, + "call.in-progress.error-vapifault-xai-transcriber-auth-failed" + }, + { + CallEndedReason.CallInProgressErrorVapifaultXaiTranscriberRateLimited, + "call.in-progress.error-vapifault-xai-transcriber-rate-limited" + }, + { + CallEndedReason.CallInProgressErrorVapifaultXaiTranscriberInvalidConfig, + "call.in-progress.error-vapifault-xai-transcriber-invalid-config" + }, + { + CallEndedReason.CallInProgressErrorVapifaultXaiTranscriberServerError, + "call.in-progress.error-vapifault-xai-transcriber-server-error" + }, + { + CallEndedReason.CallInProgressErrorVapifaultXaiTranscriberFailed, + "call.in-progress.error-vapifault-xai-transcriber-failed" + }, + { + CallEndedReason.PipelineErrorCartesiaTranscriberFailed, + "pipeline-error-cartesia-transcriber-failed" + }, + { + CallEndedReason.CallInProgressErrorVapifaultCartesiaTranscriberFailed, + "call.in-progress.error-vapifault-cartesia-transcriber-failed" + }, { CallEndedReason.CallInProgressErrorPipelineNoAvailableLlmModel, "call.in-progress.error-pipeline-no-available-llm-model" @@ -5989,6 +6240,7 @@ internal class CallEndedReasonSerializer "phone-call-provider-closed-websocket" }, { CallEndedReason.CallForwardingOperatorBusy, "call.forwarding.operator-busy" }, + { CallEndedReason.CallForwardingNoAnswer, "call.forwarding.no-answer" }, { CallEndedReason.SilenceTimedOut, "silence-timed-out" }, { CallEndedReason.CallInProgressErrorProviderfaultOutboundSip403Forbidden, diff --git a/src/Vapi.Net/Types/CallHookAssistantSpeechInterrupted.cs b/src/Vapi.Net/Types/CallHookAssistantSpeechInterrupted.cs index b42ad7f3..d0112a05 100644 --- a/src/Vapi.Net/Types/CallHookAssistantSpeechInterrupted.cs +++ b/src/Vapi.Net/Types/CallHookAssistantSpeechInterrupted.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Runs configured actions when the customer's speech interrupts the assistant. +/// [Serializable] public record CallHookAssistantSpeechInterrupted : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/CallHookCallEnding.cs b/src/Vapi.Net/Types/CallHookCallEnding.cs index c35329db..b4257a5c 100644 --- a/src/Vapi.Net/Types/CallHookCallEnding.cs +++ b/src/Vapi.Net/Types/CallHookCallEnding.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Runs configured actions when a call is ending, optionally only when its filters match. +/// [Serializable] public record CallHookCallEnding : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/CallHookCustomerSpeechInterrupted.cs b/src/Vapi.Net/Types/CallHookCustomerSpeechInterrupted.cs index 0f5eb86a..bc6bde4f 100644 --- a/src/Vapi.Net/Types/CallHookCustomerSpeechInterrupted.cs +++ b/src/Vapi.Net/Types/CallHookCustomerSpeechInterrupted.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Runs configured actions when the assistant interrupts the customer's speech. +/// [Serializable] public record CallHookCustomerSpeechInterrupted : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/CallHookCustomerSpeechTimeout.cs b/src/Vapi.Net/Types/CallHookCustomerSpeechTimeout.cs index a9d3bd23..0b093f34 100644 --- a/src/Vapi.Net/Types/CallHookCustomerSpeechTimeout.cs +++ b/src/Vapi.Net/Types/CallHookCustomerSpeechTimeout.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Runs configured actions when the customer does not speak before the configured timeout, with support for trigger limits and named instances. +/// [Serializable] public record CallHookCustomerSpeechTimeout : IJsonOnDeserialized { @@ -24,7 +27,7 @@ public record CallHookCustomerSpeechTimeout : IJsonOnDeserialized public IEnumerable Do { get; set; } = new List(); /// - /// This is the set of filters that must match for the hook to trigger + /// Controls the speech timeout, maximum trigger count, and counter reset behavior for this hook. /// [JsonPropertyName("options")] public CustomerSpeechTimeoutOptions? Options { get; set; } diff --git a/src/Vapi.Net/Types/CallHookFilter.cs b/src/Vapi.Net/Types/CallHookFilter.cs index 0bfdb111..5abd84e1 100644 --- a/src/Vapi.Net/Types/CallHookFilter.cs +++ b/src/Vapi.Net/Types/CallHookFilter.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Matches a call field against one or more allowed values to determine whether a hook runs. +/// [Serializable] public record CallHookFilter : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/CallHookModelResponseTimeout.cs b/src/Vapi.Net/Types/CallHookModelResponseTimeout.cs index 9bf3700c..8c451bb4 100644 --- a/src/Vapi.Net/Types/CallHookModelResponseTimeout.cs +++ b/src/Vapi.Net/Types/CallHookModelResponseTimeout.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Runs configured actions when the language model does not respond before its timeout. +/// [Serializable] public record CallHookModelResponseTimeout : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/Campaign.cs b/src/Vapi.Net/Types/Campaign.cs index 0fc42fd2..90425b45 100644 --- a/src/Vapi.Net/Types/Campaign.cs +++ b/src/Vapi.Net/Types/Campaign.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// A saved outbound calling campaign, including its calling configuration, schedule, status, customers, calls, and call-progress counters. +/// [Serializable] public record Campaign : IJsonOnDeserialized { @@ -66,11 +69,47 @@ public record Campaign : IJsonOnDeserialized public SchedulePlan? SchedulePlan { get; set; } /// - /// These are the customers that will be called in the campaign. Required if dialPlan is not provided. + /// These are the customers that will be called in the campaign. Required if dialPlan is not provided. Maximum of 10000 customers per campaign. /// [JsonPropertyName("customers")] public IEnumerable? Customers { get; set; } + /// + /// This is the maximum number of concurrent calls that will be made for the campaign. Defaults to 10. + /// + [JsonPropertyName("maxConcurrency")] + public double? MaxConcurrency { get; set; } + + /// + /// These are the overrides for the assistant's settings and template variables for the campaign. Use this when the campaign targets an `assistantId`. + /// + [JsonPropertyName("assistantOverrides")] + public AssistantOverrides? AssistantOverrides { get; set; } + + /// + /// These are the overrides for the squad and template variables for the campaign. Use this when the campaign targets a `squadId`. Per-contact `squadOverrides` are deep-merged on top of this at dispatch time. + /// + [JsonPropertyName("squadOverrides")] + public AssistantOverrides? SquadOverrides { get; set; } + + /// + /// This is the server (URL, auth headers, timeout, etc.) for the campaign webhooks. + /// + [JsonPropertyName("server")] + public Server? Server { get; set; } + + /// + /// These are the messages that will be sent to your Server URL. + /// + [JsonPropertyName("serverMessages")] + public IEnumerable? ServerMessages { get; set; } + + /// + /// This opts the campaign into the blocking `campaign.predial` eligibility webhook. When set, every contact triggers a `campaign.predial` POST to the Server URL before dialing, and the response `{ eligible: boolean }` decides whether the call is placed. Requires `server`. When unset, no pre-dial webhook is sent. + /// + [JsonPropertyName("predialPlan")] + public CampaignPredialPlan? PredialPlan { get; set; } + /// /// This is the unique identifier for the campaign. /// diff --git a/src/Vapi.Net/Types/CampaignContact.cs b/src/Vapi.Net/Types/CampaignContact.cs new file mode 100644 index 00000000..4f90e895 --- /dev/null +++ b/src/Vapi.Net/Types/CampaignContact.cs @@ -0,0 +1,55 @@ +using global::System.Text.Json; +using global::System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[Serializable] +public record CampaignContact : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("id")] + public required string Id { get; set; } + + [JsonPropertyName("campaignId")] + public required string CampaignId { get; set; } + + [JsonPropertyName("orgId")] + public required string OrgId { get; set; } + + [JsonPropertyName("customerId")] + public string? CustomerId { get; set; } + + [JsonPropertyName("number")] + public required string Number { get; set; } + + [JsonPropertyName("name")] + public string? Name { get; set; } + + [JsonPropertyName("assistantOverrides")] + public AssistantOverrides? AssistantOverrides { get; set; } + + /// + /// Use this when the campaign targets a `squadId`. Mirrors the call-level `squadOverrides` field. Merged with the campaign-level squadOverrides at dispatch time. + /// + [JsonPropertyName("squadOverrides")] + public AssistantOverrides? SquadOverrides { get; set; } + + [JsonPropertyName("createdAt")] + public required DateTime CreatedAt { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/CampaignPaginatedResponse.cs b/src/Vapi.Net/Types/CampaignPaginatedResponse.cs index 6e2e68d6..b83423b8 100644 --- a/src/Vapi.Net/Types/CampaignPaginatedResponse.cs +++ b/src/Vapi.Net/Types/CampaignPaginatedResponse.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// A paginated collection of outbound calling campaigns and metadata describing the result set. +/// [Serializable] public record CampaignPaginatedResponse : IJsonOnDeserialized { @@ -11,9 +14,15 @@ public record CampaignPaginatedResponse : IJsonOnDeserialized private readonly IDictionary _extensionData = new Dictionary(); + /// + /// The campaigns returned for the current page. + /// [JsonPropertyName("results")] public IEnumerable Results { get; set; } = new List(); + /// + /// Pagination metadata for the campaign result set. + /// [JsonPropertyName("metadata")] public required PaginationMeta Metadata { get; set; } diff --git a/src/Vapi.Net/Types/CampaignPredialPlan.cs b/src/Vapi.Net/Types/CampaignPredialPlan.cs new file mode 100644 index 00000000..b8c1fd2d --- /dev/null +++ b/src/Vapi.Net/Types/CampaignPredialPlan.cs @@ -0,0 +1,31 @@ +using global::System.Text.Json; +using global::System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[Serializable] +public record CampaignPredialPlan : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + /// + /// Whether the pre-dial eligibility webhook is active. Defaults to true when `predialPlan` is set. Set to false to keep the plan without running the webhook (useful when duplicating a campaign). + /// + [JsonPropertyName("enabled")] + public bool? Enabled { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/CampaignServerMessagesItem.cs b/src/Vapi.Net/Types/CampaignServerMessagesItem.cs new file mode 100644 index 00000000..2a07f8e6 --- /dev/null +++ b/src/Vapi.Net/Types/CampaignServerMessagesItem.cs @@ -0,0 +1,129 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(CampaignServerMessagesItemSerializer))] +public enum CampaignServerMessagesItem +{ + [EnumMember(Value = "campaign.started")] + CampaignStarted, + + [EnumMember(Value = "campaign.cancelled")] + CampaignCancelled, + + [EnumMember(Value = "campaign.ended")] + CampaignEnded, + + [EnumMember(Value = "campaign.archived")] + CampaignArchived, + + [EnumMember(Value = "campaign.unarchived")] + CampaignUnarchived, + + [EnumMember(Value = "contact.dispatched")] + ContactDispatched, + + [EnumMember(Value = "contact.completed")] + ContactCompleted, + + [EnumMember(Value = "contact.failed")] + ContactFailed, + + [EnumMember(Value = "contact.skipped")] + ContactSkipped, + + [EnumMember(Value = "contact.predial-failed")] + ContactPredialFailed, + + [EnumMember(Value = "campaign.job.continued")] + CampaignJobContinued, +} + +internal class CampaignServerMessagesItemSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + CampaignServerMessagesItem + > _stringToEnum = new() + { + { "campaign.started", CampaignServerMessagesItem.CampaignStarted }, + { "campaign.cancelled", CampaignServerMessagesItem.CampaignCancelled }, + { "campaign.ended", CampaignServerMessagesItem.CampaignEnded }, + { "campaign.archived", CampaignServerMessagesItem.CampaignArchived }, + { "campaign.unarchived", CampaignServerMessagesItem.CampaignUnarchived }, + { "contact.dispatched", CampaignServerMessagesItem.ContactDispatched }, + { "contact.completed", CampaignServerMessagesItem.ContactCompleted }, + { "contact.failed", CampaignServerMessagesItem.ContactFailed }, + { "contact.skipped", CampaignServerMessagesItem.ContactSkipped }, + { "contact.predial-failed", CampaignServerMessagesItem.ContactPredialFailed }, + { "campaign.job.continued", CampaignServerMessagesItem.CampaignJobContinued }, + }; + + private static readonly global::System.Collections.Generic.Dictionary< + CampaignServerMessagesItem, + string + > _enumToString = new() + { + { CampaignServerMessagesItem.CampaignStarted, "campaign.started" }, + { CampaignServerMessagesItem.CampaignCancelled, "campaign.cancelled" }, + { CampaignServerMessagesItem.CampaignEnded, "campaign.ended" }, + { CampaignServerMessagesItem.CampaignArchived, "campaign.archived" }, + { CampaignServerMessagesItem.CampaignUnarchived, "campaign.unarchived" }, + { CampaignServerMessagesItem.ContactDispatched, "contact.dispatched" }, + { CampaignServerMessagesItem.ContactCompleted, "contact.completed" }, + { CampaignServerMessagesItem.ContactFailed, "contact.failed" }, + { CampaignServerMessagesItem.ContactSkipped, "contact.skipped" }, + { CampaignServerMessagesItem.ContactPredialFailed, "contact.predial-failed" }, + { CampaignServerMessagesItem.CampaignJobContinued, "campaign.job.continued" }, + }; + + public override CampaignServerMessagesItem Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + CampaignServerMessagesItem value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override CampaignServerMessagesItem ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + CampaignServerMessagesItem value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/CampaignStatus.cs b/src/Vapi.Net/Types/CampaignStatus.cs index d3fd8049..e91b4107 100644 --- a/src/Vapi.Net/Types/CampaignStatus.cs +++ b/src/Vapi.Net/Types/CampaignStatus.cs @@ -14,6 +14,12 @@ public enum CampaignStatus [EnumMember(Value = "ended")] Ended, + + [EnumMember(Value = "cancelled")] + Cancelled, + + [EnumMember(Value = "archived")] + Archived, } internal class CampaignStatusSerializer @@ -27,6 +33,8 @@ internal class CampaignStatusSerializer { "scheduled", CampaignStatus.Scheduled }, { "in-progress", CampaignStatus.InProgress }, { "ended", CampaignStatus.Ended }, + { "cancelled", CampaignStatus.Cancelled }, + { "archived", CampaignStatus.Archived }, }; private static readonly global::System.Collections.Generic.Dictionary< @@ -37,6 +45,8 @@ internal class CampaignStatusSerializer { CampaignStatus.Scheduled, "scheduled" }, { CampaignStatus.InProgress, "in-progress" }, { CampaignStatus.Ended, "ended" }, + { CampaignStatus.Cancelled, "cancelled" }, + { CampaignStatus.Archived, "archived" }, }; public override CampaignStatus Read( diff --git a/src/Vapi.Net/Types/CartesiaCredential.cs b/src/Vapi.Net/Types/CartesiaCredential.cs index f2d10956..073ccc9e 100644 --- a/src/Vapi.Net/Types/CartesiaCredential.cs +++ b/src/Vapi.Net/Types/CartesiaCredential.cs @@ -50,6 +50,12 @@ public record CartesiaCredential : IJsonOnDeserialized [JsonPropertyName("name")] public string? Name { get; set; } + /// + /// This can be used to point to an onprem Cartesia instance. Defaults to api.cartesia.ai. + /// + [JsonPropertyName("apiUrl")] + public string? ApiUrl { get; set; } + [JsonIgnore] public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); diff --git a/src/Vapi.Net/Types/CartesiaExperimentalControls.cs b/src/Vapi.Net/Types/CartesiaExperimentalControls.cs index ce9ae9f8..7fe2f1b6 100644 --- a/src/Vapi.Net/Types/CartesiaExperimentalControls.cs +++ b/src/Vapi.Net/Types/CartesiaExperimentalControls.cs @@ -5,6 +5,9 @@ namespace Vapi.Net; +/// +/// Cartesia voice controls for speed and emotion. +/// [Serializable] public record CartesiaExperimentalControls : IJsonOnDeserialized { @@ -12,9 +15,15 @@ public record CartesiaExperimentalControls : IJsonOnDeserialized private readonly IDictionary _extensionData = new Dictionary(); + /// + /// Speaking-speed control expressed as a preset or a value from -1 to 1. + /// [JsonPropertyName("speed")] public OneOf? Speed { get; set; } + /// + /// Emotion and intensity applied to the Cartesia voice. + /// [JsonPropertyName("emotion")] public CartesiaExperimentalControlsEmotion? Emotion { get; set; } diff --git a/src/Vapi.Net/Types/CartesiaGenerationConfig.cs b/src/Vapi.Net/Types/CartesiaGenerationConfig.cs index ba607677..5aab8c43 100644 --- a/src/Vapi.Net/Types/CartesiaGenerationConfig.cs +++ b/src/Vapi.Net/Types/CartesiaGenerationConfig.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Generation controls for Cartesia Sonic 3 voices, including speed, volume, and accent localization. +/// [Serializable] public record CartesiaGenerationConfig : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/CartesiaGenerationConfigExperimental.cs b/src/Vapi.Net/Types/CartesiaGenerationConfigExperimental.cs index 19ae194d..f68ef067 100644 --- a/src/Vapi.Net/Types/CartesiaGenerationConfigExperimental.cs +++ b/src/Vapi.Net/Types/CartesiaGenerationConfigExperimental.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Cartesia Sonic 3 generation controls, including accent localization. +/// [Serializable] public record CartesiaGenerationConfigExperimental : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/CartesiaTranscriber.cs b/src/Vapi.Net/Types/CartesiaTranscriber.cs index dc1c6f6a..7c0bb14a 100644 --- a/src/Vapi.Net/Types/CartesiaTranscriber.cs +++ b/src/Vapi.Net/Types/CartesiaTranscriber.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Configuration for transcribing speech during assistant conversations with Cartesia, including model, language, and fallback settings. +/// [Serializable] public record CartesiaTranscriber : IJsonOnDeserialized { @@ -11,9 +14,15 @@ public record CartesiaTranscriber : IJsonOnDeserialized private readonly IDictionary _extensionData = new Dictionary(); + /// + /// The Cartesia speech-to-text model used for transcription. + /// [JsonPropertyName("model")] public CartesiaTranscriberModel? Model { get; set; } + /// + /// The language code used for transcription. + /// [JsonPropertyName("language")] public CartesiaTranscriberLanguage? Language { get; set; } diff --git a/src/Vapi.Net/Types/CartesiaTranscriberModel.cs b/src/Vapi.Net/Types/CartesiaTranscriberModel.cs index 9f2aa607..e687c6c6 100644 --- a/src/Vapi.Net/Types/CartesiaTranscriberModel.cs +++ b/src/Vapi.Net/Types/CartesiaTranscriberModel.cs @@ -8,6 +8,9 @@ public enum CartesiaTranscriberModel { [EnumMember(Value = "ink-whisper")] InkWhisper, + + [EnumMember(Value = "ink-2")] + Ink2, } internal class CartesiaTranscriberModelSerializer @@ -16,12 +19,20 @@ internal class CartesiaTranscriberModelSerializer private static readonly global::System.Collections.Generic.Dictionary< string, CartesiaTranscriberModel - > _stringToEnum = new() { { "ink-whisper", CartesiaTranscriberModel.InkWhisper } }; + > _stringToEnum = new() + { + { "ink-whisper", CartesiaTranscriberModel.InkWhisper }, + { "ink-2", CartesiaTranscriberModel.Ink2 }, + }; private static readonly global::System.Collections.Generic.Dictionary< CartesiaTranscriberModel, string - > _enumToString = new() { { CartesiaTranscriberModel.InkWhisper, "ink-whisper" } }; + > _enumToString = new() + { + { CartesiaTranscriberModel.InkWhisper, "ink-whisper" }, + { CartesiaTranscriberModel.Ink2, "ink-2" }, + }; public override CartesiaTranscriberModel Read( ref global::System.Text.Json.Utf8JsonReader reader, diff --git a/src/Vapi.Net/Types/CartesiaVoice.cs b/src/Vapi.Net/Types/CartesiaVoice.cs index b3f0ce7e..25d3501f 100644 --- a/src/Vapi.Net/Types/CartesiaVoice.cs +++ b/src/Vapi.Net/Types/CartesiaVoice.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Configuration for synthesizing assistant speech with Cartesia, including voice and model selection, language, generation controls, pronunciation dictionaries, chunking, caching, and fallback settings. +/// [Serializable] public record CartesiaVoice : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/CartesiaVoiceModel.cs b/src/Vapi.Net/Types/CartesiaVoiceModel.cs index 9f1f87f1..d210b00e 100644 --- a/src/Vapi.Net/Types/CartesiaVoiceModel.cs +++ b/src/Vapi.Net/Types/CartesiaVoiceModel.cs @@ -6,6 +6,12 @@ namespace Vapi.Net; [JsonConverter(typeof(CartesiaVoiceModelSerializer))] public enum CartesiaVoiceModel { + [EnumMember(Value = "sonic-3.5")] + Sonic35, + + [EnumMember(Value = "sonic-3.5-2026-05-04")] + Sonic3520260504, + [EnumMember(Value = "sonic-3")] Sonic3, @@ -42,6 +48,8 @@ internal class CartesiaVoiceModelSerializer CartesiaVoiceModel > _stringToEnum = new() { + { "sonic-3.5", CartesiaVoiceModel.Sonic35 }, + { "sonic-3.5-2026-05-04", CartesiaVoiceModel.Sonic3520260504 }, { "sonic-3", CartesiaVoiceModel.Sonic3 }, { "sonic-3-2026-01-12", CartesiaVoiceModel.Sonic320260112 }, { "sonic-3-2025-10-27", CartesiaVoiceModel.Sonic320251027 }, @@ -58,6 +66,8 @@ internal class CartesiaVoiceModelSerializer string > _enumToString = new() { + { CartesiaVoiceModel.Sonic35, "sonic-3.5" }, + { CartesiaVoiceModel.Sonic3520260504, "sonic-3.5-2026-05-04" }, { CartesiaVoiceModel.Sonic3, "sonic-3" }, { CartesiaVoiceModel.Sonic320260112, "sonic-3-2026-01-12" }, { CartesiaVoiceModel.Sonic320251027, "sonic-3-2025-10-27" }, diff --git a/src/Vapi.Net/Types/CerebrasModel.cs b/src/Vapi.Net/Types/CerebrasModel.cs index 6106c1b5..380f9a06 100644 --- a/src/Vapi.Net/Types/CerebrasModel.cs +++ b/src/Vapi.Net/Types/CerebrasModel.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Configuration for generating assistant responses with Cerebras, including model, prompts, tools, knowledge-base access, and generation settings. +/// [Serializable] public record CerebrasModel : IJsonOnDeserialized { @@ -33,6 +36,15 @@ public record CerebrasModel : IJsonOnDeserialized [JsonPropertyName("toolIds")] public IEnumerable? ToolIds { get; set; } + /// + /// These are version-pinned references to tools. Each entry pins a specific + /// version of a tool by `(toolId, version)`. When the same `toolId` appears + /// in both `toolIds` and `toolRefs[]`, the `toolRefs` pin wins (the + /// `toolIds` entry is dropped at write time). + /// + [JsonPropertyName("toolRefs")] + public IEnumerable? ToolRefs { get; set; } + /// /// These are the options for the knowledge base. /// @@ -46,7 +58,7 @@ public record CerebrasModel : IJsonOnDeserialized 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. + /// This is the temperature that will be used for calls. Default is 0.5. /// [JsonPropertyName("temperature")] public double? Temperature { get; set; } diff --git a/src/Vapi.Net/Types/ChatEvalAssistantMessageEvaluation.cs b/src/Vapi.Net/Types/ChatEvalAssistantMessageEvaluation.cs index 29e81ddc..e4bf2027 100644 --- a/src/Vapi.Net/Types/ChatEvalAssistantMessageEvaluation.cs +++ b/src/Vapi.Net/Types/ChatEvalAssistantMessageEvaluation.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// An expected assistant turn in an evaluation, including the judge plan and how the evaluation should continue afterward. +/// [Serializable] public record ChatEvalAssistantMessageEvaluation : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/ChatEvalAssistantMessageMock.cs b/src/Vapi.Net/Types/ChatEvalAssistantMessageMock.cs index dce1af9f..3cc0ac40 100644 --- a/src/Vapi.Net/Types/ChatEvalAssistantMessageMock.cs +++ b/src/Vapi.Net/Types/ChatEvalAssistantMessageMock.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// A simulated assistant turn in an evaluation conversation, with optional message content and tool calls. +/// [Serializable] public record ChatEvalAssistantMessageMock : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/ChatEvalAssistantMessageMockToolCall.cs b/src/Vapi.Net/Types/ChatEvalAssistantMessageMockToolCall.cs index 4e34cdfa..b6ae4539 100644 --- a/src/Vapi.Net/Types/ChatEvalAssistantMessageMockToolCall.cs +++ b/src/Vapi.Net/Types/ChatEvalAssistantMessageMockToolCall.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// A simulated assistant tool call with the tool name and optional arguments. +/// [Serializable] public record ChatEvalAssistantMessageMockToolCall : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/ChatEvalSystemMessageMock.cs b/src/Vapi.Net/Types/ChatEvalSystemMessageMock.cs index f90df451..8f37501f 100644 --- a/src/Vapi.Net/Types/ChatEvalSystemMessageMock.cs +++ b/src/Vapi.Net/Types/ChatEvalSystemMessageMock.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// A simulated system message in an evaluation conversation. +/// [Serializable] public record ChatEvalSystemMessageMock : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/ChatEvalToolResponseMessageEvaluation.cs b/src/Vapi.Net/Types/ChatEvalToolResponseMessageEvaluation.cs index 93a2b5aa..d521db68 100644 --- a/src/Vapi.Net/Types/ChatEvalToolResponseMessageEvaluation.cs +++ b/src/Vapi.Net/Types/ChatEvalToolResponseMessageEvaluation.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// An expected tool-response turn evaluated by a configured LLM judge. +/// [Serializable] public record ChatEvalToolResponseMessageEvaluation : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/ChatEvalToolResponseMessageMock.cs b/src/Vapi.Net/Types/ChatEvalToolResponseMessageMock.cs index 944b7ca7..774dbd66 100644 --- a/src/Vapi.Net/Types/ChatEvalToolResponseMessageMock.cs +++ b/src/Vapi.Net/Types/ChatEvalToolResponseMessageMock.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// A simulated tool response in an evaluation conversation. +/// [Serializable] public record ChatEvalToolResponseMessageMock : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/ChatEvalUserMessageMock.cs b/src/Vapi.Net/Types/ChatEvalUserMessageMock.cs index 46f9053d..0de3c341 100644 --- a/src/Vapi.Net/Types/ChatEvalUserMessageMock.cs +++ b/src/Vapi.Net/Types/ChatEvalUserMessageMock.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// A simulated user message in an evaluation conversation. +/// [Serializable] public record ChatEvalUserMessageMock : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/ChunkPlan.cs b/src/Vapi.Net/Types/ChunkPlan.cs index d7576c9f..4adddfad 100644 --- a/src/Vapi.Net/Types/ChunkPlan.cs +++ b/src/Vapi.Net/Types/ChunkPlan.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Controls how model output is split into chunks before voice synthesis, including minimum length, punctuation boundaries, and formatting. +/// [Serializable] public record ChunkPlan : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/ClientMessageAssistantSpeech.cs b/src/Vapi.Net/Types/ClientMessageAssistantSpeech.cs index 87cc7579..8b7bd91e 100644 --- a/src/Vapi.Net/Types/ClientMessageAssistantSpeech.cs +++ b/src/Vapi.Net/Types/ClientMessageAssistantSpeech.cs @@ -17,6 +17,15 @@ public record ClientMessageAssistantSpeech : IJsonOnDeserialized [JsonPropertyName("phoneNumber")] public object? PhoneNumber { get; set; } + /// + /// This is the version label (e.g. `v3`) of the assistant the call was + /// configured with. `null` for inline assistants, squad/workflow calls, + /// pre-resolution assistant-request messages, and orgs not on + /// assistant versioning. + /// + [JsonPropertyName("assistantVersion")] + public string? AssistantVersion { get; set; } + /// /// This is the type of the message. "assistant-speech" is sent as assistant audio is being played. /// diff --git a/src/Vapi.Net/Types/ClientMessageAssistantStarted.cs b/src/Vapi.Net/Types/ClientMessageAssistantStarted.cs index 7055495f..e931c6a1 100644 --- a/src/Vapi.Net/Types/ClientMessageAssistantStarted.cs +++ b/src/Vapi.Net/Types/ClientMessageAssistantStarted.cs @@ -17,6 +17,15 @@ public record ClientMessageAssistantStarted : IJsonOnDeserialized [JsonPropertyName("phoneNumber")] public object? PhoneNumber { get; set; } + /// + /// This is the version label (e.g. `v3`) of the assistant the call was + /// configured with. `null` for inline assistants, squad/workflow calls, + /// pre-resolution assistant-request messages, and orgs not on + /// assistant versioning. + /// + [JsonPropertyName("assistantVersion")] + public string? AssistantVersion { get; set; } + /// /// This is the type of the message. "assistant.started" is sent when the assistant is started. /// diff --git a/src/Vapi.Net/Types/ClientMessageCallDeleteFailed.cs b/src/Vapi.Net/Types/ClientMessageCallDeleteFailed.cs index a982f29e..ddd95000 100644 --- a/src/Vapi.Net/Types/ClientMessageCallDeleteFailed.cs +++ b/src/Vapi.Net/Types/ClientMessageCallDeleteFailed.cs @@ -17,6 +17,15 @@ public record ClientMessageCallDeleteFailed : IJsonOnDeserialized [JsonPropertyName("phoneNumber")] public object? PhoneNumber { get; set; } + /// + /// This is the version label (e.g. `v3`) of the assistant the call was + /// configured with. `null` for inline assistants, squad/workflow calls, + /// pre-resolution assistant-request messages, and orgs not on + /// assistant versioning. + /// + [JsonPropertyName("assistantVersion")] + public string? AssistantVersion { get; set; } + /// /// This is the type of the message. "call.deleted" is sent when a call is deleted. /// diff --git a/src/Vapi.Net/Types/ClientMessageCallDeleted.cs b/src/Vapi.Net/Types/ClientMessageCallDeleted.cs index 0678446a..27e4574e 100644 --- a/src/Vapi.Net/Types/ClientMessageCallDeleted.cs +++ b/src/Vapi.Net/Types/ClientMessageCallDeleted.cs @@ -17,6 +17,15 @@ public record ClientMessageCallDeleted : IJsonOnDeserialized [JsonPropertyName("phoneNumber")] public object? PhoneNumber { get; set; } + /// + /// This is the version label (e.g. `v3`) of the assistant the call was + /// configured with. `null` for inline assistants, squad/workflow calls, + /// pre-resolution assistant-request messages, and orgs not on + /// assistant versioning. + /// + [JsonPropertyName("assistantVersion")] + public string? AssistantVersion { get; set; } + /// /// This is the type of the message. "call.deleted" is sent when a call is deleted. /// diff --git a/src/Vapi.Net/Types/ClientMessageChatCreated.cs b/src/Vapi.Net/Types/ClientMessageChatCreated.cs index 77410938..0044279d 100644 --- a/src/Vapi.Net/Types/ClientMessageChatCreated.cs +++ b/src/Vapi.Net/Types/ClientMessageChatCreated.cs @@ -17,6 +17,15 @@ public record ClientMessageChatCreated : IJsonOnDeserialized [JsonPropertyName("phoneNumber")] public object? PhoneNumber { get; set; } + /// + /// This is the version label (e.g. `v3`) of the assistant the call was + /// configured with. `null` for inline assistants, squad/workflow calls, + /// pre-resolution assistant-request messages, and orgs not on + /// assistant versioning. + /// + [JsonPropertyName("assistantVersion")] + public string? AssistantVersion { get; set; } + /// /// This is the type of the message. "chat.created" is sent when a new chat is created. /// diff --git a/src/Vapi.Net/Types/ClientMessageChatDeleted.cs b/src/Vapi.Net/Types/ClientMessageChatDeleted.cs index 79eabd56..20cdc3af 100644 --- a/src/Vapi.Net/Types/ClientMessageChatDeleted.cs +++ b/src/Vapi.Net/Types/ClientMessageChatDeleted.cs @@ -17,6 +17,15 @@ public record ClientMessageChatDeleted : IJsonOnDeserialized [JsonPropertyName("phoneNumber")] public object? PhoneNumber { get; set; } + /// + /// This is the version label (e.g. `v3`) of the assistant the call was + /// configured with. `null` for inline assistants, squad/workflow calls, + /// pre-resolution assistant-request messages, and orgs not on + /// assistant versioning. + /// + [JsonPropertyName("assistantVersion")] + public string? AssistantVersion { get; set; } + /// /// This is the type of the message. "chat.deleted" is sent when a chat is deleted. /// diff --git a/src/Vapi.Net/Types/ClientMessageConversationUpdate.cs b/src/Vapi.Net/Types/ClientMessageConversationUpdate.cs index 87ad11c4..8f320b45 100644 --- a/src/Vapi.Net/Types/ClientMessageConversationUpdate.cs +++ b/src/Vapi.Net/Types/ClientMessageConversationUpdate.cs @@ -18,6 +18,15 @@ public record ClientMessageConversationUpdate : IJsonOnDeserialized [JsonPropertyName("phoneNumber")] public object? PhoneNumber { get; set; } + /// + /// This is the version label (e.g. `v3`) of the assistant the call was + /// configured with. `null` for inline assistants, squad/workflow calls, + /// pre-resolution assistant-request messages, and orgs not on + /// assistant versioning. + /// + [JsonPropertyName("assistantVersion")] + public string? AssistantVersion { get; set; } + /// /// This is the type of the message. "conversation-update" is sent when an update is committed to the conversation history. /// @@ -29,7 +38,7 @@ public record ClientMessageConversationUpdate : IJsonOnDeserialized /// [JsonPropertyName("messages")] public IEnumerable< - OneOf + OneOf >? Messages { get; set; } /// diff --git a/src/Vapi.Net/Types/ClientMessageHang.cs b/src/Vapi.Net/Types/ClientMessageHang.cs index 88c7aac8..25b99ddd 100644 --- a/src/Vapi.Net/Types/ClientMessageHang.cs +++ b/src/Vapi.Net/Types/ClientMessageHang.cs @@ -17,6 +17,15 @@ public record ClientMessageHang : IJsonOnDeserialized [JsonPropertyName("phoneNumber")] public object? PhoneNumber { get; set; } + /// + /// This is the version label (e.g. `v3`) of the assistant the call was + /// configured with. `null` for inline assistants, squad/workflow calls, + /// pre-resolution assistant-request messages, and orgs not on + /// assistant versioning. + /// + [JsonPropertyName("assistantVersion")] + public string? AssistantVersion { 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 diff --git a/src/Vapi.Net/Types/ClientMessageLanguageChangeDetected.cs b/src/Vapi.Net/Types/ClientMessageLanguageChangeDetected.cs index 8b97f0fd..99070291 100644 --- a/src/Vapi.Net/Types/ClientMessageLanguageChangeDetected.cs +++ b/src/Vapi.Net/Types/ClientMessageLanguageChangeDetected.cs @@ -17,6 +17,15 @@ public record ClientMessageLanguageChangeDetected : IJsonOnDeserialized [JsonPropertyName("phoneNumber")] public object? PhoneNumber { get; set; } + /// + /// This is the version label (e.g. `v3`) of the assistant the call was + /// configured with. `null` for inline assistants, squad/workflow calls, + /// pre-resolution assistant-request messages, and orgs not on + /// assistant versioning. + /// + [JsonPropertyName("assistantVersion")] + public string? AssistantVersion { 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. /// diff --git a/src/Vapi.Net/Types/ClientMessageMetadata.cs b/src/Vapi.Net/Types/ClientMessageMetadata.cs index 2fcf36b5..92284232 100644 --- a/src/Vapi.Net/Types/ClientMessageMetadata.cs +++ b/src/Vapi.Net/Types/ClientMessageMetadata.cs @@ -17,6 +17,15 @@ public record ClientMessageMetadata : IJsonOnDeserialized [JsonPropertyName("phoneNumber")] public object? PhoneNumber { get; set; } + /// + /// This is the version label (e.g. `v3`) of the assistant the call was + /// configured with. `null` for inline assistants, squad/workflow calls, + /// pre-resolution assistant-request messages, and orgs not on + /// assistant versioning. + /// + [JsonPropertyName("assistantVersion")] + public string? AssistantVersion { get; set; } + /// /// This is the type of the message. "metadata" is sent to forward metadata to the client. /// diff --git a/src/Vapi.Net/Types/ClientMessageModelOutput.cs b/src/Vapi.Net/Types/ClientMessageModelOutput.cs index 77ff74b2..6b288f7b 100644 --- a/src/Vapi.Net/Types/ClientMessageModelOutput.cs +++ b/src/Vapi.Net/Types/ClientMessageModelOutput.cs @@ -17,6 +17,15 @@ public record ClientMessageModelOutput : IJsonOnDeserialized [JsonPropertyName("phoneNumber")] public object? PhoneNumber { get; set; } + /// + /// This is the version label (e.g. `v3`) of the assistant the call was + /// configured with. `null` for inline assistants, squad/workflow calls, + /// pre-resolution assistant-request messages, and orgs not on + /// assistant versioning. + /// + [JsonPropertyName("assistantVersion")] + public string? AssistantVersion { get; set; } + /// /// This is the type of the message. "model-output" is sent as the model outputs tokens. /// diff --git a/src/Vapi.Net/Types/ClientMessageSessionCreated.cs b/src/Vapi.Net/Types/ClientMessageSessionCreated.cs index eac2056d..feb6bdff 100644 --- a/src/Vapi.Net/Types/ClientMessageSessionCreated.cs +++ b/src/Vapi.Net/Types/ClientMessageSessionCreated.cs @@ -17,6 +17,15 @@ public record ClientMessageSessionCreated : IJsonOnDeserialized [JsonPropertyName("phoneNumber")] public object? PhoneNumber { get; set; } + /// + /// This is the version label (e.g. `v3`) of the assistant the call was + /// configured with. `null` for inline assistants, squad/workflow calls, + /// pre-resolution assistant-request messages, and orgs not on + /// assistant versioning. + /// + [JsonPropertyName("assistantVersion")] + public string? AssistantVersion { get; set; } + /// /// This is the type of the message. "session.created" is sent when a new session is created. /// diff --git a/src/Vapi.Net/Types/ClientMessageSessionDeleted.cs b/src/Vapi.Net/Types/ClientMessageSessionDeleted.cs index a7699809..e44346d9 100644 --- a/src/Vapi.Net/Types/ClientMessageSessionDeleted.cs +++ b/src/Vapi.Net/Types/ClientMessageSessionDeleted.cs @@ -17,6 +17,15 @@ public record ClientMessageSessionDeleted : IJsonOnDeserialized [JsonPropertyName("phoneNumber")] public object? PhoneNumber { get; set; } + /// + /// This is the version label (e.g. `v3`) of the assistant the call was + /// configured with. `null` for inline assistants, squad/workflow calls, + /// pre-resolution assistant-request messages, and orgs not on + /// assistant versioning. + /// + [JsonPropertyName("assistantVersion")] + public string? AssistantVersion { get; set; } + /// /// This is the type of the message. "session.deleted" is sent when a session is deleted. /// diff --git a/src/Vapi.Net/Types/ClientMessageSessionUpdated.cs b/src/Vapi.Net/Types/ClientMessageSessionUpdated.cs index 47868fee..041c3f5a 100644 --- a/src/Vapi.Net/Types/ClientMessageSessionUpdated.cs +++ b/src/Vapi.Net/Types/ClientMessageSessionUpdated.cs @@ -17,6 +17,15 @@ public record ClientMessageSessionUpdated : IJsonOnDeserialized [JsonPropertyName("phoneNumber")] public object? PhoneNumber { get; set; } + /// + /// This is the version label (e.g. `v3`) of the assistant the call was + /// configured with. `null` for inline assistants, squad/workflow calls, + /// pre-resolution assistant-request messages, and orgs not on + /// assistant versioning. + /// + [JsonPropertyName("assistantVersion")] + public string? AssistantVersion { get; set; } + /// /// This is the type of the message. "session.updated" is sent when a session is updated. /// diff --git a/src/Vapi.Net/Types/ClientMessageSpeechUpdate.cs b/src/Vapi.Net/Types/ClientMessageSpeechUpdate.cs index b25a67a0..2f259843 100644 --- a/src/Vapi.Net/Types/ClientMessageSpeechUpdate.cs +++ b/src/Vapi.Net/Types/ClientMessageSpeechUpdate.cs @@ -17,6 +17,15 @@ public record ClientMessageSpeechUpdate : IJsonOnDeserialized [JsonPropertyName("phoneNumber")] public object? PhoneNumber { get; set; } + /// + /// This is the version label (e.g. `v3`) of the assistant the call was + /// configured with. `null` for inline assistants, squad/workflow calls, + /// pre-resolution assistant-request messages, and orgs not on + /// assistant versioning. + /// + [JsonPropertyName("assistantVersion")] + public string? AssistantVersion { get; set; } + /// /// This is the type of the message. "speech-update" is sent whenever assistant or user start or stop speaking. /// diff --git a/src/Vapi.Net/Types/ClientMessageToolCalls.cs b/src/Vapi.Net/Types/ClientMessageToolCalls.cs index d00c33cc..be4f14df 100644 --- a/src/Vapi.Net/Types/ClientMessageToolCalls.cs +++ b/src/Vapi.Net/Types/ClientMessageToolCalls.cs @@ -17,6 +17,15 @@ public record ClientMessageToolCalls : IJsonOnDeserialized [JsonPropertyName("phoneNumber")] public object? PhoneNumber { get; set; } + /// + /// This is the version label (e.g. `v3`) of the assistant the call was + /// configured with. `null` for inline assistants, squad/workflow calls, + /// pre-resolution assistant-request messages, and orgs not on + /// assistant versioning. + /// + [JsonPropertyName("assistantVersion")] + public string? AssistantVersion { get; set; } + /// /// This is the type of the message. "tool-calls" is sent to call a tool. /// diff --git a/src/Vapi.Net/Types/ClientMessageToolCallsResult.cs b/src/Vapi.Net/Types/ClientMessageToolCallsResult.cs index ae9cf93a..525929a5 100644 --- a/src/Vapi.Net/Types/ClientMessageToolCallsResult.cs +++ b/src/Vapi.Net/Types/ClientMessageToolCallsResult.cs @@ -17,6 +17,15 @@ public record ClientMessageToolCallsResult : IJsonOnDeserialized [JsonPropertyName("phoneNumber")] public object? PhoneNumber { get; set; } + /// + /// This is the version label (e.g. `v3`) of the assistant the call was + /// configured with. `null` for inline assistants, squad/workflow calls, + /// pre-resolution assistant-request messages, and orgs not on + /// assistant versioning. + /// + [JsonPropertyName("assistantVersion")] + public string? AssistantVersion { 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. /// diff --git a/src/Vapi.Net/Types/ClientMessageTranscript.cs b/src/Vapi.Net/Types/ClientMessageTranscript.cs index 036c1cbb..868f41c5 100644 --- a/src/Vapi.Net/Types/ClientMessageTranscript.cs +++ b/src/Vapi.Net/Types/ClientMessageTranscript.cs @@ -17,6 +17,15 @@ public record ClientMessageTranscript : IJsonOnDeserialized [JsonPropertyName("phoneNumber")] public object? PhoneNumber { get; set; } + /// + /// This is the version label (e.g. `v3`) of the assistant the call was + /// configured with. `null` for inline assistants, squad/workflow calls, + /// pre-resolution assistant-request messages, and orgs not on + /// assistant versioning. + /// + [JsonPropertyName("assistantVersion")] + public string? AssistantVersion { get; set; } + /// /// This is the type of the message. "transcript" is sent as transcriber outputs partial or final transcript. /// diff --git a/src/Vapi.Net/Types/ClientMessageTransferUpdate.cs b/src/Vapi.Net/Types/ClientMessageTransferUpdate.cs index 46e8b45a..c17e876a 100644 --- a/src/Vapi.Net/Types/ClientMessageTransferUpdate.cs +++ b/src/Vapi.Net/Types/ClientMessageTransferUpdate.cs @@ -17,6 +17,15 @@ public record ClientMessageTransferUpdate : IJsonOnDeserialized [JsonPropertyName("phoneNumber")] public object? PhoneNumber { get; set; } + /// + /// This is the version label (e.g. `v3`) of the assistant the call was + /// configured with. `null` for inline assistants, squad/workflow calls, + /// pre-resolution assistant-request messages, and orgs not on + /// assistant versioning. + /// + [JsonPropertyName("assistantVersion")] + public string? AssistantVersion { get; set; } + /// /// This is the type of the message. "transfer-update" is sent whenever a transfer happens. /// diff --git a/src/Vapi.Net/Types/ClientMessageUserInterrupted.cs b/src/Vapi.Net/Types/ClientMessageUserInterrupted.cs index 1a8f75a8..f58027da 100644 --- a/src/Vapi.Net/Types/ClientMessageUserInterrupted.cs +++ b/src/Vapi.Net/Types/ClientMessageUserInterrupted.cs @@ -17,6 +17,15 @@ public record ClientMessageUserInterrupted : IJsonOnDeserialized [JsonPropertyName("phoneNumber")] public object? PhoneNumber { get; set; } + /// + /// This is the version label (e.g. `v3`) of the assistant the call was + /// configured with. `null` for inline assistants, squad/workflow calls, + /// pre-resolution assistant-request messages, and orgs not on + /// assistant versioning. + /// + [JsonPropertyName("assistantVersion")] + public string? AssistantVersion { get; set; } + /// /// This is the type of the message. "user-interrupted" is sent when the user interrupts the assistant. /// diff --git a/src/Vapi.Net/Types/ClientMessageVoiceInput.cs b/src/Vapi.Net/Types/ClientMessageVoiceInput.cs index 7955acad..b2e48c6c 100644 --- a/src/Vapi.Net/Types/ClientMessageVoiceInput.cs +++ b/src/Vapi.Net/Types/ClientMessageVoiceInput.cs @@ -17,6 +17,15 @@ public record ClientMessageVoiceInput : IJsonOnDeserialized [JsonPropertyName("phoneNumber")] public object? PhoneNumber { get; set; } + /// + /// This is the version label (e.g. `v3`) of the assistant the call was + /// configured with. `null` for inline assistants, squad/workflow calls, + /// pre-resolution assistant-request messages, and orgs not on + /// assistant versioning. + /// + [JsonPropertyName("assistantVersion")] + public string? AssistantVersion { get; set; } + /// /// This is the type of the message. "voice-input" is sent when a generation is requested from voice provider. /// diff --git a/src/Vapi.Net/Types/ClientMessageWorkflowNodeStarted.cs b/src/Vapi.Net/Types/ClientMessageWorkflowNodeStarted.cs index 28a3ed95..1ad0ea74 100644 --- a/src/Vapi.Net/Types/ClientMessageWorkflowNodeStarted.cs +++ b/src/Vapi.Net/Types/ClientMessageWorkflowNodeStarted.cs @@ -17,6 +17,15 @@ public record ClientMessageWorkflowNodeStarted : IJsonOnDeserialized [JsonPropertyName("phoneNumber")] public object? PhoneNumber { get; set; } + /// + /// This is the version label (e.g. `v3`) of the assistant the call was + /// configured with. `null` for inline assistants, squad/workflow calls, + /// pre-resolution assistant-request messages, and orgs not on + /// assistant versioning. + /// + [JsonPropertyName("assistantVersion")] + public string? AssistantVersion { get; set; } + /// /// This is the type of the message. "workflow.node.started" is sent when the active node changes. /// diff --git a/src/Vapi.Net/Types/CloudflareR2BucketPlan.cs b/src/Vapi.Net/Types/CloudflareR2BucketPlan.cs index 43165dcb..72b556ce 100644 --- a/src/Vapi.Net/Types/CloudflareR2BucketPlan.cs +++ b/src/Vapi.Net/Types/CloudflareR2BucketPlan.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Cloudflare R2 bucket configuration for call-artifact storage, including access keys, base URL, bucket name, and path. +/// [Serializable] public record CloudflareR2BucketPlan : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/CodeTool.cs b/src/Vapi.Net/Types/CodeTool.cs index 8c1c1b7b..6a4dddbd 100644 --- a/src/Vapi.Net/Types/CodeTool.cs +++ b/src/Vapi.Net/Types/CodeTool.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// A reusable tool that executes TypeScript code with configured credentials, environment variables, and timeout. +/// [Serializable] public record CodeTool : IJsonOnDeserialized { @@ -11,10 +14,11 @@ public record CodeTool : IJsonOnDeserialized private readonly IDictionary _extensionData = new Dictionary(); + [JsonPropertyName("latestVersion")] + public string? LatestVersion { 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. + /// Messages spoken while the tool is running. Multiple request-start messages are variants. For request-response-delayed, same timing means variants and different timings mean staged updates. /// [JsonPropertyName("messages")] public IEnumerable? Messages { get; set; } diff --git a/src/Vapi.Net/Types/CodeToolEnvironmentVariable.cs b/src/Vapi.Net/Types/CodeToolEnvironmentVariable.cs index 73585828..21268dfb 100644 --- a/src/Vapi.Net/Types/CodeToolEnvironmentVariable.cs +++ b/src/Vapi.Net/Types/CodeToolEnvironmentVariable.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// An environment variable supplied to code-tool execution, with support for Liquid templates in its value. +/// [Serializable] public record CodeToolEnvironmentVariable : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/Compliance.cs b/src/Vapi.Net/Types/Compliance.cs index 21948296..67020f75 100644 --- a/src/Vapi.Net/Types/Compliance.cs +++ b/src/Vapi.Net/Types/Compliance.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Compliance information captured for a call, including recording consent. +/// [Serializable] public record Compliance : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/ComplianceOverride.cs b/src/Vapi.Net/Types/ComplianceOverride.cs index 0e619420..fb0b1329 100644 --- a/src/Vapi.Net/Types/ComplianceOverride.cs +++ b/src/Vapi.Net/Types/ComplianceOverride.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Overrides storage behavior for an output when HIPAA compliance is enabled. +/// [Serializable] public record ComplianceOverride : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/CompliancePlan.cs b/src/Vapi.Net/Types/CompliancePlan.cs index cfed285e..3f36c426 100644 --- a/src/Vapi.Net/Types/CompliancePlan.cs +++ b/src/Vapi.Net/Types/CompliancePlan.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Controls HIPAA and PCI requirements, transcript security filtering, and recording-consent handling for assistant calls. +/// [Serializable] public record CompliancePlan : IJsonOnDeserialized { @@ -30,6 +33,9 @@ public record CompliancePlan : IJsonOnDeserialized [JsonPropertyName("securityFilterPlan")] public SecurityFilterPlan? SecurityFilterPlan { get; set; } + /// + /// Controls how recording consent is requested before the assistant joins the call. + /// [JsonPropertyName("recordingConsentPlan")] public object? RecordingConsentPlan { get; set; } diff --git a/src/Vapi.Net/Types/ComputerTool.cs b/src/Vapi.Net/Types/ComputerTool.cs index 3b3b485a..9532bda8 100644 --- a/src/Vapi.Net/Types/ComputerTool.cs +++ b/src/Vapi.Net/Types/ComputerTool.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// A reusable tool that lets the model interact with a computer display through screen, pointer, and keyboard actions. +/// [Serializable] public record ComputerTool : IJsonOnDeserialized { @@ -11,10 +14,11 @@ public record ComputerTool : IJsonOnDeserialized private readonly IDictionary _extensionData = new Dictionary(); + [JsonPropertyName("latestVersion")] + public string? LatestVersion { 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. + /// Messages spoken while the tool is running. Multiple request-start messages are variants. For request-response-delayed, same timing means variants and different timings mean staged updates. /// [JsonPropertyName("messages")] public IEnumerable? Messages { get; set; } diff --git a/src/Vapi.Net/Types/ComputerToolWithToolCall.cs b/src/Vapi.Net/Types/ComputerToolWithToolCall.cs index 23d42ba1..07e63004 100644 --- a/src/Vapi.Net/Types/ComputerToolWithToolCall.cs +++ b/src/Vapi.Net/Types/ComputerToolWithToolCall.cs @@ -12,9 +12,7 @@ public record ComputerToolWithToolCall : IJsonOnDeserialized new Dictionary(); /// - /// 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. + /// Messages spoken while the tool is running. Multiple request-start messages are variants. For request-response-delayed, same timing means variants and different timings mean staged updates. /// [JsonPropertyName("messages")] public IEnumerable? Messages { get; set; } diff --git a/src/Vapi.Net/Types/Condition.cs b/src/Vapi.Net/Types/Condition.cs index 7b02c307..25c87324 100644 --- a/src/Vapi.Net/Types/Condition.cs +++ b/src/Vapi.Net/Types/Condition.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Compares a named parameter with a value using the selected comparison operator. +/// [Serializable] public record Condition : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/ContextEngineeringPlanAll.cs b/src/Vapi.Net/Types/ContextEngineeringPlanAll.cs index bbd71571..a0ad070f 100644 --- a/src/Vapi.Net/Types/ContextEngineeringPlanAll.cs +++ b/src/Vapi.Net/Types/ContextEngineeringPlanAll.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Includes all available messages when constructing context for a handoff. +/// [Serializable] public record ContextEngineeringPlanAll : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/ContextEngineeringPlanLastNMessages.cs b/src/Vapi.Net/Types/ContextEngineeringPlanLastNMessages.cs index 17ac3571..ed443735 100644 --- a/src/Vapi.Net/Types/ContextEngineeringPlanLastNMessages.cs +++ b/src/Vapi.Net/Types/ContextEngineeringPlanLastNMessages.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Includes a configured number of the most recent messages when constructing context for a handoff. +/// [Serializable] public record ContextEngineeringPlanLastNMessages : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/ContextEngineeringPlanNone.cs b/src/Vapi.Net/Types/ContextEngineeringPlanNone.cs index de4ff7b1..943f1e98 100644 --- a/src/Vapi.Net/Types/ContextEngineeringPlanNone.cs +++ b/src/Vapi.Net/Types/ContextEngineeringPlanNone.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Excludes prior conversation messages when constructing context for a handoff. +/// [Serializable] public record ContextEngineeringPlanNone : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/SbcConfiguration.cs b/src/Vapi.Net/Types/ContextEngineeringPlanPreviousAssistantMessages.cs similarity index 88% rename from src/Vapi.Net/Types/SbcConfiguration.cs rename to src/Vapi.Net/Types/ContextEngineeringPlanPreviousAssistantMessages.cs index baf7a717..418b469e 100644 --- a/src/Vapi.Net/Types/SbcConfiguration.cs +++ b/src/Vapi.Net/Types/ContextEngineeringPlanPreviousAssistantMessages.cs @@ -5,7 +5,7 @@ namespace Vapi.Net; [Serializable] -public record SbcConfiguration : IJsonOnDeserialized +public record ContextEngineeringPlanPreviousAssistantMessages : IJsonOnDeserialized { [JsonExtensionData] private readonly IDictionary _extensionData = diff --git a/src/Vapi.Net/Types/ContextEngineeringPlanUserAndAssistantMessages.cs b/src/Vapi.Net/Types/ContextEngineeringPlanUserAndAssistantMessages.cs index 6a72e615..c566cb2f 100644 --- a/src/Vapi.Net/Types/ContextEngineeringPlanUserAndAssistantMessages.cs +++ b/src/Vapi.Net/Types/ContextEngineeringPlanUserAndAssistantMessages.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Includes only user and assistant messages when constructing context for a handoff. +/// [Serializable] public record ContextEngineeringPlanUserAndAssistantMessages : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/ConversationNode.cs b/src/Vapi.Net/Types/ConversationNode.cs index 1098d302..c5b247bf 100644 --- a/src/Vapi.Net/Types/ConversationNode.cs +++ b/src/Vapi.Net/Types/ConversationNode.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// A workflow node where the assistant conducts a conversation using optional node-specific providers, tools, prompt, and variable extraction. +/// [Serializable] public record ConversationNode : IJsonOnDeserialized { @@ -51,6 +54,9 @@ public record ConversationNode : IJsonOnDeserialized [JsonPropertyName("toolIds")] public IEnumerable? ToolIds { get; set; } + /// + /// Prompt that guides the assistant while this node is active. + /// [JsonPropertyName("prompt")] public string? Prompt { get; set; } @@ -112,6 +118,9 @@ public record ConversationNode : IJsonOnDeserialized [JsonPropertyName("variableExtractionPlan")] public VariableExtractionPlan? VariableExtractionPlan { get; set; } + /// + /// Unique name used to identify this workflow node. + /// [JsonPropertyName("name")] public required string Name { get; set; } diff --git a/src/Vapi.Net/Types/CostBreakdown.cs b/src/Vapi.Net/Types/CostBreakdown.cs index 9227e659..fc3c7ce3 100644 --- a/src/Vapi.Net/Types/CostBreakdown.cs +++ b/src/Vapi.Net/Types/CostBreakdown.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Aggregated call costs and usage, including transport, transcription, model, voice, Vapi, analysis, token, and character totals. +/// [Serializable] public record CostBreakdown : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/CreateAnthropicBedrockCredentialDto.cs b/src/Vapi.Net/Types/CreateAnthropicBedrockCredentialDto.cs index bd6b9081..fa04ddca 100644 --- a/src/Vapi.Net/Types/CreateAnthropicBedrockCredentialDto.cs +++ b/src/Vapi.Net/Types/CreateAnthropicBedrockCredentialDto.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Credentials for authenticating Anthropic model requests through Amazon Bedrock, including AWS region and authentication method. +/// [Serializable] public record CreateAnthropicBedrockCredentialDto : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/CreateAnthropicBedrockCredentialDtoRegion.cs b/src/Vapi.Net/Types/CreateAnthropicBedrockCredentialDtoRegion.cs index 916926f2..145ec32e 100644 --- a/src/Vapi.Net/Types/CreateAnthropicBedrockCredentialDtoRegion.cs +++ b/src/Vapi.Net/Types/CreateAnthropicBedrockCredentialDtoRegion.cs @@ -12,6 +12,9 @@ public enum CreateAnthropicBedrockCredentialDtoRegion [EnumMember(Value = "us-west-2")] UsWest2, + [EnumMember(Value = "eu-central-1")] + EuCentral1, + [EnumMember(Value = "eu-west-1")] EuWest1, @@ -35,6 +38,7 @@ internal class CreateAnthropicBedrockCredentialDtoRegionSerializer { { "us-east-1", CreateAnthropicBedrockCredentialDtoRegion.UsEast1 }, { "us-west-2", CreateAnthropicBedrockCredentialDtoRegion.UsWest2 }, + { "eu-central-1", CreateAnthropicBedrockCredentialDtoRegion.EuCentral1 }, { "eu-west-1", CreateAnthropicBedrockCredentialDtoRegion.EuWest1 }, { "eu-west-3", CreateAnthropicBedrockCredentialDtoRegion.EuWest3 }, { "ap-northeast-1", CreateAnthropicBedrockCredentialDtoRegion.ApNortheast1 }, @@ -48,6 +52,7 @@ internal class CreateAnthropicBedrockCredentialDtoRegionSerializer { { CreateAnthropicBedrockCredentialDtoRegion.UsEast1, "us-east-1" }, { CreateAnthropicBedrockCredentialDtoRegion.UsWest2, "us-west-2" }, + { CreateAnthropicBedrockCredentialDtoRegion.EuCentral1, "eu-central-1" }, { CreateAnthropicBedrockCredentialDtoRegion.EuWest1, "eu-west-1" }, { CreateAnthropicBedrockCredentialDtoRegion.EuWest3, "eu-west-3" }, { CreateAnthropicBedrockCredentialDtoRegion.ApNortheast1, "ap-northeast-1" }, diff --git a/src/Vapi.Net/Types/CreateAnthropicCredentialDto.cs b/src/Vapi.Net/Types/CreateAnthropicCredentialDto.cs index dcb9083e..44abf2d4 100644 --- a/src/Vapi.Net/Types/CreateAnthropicCredentialDto.cs +++ b/src/Vapi.Net/Types/CreateAnthropicCredentialDto.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Credentials for authenticating assistant model requests with Anthropic. +/// [Serializable] public record CreateAnthropicCredentialDto : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/CreateAnyscaleCredentialDto.cs b/src/Vapi.Net/Types/CreateAnyscaleCredentialDto.cs index 9b918a58..48904fed 100644 --- a/src/Vapi.Net/Types/CreateAnyscaleCredentialDto.cs +++ b/src/Vapi.Net/Types/CreateAnyscaleCredentialDto.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Credentials for authenticating assistant model requests with Anyscale. +/// [Serializable] public record CreateAnyscaleCredentialDto : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/CreateApiRequestToolDto.cs b/src/Vapi.Net/Types/CreateApiRequestToolDto.cs index c6903a3d..ae028c78 100644 --- a/src/Vapi.Net/Types/CreateApiRequestToolDto.cs +++ b/src/Vapi.Net/Types/CreateApiRequestToolDto.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Configuration used to create a reusable tool that sends HTTP requests to a configured API and can authenticate, retry failures, and extract variables from responses. +/// [Serializable] public record CreateApiRequestToolDto : IJsonOnDeserialized { @@ -12,13 +15,22 @@ public record CreateApiRequestToolDto : IJsonOnDeserialized new Dictionary(); /// - /// 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. + /// Messages spoken while the tool is running. Multiple request-start messages are variants. For request-response-delayed, same timing means variants and different timings mean staged updates. /// [JsonPropertyName("messages")] public IEnumerable? Messages { get; set; } + /// + /// This is the name of the tool. This will be passed to the model. + /// + /// Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 40. + /// + [JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// The HTTP method used for the API request. + /// [JsonPropertyName("method")] public required CreateApiRequestToolDtoMethod Method { get; set; } @@ -48,14 +60,6 @@ public record CreateApiRequestToolDto : IJsonOnDeserialized [JsonPropertyName("parameters")] public IEnumerable? Parameters { get; set; } - /// - /// This is the name of the tool. This will be passed to the model. - /// - /// Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 40. - /// - [JsonPropertyName("name")] - public string? Name { get; set; } - /// /// This is the description of the tool. This will be passed to the model. /// diff --git a/src/Vapi.Net/Types/CreateAssemblyAiCredentialDto.cs b/src/Vapi.Net/Types/CreateAssemblyAiCredentialDto.cs index a49271bd..ed0c0244 100644 --- a/src/Vapi.Net/Types/CreateAssemblyAiCredentialDto.cs +++ b/src/Vapi.Net/Types/CreateAssemblyAiCredentialDto.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Credentials for authenticating transcription requests with AssemblyAI. +/// [Serializable] public record CreateAssemblyAiCredentialDto : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/CreateAssistantDraftDto.cs b/src/Vapi.Net/Types/CreateAssistantDraftDto.cs new file mode 100644 index 00000000..163653a6 --- /dev/null +++ b/src/Vapi.Net/Types/CreateAssistantDraftDto.cs @@ -0,0 +1,283 @@ +using global::System.Text.Json; +using global::System.Text.Json.Serialization; +using OneOf; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[Serializable] +public record CreateAssistantDraftDto : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + /// + /// These are the options for the assistant's transcriber. + /// + [JsonPropertyName("transcriber")] + public object? Transcriber { get; set; } + + /// + /// These are the options for the assistant's LLM. + /// + [JsonPropertyName("model")] + public object? Model { get; set; } + + /// + /// These are the options for the assistant's voice. + /// + [JsonPropertyName("voice")] + public object? Voice { get; set; } + + /// + /// This is the first message that the assistant will say. This can also be a URL to a containerized audio file (mp3, wav, etc.). + /// + /// If unspecified, assistant will wait for user to speak and use the model to respond once they speak. + /// + [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'. + /// + /// Use: + /// - 'assistant-speaks-first' to have the assistant speak first. + /// - 'assistant-waits-for-user' to have the assistant wait for the user to speak first. + /// - 'assistant-speaks-first-with-model-generated-message' to have the assistant speak first with a message generated by the model based on the conversation state. (`assistant.model.messages` at call start, `call.messages` at squad transfer points). + /// + /// @default 'assistant-speaks-first' + /// + [JsonPropertyName("firstMessageMode")] + public CreateAssistantDraftDtoFirstMessageMode? FirstMessageMode { get; set; } + + /// + /// These are the settings to configure or disable voicemail detection. Alternatively, voicemail detection can be configured using the model.tools=[VoicemailTool]. + /// By default, voicemail detection is disabled. + /// + [JsonPropertyName("voicemailDetection")] + public OneOf< + CreateAssistantDraftDtoVoicemailDetectionZero, + GoogleVoicemailDetectionPlan, + OpenAiVoicemailDetectionPlan, + TwilioVoicemailDetectionPlan, + VapiVoicemailDetectionPlan + >? 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,assistant.started. You can check the shape of the messages in ClientMessage schema. + /// + [JsonPropertyName("clientMessages")] + public IEnumerable? ClientMessages { get; set; } + + /// + /// These are the messages that will be sent to your Server URL. Default is conversation-update,end-of-call-report,function-call,hang,speech-update,status-update,tool-calls,transfer-destination-request,handoff-destination-request,user-interrupted,assistant.started. You can check the shape of the messages in ServerMessage schema. + /// + [JsonPropertyName("serverMessages")] + public IEnumerable? ServerMessages { get; set; } + + /// + /// This is the maximum number of seconds that the call will last. When the call reaches this duration, it will be ended. + /// + /// @default 600 (10 minutes) + /// + [JsonPropertyName("maxDurationSeconds")] + public double? MaxDurationSeconds { get; set; } + + /// + /// 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 OneOf? BackgroundSound { get; set; } + + /// + /// This determines whether the model's output is used in conversation history rather than the transcription of assistant's speech. + /// + /// @default false + /// + [JsonPropertyName("modelOutputInMessagesEnabled")] + public bool? ModelOutputInMessagesEnabled { get; set; } + + /// + /// These are the configurations to be passed to the transport providers of assistant's calls, like Twilio. You can store multiple configurations for different transport providers. For a call, only the configuration matching the call transport provider is used. + /// + [JsonPropertyName("transportConfigurations")] + public IEnumerable? TransportConfigurations { get; set; } + + /// + /// This is the plan for observability of assistant's calls. + /// + /// Currently, only Langfuse is supported. + /// + [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. + /// + [JsonPropertyName("credentials")] + public IEnumerable? Credentials { get; set; } + + /// + /// This is a set of actions that will be performed on certain events. + /// + [JsonPropertyName("hooks")] + public IEnumerable< + OneOf< + CallHookCallEnding, + CallHookAssistantSpeechInterrupted, + CallHookCustomerSpeechInterrupted, + CallHookCustomerSpeechTimeout, + SessionCreatedHook + > + >? Hooks { get; set; } + + /// + /// This is the name of the assistant. + /// + /// This is required when you want to transfer between assistants in a call. + /// + [JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// This is the message that the assistant will say if the call is forwarded to voicemail. + /// + /// If unspecified, it will hang up. + /// + [JsonPropertyName("voicemailMessage")] + public string? VoicemailMessage { get; set; } + + /// + /// This is the message that the assistant will say if it ends the call. + /// + /// If unspecified, it will hang up without saying anything. + /// + [JsonPropertyName("endCallMessage")] + public string? EndCallMessage { get; set; } + + /// + /// This list contains phrases that, if spoken by the assistant, will trigger the call to be hung up. Case insensitive. + /// + [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. + /// + [JsonPropertyName("metadata")] + public object? Metadata { get; set; } + + /// + /// This enables filtering of noise and background speech while the user is talking. + /// + /// Features: + /// - Smart denoising using Krisp + /// - Fourier denoising + /// + /// Smart denoising can be combined with or used independently of Fourier denoising. + /// + /// Order of precedence: + /// - Smart denoising + /// - Fourier denoising + /// + [JsonPropertyName("backgroundSpeechDenoisingPlan")] + public BackgroundSpeechDenoisingPlan? BackgroundSpeechDenoisingPlan { get; set; } + + /// + /// This is the plan for analysis of assistant's calls. Stored in `call.analysis`. + /// + [JsonPropertyName("analysisPlan")] + public AnalysisPlan? AnalysisPlan { get; set; } + + /// + /// This is the plan for artifacts generated during assistant's calls. Stored in `call.artifact`. + /// + [JsonPropertyName("artifactPlan")] + public ArtifactPlan? ArtifactPlan { get; set; } + + /// + /// This is the plan for when the assistant should start talking. + /// + /// You should configure this if you're running into these issues: + /// - The assistant is too slow to start talking after the customer is done speaking. + /// - The assistant is too fast to start talking after the customer is done speaking. + /// - The assistant is so fast that it's actually interrupting the customer. + /// + [JsonPropertyName("startSpeakingPlan")] + public StartSpeakingPlan? StartSpeakingPlan { get; set; } + + /// + /// This is the plan for when assistant should stop talking on customer interruption. + /// + /// You should configure this if you're running into these issues: + /// - The assistant is too slow to recognize customer's interruption. + /// - The assistant is too fast to recognize customer's interruption. + /// - The assistant is getting interrupted by phrases that are just acknowledgments. + /// - The assistant is getting interrupted by background noises. + /// - The assistant is not properly stopping -- it starts talking right after getting interrupted. + /// + [JsonPropertyName("stopSpeakingPlan")] + public StopSpeakingPlan? StopSpeakingPlan { get; set; } + + /// + /// This is the plan for real-time monitoring of the assistant's calls. + /// + /// Usage: + /// - To enable live listening of the assistant's calls, set `monitorPlan.listenEnabled` to `true`. + /// - To enable live control of the assistant's calls, set `monitorPlan.controlEnabled` to `true`. + /// - To attach monitors to the assistant, set `monitorPlan.monitorIds` to the set of monitor ids. + /// + [JsonPropertyName("monitorPlan")] + public MonitorPlan? MonitorPlan { get; set; } + + /// + /// These are the credentials that will be used for the assistant calls. By default, all the credentials are available for use in the call but you can provide a subset using this. + /// + [JsonPropertyName("credentialIds")] + public IEnumerable? CredentialIds { 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.url + /// 2. phoneNumber.serverUrl + /// 3. org.serverUrl + /// + [JsonPropertyName("server")] + public Server? Server { get; set; } + + [JsonPropertyName("keypadInputPlan")] + public KeypadInputPlan? KeypadInputPlan { get; set; } + + /// + /// Optional pointer to the published version this draft was forked from. + /// When omitted on `POST /assistant/:id/draft`, defaults server-side to the + /// parent assistant's current `latestVersion` (which is lazy-created via + /// `assistantBaselineVersionEnsureInTx` if the parent has never been + /// versioned). Immutable for the lifetime of the draft. + /// + [JsonPropertyName("baseVersion")] + public string? BaseVersion { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/CreateAssistantDraftDtoBackgroundSoundZero.cs b/src/Vapi.Net/Types/CreateAssistantDraftDtoBackgroundSoundZero.cs new file mode 100644 index 00000000..fd35a648 --- /dev/null +++ b/src/Vapi.Net/Types/CreateAssistantDraftDtoBackgroundSoundZero.cs @@ -0,0 +1,84 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(CreateAssistantDraftDtoBackgroundSoundZeroSerializer))] +public enum CreateAssistantDraftDtoBackgroundSoundZero +{ + [EnumMember(Value = "off")] + Off, + + [EnumMember(Value = "office")] + Office, +} + +internal class CreateAssistantDraftDtoBackgroundSoundZeroSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + CreateAssistantDraftDtoBackgroundSoundZero + > _stringToEnum = new() + { + { "off", CreateAssistantDraftDtoBackgroundSoundZero.Off }, + { "office", CreateAssistantDraftDtoBackgroundSoundZero.Office }, + }; + + private static readonly global::System.Collections.Generic.Dictionary< + CreateAssistantDraftDtoBackgroundSoundZero, + string + > _enumToString = new() + { + { CreateAssistantDraftDtoBackgroundSoundZero.Off, "off" }, + { CreateAssistantDraftDtoBackgroundSoundZero.Office, "office" }, + }; + + public override CreateAssistantDraftDtoBackgroundSoundZero Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + CreateAssistantDraftDtoBackgroundSoundZero value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override CreateAssistantDraftDtoBackgroundSoundZero ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + CreateAssistantDraftDtoBackgroundSoundZero value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/CreateAssistantDraftDtoClientMessagesItem.cs b/src/Vapi.Net/Types/CreateAssistantDraftDtoClientMessagesItem.cs new file mode 100644 index 00000000..bbb1cbc7 --- /dev/null +++ b/src/Vapi.Net/Types/CreateAssistantDraftDtoClientMessagesItem.cs @@ -0,0 +1,175 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(CreateAssistantDraftDtoClientMessagesItemSerializer))] +public enum CreateAssistantDraftDtoClientMessagesItem +{ + [EnumMember(Value = "conversation-update")] + ConversationUpdate, + + [EnumMember(Value = "assistant.speechStarted")] + AssistantSpeechStarted, + + [EnumMember(Value = "function-call")] + FunctionCall, + + [EnumMember(Value = "function-call-result")] + FunctionCallResult, + + [EnumMember(Value = "hang")] + Hang, + + [EnumMember(Value = "language-changed")] + LanguageChanged, + + [EnumMember(Value = "metadata")] + Metadata, + + [EnumMember(Value = "model-output")] + ModelOutput, + + [EnumMember(Value = "speech-update")] + SpeechUpdate, + + [EnumMember(Value = "status-update")] + StatusUpdate, + + [EnumMember(Value = "transcript")] + Transcript, + + [EnumMember(Value = "tool-calls")] + ToolCalls, + + [EnumMember(Value = "tool-calls-result")] + ToolCallsResult, + + [EnumMember(Value = "tool.completed")] + ToolCompleted, + + [EnumMember(Value = "transfer-update")] + TransferUpdate, + + [EnumMember(Value = "user-interrupted")] + UserInterrupted, + + [EnumMember(Value = "voice-input")] + VoiceInput, + + [EnumMember(Value = "workflow.node.started")] + WorkflowNodeStarted, + + [EnumMember(Value = "assistant.started")] + AssistantStarted, +} + +internal class CreateAssistantDraftDtoClientMessagesItemSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + CreateAssistantDraftDtoClientMessagesItem + > _stringToEnum = new() + { + { "conversation-update", CreateAssistantDraftDtoClientMessagesItem.ConversationUpdate }, + { + "assistant.speechStarted", + CreateAssistantDraftDtoClientMessagesItem.AssistantSpeechStarted + }, + { "function-call", CreateAssistantDraftDtoClientMessagesItem.FunctionCall }, + { "function-call-result", CreateAssistantDraftDtoClientMessagesItem.FunctionCallResult }, + { "hang", CreateAssistantDraftDtoClientMessagesItem.Hang }, + { "language-changed", CreateAssistantDraftDtoClientMessagesItem.LanguageChanged }, + { "metadata", CreateAssistantDraftDtoClientMessagesItem.Metadata }, + { "model-output", CreateAssistantDraftDtoClientMessagesItem.ModelOutput }, + { "speech-update", CreateAssistantDraftDtoClientMessagesItem.SpeechUpdate }, + { "status-update", CreateAssistantDraftDtoClientMessagesItem.StatusUpdate }, + { "transcript", CreateAssistantDraftDtoClientMessagesItem.Transcript }, + { "tool-calls", CreateAssistantDraftDtoClientMessagesItem.ToolCalls }, + { "tool-calls-result", CreateAssistantDraftDtoClientMessagesItem.ToolCallsResult }, + { "tool.completed", CreateAssistantDraftDtoClientMessagesItem.ToolCompleted }, + { "transfer-update", CreateAssistantDraftDtoClientMessagesItem.TransferUpdate }, + { "user-interrupted", CreateAssistantDraftDtoClientMessagesItem.UserInterrupted }, + { "voice-input", CreateAssistantDraftDtoClientMessagesItem.VoiceInput }, + { "workflow.node.started", CreateAssistantDraftDtoClientMessagesItem.WorkflowNodeStarted }, + { "assistant.started", CreateAssistantDraftDtoClientMessagesItem.AssistantStarted }, + }; + + private static readonly global::System.Collections.Generic.Dictionary< + CreateAssistantDraftDtoClientMessagesItem, + string + > _enumToString = new() + { + { CreateAssistantDraftDtoClientMessagesItem.ConversationUpdate, "conversation-update" }, + { + CreateAssistantDraftDtoClientMessagesItem.AssistantSpeechStarted, + "assistant.speechStarted" + }, + { CreateAssistantDraftDtoClientMessagesItem.FunctionCall, "function-call" }, + { CreateAssistantDraftDtoClientMessagesItem.FunctionCallResult, "function-call-result" }, + { CreateAssistantDraftDtoClientMessagesItem.Hang, "hang" }, + { CreateAssistantDraftDtoClientMessagesItem.LanguageChanged, "language-changed" }, + { CreateAssistantDraftDtoClientMessagesItem.Metadata, "metadata" }, + { CreateAssistantDraftDtoClientMessagesItem.ModelOutput, "model-output" }, + { CreateAssistantDraftDtoClientMessagesItem.SpeechUpdate, "speech-update" }, + { CreateAssistantDraftDtoClientMessagesItem.StatusUpdate, "status-update" }, + { CreateAssistantDraftDtoClientMessagesItem.Transcript, "transcript" }, + { CreateAssistantDraftDtoClientMessagesItem.ToolCalls, "tool-calls" }, + { CreateAssistantDraftDtoClientMessagesItem.ToolCallsResult, "tool-calls-result" }, + { CreateAssistantDraftDtoClientMessagesItem.ToolCompleted, "tool.completed" }, + { CreateAssistantDraftDtoClientMessagesItem.TransferUpdate, "transfer-update" }, + { CreateAssistantDraftDtoClientMessagesItem.UserInterrupted, "user-interrupted" }, + { CreateAssistantDraftDtoClientMessagesItem.VoiceInput, "voice-input" }, + { CreateAssistantDraftDtoClientMessagesItem.WorkflowNodeStarted, "workflow.node.started" }, + { CreateAssistantDraftDtoClientMessagesItem.AssistantStarted, "assistant.started" }, + }; + + public override CreateAssistantDraftDtoClientMessagesItem Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + CreateAssistantDraftDtoClientMessagesItem value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override CreateAssistantDraftDtoClientMessagesItem ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + CreateAssistantDraftDtoClientMessagesItem value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/CreateAssistantDraftDtoFirstMessageMode.cs b/src/Vapi.Net/Types/CreateAssistantDraftDtoFirstMessageMode.cs new file mode 100644 index 00000000..b6f63dbd --- /dev/null +++ b/src/Vapi.Net/Types/CreateAssistantDraftDtoFirstMessageMode.cs @@ -0,0 +1,101 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(CreateAssistantDraftDtoFirstMessageModeSerializer))] +public enum CreateAssistantDraftDtoFirstMessageMode +{ + [EnumMember(Value = "assistant-speaks-first")] + AssistantSpeaksFirst, + + [EnumMember(Value = "assistant-speaks-first-with-model-generated-message")] + AssistantSpeaksFirstWithModelGeneratedMessage, + + [EnumMember(Value = "assistant-waits-for-user")] + AssistantWaitsForUser, +} + +internal class CreateAssistantDraftDtoFirstMessageModeSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + CreateAssistantDraftDtoFirstMessageMode + > _stringToEnum = new() + { + { "assistant-speaks-first", CreateAssistantDraftDtoFirstMessageMode.AssistantSpeaksFirst }, + { + "assistant-speaks-first-with-model-generated-message", + CreateAssistantDraftDtoFirstMessageMode.AssistantSpeaksFirstWithModelGeneratedMessage + }, + { + "assistant-waits-for-user", + CreateAssistantDraftDtoFirstMessageMode.AssistantWaitsForUser + }, + }; + + private static readonly global::System.Collections.Generic.Dictionary< + CreateAssistantDraftDtoFirstMessageMode, + string + > _enumToString = new() + { + { CreateAssistantDraftDtoFirstMessageMode.AssistantSpeaksFirst, "assistant-speaks-first" }, + { + CreateAssistantDraftDtoFirstMessageMode.AssistantSpeaksFirstWithModelGeneratedMessage, + "assistant-speaks-first-with-model-generated-message" + }, + { + CreateAssistantDraftDtoFirstMessageMode.AssistantWaitsForUser, + "assistant-waits-for-user" + }, + }; + + public override CreateAssistantDraftDtoFirstMessageMode Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + CreateAssistantDraftDtoFirstMessageMode value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override CreateAssistantDraftDtoFirstMessageMode ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + CreateAssistantDraftDtoFirstMessageMode value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/CreateAssistantDraftDtoServerMessagesItem.cs b/src/Vapi.Net/Types/CreateAssistantDraftDtoServerMessagesItem.cs new file mode 100644 index 00000000..53979421 --- /dev/null +++ b/src/Vapi.Net/Types/CreateAssistantDraftDtoServerMessagesItem.cs @@ -0,0 +1,239 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(CreateAssistantDraftDtoServerMessagesItemSerializer))] +public enum CreateAssistantDraftDtoServerMessagesItem +{ + [EnumMember(Value = "assistant.started")] + AssistantStarted, + + [EnumMember(Value = "assistant.speechStarted")] + AssistantSpeechStarted, + + [EnumMember(Value = "conversation-update")] + ConversationUpdate, + + [EnumMember(Value = "end-of-call-report")] + EndOfCallReport, + + [EnumMember(Value = "function-call")] + FunctionCall, + + [EnumMember(Value = "hang")] + Hang, + + [EnumMember(Value = "language-changed")] + LanguageChanged, + + [EnumMember(Value = "language-change-detected")] + LanguageChangeDetected, + + [EnumMember(Value = "model-output")] + ModelOutput, + + [EnumMember(Value = "phone-call-control")] + PhoneCallControl, + + [EnumMember(Value = "speech-update")] + SpeechUpdate, + + [EnumMember(Value = "status-update")] + StatusUpdate, + + [EnumMember(Value = "transcript")] + Transcript, + + [EnumMember(Value = "transcript[transcriptType=\"final\"]")] + TranscriptTranscriptTypeFinal, + + [EnumMember(Value = "tool-calls")] + ToolCalls, + + [EnumMember(Value = "transfer-destination-request")] + TransferDestinationRequest, + + [EnumMember(Value = "handoff-destination-request")] + HandoffDestinationRequest, + + [EnumMember(Value = "transfer-update")] + TransferUpdate, + + [EnumMember(Value = "user-interrupted")] + UserInterrupted, + + [EnumMember(Value = "voice-input")] + VoiceInput, + + [EnumMember(Value = "chat.created")] + ChatCreated, + + [EnumMember(Value = "chat.deleted")] + ChatDeleted, + + [EnumMember(Value = "session.created")] + SessionCreated, + + [EnumMember(Value = "session.updated")] + SessionUpdated, + + [EnumMember(Value = "session.deleted")] + SessionDeleted, + + [EnumMember(Value = "call.deleted")] + CallDeleted, + + [EnumMember(Value = "call.delete.failed")] + CallDeleteFailed, +} + +internal class CreateAssistantDraftDtoServerMessagesItemSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + CreateAssistantDraftDtoServerMessagesItem + > _stringToEnum = new() + { + { "assistant.started", CreateAssistantDraftDtoServerMessagesItem.AssistantStarted }, + { + "assistant.speechStarted", + CreateAssistantDraftDtoServerMessagesItem.AssistantSpeechStarted + }, + { "conversation-update", CreateAssistantDraftDtoServerMessagesItem.ConversationUpdate }, + { "end-of-call-report", CreateAssistantDraftDtoServerMessagesItem.EndOfCallReport }, + { "function-call", CreateAssistantDraftDtoServerMessagesItem.FunctionCall }, + { "hang", CreateAssistantDraftDtoServerMessagesItem.Hang }, + { "language-changed", CreateAssistantDraftDtoServerMessagesItem.LanguageChanged }, + { + "language-change-detected", + CreateAssistantDraftDtoServerMessagesItem.LanguageChangeDetected + }, + { "model-output", CreateAssistantDraftDtoServerMessagesItem.ModelOutput }, + { "phone-call-control", CreateAssistantDraftDtoServerMessagesItem.PhoneCallControl }, + { "speech-update", CreateAssistantDraftDtoServerMessagesItem.SpeechUpdate }, + { "status-update", CreateAssistantDraftDtoServerMessagesItem.StatusUpdate }, + { "transcript", CreateAssistantDraftDtoServerMessagesItem.Transcript }, + { + "transcript[transcriptType=\"final\"]", + CreateAssistantDraftDtoServerMessagesItem.TranscriptTranscriptTypeFinal + }, + { "tool-calls", CreateAssistantDraftDtoServerMessagesItem.ToolCalls }, + { + "transfer-destination-request", + CreateAssistantDraftDtoServerMessagesItem.TransferDestinationRequest + }, + { + "handoff-destination-request", + CreateAssistantDraftDtoServerMessagesItem.HandoffDestinationRequest + }, + { "transfer-update", CreateAssistantDraftDtoServerMessagesItem.TransferUpdate }, + { "user-interrupted", CreateAssistantDraftDtoServerMessagesItem.UserInterrupted }, + { "voice-input", CreateAssistantDraftDtoServerMessagesItem.VoiceInput }, + { "chat.created", CreateAssistantDraftDtoServerMessagesItem.ChatCreated }, + { "chat.deleted", CreateAssistantDraftDtoServerMessagesItem.ChatDeleted }, + { "session.created", CreateAssistantDraftDtoServerMessagesItem.SessionCreated }, + { "session.updated", CreateAssistantDraftDtoServerMessagesItem.SessionUpdated }, + { "session.deleted", CreateAssistantDraftDtoServerMessagesItem.SessionDeleted }, + { "call.deleted", CreateAssistantDraftDtoServerMessagesItem.CallDeleted }, + { "call.delete.failed", CreateAssistantDraftDtoServerMessagesItem.CallDeleteFailed }, + }; + + private static readonly global::System.Collections.Generic.Dictionary< + CreateAssistantDraftDtoServerMessagesItem, + string + > _enumToString = new() + { + { CreateAssistantDraftDtoServerMessagesItem.AssistantStarted, "assistant.started" }, + { + CreateAssistantDraftDtoServerMessagesItem.AssistantSpeechStarted, + "assistant.speechStarted" + }, + { CreateAssistantDraftDtoServerMessagesItem.ConversationUpdate, "conversation-update" }, + { CreateAssistantDraftDtoServerMessagesItem.EndOfCallReport, "end-of-call-report" }, + { CreateAssistantDraftDtoServerMessagesItem.FunctionCall, "function-call" }, + { CreateAssistantDraftDtoServerMessagesItem.Hang, "hang" }, + { CreateAssistantDraftDtoServerMessagesItem.LanguageChanged, "language-changed" }, + { + CreateAssistantDraftDtoServerMessagesItem.LanguageChangeDetected, + "language-change-detected" + }, + { CreateAssistantDraftDtoServerMessagesItem.ModelOutput, "model-output" }, + { CreateAssistantDraftDtoServerMessagesItem.PhoneCallControl, "phone-call-control" }, + { CreateAssistantDraftDtoServerMessagesItem.SpeechUpdate, "speech-update" }, + { CreateAssistantDraftDtoServerMessagesItem.StatusUpdate, "status-update" }, + { CreateAssistantDraftDtoServerMessagesItem.Transcript, "transcript" }, + { + CreateAssistantDraftDtoServerMessagesItem.TranscriptTranscriptTypeFinal, + "transcript[transcriptType=\"final\"]" + }, + { CreateAssistantDraftDtoServerMessagesItem.ToolCalls, "tool-calls" }, + { + CreateAssistantDraftDtoServerMessagesItem.TransferDestinationRequest, + "transfer-destination-request" + }, + { + CreateAssistantDraftDtoServerMessagesItem.HandoffDestinationRequest, + "handoff-destination-request" + }, + { CreateAssistantDraftDtoServerMessagesItem.TransferUpdate, "transfer-update" }, + { CreateAssistantDraftDtoServerMessagesItem.UserInterrupted, "user-interrupted" }, + { CreateAssistantDraftDtoServerMessagesItem.VoiceInput, "voice-input" }, + { CreateAssistantDraftDtoServerMessagesItem.ChatCreated, "chat.created" }, + { CreateAssistantDraftDtoServerMessagesItem.ChatDeleted, "chat.deleted" }, + { CreateAssistantDraftDtoServerMessagesItem.SessionCreated, "session.created" }, + { CreateAssistantDraftDtoServerMessagesItem.SessionUpdated, "session.updated" }, + { CreateAssistantDraftDtoServerMessagesItem.SessionDeleted, "session.deleted" }, + { CreateAssistantDraftDtoServerMessagesItem.CallDeleted, "call.deleted" }, + { CreateAssistantDraftDtoServerMessagesItem.CallDeleteFailed, "call.delete.failed" }, + }; + + public override CreateAssistantDraftDtoServerMessagesItem Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + CreateAssistantDraftDtoServerMessagesItem value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override CreateAssistantDraftDtoServerMessagesItem ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + CreateAssistantDraftDtoServerMessagesItem value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/CreateAssistantDraftDtoVoicemailDetectionZero.cs b/src/Vapi.Net/Types/CreateAssistantDraftDtoVoicemailDetectionZero.cs new file mode 100644 index 00000000..2540359b --- /dev/null +++ b/src/Vapi.Net/Types/CreateAssistantDraftDtoVoicemailDetectionZero.cs @@ -0,0 +1,73 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(CreateAssistantDraftDtoVoicemailDetectionZeroSerializer))] +public enum CreateAssistantDraftDtoVoicemailDetectionZero +{ + [EnumMember(Value = "off")] + Off, +} + +internal class CreateAssistantDraftDtoVoicemailDetectionZeroSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + CreateAssistantDraftDtoVoicemailDetectionZero + > _stringToEnum = new() { { "off", CreateAssistantDraftDtoVoicemailDetectionZero.Off } }; + + private static readonly global::System.Collections.Generic.Dictionary< + CreateAssistantDraftDtoVoicemailDetectionZero, + string + > _enumToString = new() { { CreateAssistantDraftDtoVoicemailDetectionZero.Off, "off" } }; + + public override CreateAssistantDraftDtoVoicemailDetectionZero Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + CreateAssistantDraftDtoVoicemailDetectionZero value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override CreateAssistantDraftDtoVoicemailDetectionZero ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + CreateAssistantDraftDtoVoicemailDetectionZero value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/CreateAssistantDto.cs b/src/Vapi.Net/Types/CreateAssistantDto.cs index 40a7fea7..f897a85a 100644 --- a/src/Vapi.Net/Types/CreateAssistantDto.cs +++ b/src/Vapi.Net/Types/CreateAssistantDto.cs @@ -5,6 +5,9 @@ namespace Vapi.Net; +/// +/// Configuration used to create an assistant, including its model, voice, transcriber, prompts, tools, messaging, and conversation behavior. +/// [Serializable] public record CreateAssistantDto : IJsonOnDeserialized { @@ -38,6 +41,9 @@ public record CreateAssistantDto : IJsonOnDeserialized [JsonPropertyName("firstMessage")] public string? FirstMessage { get; set; } + /// + /// Set to `true` to allow the user to interrupt the assistant while it speaks the first message. Default is `false`. + /// [JsonPropertyName("firstMessageInterruptionsEnabled")] public bool? FirstMessageInterruptionsEnabled { get; set; } @@ -166,6 +172,9 @@ public IEnumerable< [JsonPropertyName("endCallPhrases")] public IEnumerable? EndCallPhrases { get; set; } + /// + /// Compliance settings for the assistant, including HIPAA and PCI behavior, security filtering, and recording consent. + /// [JsonPropertyName("compliancePlan")] public CompliancePlan? CompliancePlan { get; set; } @@ -256,6 +265,9 @@ public IEnumerable< [JsonPropertyName("server")] public Server? Server { get; set; } + /// + /// Configuration for collecting and processing DTMF keypad input during calls. + /// [JsonPropertyName("keypadInputPlan")] public KeypadInputPlan? KeypadInputPlan { get; set; } diff --git a/src/Vapi.Net/Types/CreateAzureCredentialDto.cs b/src/Vapi.Net/Types/CreateAzureCredentialDto.cs index 23606646..5e708eed 100644 --- a/src/Vapi.Net/Types/CreateAzureCredentialDto.cs +++ b/src/Vapi.Net/Types/CreateAzureCredentialDto.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Credentials for Azure Speech or Blob Storage, including service, region, and optional storage bucket settings. +/// [Serializable] public record CreateAzureCredentialDto : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/CreateAzureCredentialDtoRegion.cs b/src/Vapi.Net/Types/CreateAzureCredentialDtoRegion.cs index 87ed804e..1889830a 100644 --- a/src/Vapi.Net/Types/CreateAzureCredentialDtoRegion.cs +++ b/src/Vapi.Net/Types/CreateAzureCredentialDtoRegion.cs @@ -60,6 +60,12 @@ public enum CreateAzureCredentialDtoRegion [EnumMember(Value = "switzerland")] Switzerland, + [EnumMember(Value = "switzerlandnorth")] + Switzerlandnorth, + + [EnumMember(Value = "switzerlandwest")] + Switzerlandwest, + [EnumMember(Value = "uaenorth")] Uaenorth, @@ -102,6 +108,8 @@ internal class CreateAzureCredentialDtoRegionSerializer { "spaincentral", CreateAzureCredentialDtoRegion.Spaincentral }, { "swedencentral", CreateAzureCredentialDtoRegion.Swedencentral }, { "switzerland", CreateAzureCredentialDtoRegion.Switzerland }, + { "switzerlandnorth", CreateAzureCredentialDtoRegion.Switzerlandnorth }, + { "switzerlandwest", CreateAzureCredentialDtoRegion.Switzerlandwest }, { "uaenorth", CreateAzureCredentialDtoRegion.Uaenorth }, { "uk", CreateAzureCredentialDtoRegion.Uk }, { "westeurope", CreateAzureCredentialDtoRegion.Westeurope }, @@ -132,6 +140,8 @@ internal class CreateAzureCredentialDtoRegionSerializer { CreateAzureCredentialDtoRegion.Spaincentral, "spaincentral" }, { CreateAzureCredentialDtoRegion.Swedencentral, "swedencentral" }, { CreateAzureCredentialDtoRegion.Switzerland, "switzerland" }, + { CreateAzureCredentialDtoRegion.Switzerlandnorth, "switzerlandnorth" }, + { CreateAzureCredentialDtoRegion.Switzerlandwest, "switzerlandwest" }, { CreateAzureCredentialDtoRegion.Uaenorth, "uaenorth" }, { CreateAzureCredentialDtoRegion.Uk, "uk" }, { CreateAzureCredentialDtoRegion.Westeurope, "westeurope" }, diff --git a/src/Vapi.Net/Types/CreateAzureOpenAiCredentialDto.cs b/src/Vapi.Net/Types/CreateAzureOpenAiCredentialDto.cs index d0297088..f0c818e3 100644 --- a/src/Vapi.Net/Types/CreateAzureOpenAiCredentialDto.cs +++ b/src/Vapi.Net/Types/CreateAzureOpenAiCredentialDto.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Credentials for authenticating assistant model requests with Azure OpenAI, including region, endpoint, and available models. +/// [Serializable] public record CreateAzureOpenAiCredentialDto : IJsonOnDeserialized { @@ -11,9 +14,15 @@ public record CreateAzureOpenAiCredentialDto : IJsonOnDeserialized private readonly IDictionary _extensionData = new Dictionary(); + /// + /// Azure region that hosts the OpenAI resource. + /// [JsonPropertyName("region")] public required CreateAzureOpenAiCredentialDtoRegion Region { get; set; } + /// + /// Azure OpenAI models available through this credential. + /// [JsonPropertyName("models")] public IEnumerable Models { get; set; } = new List(); @@ -30,6 +39,9 @@ public record CreateAzureOpenAiCredentialDto : IJsonOnDeserialized [JsonPropertyName("ocpApimSubscriptionKey")] public string? OcpApimSubscriptionKey { get; set; } + /// + /// Endpoint URL for the Azure OpenAI resource. + /// [JsonPropertyName("openAIEndpoint")] public required string OpenAiEndpoint { get; set; } diff --git a/src/Vapi.Net/Types/CreateAzureOpenAiCredentialDtoModelsItem.cs b/src/Vapi.Net/Types/CreateAzureOpenAiCredentialDtoModelsItem.cs index 01ea1c3c..215fd9bf 100644 --- a/src/Vapi.Net/Types/CreateAzureOpenAiCredentialDtoModelsItem.cs +++ b/src/Vapi.Net/Types/CreateAzureOpenAiCredentialDtoModelsItem.cs @@ -74,6 +74,15 @@ public enum CreateAzureOpenAiCredentialDtoModelsItem [EnumMember(Value = "gpt-35-turbo-1106")] Gpt35Turbo1106, + + [EnumMember(Value = "gpt-4o")] + Gpt4O, + + [EnumMember(Value = "gpt-4.1")] + Gpt41, + + [EnumMember(Value = "gpt-5.4-mini-2026-03-17")] + Gpt54Mini20260317, } internal class CreateAzureOpenAiCredentialDtoModelsItemSerializer @@ -107,6 +116,9 @@ internal class CreateAzureOpenAiCredentialDtoModelsItemSerializer { "gpt-4-0613", CreateAzureOpenAiCredentialDtoModelsItem.Gpt40613 }, { "gpt-35-turbo-0125", CreateAzureOpenAiCredentialDtoModelsItem.Gpt35Turbo0125 }, { "gpt-35-turbo-1106", CreateAzureOpenAiCredentialDtoModelsItem.Gpt35Turbo1106 }, + { "gpt-4o", CreateAzureOpenAiCredentialDtoModelsItem.Gpt4O }, + { "gpt-4.1", CreateAzureOpenAiCredentialDtoModelsItem.Gpt41 }, + { "gpt-5.4-mini-2026-03-17", CreateAzureOpenAiCredentialDtoModelsItem.Gpt54Mini20260317 }, }; private static readonly global::System.Collections.Generic.Dictionary< @@ -137,6 +149,9 @@ internal class CreateAzureOpenAiCredentialDtoModelsItemSerializer { CreateAzureOpenAiCredentialDtoModelsItem.Gpt40613, "gpt-4-0613" }, { CreateAzureOpenAiCredentialDtoModelsItem.Gpt35Turbo0125, "gpt-35-turbo-0125" }, { CreateAzureOpenAiCredentialDtoModelsItem.Gpt35Turbo1106, "gpt-35-turbo-1106" }, + { CreateAzureOpenAiCredentialDtoModelsItem.Gpt4O, "gpt-4o" }, + { CreateAzureOpenAiCredentialDtoModelsItem.Gpt41, "gpt-4.1" }, + { CreateAzureOpenAiCredentialDtoModelsItem.Gpt54Mini20260317, "gpt-5.4-mini-2026-03-17" }, }; public override CreateAzureOpenAiCredentialDtoModelsItem Read( diff --git a/src/Vapi.Net/Types/CreateAzureOpenAiCredentialDtoRegion.cs b/src/Vapi.Net/Types/CreateAzureOpenAiCredentialDtoRegion.cs index fd75adaf..f3bfa1cf 100644 --- a/src/Vapi.Net/Types/CreateAzureOpenAiCredentialDtoRegion.cs +++ b/src/Vapi.Net/Types/CreateAzureOpenAiCredentialDtoRegion.cs @@ -60,6 +60,12 @@ public enum CreateAzureOpenAiCredentialDtoRegion [EnumMember(Value = "switzerland")] Switzerland, + [EnumMember(Value = "switzerlandnorth")] + Switzerlandnorth, + + [EnumMember(Value = "switzerlandwest")] + Switzerlandwest, + [EnumMember(Value = "uaenorth")] Uaenorth, @@ -102,6 +108,8 @@ internal class CreateAzureOpenAiCredentialDtoRegionSerializer { "spaincentral", CreateAzureOpenAiCredentialDtoRegion.Spaincentral }, { "swedencentral", CreateAzureOpenAiCredentialDtoRegion.Swedencentral }, { "switzerland", CreateAzureOpenAiCredentialDtoRegion.Switzerland }, + { "switzerlandnorth", CreateAzureOpenAiCredentialDtoRegion.Switzerlandnorth }, + { "switzerlandwest", CreateAzureOpenAiCredentialDtoRegion.Switzerlandwest }, { "uaenorth", CreateAzureOpenAiCredentialDtoRegion.Uaenorth }, { "uk", CreateAzureOpenAiCredentialDtoRegion.Uk }, { "westeurope", CreateAzureOpenAiCredentialDtoRegion.Westeurope }, @@ -132,6 +140,8 @@ internal class CreateAzureOpenAiCredentialDtoRegionSerializer { CreateAzureOpenAiCredentialDtoRegion.Spaincentral, "spaincentral" }, { CreateAzureOpenAiCredentialDtoRegion.Swedencentral, "swedencentral" }, { CreateAzureOpenAiCredentialDtoRegion.Switzerland, "switzerland" }, + { CreateAzureOpenAiCredentialDtoRegion.Switzerlandnorth, "switzerlandnorth" }, + { CreateAzureOpenAiCredentialDtoRegion.Switzerlandwest, "switzerlandwest" }, { CreateAzureOpenAiCredentialDtoRegion.Uaenorth, "uaenorth" }, { CreateAzureOpenAiCredentialDtoRegion.Uk, "uk" }, { CreateAzureOpenAiCredentialDtoRegion.Westeurope, "westeurope" }, diff --git a/src/Vapi.Net/Types/CreateBarInsightFromCallTableDto.cs b/src/Vapi.Net/Types/CreateBarInsightFromCallTableDto.cs index 77ac866b..2d051305 100644 --- a/src/Vapi.Net/Types/CreateBarInsightFromCallTableDto.cs +++ b/src/Vapi.Net/Types/CreateBarInsightFromCallTableDto.cs @@ -5,6 +5,9 @@ namespace Vapi.Net; +/// +/// Configuration used to create a bar-chart insight from call data using metric queries, formulas, grouping, and a stepped time range. +/// [Serializable] public record CreateBarInsightFromCallTableDto : IJsonOnDeserialized { @@ -44,6 +47,9 @@ public record CreateBarInsightFromCallTableDto : IJsonOnDeserialized [JsonPropertyName("metadata")] public BarInsightMetadata? Metadata { get; set; } + /// + /// The time range and interval used to aggregate the bar-chart data. + /// [JsonPropertyName("timeRange")] public InsightTimeRangeWithStep? TimeRange { get; set; } diff --git a/src/Vapi.Net/Types/CreateBashToolDto.cs b/src/Vapi.Net/Types/CreateBashToolDto.cs index a6b1e214..eab2879e 100644 --- a/src/Vapi.Net/Types/CreateBashToolDto.cs +++ b/src/Vapi.Net/Types/CreateBashToolDto.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Configuration used to create a tool that executes shell commands in a configured environment. +/// [Serializable] public record CreateBashToolDto : IJsonOnDeserialized { @@ -12,9 +15,7 @@ public record CreateBashToolDto : IJsonOnDeserialized new Dictionary(); /// - /// 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. + /// Messages spoken while the tool is running. Multiple request-start messages are variants. For request-response-delayed, same timing means variants and different timings mean staged updates. /// [JsonPropertyName("messages")] public IEnumerable? Messages { get; set; } diff --git a/src/Vapi.Net/Types/CreateByoPhoneNumberDto.cs b/src/Vapi.Net/Types/CreateByoPhoneNumberDto.cs index 60c0f6b2..cec7a7db 100644 --- a/src/Vapi.Net/Types/CreateByoPhoneNumberDto.cs +++ b/src/Vapi.Net/Types/CreateByoPhoneNumberDto.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Configuration used to connect a bring-your-own phone number to Vapi with a stored telephony credential and routing settings. +/// [Serializable] public record CreateByoPhoneNumberDto : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/CreateByoSipTrunkCredentialDto.cs b/src/Vapi.Net/Types/CreateByoSipTrunkCredentialDto.cs index 39b51c15..84997f41 100644 --- a/src/Vapi.Net/Types/CreateByoSipTrunkCredentialDto.cs +++ b/src/Vapi.Net/Types/CreateByoSipTrunkCredentialDto.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Configuration for connecting Vapi to a bring-your-own SIP trunk or carrier, including gateways, outbound authentication, number handling, and optional session border controller routing. +/// [Serializable] public record CreateByoSipTrunkCredentialDto : IJsonOnDeserialized { @@ -46,12 +49,6 @@ public record CreateByoSipTrunkCredentialDto : IJsonOnDeserialized [JsonPropertyName("sipDiversionHeader")] public string? SipDiversionHeader { get; set; } - /// - /// This is an advanced configuration for enterprise deployments. This uses the onprem SBC to trunk into the SIP trunk's `gateways`, rather than the managed SBC provided by Vapi. - /// - [JsonPropertyName("sbcConfiguration")] - public SbcConfiguration? SbcConfiguration { get; set; } - /// /// This is the name of credential. This is just for your reference. /// diff --git a/src/Vapi.Net/Types/CreateCampaignDto.cs b/src/Vapi.Net/Types/CreateCampaignDto.cs new file mode 100644 index 00000000..dbec55bc --- /dev/null +++ b/src/Vapi.Net/Types/CreateCampaignDto.cs @@ -0,0 +1,118 @@ +using global::System.Text.Json; +using global::System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +/// +/// Configuration used to create an outbound calling campaign. Choose an assistant, squad, or workflow, then provide customers, phone-number or dial-plan settings, and an optional schedule. +/// +[Serializable] +public record CreateCampaignDto : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + /// + /// This is the name of the campaign. This is just for your own reference. + /// + [JsonPropertyName("name")] + public required string Name { get; set; } + + /// + /// This is the assistant ID that will be used for the campaign calls. Note: Only one of assistantId, workflowId, or squadId can be used. + /// + [JsonPropertyName("assistantId")] + public string? AssistantId { get; set; } + + /// + /// This is the workflow ID that will be used for the campaign calls. Note: Only one of assistantId, workflowId, or squadId can be used. + /// + [JsonPropertyName("workflowId")] + public string? WorkflowId { get; set; } + + /// + /// This is the squad ID that will be used for the campaign calls. Note: Only one of assistantId, workflowId, or squadId can be used. + /// + [JsonPropertyName("squadId")] + public string? SquadId { get; set; } + + /// + /// This is the phone number ID that will be used for the campaign calls. Required if dialPlan is not provided. Note: phoneNumberId and dialPlan are mutually exclusive. + /// + [JsonPropertyName("phoneNumberId")] + public string? PhoneNumberId { get; set; } + + /// + /// This is a list of dial entries, each specifying a phone number and the customers to call using that number. Use this when you want different phone numbers to call different sets of customers. Note: phoneNumberId and dialPlan are mutually exclusive. + /// + [JsonPropertyName("dialPlan")] + public IEnumerable? DialPlan { get; set; } + + /// + /// This is the schedule plan for the campaign. Calls will start at startedAt and continue until your organization’s concurrency limit is reached. Any remaining calls will be retried for up to one hour as capacity becomes available. After that hour or after latestAt, whichever comes first, any calls that couldn’t be placed won’t be retried. + /// + [JsonPropertyName("schedulePlan")] + public SchedulePlan? SchedulePlan { get; set; } + + /// + /// These are the customers that will be called in the campaign. Required if dialPlan is not provided. Maximum of 10000 customers per campaign. + /// + [JsonPropertyName("customers")] + public IEnumerable? Customers { get; set; } + + /// + /// This is the maximum number of concurrent calls that will be made for the campaign. Defaults to 10. + /// + [JsonPropertyName("maxConcurrency")] + public double? MaxConcurrency { get; set; } + + /// + /// These are the overrides for the assistant's settings and template variables for the campaign. Use this when the campaign targets an `assistantId`. + /// + [JsonPropertyName("assistantOverrides")] + public AssistantOverrides? AssistantOverrides { get; set; } + + /// + /// These are the overrides for the squad and template variables for the campaign. Use this when the campaign targets a `squadId`. Per-contact `squadOverrides` are deep-merged on top of this at dispatch time. + /// + [JsonPropertyName("squadOverrides")] + public AssistantOverrides? SquadOverrides { get; set; } + + /// + /// This is the server (URL, auth headers, timeout, etc.) for the campaign webhooks. + /// + [JsonPropertyName("server")] + public Server? Server { get; set; } + + /// + /// These are the messages that will be sent to your Server URL. + /// + [JsonPropertyName("serverMessages")] + public IEnumerable? ServerMessages { get; set; } + + /// + /// This opts the campaign into the blocking `campaign.predial` eligibility webhook. When set, every contact triggers a `campaign.predial` POST to the Server URL before dialing, and the response `{ eligible: boolean }` decides whether the call is placed. Requires `server`. When unset, no pre-dial webhook is sent. + /// + [JsonPropertyName("predialPlan")] + public CampaignPredialPlan? PredialPlan { get; set; } + + /// + /// Optional campaign ID to duplicate config from. Provided fields in the request override the source. If `customers` is omitted, contacts are copied from the source. + /// + [JsonPropertyName("duplicateFromCampaignId")] + public string? DuplicateFromCampaignId { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/CreateCampaignDtoServerMessagesItem.cs b/src/Vapi.Net/Types/CreateCampaignDtoServerMessagesItem.cs new file mode 100644 index 00000000..5613477c --- /dev/null +++ b/src/Vapi.Net/Types/CreateCampaignDtoServerMessagesItem.cs @@ -0,0 +1,129 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(CreateCampaignDtoServerMessagesItemSerializer))] +public enum CreateCampaignDtoServerMessagesItem +{ + [EnumMember(Value = "campaign.started")] + CampaignStarted, + + [EnumMember(Value = "campaign.cancelled")] + CampaignCancelled, + + [EnumMember(Value = "campaign.ended")] + CampaignEnded, + + [EnumMember(Value = "campaign.archived")] + CampaignArchived, + + [EnumMember(Value = "campaign.unarchived")] + CampaignUnarchived, + + [EnumMember(Value = "contact.dispatched")] + ContactDispatched, + + [EnumMember(Value = "contact.completed")] + ContactCompleted, + + [EnumMember(Value = "contact.failed")] + ContactFailed, + + [EnumMember(Value = "contact.skipped")] + ContactSkipped, + + [EnumMember(Value = "contact.predial-failed")] + ContactPredialFailed, + + [EnumMember(Value = "campaign.job.continued")] + CampaignJobContinued, +} + +internal class CreateCampaignDtoServerMessagesItemSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + CreateCampaignDtoServerMessagesItem + > _stringToEnum = new() + { + { "campaign.started", CreateCampaignDtoServerMessagesItem.CampaignStarted }, + { "campaign.cancelled", CreateCampaignDtoServerMessagesItem.CampaignCancelled }, + { "campaign.ended", CreateCampaignDtoServerMessagesItem.CampaignEnded }, + { "campaign.archived", CreateCampaignDtoServerMessagesItem.CampaignArchived }, + { "campaign.unarchived", CreateCampaignDtoServerMessagesItem.CampaignUnarchived }, + { "contact.dispatched", CreateCampaignDtoServerMessagesItem.ContactDispatched }, + { "contact.completed", CreateCampaignDtoServerMessagesItem.ContactCompleted }, + { "contact.failed", CreateCampaignDtoServerMessagesItem.ContactFailed }, + { "contact.skipped", CreateCampaignDtoServerMessagesItem.ContactSkipped }, + { "contact.predial-failed", CreateCampaignDtoServerMessagesItem.ContactPredialFailed }, + { "campaign.job.continued", CreateCampaignDtoServerMessagesItem.CampaignJobContinued }, + }; + + private static readonly global::System.Collections.Generic.Dictionary< + CreateCampaignDtoServerMessagesItem, + string + > _enumToString = new() + { + { CreateCampaignDtoServerMessagesItem.CampaignStarted, "campaign.started" }, + { CreateCampaignDtoServerMessagesItem.CampaignCancelled, "campaign.cancelled" }, + { CreateCampaignDtoServerMessagesItem.CampaignEnded, "campaign.ended" }, + { CreateCampaignDtoServerMessagesItem.CampaignArchived, "campaign.archived" }, + { CreateCampaignDtoServerMessagesItem.CampaignUnarchived, "campaign.unarchived" }, + { CreateCampaignDtoServerMessagesItem.ContactDispatched, "contact.dispatched" }, + { CreateCampaignDtoServerMessagesItem.ContactCompleted, "contact.completed" }, + { CreateCampaignDtoServerMessagesItem.ContactFailed, "contact.failed" }, + { CreateCampaignDtoServerMessagesItem.ContactSkipped, "contact.skipped" }, + { CreateCampaignDtoServerMessagesItem.ContactPredialFailed, "contact.predial-failed" }, + { CreateCampaignDtoServerMessagesItem.CampaignJobContinued, "campaign.job.continued" }, + }; + + public override CreateCampaignDtoServerMessagesItem Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + CreateCampaignDtoServerMessagesItem value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override CreateCampaignDtoServerMessagesItem ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + CreateCampaignDtoServerMessagesItem value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/CreateCartesiaCredentialDto.cs b/src/Vapi.Net/Types/CreateCartesiaCredentialDto.cs index d85c804f..8fb223d1 100644 --- a/src/Vapi.Net/Types/CreateCartesiaCredentialDto.cs +++ b/src/Vapi.Net/Types/CreateCartesiaCredentialDto.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Credentials for authenticating speech recognition and voice synthesis requests with Cartesia. +/// [Serializable] public record CreateCartesiaCredentialDto : IJsonOnDeserialized { @@ -17,6 +20,12 @@ public record CreateCartesiaCredentialDto : IJsonOnDeserialized [JsonPropertyName("apiKey")] public required string ApiKey { get; set; } + /// + /// This can be used to point to an onprem Cartesia instance. Defaults to api.cartesia.ai. + /// + [JsonPropertyName("apiUrl")] + public string? ApiUrl { get; set; } + /// /// This is the name of credential. This is just for your reference. /// diff --git a/src/Vapi.Net/Types/CreateCerebrasCredentialDto.cs b/src/Vapi.Net/Types/CreateCerebrasCredentialDto.cs index c05f4ebc..38049f04 100644 --- a/src/Vapi.Net/Types/CreateCerebrasCredentialDto.cs +++ b/src/Vapi.Net/Types/CreateCerebrasCredentialDto.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Credentials for authenticating assistant model requests with Cerebras. +/// [Serializable] public record CreateCerebrasCredentialDto : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/CreateCloudflareCredentialDto.cs b/src/Vapi.Net/Types/CreateCloudflareCredentialDto.cs index 1ad62f16..afa4a474 100644 --- a/src/Vapi.Net/Types/CreateCloudflareCredentialDto.cs +++ b/src/Vapi.Net/Types/CreateCloudflareCredentialDto.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Credentials for storing call artifacts in Cloudflare R2, including account details, bucket configuration, and upload fallback order. +/// [Serializable] public record CreateCloudflareCredentialDto : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/CreateCodeToolDto.cs b/src/Vapi.Net/Types/CreateCodeToolDto.cs index f6cea4e3..3c229a8e 100644 --- a/src/Vapi.Net/Types/CreateCodeToolDto.cs +++ b/src/Vapi.Net/Types/CreateCodeToolDto.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Configuration used to create a reusable tool that executes TypeScript code with configured credentials, environment variables, and timeout. +/// [Serializable] public record CreateCodeToolDto : IJsonOnDeserialized { @@ -12,9 +15,7 @@ public record CreateCodeToolDto : IJsonOnDeserialized new Dictionary(); /// - /// 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. + /// Messages spoken while the tool is running. Multiple request-start messages are variants. For request-response-delayed, same timing means variants and different timings mean staged updates. /// [JsonPropertyName("messages")] public IEnumerable? Messages { get; set; } diff --git a/src/Vapi.Net/Types/CreateComputerToolDto.cs b/src/Vapi.Net/Types/CreateComputerToolDto.cs index 3234a0fd..e100df45 100644 --- a/src/Vapi.Net/Types/CreateComputerToolDto.cs +++ b/src/Vapi.Net/Types/CreateComputerToolDto.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Configuration used to create a tool that lets the model interact with a computer display through screen, pointer, and keyboard actions. +/// [Serializable] public record CreateComputerToolDto : IJsonOnDeserialized { @@ -12,9 +15,7 @@ public record CreateComputerToolDto : IJsonOnDeserialized new Dictionary(); /// - /// 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. + /// Messages spoken while the tool is running. Multiple request-start messages are variants. For request-response-delayed, same timing means variants and different timings mean staged updates. /// [JsonPropertyName("messages")] public IEnumerable? Messages { get; set; } diff --git a/src/Vapi.Net/Types/CreateCustomCredentialDto.cs b/src/Vapi.Net/Types/CreateCustomCredentialDto.cs index 9b2f1851..f4de523f 100644 --- a/src/Vapi.Net/Types/CreateCustomCredentialDto.cs +++ b/src/Vapi.Net/Types/CreateCustomCredentialDto.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Reusable custom credentials for authenticating outbound requests, with optional public-key encryption for sensitive request data. +/// [Serializable] public record CreateCustomCredentialDto : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/CreateCustomKnowledgeBaseDto.cs b/src/Vapi.Net/Types/CreateCustomKnowledgeBaseDto.cs index 02b692c7..1fe55874 100644 --- a/src/Vapi.Net/Types/CreateCustomKnowledgeBaseDto.cs +++ b/src/Vapi.Net/Types/CreateCustomKnowledgeBaseDto.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Configuration for connecting a custom knowledge-base implementation through a customer-hosted server. +/// [Serializable] public record CreateCustomKnowledgeBaseDto : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/CreateCustomLlmCredentialDto.cs b/src/Vapi.Net/Types/CreateCustomLlmCredentialDto.cs index e1166bdc..1bd36134 100644 --- a/src/Vapi.Net/Types/CreateCustomLlmCredentialDto.cs +++ b/src/Vapi.Net/Types/CreateCustomLlmCredentialDto.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Credentials for authenticating requests to a custom language model with an API key or OAuth 2.0 authentication plan. +/// [Serializable] public record CreateCustomLlmCredentialDto : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/CreateCustomerDto.cs b/src/Vapi.Net/Types/CreateCustomerDto.cs index 0ec3addf..a818713c 100644 --- a/src/Vapi.Net/Types/CreateCustomerDto.cs +++ b/src/Vapi.Net/Types/CreateCustomerDto.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Customer details used for call delivery and assistant personalization, including phone or SIP destination, contact identifiers, extension, and assistant overrides. +/// [Serializable] public record CreateCustomerDto : IJsonOnDeserialized { @@ -38,6 +41,14 @@ public record CreateCustomerDto : IJsonOnDeserialized [JsonPropertyName("assistantOverrides")] public AssistantOverrides? AssistantOverrides { get; set; } + /// + /// These are the overrides applied when the call targets a `squadId`. Mirrors + /// the call-level `squadOverrides` — use this instead of `assistantOverrides` + /// when the campaign or call is squad-based. + /// + [JsonPropertyName("squadOverrides")] + public AssistantOverrides? SquadOverrides { get; set; } + /// /// This is the number of the customer. /// diff --git a/src/Vapi.Net/Types/CreateDeepInfraCredentialDto.cs b/src/Vapi.Net/Types/CreateDeepInfraCredentialDto.cs index 60f72310..dae8c200 100644 --- a/src/Vapi.Net/Types/CreateDeepInfraCredentialDto.cs +++ b/src/Vapi.Net/Types/CreateDeepInfraCredentialDto.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Credentials for authenticating assistant model requests with DeepInfra. +/// [Serializable] public record CreateDeepInfraCredentialDto : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/CreateDeepSeekCredentialDto.cs b/src/Vapi.Net/Types/CreateDeepSeekCredentialDto.cs index 943ba331..a886dc35 100644 --- a/src/Vapi.Net/Types/CreateDeepSeekCredentialDto.cs +++ b/src/Vapi.Net/Types/CreateDeepSeekCredentialDto.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Credentials for authenticating assistant model requests with DeepSeek. +/// [Serializable] public record CreateDeepSeekCredentialDto : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/CreateDeepgramCredentialDto.cs b/src/Vapi.Net/Types/CreateDeepgramCredentialDto.cs index f21b4d20..54cc77c1 100644 --- a/src/Vapi.Net/Types/CreateDeepgramCredentialDto.cs +++ b/src/Vapi.Net/Types/CreateDeepgramCredentialDto.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Credentials for authenticating speech recognition and voice synthesis requests with Deepgram, with an optional API URL for an on-premises instance. +/// [Serializable] public record CreateDeepgramCredentialDto : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/CreateDtmfToolDto.cs b/src/Vapi.Net/Types/CreateDtmfToolDto.cs index baa688f8..5cf23eb7 100644 --- a/src/Vapi.Net/Types/CreateDtmfToolDto.cs +++ b/src/Vapi.Net/Types/CreateDtmfToolDto.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Configuration used to create a tool that lets an assistant send DTMF keypad tones during a call. +/// [Serializable] public record CreateDtmfToolDto : IJsonOnDeserialized { @@ -12,9 +15,7 @@ public record CreateDtmfToolDto : IJsonOnDeserialized new Dictionary(); /// - /// 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. + /// Messages spoken while the tool is running. Multiple request-start messages are variants. For request-response-delayed, same timing means variants and different timings mean staged updates. /// [JsonPropertyName("messages")] public IEnumerable? Messages { get; set; } diff --git a/src/Vapi.Net/Types/CreateElevenLabsCredentialDto.cs b/src/Vapi.Net/Types/CreateElevenLabsCredentialDto.cs index 5cae0f83..f2ee0ad0 100644 --- a/src/Vapi.Net/Types/CreateElevenLabsCredentialDto.cs +++ b/src/Vapi.Net/Types/CreateElevenLabsCredentialDto.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Credentials for authenticating speech recognition and voice synthesis requests with ElevenLabs. +/// [Serializable] public record CreateElevenLabsCredentialDto : IJsonOnDeserialized { @@ -17,6 +20,12 @@ public record CreateElevenLabsCredentialDto : IJsonOnDeserialized [JsonPropertyName("apiKey")] public required string ApiKey { get; set; } + /// + /// ElevenLabs-only API environment for this key: the global endpoint or the EU data residency endpoint. In EU deployments, new credentials must explicitly use the EU data residency endpoint; existing credentials may omit this field on update to retain their saved endpoint. Outside EU deployments, Vapi detects an omitted endpoint automatically and null on update clears and re-detects the endpoint. + /// + [JsonPropertyName("apiUrl")] + public CreateElevenLabsCredentialDtoApiUrl? ApiUrl { get; set; } + /// /// This is the name of credential. This is just for your reference. /// diff --git a/src/Vapi.Net/Types/CreateElevenLabsCredentialDtoApiUrl.cs b/src/Vapi.Net/Types/CreateElevenLabsCredentialDtoApiUrl.cs new file mode 100644 index 00000000..f3a8b554 --- /dev/null +++ b/src/Vapi.Net/Types/CreateElevenLabsCredentialDtoApiUrl.cs @@ -0,0 +1,90 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(CreateElevenLabsCredentialDtoApiUrlSerializer))] +public enum CreateElevenLabsCredentialDtoApiUrl +{ + [EnumMember(Value = "https://api.elevenlabs.io")] + HttpsApiElevenlabsIo, + + [EnumMember(Value = "https://api.eu.residency.elevenlabs.io")] + HttpsApiEuResidencyElevenlabsIo, +} + +internal class CreateElevenLabsCredentialDtoApiUrlSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + CreateElevenLabsCredentialDtoApiUrl + > _stringToEnum = new() + { + { "https://api.elevenlabs.io", CreateElevenLabsCredentialDtoApiUrl.HttpsApiElevenlabsIo }, + { + "https://api.eu.residency.elevenlabs.io", + CreateElevenLabsCredentialDtoApiUrl.HttpsApiEuResidencyElevenlabsIo + }, + }; + + private static readonly global::System.Collections.Generic.Dictionary< + CreateElevenLabsCredentialDtoApiUrl, + string + > _enumToString = new() + { + { CreateElevenLabsCredentialDtoApiUrl.HttpsApiElevenlabsIo, "https://api.elevenlabs.io" }, + { + CreateElevenLabsCredentialDtoApiUrl.HttpsApiEuResidencyElevenlabsIo, + "https://api.eu.residency.elevenlabs.io" + }, + }; + + public override CreateElevenLabsCredentialDtoApiUrl Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + CreateElevenLabsCredentialDtoApiUrl value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override CreateElevenLabsCredentialDtoApiUrl ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + CreateElevenLabsCredentialDtoApiUrl value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/CreateEmailCredentialDto.cs b/src/Vapi.Net/Types/CreateEmailCredentialDto.cs index 9f26c552..d90fd7e0 100644 --- a/src/Vapi.Net/Types/CreateEmailCredentialDto.cs +++ b/src/Vapi.Net/Types/CreateEmailCredentialDto.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Destination configuration for sending Vapi alerts to an email address. +/// [Serializable] public record CreateEmailCredentialDto : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/CreateEndCallToolDto.cs b/src/Vapi.Net/Types/CreateEndCallToolDto.cs index 67675c11..e3e61f31 100644 --- a/src/Vapi.Net/Types/CreateEndCallToolDto.cs +++ b/src/Vapi.Net/Types/CreateEndCallToolDto.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Configuration used to create a tool that lets an assistant end the active call. +/// [Serializable] public record CreateEndCallToolDto : IJsonOnDeserialized { @@ -12,9 +15,7 @@ public record CreateEndCallToolDto : IJsonOnDeserialized new Dictionary(); /// - /// 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. + /// Messages spoken while the tool is running. Multiple request-start messages are variants. For request-response-delayed, same timing means variants and different timings mean staged updates. /// [JsonPropertyName("messages")] public IEnumerable? Messages { get; set; } diff --git a/src/Vapi.Net/Types/CreateEvalDto.cs b/src/Vapi.Net/Types/CreateEvalDto.cs index 1d283d69..35f3b357 100644 --- a/src/Vapi.Net/Types/CreateEvalDto.cs +++ b/src/Vapi.Net/Types/CreateEvalDto.cs @@ -5,6 +5,9 @@ namespace Vapi.Net; +/// +/// Configuration used to create a reusable eval containing a mock conversation and checkpoints for assessing assistant responses and tool calls. +/// [Serializable] public record CreateEvalDto : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/CreateFunctionToolDto.cs b/src/Vapi.Net/Types/CreateFunctionToolDto.cs index c1df7b24..80c2c52d 100644 --- a/src/Vapi.Net/Types/CreateFunctionToolDto.cs +++ b/src/Vapi.Net/Types/CreateFunctionToolDto.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Configuration used to create a custom function tool that sends model-generated arguments to a server and returns the result to the assistant. +/// [Serializable] public record CreateFunctionToolDto : IJsonOnDeserialized { @@ -12,9 +15,7 @@ public record CreateFunctionToolDto : IJsonOnDeserialized new Dictionary(); /// - /// 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. + /// Messages spoken while the tool is running. Multiple request-start messages are variants. For request-response-delayed, same timing means variants and different timings mean staged updates. /// [JsonPropertyName("messages")] public IEnumerable? Messages { get; set; } diff --git a/src/Vapi.Net/Types/CreateGcpCredentialDto.cs b/src/Vapi.Net/Types/CreateGcpCredentialDto.cs index c1380afc..82ed3858 100644 --- a/src/Vapi.Net/Types/CreateGcpCredentialDto.cs +++ b/src/Vapi.Net/Types/CreateGcpCredentialDto.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Service-account credentials for Google Cloud resources and optional call-artifact storage, including region, bucket configuration, and upload fallback order. +/// [Serializable] public record CreateGcpCredentialDto : IJsonOnDeserialized { @@ -31,6 +34,9 @@ public record CreateGcpCredentialDto : IJsonOnDeserialized [JsonPropertyName("region")] public string? Region { get; set; } + /// + /// Bucket configuration used to store call artifacts in Google Cloud Storage. + /// [JsonPropertyName("bucketPlan")] public BucketPlan? BucketPlan { get; set; } diff --git a/src/Vapi.Net/Types/CreateGhlToolDto.cs b/src/Vapi.Net/Types/CreateGhlToolDto.cs index 8828beff..3dc93b6d 100644 --- a/src/Vapi.Net/Types/CreateGhlToolDto.cs +++ b/src/Vapi.Net/Types/CreateGhlToolDto.cs @@ -12,9 +12,7 @@ public record CreateGhlToolDto : IJsonOnDeserialized new Dictionary(); /// - /// 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. + /// Messages spoken while the tool is running. Multiple request-start messages are variants. For request-response-delayed, same timing means variants and different timings mean staged updates. /// [JsonPropertyName("messages")] public IEnumerable? Messages { get; set; } diff --git a/src/Vapi.Net/Types/CreateGladiaCredentialDto.cs b/src/Vapi.Net/Types/CreateGladiaCredentialDto.cs index 569f6931..aa72c7e2 100644 --- a/src/Vapi.Net/Types/CreateGladiaCredentialDto.cs +++ b/src/Vapi.Net/Types/CreateGladiaCredentialDto.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Credentials for authenticating transcription requests with Gladia. +/// [Serializable] public record CreateGladiaCredentialDto : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/CreateGoHighLevelCalendarAvailabilityToolDto.cs b/src/Vapi.Net/Types/CreateGoHighLevelCalendarAvailabilityToolDto.cs index dd14540c..1c5dd8e7 100644 --- a/src/Vapi.Net/Types/CreateGoHighLevelCalendarAvailabilityToolDto.cs +++ b/src/Vapi.Net/Types/CreateGoHighLevelCalendarAvailabilityToolDto.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Configuration used to create a tool that checks calendar availability in a connected GoHighLevel account. +/// [Serializable] public record CreateGoHighLevelCalendarAvailabilityToolDto : IJsonOnDeserialized { @@ -12,9 +15,7 @@ public record CreateGoHighLevelCalendarAvailabilityToolDto : IJsonOnDeserialized new Dictionary(); /// - /// 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. + /// Messages spoken while the tool is running. Multiple request-start messages are variants. For request-response-delayed, same timing means variants and different timings mean staged updates. /// [JsonPropertyName("messages")] public IEnumerable? Messages { get; set; } diff --git a/src/Vapi.Net/Types/CreateGoHighLevelCalendarEventCreateToolDto.cs b/src/Vapi.Net/Types/CreateGoHighLevelCalendarEventCreateToolDto.cs index 14e325b8..4d270581 100644 --- a/src/Vapi.Net/Types/CreateGoHighLevelCalendarEventCreateToolDto.cs +++ b/src/Vapi.Net/Types/CreateGoHighLevelCalendarEventCreateToolDto.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Configuration used to create a tool that adds calendar events to a connected GoHighLevel account. +/// [Serializable] public record CreateGoHighLevelCalendarEventCreateToolDto : IJsonOnDeserialized { @@ -12,9 +15,7 @@ public record CreateGoHighLevelCalendarEventCreateToolDto : IJsonOnDeserialized new Dictionary(); /// - /// 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. + /// Messages spoken while the tool is running. Multiple request-start messages are variants. For request-response-delayed, same timing means variants and different timings mean staged updates. /// [JsonPropertyName("messages")] public IEnumerable? Messages { get; set; } diff --git a/src/Vapi.Net/Types/CreateGoHighLevelContactCreateToolDto.cs b/src/Vapi.Net/Types/CreateGoHighLevelContactCreateToolDto.cs index 60afcaa8..87789190 100644 --- a/src/Vapi.Net/Types/CreateGoHighLevelContactCreateToolDto.cs +++ b/src/Vapi.Net/Types/CreateGoHighLevelContactCreateToolDto.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Configuration used to create a tool that adds contacts to a connected GoHighLevel account. +/// [Serializable] public record CreateGoHighLevelContactCreateToolDto : IJsonOnDeserialized { @@ -12,9 +15,7 @@ public record CreateGoHighLevelContactCreateToolDto : IJsonOnDeserialized new Dictionary(); /// - /// 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. + /// Messages spoken while the tool is running. Multiple request-start messages are variants. For request-response-delayed, same timing means variants and different timings mean staged updates. /// [JsonPropertyName("messages")] public IEnumerable? Messages { get; set; } diff --git a/src/Vapi.Net/Types/CreateGoHighLevelContactGetToolDto.cs b/src/Vapi.Net/Types/CreateGoHighLevelContactGetToolDto.cs index e849c0b3..0ad16bc4 100644 --- a/src/Vapi.Net/Types/CreateGoHighLevelContactGetToolDto.cs +++ b/src/Vapi.Net/Types/CreateGoHighLevelContactGetToolDto.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Configuration used to create a tool that retrieves contacts from a connected GoHighLevel account. +/// [Serializable] public record CreateGoHighLevelContactGetToolDto : IJsonOnDeserialized { @@ -12,9 +15,7 @@ public record CreateGoHighLevelContactGetToolDto : IJsonOnDeserialized new Dictionary(); /// - /// 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. + /// Messages spoken while the tool is running. Multiple request-start messages are variants. For request-response-delayed, same timing means variants and different timings mean staged updates. /// [JsonPropertyName("messages")] public IEnumerable? Messages { get; set; } diff --git a/src/Vapi.Net/Types/CreateGoHighLevelCredentialDto.cs b/src/Vapi.Net/Types/CreateGoHighLevelCredentialDto.cs index b91bb894..4ae9bc59 100644 --- a/src/Vapi.Net/Types/CreateGoHighLevelCredentialDto.cs +++ b/src/Vapi.Net/Types/CreateGoHighLevelCredentialDto.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Credentials for authenticating Vapi integrations with GoHighLevel. +/// [Serializable] public record CreateGoHighLevelCredentialDto : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/CreateGoHighLevelMcpCredentialDto.cs b/src/Vapi.Net/Types/CreateGoHighLevelMcpCredentialDto.cs index b73a9a9c..9a949778 100644 --- a/src/Vapi.Net/Types/CreateGoHighLevelMcpCredentialDto.cs +++ b/src/Vapi.Net/Types/CreateGoHighLevelMcpCredentialDto.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// OAuth 2.0 session credentials for authenticating GoHighLevel MCP requests. +/// [Serializable] public record CreateGoHighLevelMcpCredentialDto : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/CreateGoogleCalendarCheckAvailabilityToolDto.cs b/src/Vapi.Net/Types/CreateGoogleCalendarCheckAvailabilityToolDto.cs index ccbd288b..3345cb09 100644 --- a/src/Vapi.Net/Types/CreateGoogleCalendarCheckAvailabilityToolDto.cs +++ b/src/Vapi.Net/Types/CreateGoogleCalendarCheckAvailabilityToolDto.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Configuration used to create a tool that checks availability in a connected Google Calendar. +/// [Serializable] public record CreateGoogleCalendarCheckAvailabilityToolDto : IJsonOnDeserialized { @@ -12,9 +15,7 @@ public record CreateGoogleCalendarCheckAvailabilityToolDto : IJsonOnDeserialized new Dictionary(); /// - /// 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. + /// Messages spoken while the tool is running. Multiple request-start messages are variants. For request-response-delayed, same timing means variants and different timings mean staged updates. /// [JsonPropertyName("messages")] public IEnumerable? Messages { get; set; } diff --git a/src/Vapi.Net/Types/CreateGoogleCalendarCreateEventToolDto.cs b/src/Vapi.Net/Types/CreateGoogleCalendarCreateEventToolDto.cs index 925543fd..613f8361 100644 --- a/src/Vapi.Net/Types/CreateGoogleCalendarCreateEventToolDto.cs +++ b/src/Vapi.Net/Types/CreateGoogleCalendarCreateEventToolDto.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Configuration used to create a tool that adds events to a connected Google Calendar. +/// [Serializable] public record CreateGoogleCalendarCreateEventToolDto : IJsonOnDeserialized { @@ -12,9 +15,7 @@ public record CreateGoogleCalendarCreateEventToolDto : IJsonOnDeserialized new Dictionary(); /// - /// 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. + /// Messages spoken while the tool is running. Multiple request-start messages are variants. For request-response-delayed, same timing means variants and different timings mean staged updates. /// [JsonPropertyName("messages")] public IEnumerable? Messages { get; set; } diff --git a/src/Vapi.Net/Types/CreateGoogleCalendarOAuth2AuthorizationCredentialDto.cs b/src/Vapi.Net/Types/CreateGoogleCalendarOAuth2AuthorizationCredentialDto.cs index 6d65d6cb..43f39c9e 100644 --- a/src/Vapi.Net/Types/CreateGoogleCalendarOAuth2AuthorizationCredentialDto.cs +++ b/src/Vapi.Net/Types/CreateGoogleCalendarOAuth2AuthorizationCredentialDto.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Stored OAuth 2.0 authorization for Google Calendar operations. +/// [Serializable] public record CreateGoogleCalendarOAuth2AuthorizationCredentialDto : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/CreateGoogleCalendarOAuth2ClientCredentialDto.cs b/src/Vapi.Net/Types/CreateGoogleCalendarOAuth2ClientCredentialDto.cs index f517b9a4..977689af 100644 --- a/src/Vapi.Net/Types/CreateGoogleCalendarOAuth2ClientCredentialDto.cs +++ b/src/Vapi.Net/Types/CreateGoogleCalendarOAuth2ClientCredentialDto.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// OAuth 2.0 client credential for Google Calendar integrations. +/// [Serializable] public record CreateGoogleCalendarOAuth2ClientCredentialDto : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/CreateGoogleCredentialDto.cs b/src/Vapi.Net/Types/CreateGoogleCredentialDto.cs index 46e5e458..d062f18a 100644 --- a/src/Vapi.Net/Types/CreateGoogleCredentialDto.cs +++ b/src/Vapi.Net/Types/CreateGoogleCredentialDto.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Credentials for authenticating assistant model requests with Google AI. +/// [Serializable] public record CreateGoogleCredentialDto : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/CreateGoogleSheetsOAuth2AuthorizationCredentialDto.cs b/src/Vapi.Net/Types/CreateGoogleSheetsOAuth2AuthorizationCredentialDto.cs index 5fc18ef3..b073da66 100644 --- a/src/Vapi.Net/Types/CreateGoogleSheetsOAuth2AuthorizationCredentialDto.cs +++ b/src/Vapi.Net/Types/CreateGoogleSheetsOAuth2AuthorizationCredentialDto.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Stored OAuth 2.0 authorization for Google Sheets operations. +/// [Serializable] public record CreateGoogleSheetsOAuth2AuthorizationCredentialDto : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/CreateGoogleSheetsRowAppendToolDto.cs b/src/Vapi.Net/Types/CreateGoogleSheetsRowAppendToolDto.cs index 90cafbb7..1a319d8a 100644 --- a/src/Vapi.Net/Types/CreateGoogleSheetsRowAppendToolDto.cs +++ b/src/Vapi.Net/Types/CreateGoogleSheetsRowAppendToolDto.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Configuration used to create a tool that appends rows to a connected Google Sheet. +/// [Serializable] public record CreateGoogleSheetsRowAppendToolDto : IJsonOnDeserialized { @@ -12,9 +15,7 @@ public record CreateGoogleSheetsRowAppendToolDto : IJsonOnDeserialized new Dictionary(); /// - /// 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. + /// Messages spoken while the tool is running. Multiple request-start messages are variants. For request-response-delayed, same timing means variants and different timings mean staged updates. /// [JsonPropertyName("messages")] public IEnumerable? Messages { get; set; } diff --git a/src/Vapi.Net/Types/CreateGroqCredentialDto.cs b/src/Vapi.Net/Types/CreateGroqCredentialDto.cs index 877dc5a6..4ef2c909 100644 --- a/src/Vapi.Net/Types/CreateGroqCredentialDto.cs +++ b/src/Vapi.Net/Types/CreateGroqCredentialDto.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Credentials for authenticating assistant model requests with Groq. +/// [Serializable] public record CreateGroqCredentialDto : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/CreateHandoffToolDto.cs b/src/Vapi.Net/Types/CreateHandoffToolDto.cs index 987606c3..733d39fb 100644 --- a/src/Vapi.Net/Types/CreateHandoffToolDto.cs +++ b/src/Vapi.Net/Types/CreateHandoffToolDto.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Configuration used to create a tool that hands a conversation to another assistant, squad, or dynamically selected destination. +/// [Serializable] public record CreateHandoffToolDto : IJsonOnDeserialized { @@ -12,9 +15,7 @@ public record CreateHandoffToolDto : IJsonOnDeserialized new Dictionary(); /// - /// 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. + /// Messages spoken while the tool is running. Multiple request-start messages are variants. For request-response-delayed, same timing means variants and different timings mean staged updates. /// [JsonPropertyName("messages")] public IEnumerable? Messages { get; set; } diff --git a/src/Vapi.Net/Types/CreateHumeCredentialDto.cs b/src/Vapi.Net/Types/CreateHumeCredentialDto.cs index e49a0ff9..089dafb1 100644 --- a/src/Vapi.Net/Types/CreateHumeCredentialDto.cs +++ b/src/Vapi.Net/Types/CreateHumeCredentialDto.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Credentials for authenticating voice synthesis requests with Hume. +/// [Serializable] public record CreateHumeCredentialDto : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/CreateInflectionAiCredentialDto.cs b/src/Vapi.Net/Types/CreateInflectionAiCredentialDto.cs index 0b52915a..195303b0 100644 --- a/src/Vapi.Net/Types/CreateInflectionAiCredentialDto.cs +++ b/src/Vapi.Net/Types/CreateInflectionAiCredentialDto.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Credentials for authenticating assistant model requests with Inflection AI. +/// [Serializable] public record CreateInflectionAiCredentialDto : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/CreateInworldCredentialDto.cs b/src/Vapi.Net/Types/CreateInworldCredentialDto.cs index 0279efc8..7d7f0286 100644 --- a/src/Vapi.Net/Types/CreateInworldCredentialDto.cs +++ b/src/Vapi.Net/Types/CreateInworldCredentialDto.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Credentials for authenticating voice synthesis requests with Inworld. +/// [Serializable] public record CreateInworldCredentialDto : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/CreateLangfuseCredentialDto.cs b/src/Vapi.Net/Types/CreateLangfuseCredentialDto.cs index 0465dc6f..d5554af9 100644 --- a/src/Vapi.Net/Types/CreateLangfuseCredentialDto.cs +++ b/src/Vapi.Net/Types/CreateLangfuseCredentialDto.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Credentials for sending assistant call traces to a Langfuse project, including its public key, secret key, and host URL. +/// [Serializable] public record CreateLangfuseCredentialDto : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/CreateLineInsightFromCallTableDto.cs b/src/Vapi.Net/Types/CreateLineInsightFromCallTableDto.cs index 4113aa68..053a119b 100644 --- a/src/Vapi.Net/Types/CreateLineInsightFromCallTableDto.cs +++ b/src/Vapi.Net/Types/CreateLineInsightFromCallTableDto.cs @@ -5,6 +5,9 @@ namespace Vapi.Net; +/// +/// Configuration used to create a line-chart insight from call data using metric queries, formulas, grouping, and a stepped time range. +/// [Serializable] public record CreateLineInsightFromCallTableDto : IJsonOnDeserialized { @@ -44,6 +47,9 @@ public record CreateLineInsightFromCallTableDto : IJsonOnDeserialized [JsonPropertyName("metadata")] public LineInsightMetadata? Metadata { get; set; } + /// + /// The time range and interval used to aggregate the line-chart data. + /// [JsonPropertyName("timeRange")] public InsightTimeRangeWithStep? TimeRange { get; set; } diff --git a/src/Vapi.Net/Types/CreateLmntCredentialDto.cs b/src/Vapi.Net/Types/CreateLmntCredentialDto.cs index 802b50f4..21260b7c 100644 --- a/src/Vapi.Net/Types/CreateLmntCredentialDto.cs +++ b/src/Vapi.Net/Types/CreateLmntCredentialDto.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Credentials for authenticating voice synthesis requests with LMNT. +/// [Serializable] public record CreateLmntCredentialDto : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/CreateMakeCredentialDto.cs b/src/Vapi.Net/Types/CreateMakeCredentialDto.cs index 3cd5669b..3eafd24d 100644 --- a/src/Vapi.Net/Types/CreateMakeCredentialDto.cs +++ b/src/Vapi.Net/Types/CreateMakeCredentialDto.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Credentials for authenticating Vapi integrations with Make, including team, region, and API key. +/// [Serializable] public record CreateMakeCredentialDto : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/CreateMakeToolDto.cs b/src/Vapi.Net/Types/CreateMakeToolDto.cs index 456f4e6f..6ae05915 100644 --- a/src/Vapi.Net/Types/CreateMakeToolDto.cs +++ b/src/Vapi.Net/Types/CreateMakeToolDto.cs @@ -12,9 +12,7 @@ public record CreateMakeToolDto : IJsonOnDeserialized new Dictionary(); /// - /// 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. + /// Messages spoken while the tool is running. Multiple request-start messages are variants. For request-response-delayed, same timing means variants and different timings mean staged updates. /// [JsonPropertyName("messages")] public IEnumerable? Messages { get; set; } diff --git a/src/Vapi.Net/Types/CreateMcpToolDto.cs b/src/Vapi.Net/Types/CreateMcpToolDto.cs index ab97d447..f73c63db 100644 --- a/src/Vapi.Net/Types/CreateMcpToolDto.cs +++ b/src/Vapi.Net/Types/CreateMcpToolDto.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Configuration used to create a tool that connects an assistant to a Model Context Protocol server and exposes its available tools. +/// [Serializable] public record CreateMcpToolDto : IJsonOnDeserialized { @@ -12,9 +15,7 @@ public record CreateMcpToolDto : IJsonOnDeserialized new Dictionary(); /// - /// 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. + /// Messages spoken while the tool is running. Multiple request-start messages are variants. For request-response-delayed, same timing means variants and different timings mean staged updates. /// [JsonPropertyName("messages")] public IEnumerable? Messages { get; set; } @@ -38,6 +39,9 @@ public record CreateMcpToolDto : IJsonOnDeserialized [JsonPropertyName("toolMessages")] public IEnumerable? ToolMessages { get; set; } + /// + /// Connection metadata for the MCP server, including its communication protocol. + /// [JsonPropertyName("metadata")] public McpToolMetadata? Metadata { get; set; } diff --git a/src/Vapi.Net/Types/UpdateTrieveCredentialDto.cs b/src/Vapi.Net/Types/CreateMicrosoftCredentialDto.cs similarity index 72% rename from src/Vapi.Net/Types/UpdateTrieveCredentialDto.cs rename to src/Vapi.Net/Types/CreateMicrosoftCredentialDto.cs index 2ff05bcc..e401616a 100644 --- a/src/Vapi.Net/Types/UpdateTrieveCredentialDto.cs +++ b/src/Vapi.Net/Types/CreateMicrosoftCredentialDto.cs @@ -5,7 +5,7 @@ namespace Vapi.Net; [Serializable] -public record UpdateTrieveCredentialDto : IJsonOnDeserialized +public record CreateMicrosoftCredentialDto : IJsonOnDeserialized { [JsonExtensionData] private readonly IDictionary _extensionData = @@ -15,7 +15,13 @@ public record UpdateTrieveCredentialDto : IJsonOnDeserialized /// This is not returned in the API. /// [JsonPropertyName("apiKey")] - public string? ApiKey { get; set; } + public required string ApiKey { get; set; } + + /// + /// Azure region for the Speech resource. Defaults to `eastus` when omitted. MAI-Voice-2 is preview and region-limited. + /// + [JsonPropertyName("region")] + public string? Region { get; set; } /// /// This is the name of credential. This is just for your reference. diff --git a/src/Vapi.Net/Types/CreateMinimaxCredentialDto.cs b/src/Vapi.Net/Types/CreateMinimaxCredentialDto.cs index e4c9f3f1..93e315e8 100644 --- a/src/Vapi.Net/Types/CreateMinimaxCredentialDto.cs +++ b/src/Vapi.Net/Types/CreateMinimaxCredentialDto.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Credentials for authenticating assistant model and voice synthesis requests with MiniMax, including the MiniMax group identifier. +/// [Serializable] public record CreateMinimaxCredentialDto : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/CreateMistralCredentialDto.cs b/src/Vapi.Net/Types/CreateMistralCredentialDto.cs index cbcf0e14..dfdc4730 100644 --- a/src/Vapi.Net/Types/CreateMistralCredentialDto.cs +++ b/src/Vapi.Net/Types/CreateMistralCredentialDto.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Credentials for authenticating assistant model requests with Mistral. +/// [Serializable] public record CreateMistralCredentialDto : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/CreateNeuphonicCredentialDto.cs b/src/Vapi.Net/Types/CreateNeuphonicCredentialDto.cs index 80aa702c..6860c49f 100644 --- a/src/Vapi.Net/Types/CreateNeuphonicCredentialDto.cs +++ b/src/Vapi.Net/Types/CreateNeuphonicCredentialDto.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Credentials for authenticating voice synthesis requests with Neuphonic. +/// [Serializable] public record CreateNeuphonicCredentialDto : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/CreateOpenAiCredentialDto.cs b/src/Vapi.Net/Types/CreateOpenAiCredentialDto.cs index 258a68d6..7f3ecc15 100644 --- a/src/Vapi.Net/Types/CreateOpenAiCredentialDto.cs +++ b/src/Vapi.Net/Types/CreateOpenAiCredentialDto.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Credentials for authenticating assistant model, transcription, and voice synthesis requests with OpenAI. +/// [Serializable] public record CreateOpenAiCredentialDto : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/CreateOpenRouterCredentialDto.cs b/src/Vapi.Net/Types/CreateOpenRouterCredentialDto.cs index 7007bf79..b4865fb9 100644 --- a/src/Vapi.Net/Types/CreateOpenRouterCredentialDto.cs +++ b/src/Vapi.Net/Types/CreateOpenRouterCredentialDto.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Credentials for authenticating assistant model requests with OpenRouter. +/// [Serializable] public record CreateOpenRouterCredentialDto : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/CreateOutboundCallDto.cs b/src/Vapi.Net/Types/CreateOutboundCallDto.cs index 043f07c4..0e313601 100644 --- a/src/Vapi.Net/Types/CreateOutboundCallDto.cs +++ b/src/Vapi.Net/Types/CreateOutboundCallDto.cs @@ -11,6 +11,19 @@ public record CreateOutboundCallDto : IJsonOnDeserialized private readonly IDictionary _extensionData = new Dictionary(); + /// + /// This is the assistant version to use for this call. Supported only with + /// direct `assistantId`. Omit to follow the latest version. + /// + [JsonPropertyName("assistantVersion")] + public string? AssistantVersion { get; set; } + + /// + /// This is the transport of the call. + /// + [JsonPropertyName("transport")] + public object? Transport { get; set; } + /// /// This is used to issue batch calls to multiple customers. /// @@ -31,12 +44,6 @@ public record CreateOutboundCallDto : IJsonOnDeserialized [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 ID that will be used for the call. To use a transient assistant, use `assistant` instead. /// diff --git a/src/Vapi.Net/Types/CreateOutputToolDto.cs b/src/Vapi.Net/Types/CreateOutputToolDto.cs index ee932027..2df1e657 100644 --- a/src/Vapi.Net/Types/CreateOutputToolDto.cs +++ b/src/Vapi.Net/Types/CreateOutputToolDto.cs @@ -12,9 +12,7 @@ public record CreateOutputToolDto : IJsonOnDeserialized new Dictionary(); /// - /// 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. + /// Messages spoken while the tool is running. Multiple request-start messages are variants. For request-response-delayed, same timing means variants and different timings mean staged updates. /// [JsonPropertyName("messages")] public IEnumerable? Messages { get; set; } diff --git a/src/Vapi.Net/Types/CreatePerplexityAiCredentialDto.cs b/src/Vapi.Net/Types/CreatePerplexityAiCredentialDto.cs index 2b4d1aa0..a98700ac 100644 --- a/src/Vapi.Net/Types/CreatePerplexityAiCredentialDto.cs +++ b/src/Vapi.Net/Types/CreatePerplexityAiCredentialDto.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Credentials for authenticating assistant model requests with Perplexity AI. +/// [Serializable] public record CreatePerplexityAiCredentialDto : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/CreatePieInsightFromCallTableDto.cs b/src/Vapi.Net/Types/CreatePieInsightFromCallTableDto.cs index a5156076..04f81039 100644 --- a/src/Vapi.Net/Types/CreatePieInsightFromCallTableDto.cs +++ b/src/Vapi.Net/Types/CreatePieInsightFromCallTableDto.cs @@ -5,6 +5,9 @@ namespace Vapi.Net; +/// +/// Configuration used to create a pie-chart insight from call data using metric queries, formulas, grouping, and a time range. +/// [Serializable] public record CreatePieInsightFromCallTableDto : IJsonOnDeserialized { @@ -38,6 +41,9 @@ public record CreatePieInsightFromCallTableDto : IJsonOnDeserialized [JsonPropertyName("formulas")] public IEnumerable? Formulas { get; set; } + /// + /// The time range used to query the pie-chart data. + /// [JsonPropertyName("timeRange")] public InsightTimeRange? TimeRange { get; set; } diff --git a/src/Vapi.Net/Types/CreatePlayHtCredentialDto.cs b/src/Vapi.Net/Types/CreatePlayHtCredentialDto.cs index caf3bab0..9da34410 100644 --- a/src/Vapi.Net/Types/CreatePlayHtCredentialDto.cs +++ b/src/Vapi.Net/Types/CreatePlayHtCredentialDto.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Credentials for authenticating voice synthesis requests with PlayHT, including the PlayHT user identifier. +/// [Serializable] public record CreatePlayHtCredentialDto : IJsonOnDeserialized { @@ -17,6 +20,9 @@ public record CreatePlayHtCredentialDto : IJsonOnDeserialized [JsonPropertyName("apiKey")] public required string ApiKey { get; set; } + /// + /// PlayHT user identifier associated with the API key. + /// [JsonPropertyName("userId")] public required string UserId { get; set; } diff --git a/src/Vapi.Net/Types/CreateQueryToolDto.cs b/src/Vapi.Net/Types/CreateQueryToolDto.cs index 15b3c74d..ffe88a6f 100644 --- a/src/Vapi.Net/Types/CreateQueryToolDto.cs +++ b/src/Vapi.Net/Types/CreateQueryToolDto.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Configuration used to create a tool that searches configured knowledge bases and returns relevant content to the assistant. +/// [Serializable] public record CreateQueryToolDto : IJsonOnDeserialized { @@ -12,9 +15,7 @@ public record CreateQueryToolDto : IJsonOnDeserialized new Dictionary(); /// - /// 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. + /// Messages spoken while the tool is running. Multiple request-start messages are variants. For request-response-delayed, same timing means variants and different timings mean staged updates. /// [JsonPropertyName("messages")] public IEnumerable? Messages { get; set; } diff --git a/src/Vapi.Net/Types/CreateRimeAiCredentialDto.cs b/src/Vapi.Net/Types/CreateRimeAiCredentialDto.cs index 2039b248..61c56e79 100644 --- a/src/Vapi.Net/Types/CreateRimeAiCredentialDto.cs +++ b/src/Vapi.Net/Types/CreateRimeAiCredentialDto.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Credentials for authenticating voice synthesis requests with Rime AI. +/// [Serializable] public record CreateRimeAiCredentialDto : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/CreateRunpodCredentialDto.cs b/src/Vapi.Net/Types/CreateRunpodCredentialDto.cs index 1bd67ed3..e0b57465 100644 --- a/src/Vapi.Net/Types/CreateRunpodCredentialDto.cs +++ b/src/Vapi.Net/Types/CreateRunpodCredentialDto.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Credentials for authenticating assistant model requests through Runpod. +/// [Serializable] public record CreateRunpodCredentialDto : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/CreateS3CompatibleCredentialDto.cs b/src/Vapi.Net/Types/CreateS3CompatibleCredentialDto.cs new file mode 100644 index 00000000..4b5feaec --- /dev/null +++ b/src/Vapi.Net/Types/CreateS3CompatibleCredentialDto.cs @@ -0,0 +1,40 @@ +using global::System.Text.Json; +using global::System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[Serializable] +public record CreateS3CompatibleCredentialDto : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("bucketPlan")] + public required S3CompatibleBucketPlan BucketPlan { get; set; } + + /// + /// This is the order in which this storage provider is tried during upload retries. Lower numbers are tried first in increasing order. + /// + [JsonPropertyName("fallbackIndex")] + public double? FallbackIndex { get; set; } + + /// + /// This is the name of credential. This is just for your reference. + /// + [JsonPropertyName("name")] + public string? Name { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + 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 169861ee..8240752b 100644 --- a/src/Vapi.Net/Types/CreateS3CredentialDto.cs +++ b/src/Vapi.Net/Types/CreateS3CredentialDto.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Credentials for storing call artifacts in Amazon S3, including access keys, region, bucket, path prefix, and upload fallback order. +/// [Serializable] public record CreateS3CredentialDto : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/CreateScorecardDto.cs b/src/Vapi.Net/Types/CreateScorecardDto.cs index d95fd591..fab40788 100644 --- a/src/Vapi.Net/Types/CreateScorecardDto.cs +++ b/src/Vapi.Net/Types/CreateScorecardDto.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Configuration used to create a scorecard containing evaluation metrics, scoring conditions, and optional assistant associations. +/// [Serializable] public record CreateScorecardDto : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/CreateSesameVoiceDto.cs b/src/Vapi.Net/Types/CreateSesameVoiceDto.cs index 203c0b3e..b8c93994 100644 --- a/src/Vapi.Net/Types/CreateSesameVoiceDto.cs +++ b/src/Vapi.Net/Types/CreateSesameVoiceDto.cs @@ -11,17 +11,26 @@ public record CreateSesameVoiceDto : IJsonOnDeserialized private readonly IDictionary _extensionData = new Dictionary(); + /// + /// This is the audio file of the utterance to clone the voice from. + /// Consumed by multer via FileInterceptor('file'), so it never reaches + /// class-validator; declared here (like CreateFileDTO.file) so the OpenAPI + /// spec is truthful about the multipart request body. + /// + [JsonPropertyName("file")] + public required string File { get; set; } + /// /// The name of the voice. /// [JsonPropertyName("voiceName")] - public string? VoiceName { get; set; } + public required string VoiceName { get; set; } /// /// The transcript of the utterance. /// [JsonPropertyName("transcription")] - public string? Transcription { get; set; } + public required string Transcription { get; set; } [JsonIgnore] public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); diff --git a/src/Vapi.Net/Types/CreateSimulationRunResponse.cs b/src/Vapi.Net/Types/CreateSimulationRunResponse.cs new file mode 100644 index 00000000..0f87ba90 --- /dev/null +++ b/src/Vapi.Net/Types/CreateSimulationRunResponse.cs @@ -0,0 +1,127 @@ +using global::System.Text.Json; +using global::System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[Serializable] +public record CreateSimulationRunResponse : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + /// + /// Unique identifier for the run + /// + [JsonPropertyName("id")] + public required string Id { get; set; } + + /// + /// Organization ID + /// + [JsonPropertyName("orgId")] + public required string OrgId { get; set; } + + /// + /// Current status of the run + /// + [JsonPropertyName("status")] + public required CreateSimulationRunResponseStatus Status { get; set; } + + /// + /// When the run was queued + /// + [JsonPropertyName("queuedAt")] + public required DateTime QueuedAt { get; set; } + + /// + /// When the run started + /// + [JsonPropertyName("startedAt")] + public DateTime? StartedAt { get; set; } + + /// + /// When the run ended + /// + [JsonPropertyName("endedAt")] + public DateTime? EndedAt { get; set; } + + /// + /// Reason the run ended + /// + [JsonPropertyName("endedReason")] + public string? EndedReason { get; set; } + + /// + /// ISO 8601 date-time when created + /// + [JsonPropertyName("createdAt")] + public required DateTime CreatedAt { get; set; } + + /// + /// ISO 8601 date-time when last updated + /// + [JsonPropertyName("updatedAt")] + public required DateTime UpdatedAt { get; set; } + + /// + /// Aggregate counts of run items by status + /// + [JsonPropertyName("itemCounts")] + public SimulationRunItemCounts? ItemCounts { get; set; } + + /// + /// Array of simulations and/or suites to run + /// + [JsonPropertyName("simulations")] + public IEnumerable Simulations { get; set; } = new List(); + + /// + /// Target to test against + /// + [JsonPropertyName("target")] + public required object Target { get; set; } + + /// + /// Number of times to run each simulation (default: 1) + /// + [JsonPropertyName("iterations")] + public double? Iterations { get; set; } + + /// + /// Transport configuration for the simulation runs + /// + [JsonPropertyName("transport")] + public SimulationRunTransportConfiguration? Transport { get; set; } + + /// + /// IDs of the individual simulation run items that were queued + /// + [JsonPropertyName("simulationRunItemIds")] + public IEnumerable SimulationRunItemIds { get; set; } = new List(); + + /// + /// Additional information about how the run will execute + /// + [JsonPropertyName("message")] + public string? Message { get; set; } + + /// + /// Dashboard URL for viewing the simulation run. When acting on behalf of a user, present this URL to them. + /// + [JsonPropertyName("url")] + public required string Url { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/CreateSimulationRunResponseStatus.cs b/src/Vapi.Net/Types/CreateSimulationRunResponseStatus.cs new file mode 100644 index 00000000..43f50a65 --- /dev/null +++ b/src/Vapi.Net/Types/CreateSimulationRunResponseStatus.cs @@ -0,0 +1,89 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(CreateSimulationRunResponseStatusSerializer))] +public enum CreateSimulationRunResponseStatus +{ + [EnumMember(Value = "queued")] + Queued, + + [EnumMember(Value = "running")] + Running, + + [EnumMember(Value = "ended")] + Ended, +} + +internal class CreateSimulationRunResponseStatusSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + CreateSimulationRunResponseStatus + > _stringToEnum = new() + { + { "queued", CreateSimulationRunResponseStatus.Queued }, + { "running", CreateSimulationRunResponseStatus.Running }, + { "ended", CreateSimulationRunResponseStatus.Ended }, + }; + + private static readonly global::System.Collections.Generic.Dictionary< + CreateSimulationRunResponseStatus, + string + > _enumToString = new() + { + { CreateSimulationRunResponseStatus.Queued, "queued" }, + { CreateSimulationRunResponseStatus.Running, "running" }, + { CreateSimulationRunResponseStatus.Ended, "ended" }, + }; + + public override CreateSimulationRunResponseStatus Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + CreateSimulationRunResponseStatus value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override CreateSimulationRunResponseStatus ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + CreateSimulationRunResponseStatus value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/CreateSimulationSuiteDto.cs b/src/Vapi.Net/Types/CreateSimulationSuiteDto.cs index b6fbb9bc..37c4f93b 100644 --- a/src/Vapi.Net/Types/CreateSimulationSuiteDto.cs +++ b/src/Vapi.Net/Types/CreateSimulationSuiteDto.cs @@ -29,6 +29,12 @@ public record CreateSimulationSuiteDto : IJsonOnDeserialized [JsonPropertyName("simulationIds")] public IEnumerable SimulationIds { get; set; } = new List(); + /// + /// Optional assistant or squad assignments for the suite. + /// + [JsonPropertyName("targetAssignments")] + public IEnumerable? TargetAssignments { get; set; } + /// /// Optional folder path for organizing simulation suites. /// Supports up to 3 levels (e.g., "dept/feature/variant"). diff --git a/src/Vapi.Net/Types/CreateSipRequestToolDto.cs b/src/Vapi.Net/Types/CreateSipRequestToolDto.cs index 38ac3992..e9aad937 100644 --- a/src/Vapi.Net/Types/CreateSipRequestToolDto.cs +++ b/src/Vapi.Net/Types/CreateSipRequestToolDto.cs @@ -5,6 +5,9 @@ namespace Vapi.Net; +/// +/// Configuration used to create a tool that sends SIP `INFO`, `MESSAGE`, or `NOTIFY` requests with configured headers and body. +/// [Serializable] public record CreateSipRequestToolDto : IJsonOnDeserialized { @@ -13,9 +16,7 @@ public record CreateSipRequestToolDto : IJsonOnDeserialized new Dictionary(); /// - /// 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. + /// Messages spoken while the tool is running. Multiple request-start messages are variants. For request-response-delayed, same timing means variants and different timings mean staged updates. /// [JsonPropertyName("messages")] public IEnumerable? Messages { get; set; } diff --git a/src/Vapi.Net/Types/CreateSlackOAuth2AuthorizationCredentialDto.cs b/src/Vapi.Net/Types/CreateSlackOAuth2AuthorizationCredentialDto.cs index 0553c87f..621373ce 100644 --- a/src/Vapi.Net/Types/CreateSlackOAuth2AuthorizationCredentialDto.cs +++ b/src/Vapi.Net/Types/CreateSlackOAuth2AuthorizationCredentialDto.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Stored OAuth 2.0 authorization for Slack operations. +/// [Serializable] public record CreateSlackOAuth2AuthorizationCredentialDto : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/CreateSlackSendMessageToolDto.cs b/src/Vapi.Net/Types/CreateSlackSendMessageToolDto.cs index d719b76a..2fb7180d 100644 --- a/src/Vapi.Net/Types/CreateSlackSendMessageToolDto.cs +++ b/src/Vapi.Net/Types/CreateSlackSendMessageToolDto.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Configuration used to create a tool that lets an assistant send a message to Slack. +/// [Serializable] public record CreateSlackSendMessageToolDto : IJsonOnDeserialized { @@ -12,9 +15,7 @@ public record CreateSlackSendMessageToolDto : IJsonOnDeserialized new Dictionary(); /// - /// 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. + /// Messages spoken while the tool is running. Multiple request-start messages are variants. For request-response-delayed, same timing means variants and different timings mean staged updates. /// [JsonPropertyName("messages")] public IEnumerable? Messages { get; set; } diff --git a/src/Vapi.Net/Types/CreateSlackWebhookCredentialDto.cs b/src/Vapi.Net/Types/CreateSlackWebhookCredentialDto.cs index f86792d9..75d6cc24 100644 --- a/src/Vapi.Net/Types/CreateSlackWebhookCredentialDto.cs +++ b/src/Vapi.Net/Types/CreateSlackWebhookCredentialDto.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Credentials for sending Vapi alerts through a Slack incoming webhook. +/// [Serializable] public record CreateSlackWebhookCredentialDto : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/CreateSmallestAiCredentialDto.cs b/src/Vapi.Net/Types/CreateSmallestAiCredentialDto.cs index 6bdf5a72..a50505b0 100644 --- a/src/Vapi.Net/Types/CreateSmallestAiCredentialDto.cs +++ b/src/Vapi.Net/Types/CreateSmallestAiCredentialDto.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Credentials for authenticating voice synthesis requests with Smallest AI. +/// [Serializable] public record CreateSmallestAiCredentialDto : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/CreateSmsToolDto.cs b/src/Vapi.Net/Types/CreateSmsToolDto.cs index f0227fa6..f9d2f92d 100644 --- a/src/Vapi.Net/Types/CreateSmsToolDto.cs +++ b/src/Vapi.Net/Types/CreateSmsToolDto.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Configuration used to create a tool that lets an assistant send an SMS message during a call. +/// [Serializable] public record CreateSmsToolDto : IJsonOnDeserialized { @@ -12,9 +15,7 @@ public record CreateSmsToolDto : IJsonOnDeserialized new Dictionary(); /// - /// 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. + /// Messages spoken while the tool is running. Multiple request-start messages are variants. For request-response-delayed, same timing means variants and different timings mean staged updates. /// [JsonPropertyName("messages")] public IEnumerable? Messages { get; set; } diff --git a/src/Vapi.Net/Types/CreateSonioxCredentialDto.cs b/src/Vapi.Net/Types/CreateSonioxCredentialDto.cs index 683e23e6..8047ad48 100644 --- a/src/Vapi.Net/Types/CreateSonioxCredentialDto.cs +++ b/src/Vapi.Net/Types/CreateSonioxCredentialDto.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Credentials for authenticating transcription requests with Soniox. +/// [Serializable] public record CreateSonioxCredentialDto : IJsonOnDeserialized { @@ -17,6 +20,12 @@ public record CreateSonioxCredentialDto : IJsonOnDeserialized [JsonPropertyName("apiKey")] public required string ApiKey { get; set; } + /// + /// Custom Soniox WebSocket endpoint (e.g. EU server wss://stt-rt.eu.soniox.com/transcribe-websocket). Defaults to the region-appropriate endpoint when omitted. + /// + [JsonPropertyName("apiUrl")] + public string? ApiUrl { get; set; } + /// /// This is the name of credential. This is just for your reference. /// diff --git a/src/Vapi.Net/Types/CreateSpeechmaticsCredentialDto.cs b/src/Vapi.Net/Types/CreateSpeechmaticsCredentialDto.cs index dec23d2e..5416225b 100644 --- a/src/Vapi.Net/Types/CreateSpeechmaticsCredentialDto.cs +++ b/src/Vapi.Net/Types/CreateSpeechmaticsCredentialDto.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Credentials for authenticating transcription requests with Speechmatics. +/// [Serializable] public record CreateSpeechmaticsCredentialDto : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/CreateSquadDto.cs b/src/Vapi.Net/Types/CreateSquadDto.cs index 19ee5e56..b496b28e 100644 --- a/src/Vapi.Net/Types/CreateSquadDto.cs +++ b/src/Vapi.Net/Types/CreateSquadDto.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Configuration used to create a squad. Provide an ordered list of assistant members and optional overrides that control how the squad handles a conversation and transfers between assistants. +/// [Serializable] public record CreateSquadDto : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/CreateStructuredOutputDto.cs b/src/Vapi.Net/Types/CreateStructuredOutputDto.cs index 546201b3..73820293 100644 --- a/src/Vapi.Net/Types/CreateStructuredOutputDto.cs +++ b/src/Vapi.Net/Types/CreateStructuredOutputDto.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Configuration used to create a structured-output definition that extracts validated data from calls using an AI model or regular expression. +/// [Serializable] public record CreateStructuredOutputDto : IJsonOnDeserialized { @@ -61,6 +64,12 @@ public record CreateStructuredOutputDto : IJsonOnDeserialized [JsonPropertyName("compliancePlan")] public ComplianceOverride? CompliancePlan { get; set; } + /// + /// These are the conditions that gate the execution of this structured output. Every condition must pass for the structured output to run (AND semantics). When omitted or empty, no user-defined conditions gate this output. Send null to clear a previously saved gate. + /// + [JsonPropertyName("conditions")] + public IEnumerable? Conditions { get; set; } + /// /// This is the name of the structured output. /// diff --git a/src/Vapi.Net/Types/CreateSupabaseCredentialDto.cs b/src/Vapi.Net/Types/CreateSupabaseCredentialDto.cs index 4fd74408..11305631 100644 --- a/src/Vapi.Net/Types/CreateSupabaseCredentialDto.cs +++ b/src/Vapi.Net/Types/CreateSupabaseCredentialDto.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Credentials for storing call artifacts in Supabase's S3-compatible storage, including bucket configuration and upload fallback order. +/// [Serializable] public record CreateSupabaseCredentialDto : IJsonOnDeserialized { @@ -17,6 +20,9 @@ public record CreateSupabaseCredentialDto : IJsonOnDeserialized [JsonPropertyName("fallbackIndex")] public double? FallbackIndex { get; set; } + /// + /// Supabase S3-compatible bucket configuration used to store call artifacts. + /// [JsonPropertyName("bucketPlan")] public SupabaseBucketPlan? BucketPlan { get; set; } diff --git a/src/Vapi.Net/Types/CreateTavusCredentialDto.cs b/src/Vapi.Net/Types/CreateTavusCredentialDto.cs index b61f46f5..9b957ba3 100644 --- a/src/Vapi.Net/Types/CreateTavusCredentialDto.cs +++ b/src/Vapi.Net/Types/CreateTavusCredentialDto.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Credentials for authenticating voice synthesis requests with Tavus. +/// [Serializable] public record CreateTavusCredentialDto : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/CreateTelnyxPhoneNumberDto.cs b/src/Vapi.Net/Types/CreateTelnyxPhoneNumberDto.cs index 075e79e9..bccd825d 100644 --- a/src/Vapi.Net/Types/CreateTelnyxPhoneNumberDto.cs +++ b/src/Vapi.Net/Types/CreateTelnyxPhoneNumberDto.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Configuration used to import a Telnyx phone number into Vapi with a stored credential and routing settings. +/// [Serializable] public record CreateTelnyxPhoneNumberDto : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/CreateTextEditorToolDto.cs b/src/Vapi.Net/Types/CreateTextEditorToolDto.cs index b63882d5..9f666e17 100644 --- a/src/Vapi.Net/Types/CreateTextEditorToolDto.cs +++ b/src/Vapi.Net/Types/CreateTextEditorToolDto.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Configuration used to create a tool that reads and edits text files in a configured environment. +/// [Serializable] public record CreateTextEditorToolDto : IJsonOnDeserialized { @@ -12,9 +15,7 @@ public record CreateTextEditorToolDto : IJsonOnDeserialized new Dictionary(); /// - /// 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. + /// Messages spoken while the tool is running. Multiple request-start messages are variants. For request-response-delayed, same timing means variants and different timings mean staged updates. /// [JsonPropertyName("messages")] public IEnumerable? Messages { get; set; } diff --git a/src/Vapi.Net/Types/CreateTextInsightFromCallTableDto.cs b/src/Vapi.Net/Types/CreateTextInsightFromCallTableDto.cs index b417ad41..aa70e346 100644 --- a/src/Vapi.Net/Types/CreateTextInsightFromCallTableDto.cs +++ b/src/Vapi.Net/Types/CreateTextInsightFromCallTableDto.cs @@ -5,6 +5,9 @@ namespace Vapi.Net; +/// +/// Configuration used to create a text-value insight from call data using metric queries, a formula, and a time range. +/// [Serializable] public record CreateTextInsightFromCallTableDto : IJsonOnDeserialized { @@ -38,6 +41,9 @@ public record CreateTextInsightFromCallTableDto : IJsonOnDeserialized [JsonPropertyName("formula")] public object? Formula { get; set; } + /// + /// The time range used to query the text-value data. + /// [JsonPropertyName("timeRange")] public InsightTimeRange? TimeRange { get; set; } diff --git a/src/Vapi.Net/Types/CreateTogetherAiCredentialDto.cs b/src/Vapi.Net/Types/CreateTogetherAiCredentialDto.cs index 6a079e95..6e0918c5 100644 --- a/src/Vapi.Net/Types/CreateTogetherAiCredentialDto.cs +++ b/src/Vapi.Net/Types/CreateTogetherAiCredentialDto.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Credentials for authenticating assistant model requests with Together AI. +/// [Serializable] public record CreateTogetherAiCredentialDto : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/CreateToolDraftDto.cs b/src/Vapi.Net/Types/CreateToolDraftDto.cs new file mode 100644 index 00000000..9d4a95f9 --- /dev/null +++ b/src/Vapi.Net/Types/CreateToolDraftDto.cs @@ -0,0 +1,306 @@ +using global::System.Text.Json; +using global::System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[Serializable] +public record CreateToolDraftDto : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + /// + /// Messages spoken while the tool is running. Multiple request-start messages are variants. For request-response-delayed, same timing means variants and different timings mean staged updates. + /// + [JsonPropertyName("messages")] + public IEnumerable? Messages { get; set; } + + /// + /// This is the type of the tool. + /// + [JsonPropertyName("type")] + public CreateToolDraftDtoType? Type { get; set; } + + /// + /// Optional pointer to the published version this draft was forked from. + /// When omitted, defaults server-side to the parent tool's current + /// `latestVersion` (lazy-created via `toolBaselineVersionEnsureInTx` if the + /// tool has never been versioned). Immutable for the lifetime of the draft. + /// + [JsonPropertyName("baseVersion")] + public string? BaseVersion { get; set; } + + /// + /// This is the function definition of the tool. + /// + [JsonPropertyName("function")] + public OpenAiFunction? Function { get; set; } + + /// + /// Provider-specific metadata. Polymorphic across tool variants with no shared + /// discriminator, so it is validated as a plain object (mirrors how + /// `ToolCallResult.metadata` is typed). + /// + [JsonPropertyName("metadata")] + public object? Metadata { get; set; } + + /// + /// This is the unique identifier for the template this tool was created from. + /// + [JsonPropertyName("templateId")] + public string? TemplateId { get; set; } + + [JsonPropertyName("server")] + public Server? Server { get; set; } + + [JsonPropertyName("async")] + public bool? Async { get; set; } + + /// + /// These are the destinations that the call can be transferred to. + /// + [JsonPropertyName("destinations")] + public IEnumerable? Destinations { 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 sub type of the tool (e.g. for computer, bash and text-editor tools). + /// + [JsonPropertyName("subType")] + public string? SubType { get; set; } + + /// + /// The display width in pixels (computer tool). + /// + [JsonPropertyName("displayWidthPx")] + public double? DisplayWidthPx { get; set; } + + /// + /// The display height in pixels (computer tool). + /// + [JsonPropertyName("displayHeightPx")] + public double? DisplayHeightPx { get; set; } + + /// + /// Optional display number (computer tool). + /// + [JsonPropertyName("displayNumber")] + public double? DisplayNumber { get; set; } + + /// + /// The knowledge bases to query (query tool). + /// + [JsonPropertyName("knowledgeBases")] + public IEnumerable? KnowledgeBases { get; set; } + + /// + /// This is where the request will be sent (api-request tool). + /// + [JsonPropertyName("url")] + public string? Url { get; set; } + + /// + /// This is the HTTP method for the request (api-request tool). + /// + [JsonPropertyName("method")] + public CreateToolDraftDtoMethod? Method { get; set; } + + /// + /// These are the headers to send with the request (api-request / sip-request tool). + /// + [JsonPropertyName("headers")] + public JsonSchema? Headers { get; set; } + + /// + /// This is the body of the request. Either a JSON schema (api-request) or a + /// literal string / schema (sip-request). + /// + [JsonPropertyName("body")] + public object? Body { get; set; } + + /// + /// This is the backoff plan if the request fails. + /// + [JsonPropertyName("backoffPlan")] + public BackoffPlan? BackoffPlan { get; set; } + + /// + /// This is the timeout in seconds for the request. + /// + [JsonPropertyName("timeoutSeconds")] + public double? TimeoutSeconds { 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 the plan to extract variables from the tool's response. + /// + [JsonPropertyName("variableExtractionPlan")] + public VariableExtractionPlan? VariableExtractionPlan { get; set; } + + /// + /// This is the credential ID that will be used for authorization. + /// + [JsonPropertyName("credentialId")] + public string? CredentialId { get; set; } + + [JsonPropertyName("extendedDelayWhenPrecededByTextEnabled")] + public bool? ExtendedDelayWhenPrecededByTextEnabled { get; set; } + + [JsonPropertyName("beepDetectionEnabled")] + public bool? BeepDetectionEnabled { get; set; } + + /// + /// This is the TypeScript code that will be executed when the tool is called (code tool). + /// + [JsonPropertyName("code")] + public string? Code { get; set; } + + /// + /// These are the environment variables available in the code via the `env` object (code tool). + /// + [JsonPropertyName("environmentVariables")] + public IEnumerable? EnvironmentVariables { get; set; } + + /// + /// These are the static parameters to merge into the tool's request body. + /// + [JsonPropertyName("parameters")] + public IEnumerable? Parameters { get; set; } + + /// + /// This is the paths to encrypt in the request body. + /// + [JsonPropertyName("encryptedPaths")] + public IEnumerable? EncryptedPaths { get; set; } + + /// + /// This enables sending DTMF tones via SIP INFO messages instead of RFC 2833. + /// + [JsonPropertyName("sipInfoDtmfEnabled")] + public bool? SipInfoDtmfEnabled { get; set; } + + /// + /// This is the SIP method to send (sip-request tool). + /// + [JsonPropertyName("verb")] + public CreateToolDraftDtoVerb? Verb { get; set; } + + /// + /// This is the default local tool result message used when no runtime override is returned (handoff tool). + /// + [JsonPropertyName("defaultResult")] + public string? DefaultResult { get; set; } + + /// + /// Per-tool message overrides for individual tools loaded from the MCP server (mcp tool). + /// + [JsonPropertyName("toolMessages")] + public IEnumerable? ToolMessages { get; set; } + + /// + /// This is the plan to reject a tool call based on the conversation state. + /// + /// // Example 1: Reject endCall if user didn't say goodbye + /// ```json + /// { + /// conditions: [{ + /// type: 'regex', + /// regex: '(?i)\\b(bye|goodbye|farewell|see you later|take care)\\b', + /// target: { position: -1, role: 'user' }, + /// negate: true // Reject if pattern does NOT match + /// }] + /// } + /// ``` + /// + /// // Example 2: Reject transfer if user is actually asking a question + /// ```json + /// { + /// conditions: [{ + /// type: 'regex', + /// regex: '\\?', + /// target: { position: -1, role: 'user' } + /// }] + /// } + /// ``` + /// + /// // Example 3: Reject transfer if user didn't mention transfer recently + /// ```json + /// { + /// conditions: [{ + /// type: 'liquid', + /// liquid: `{% assign recentMessages = messages | last: 5 %} + /// {% assign userMessages = recentMessages | where: 'role', 'user' %} + /// {% assign mentioned = false %} + /// {% for msg in userMessages %} + /// {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %} + /// {% assign mentioned = true %} + /// {% break %} + /// {% endif %} + /// {% endfor %} + /// {% if mentioned %} + /// false + /// {% else %} + /// true + /// {% endif %}` + /// }] + /// } + /// ``` + /// + /// // Example 4: Reject endCall if the bot is looping and trying to exit + /// ```json + /// { + /// conditions: [{ + /// type: 'liquid', + /// liquid: `{% assign recentMessages = messages | last: 6 %} + /// {% assign userMessages = recentMessages | where: 'role', 'user' | reverse %} + /// {% if userMessages.size < 3 %} + /// false + /// {% else %} + /// {% assign msg1 = userMessages[0].content | downcase %} + /// {% assign msg2 = userMessages[1].content | downcase %} + /// {% assign msg3 = userMessages[2].content | downcase %} + /// {% comment %} Check for repetitive messages {% endcomment %} + /// {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %} + /// true + /// {% comment %} Check for common loop phrases {% endcomment %} + /// {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %} + /// true + /// {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %} + /// true + /// {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %} + /// true + /// {% else %} + /// false + /// {% endif %} + /// {% endif %}` + /// }] + /// } + /// ``` + /// + [JsonPropertyName("rejectionPlan")] + public ToolRejectionPlan? RejectionPlan { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/CreateToolDraftDtoMethod.cs b/src/Vapi.Net/Types/CreateToolDraftDtoMethod.cs new file mode 100644 index 00000000..669f3c4a --- /dev/null +++ b/src/Vapi.Net/Types/CreateToolDraftDtoMethod.cs @@ -0,0 +1,99 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(CreateToolDraftDtoMethodSerializer))] +public enum CreateToolDraftDtoMethod +{ + [EnumMember(Value = "POST")] + Post, + + [EnumMember(Value = "GET")] + Get, + + [EnumMember(Value = "PUT")] + Put, + + [EnumMember(Value = "PATCH")] + Patch, + + [EnumMember(Value = "DELETE")] + Delete, +} + +internal class CreateToolDraftDtoMethodSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + CreateToolDraftDtoMethod + > _stringToEnum = new() + { + { "POST", CreateToolDraftDtoMethod.Post }, + { "GET", CreateToolDraftDtoMethod.Get }, + { "PUT", CreateToolDraftDtoMethod.Put }, + { "PATCH", CreateToolDraftDtoMethod.Patch }, + { "DELETE", CreateToolDraftDtoMethod.Delete }, + }; + + private static readonly global::System.Collections.Generic.Dictionary< + CreateToolDraftDtoMethod, + string + > _enumToString = new() + { + { CreateToolDraftDtoMethod.Post, "POST" }, + { CreateToolDraftDtoMethod.Get, "GET" }, + { CreateToolDraftDtoMethod.Put, "PUT" }, + { CreateToolDraftDtoMethod.Patch, "PATCH" }, + { CreateToolDraftDtoMethod.Delete, "DELETE" }, + }; + + public override CreateToolDraftDtoMethod Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + CreateToolDraftDtoMethod value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override CreateToolDraftDtoMethod ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + CreateToolDraftDtoMethod value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/CreateToolDraftDtoType.cs b/src/Vapi.Net/Types/CreateToolDraftDtoType.cs new file mode 100644 index 00000000..86ae295a --- /dev/null +++ b/src/Vapi.Net/Types/CreateToolDraftDtoType.cs @@ -0,0 +1,232 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(CreateToolDraftDtoTypeSerializer))] +public enum CreateToolDraftDtoType +{ + [EnumMember(Value = "dtmf")] + Dtmf, + + [EnumMember(Value = "endCall")] + EndCall, + + [EnumMember(Value = "transferCall")] + TransferCall, + + [EnumMember(Value = "transferCancel")] + TransferCancel, + + [EnumMember(Value = "transferSuccessful")] + TransferSuccessful, + + [EnumMember(Value = "handoff")] + Handoff, + + [EnumMember(Value = "output")] + Output, + + [EnumMember(Value = "voicemail")] + Voicemail, + + [EnumMember(Value = "query")] + Query, + + [EnumMember(Value = "sms")] + Sms, + + [EnumMember(Value = "sipRequest")] + SipRequest, + + [EnumMember(Value = "function")] + Function, + + [EnumMember(Value = "mcp")] + Mcp, + + [EnumMember(Value = "apiRequest")] + ApiRequest, + + [EnumMember(Value = "code")] + Code, + + [EnumMember(Value = "bash")] + Bash, + + [EnumMember(Value = "computer")] + Computer, + + [EnumMember(Value = "textEditor")] + TextEditor, + + [EnumMember(Value = "google.calendar.event.create")] + GoogleCalendarEventCreate, + + [EnumMember(Value = "google.calendar.availability.check")] + GoogleCalendarAvailabilityCheck, + + [EnumMember(Value = "google.sheets.row.append")] + GoogleSheetsRowAppend, + + [EnumMember(Value = "slack.message.send")] + SlackMessageSend, + + [EnumMember(Value = "gohighlevel.calendar.event.create")] + GohighlevelCalendarEventCreate, + + [EnumMember(Value = "gohighlevel.calendar.availability.check")] + GohighlevelCalendarAvailabilityCheck, + + [EnumMember(Value = "gohighlevel.contact.create")] + GohighlevelContactCreate, + + [EnumMember(Value = "gohighlevel.contact.get")] + GohighlevelContactGet, + + [EnumMember(Value = "make")] + Make, + + [EnumMember(Value = "ghl")] + Ghl, +} + +internal class CreateToolDraftDtoTypeSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + CreateToolDraftDtoType + > _stringToEnum = new() + { + { "dtmf", CreateToolDraftDtoType.Dtmf }, + { "endCall", CreateToolDraftDtoType.EndCall }, + { "transferCall", CreateToolDraftDtoType.TransferCall }, + { "transferCancel", CreateToolDraftDtoType.TransferCancel }, + { "transferSuccessful", CreateToolDraftDtoType.TransferSuccessful }, + { "handoff", CreateToolDraftDtoType.Handoff }, + { "output", CreateToolDraftDtoType.Output }, + { "voicemail", CreateToolDraftDtoType.Voicemail }, + { "query", CreateToolDraftDtoType.Query }, + { "sms", CreateToolDraftDtoType.Sms }, + { "sipRequest", CreateToolDraftDtoType.SipRequest }, + { "function", CreateToolDraftDtoType.Function }, + { "mcp", CreateToolDraftDtoType.Mcp }, + { "apiRequest", CreateToolDraftDtoType.ApiRequest }, + { "code", CreateToolDraftDtoType.Code }, + { "bash", CreateToolDraftDtoType.Bash }, + { "computer", CreateToolDraftDtoType.Computer }, + { "textEditor", CreateToolDraftDtoType.TextEditor }, + { "google.calendar.event.create", CreateToolDraftDtoType.GoogleCalendarEventCreate }, + { + "google.calendar.availability.check", + CreateToolDraftDtoType.GoogleCalendarAvailabilityCheck + }, + { "google.sheets.row.append", CreateToolDraftDtoType.GoogleSheetsRowAppend }, + { "slack.message.send", CreateToolDraftDtoType.SlackMessageSend }, + { + "gohighlevel.calendar.event.create", + CreateToolDraftDtoType.GohighlevelCalendarEventCreate + }, + { + "gohighlevel.calendar.availability.check", + CreateToolDraftDtoType.GohighlevelCalendarAvailabilityCheck + }, + { "gohighlevel.contact.create", CreateToolDraftDtoType.GohighlevelContactCreate }, + { "gohighlevel.contact.get", CreateToolDraftDtoType.GohighlevelContactGet }, + { "make", CreateToolDraftDtoType.Make }, + { "ghl", CreateToolDraftDtoType.Ghl }, + }; + + private static readonly global::System.Collections.Generic.Dictionary< + CreateToolDraftDtoType, + string + > _enumToString = new() + { + { CreateToolDraftDtoType.Dtmf, "dtmf" }, + { CreateToolDraftDtoType.EndCall, "endCall" }, + { CreateToolDraftDtoType.TransferCall, "transferCall" }, + { CreateToolDraftDtoType.TransferCancel, "transferCancel" }, + { CreateToolDraftDtoType.TransferSuccessful, "transferSuccessful" }, + { CreateToolDraftDtoType.Handoff, "handoff" }, + { CreateToolDraftDtoType.Output, "output" }, + { CreateToolDraftDtoType.Voicemail, "voicemail" }, + { CreateToolDraftDtoType.Query, "query" }, + { CreateToolDraftDtoType.Sms, "sms" }, + { CreateToolDraftDtoType.SipRequest, "sipRequest" }, + { CreateToolDraftDtoType.Function, "function" }, + { CreateToolDraftDtoType.Mcp, "mcp" }, + { CreateToolDraftDtoType.ApiRequest, "apiRequest" }, + { CreateToolDraftDtoType.Code, "code" }, + { CreateToolDraftDtoType.Bash, "bash" }, + { CreateToolDraftDtoType.Computer, "computer" }, + { CreateToolDraftDtoType.TextEditor, "textEditor" }, + { CreateToolDraftDtoType.GoogleCalendarEventCreate, "google.calendar.event.create" }, + { + CreateToolDraftDtoType.GoogleCalendarAvailabilityCheck, + "google.calendar.availability.check" + }, + { CreateToolDraftDtoType.GoogleSheetsRowAppend, "google.sheets.row.append" }, + { CreateToolDraftDtoType.SlackMessageSend, "slack.message.send" }, + { + CreateToolDraftDtoType.GohighlevelCalendarEventCreate, + "gohighlevel.calendar.event.create" + }, + { + CreateToolDraftDtoType.GohighlevelCalendarAvailabilityCheck, + "gohighlevel.calendar.availability.check" + }, + { CreateToolDraftDtoType.GohighlevelContactCreate, "gohighlevel.contact.create" }, + { CreateToolDraftDtoType.GohighlevelContactGet, "gohighlevel.contact.get" }, + { CreateToolDraftDtoType.Make, "make" }, + { CreateToolDraftDtoType.Ghl, "ghl" }, + }; + + public override CreateToolDraftDtoType Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + CreateToolDraftDtoType value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override CreateToolDraftDtoType ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + CreateToolDraftDtoType value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/CreateToolDraftDtoVerb.cs b/src/Vapi.Net/Types/CreateToolDraftDtoVerb.cs new file mode 100644 index 00000000..cf23b480 --- /dev/null +++ b/src/Vapi.Net/Types/CreateToolDraftDtoVerb.cs @@ -0,0 +1,89 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(CreateToolDraftDtoVerbSerializer))] +public enum CreateToolDraftDtoVerb +{ + [EnumMember(Value = "INFO")] + Info, + + [EnumMember(Value = "MESSAGE")] + Message, + + [EnumMember(Value = "NOTIFY")] + Notify, +} + +internal class CreateToolDraftDtoVerbSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + CreateToolDraftDtoVerb + > _stringToEnum = new() + { + { "INFO", CreateToolDraftDtoVerb.Info }, + { "MESSAGE", CreateToolDraftDtoVerb.Message }, + { "NOTIFY", CreateToolDraftDtoVerb.Notify }, + }; + + private static readonly global::System.Collections.Generic.Dictionary< + CreateToolDraftDtoVerb, + string + > _enumToString = new() + { + { CreateToolDraftDtoVerb.Info, "INFO" }, + { CreateToolDraftDtoVerb.Message, "MESSAGE" }, + { CreateToolDraftDtoVerb.Notify, "NOTIFY" }, + }; + + public override CreateToolDraftDtoVerb Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + CreateToolDraftDtoVerb value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override CreateToolDraftDtoVerb ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + CreateToolDraftDtoVerb value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/CreateTransferCallToolDto.cs b/src/Vapi.Net/Types/CreateTransferCallToolDto.cs index 68dc3ef2..b12e21ce 100644 --- a/src/Vapi.Net/Types/CreateTransferCallToolDto.cs +++ b/src/Vapi.Net/Types/CreateTransferCallToolDto.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Configuration used to create a tool that transfers the active call to one of its configured destinations. +/// [Serializable] public record CreateTransferCallToolDto : IJsonOnDeserialized { @@ -12,9 +15,7 @@ public record CreateTransferCallToolDto : IJsonOnDeserialized new Dictionary(); /// - /// 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. + /// Messages spoken while the tool is running. Multiple request-start messages are variants. For request-response-delayed, same timing means variants and different timings mean staged updates. /// [JsonPropertyName("messages")] public IEnumerable? Messages { get; set; } diff --git a/src/Vapi.Net/Types/CreateTrieveCredentialDto.cs b/src/Vapi.Net/Types/CreateTrieveCredentialDto.cs index 7c892577..8f0eb0a6 100644 --- a/src/Vapi.Net/Types/CreateTrieveCredentialDto.cs +++ b/src/Vapi.Net/Types/CreateTrieveCredentialDto.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Credentials for authenticating knowledge-base requests with Trieve. +/// [Serializable] public record CreateTrieveCredentialDto : IJsonOnDeserialized { @@ -12,16 +15,10 @@ public record CreateTrieveCredentialDto : IJsonOnDeserialized new Dictionary(); /// - /// This is not returned in the API. + /// Selects Trieve as the credential provider. /// - [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; } + [JsonPropertyName("provider")] + public object? Provider { get; set; } [JsonIgnore] public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); diff --git a/src/Vapi.Net/Types/CreateTrieveKnowledgeBaseDto.cs b/src/Vapi.Net/Types/CreateTrieveKnowledgeBaseDto.cs deleted file mode 100644 index 8ef45548..00000000 --- a/src/Vapi.Net/Types/CreateTrieveKnowledgeBaseDto.cs +++ /dev/null @@ -1,55 +0,0 @@ -using global::System.Text.Json; -using global::System.Text.Json.Serialization; -using Vapi.Net.Core; - -namespace Vapi.Net; - -[Serializable] -public record CreateTrieveKnowledgeBaseDto : IJsonOnDeserialized -{ - [JsonExtensionData] - private readonly IDictionary _extensionData = - new Dictionary(); - - /// - /// This knowledge base is provided by Trieve. - /// - /// To learn more about Trieve, visit https://trieve.ai. - /// - [JsonPropertyName("provider")] - public required CreateTrieveKnowledgeBaseDtoProvider Provider { get; set; } - - /// - /// This is the name of the knowledge base. - /// - [JsonPropertyName("name")] - public string? Name { get; set; } - - /// - /// This is the searching plan used when searching for relevant chunks from the vector store. - /// - /// You should configure this if you're running into these issues: - /// - Too much unnecessary context is being fed as knowledge base context. - /// - Not enough relevant context is being fed as knowledge base context. - /// - [JsonPropertyName("searchPlan")] - public TrieveKnowledgeBaseSearchPlan? SearchPlan { get; set; } - - /// - /// This is the plan if you want us to create/import a new vector store using Trieve. - /// - [JsonPropertyName("createPlan")] - public TrieveKnowledgeBaseImport? CreatePlan { get; set; } - - [JsonIgnore] - public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); - - void IJsonOnDeserialized.OnDeserialized() => - AdditionalProperties.CopyFromExtensionData(_extensionData); - - /// - 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 b622d8e0..de5bb2e4 100644 --- a/src/Vapi.Net/Types/CreateTwilioCredentialDto.cs +++ b/src/Vapi.Net/Types/CreateTwilioCredentialDto.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Credentials for authenticating telephony requests with Twilio using an account SID and either an auth token or API key credentials. +/// [Serializable] public record CreateTwilioCredentialDto : IJsonOnDeserialized { @@ -29,6 +32,9 @@ public record CreateTwilioCredentialDto : IJsonOnDeserialized [JsonPropertyName("apiSecret")] public string? ApiSecret { get; set; } + /// + /// Twilio Account SID associated with the credential. + /// [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 fe4a701e..c168d3dd 100644 --- a/src/Vapi.Net/Types/CreateTwilioPhoneNumberDto.cs +++ b/src/Vapi.Net/Types/CreateTwilioPhoneNumberDto.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Configuration used to import a Twilio phone number into Vapi with its account credentials and routing settings. +/// [Serializable] public record CreateTwilioPhoneNumberDto : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/CreateVapiPhoneNumberDto.cs b/src/Vapi.Net/Types/CreateVapiPhoneNumberDto.cs index 343826e7..025106f7 100644 --- a/src/Vapi.Net/Types/CreateVapiPhoneNumberDto.cs +++ b/src/Vapi.Net/Types/CreateVapiPhoneNumberDto.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Configuration used to provision a Vapi-managed phone number or connect a SIP URI, with optional routing and authentication settings. +/// [Serializable] public record CreateVapiPhoneNumberDto : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/CreateVoicemailToolDto.cs b/src/Vapi.Net/Types/CreateVoicemailToolDto.cs index 93c2b088..bcf47e3d 100644 --- a/src/Vapi.Net/Types/CreateVoicemailToolDto.cs +++ b/src/Vapi.Net/Types/CreateVoicemailToolDto.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Configuration used to create a voicemail-detection tool with optional beep detection for supported calls. +/// [Serializable] public record CreateVoicemailToolDto : IJsonOnDeserialized { @@ -12,9 +15,7 @@ public record CreateVoicemailToolDto : IJsonOnDeserialized new Dictionary(); /// - /// 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. + /// Messages spoken while the tool is running. Multiple request-start messages are variants. For request-response-delayed, same timing means variants and different timings mean staged updates. /// [JsonPropertyName("messages")] public IEnumerable? Messages { get; set; } diff --git a/src/Vapi.Net/Types/CreateVonageCredentialDto.cs b/src/Vapi.Net/Types/CreateVonageCredentialDto.cs index 1f66cf70..732455e8 100644 --- a/src/Vapi.Net/Types/CreateVonageCredentialDto.cs +++ b/src/Vapi.Net/Types/CreateVonageCredentialDto.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Credentials for authenticating telephony requests with Vonage. +/// [Serializable] public record CreateVonageCredentialDto : IJsonOnDeserialized { @@ -17,6 +20,9 @@ public record CreateVonageCredentialDto : IJsonOnDeserialized [JsonPropertyName("apiSecret")] public required string ApiSecret { get; set; } + /// + /// Vonage API key associated with the credential. + /// [JsonPropertyName("apiKey")] public required string ApiKey { get; set; } diff --git a/src/Vapi.Net/Types/CreateVonagePhoneNumberDto.cs b/src/Vapi.Net/Types/CreateVonagePhoneNumberDto.cs index 43a023a7..77ab1d22 100644 --- a/src/Vapi.Net/Types/CreateVonagePhoneNumberDto.cs +++ b/src/Vapi.Net/Types/CreateVonagePhoneNumberDto.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Configuration used to import a Vonage phone number into Vapi with a stored credential and routing settings. +/// [Serializable] public record CreateVonagePhoneNumberDto : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/CreateWebCallDto.cs b/src/Vapi.Net/Types/CreateWebCallDto.cs index 3b2cfb77..a309a4ae 100644 --- a/src/Vapi.Net/Types/CreateWebCallDto.cs +++ b/src/Vapi.Net/Types/CreateWebCallDto.cs @@ -11,6 +11,13 @@ public record CreateWebCallDto : IJsonOnDeserialized private readonly IDictionary _extensionData = new Dictionary(); + /// + /// This is the assistant version to use for this call. Supported only with + /// direct `assistantId`. Omit to follow the latest version. + /// + [JsonPropertyName("assistantVersion")] + public string? AssistantVersion { get; set; } + [JsonPropertyName("roomDeleteOnUserLeaveEnabled")] public bool? RoomDeleteOnUserLeaveEnabled { get; set; } diff --git a/src/Vapi.Net/Types/CreateWellSaidCredentialDto.cs b/src/Vapi.Net/Types/CreateWellSaidCredentialDto.cs index f1801ec2..a0b28eab 100644 --- a/src/Vapi.Net/Types/CreateWellSaidCredentialDto.cs +++ b/src/Vapi.Net/Types/CreateWellSaidCredentialDto.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Credentials for authenticating voice synthesis requests with WellSaid. +/// [Serializable] public record CreateWellSaidCredentialDto : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/CreateWorkflowDto.cs b/src/Vapi.Net/Types/CreateWorkflowDto.cs index d0a2e2dc..3089ef0a 100644 --- a/src/Vapi.Net/Types/CreateWorkflowDto.cs +++ b/src/Vapi.Net/Types/CreateWorkflowDto.cs @@ -5,6 +5,9 @@ namespace Vapi.Net; +/// +/// Configuration for creating a graph-based workflow, including conversation and tool nodes, directed edges, global prompts, shared providers, hooks, credentials, and call behavior. +/// [Serializable] public record CreateWorkflowDto : IJsonOnDeserialized { @@ -12,6 +15,9 @@ public record CreateWorkflowDto : IJsonOnDeserialized private readonly IDictionary _extensionData = new Dictionary(); + /// + /// Nodes that make up the workflow graph. Conversation nodes interact with the customer, while tool nodes invoke configured tools. + /// [JsonPropertyName("nodes")] public IEnumerable Nodes { get; set; } = new List(); @@ -96,12 +102,21 @@ public OneOf< [JsonPropertyName("maxDurationSeconds")] public double? MaxDurationSeconds { get; set; } + /// + /// Name used to identify the workflow. + /// [JsonPropertyName("name")] public required string Name { get; set; } + /// + /// Directed connections that determine transitions between nodes. + /// [JsonPropertyName("edges")] public IEnumerable Edges { get; set; } = new List(); + /// + /// Prompt applied across the workflow's conversation nodes. + /// [JsonPropertyName("globalPrompt")] public string? GlobalPrompt { get; set; } diff --git a/src/Vapi.Net/Types/CreateXAiCredentialDto.cs b/src/Vapi.Net/Types/CreateXAiCredentialDto.cs index 050a18ee..e8ad5d3a 100644 --- a/src/Vapi.Net/Types/CreateXAiCredentialDto.cs +++ b/src/Vapi.Net/Types/CreateXAiCredentialDto.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Credentials for authenticating assistant model requests with xAI. +/// [Serializable] public record CreateXAiCredentialDto : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/CustomEndpointingModelSmartEndpointingPlan.cs b/src/Vapi.Net/Types/CustomEndpointingModelSmartEndpointingPlan.cs index 4e0c85f0..05c66e61 100644 --- a/src/Vapi.Net/Types/CustomEndpointingModelSmartEndpointingPlan.cs +++ b/src/Vapi.Net/Types/CustomEndpointingModelSmartEndpointingPlan.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Configuration for using a custom endpointing model, including its provider identifier and server connection. +/// [Serializable] public record CustomEndpointingModelSmartEndpointingPlan : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/CustomLlmModel.cs b/src/Vapi.Net/Types/CustomLlmModel.cs index cba00a49..527b2f3b 100644 --- a/src/Vapi.Net/Types/CustomLlmModel.cs +++ b/src/Vapi.Net/Types/CustomLlmModel.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Configuration for generating assistant responses through a custom language model endpoint, including server URL, headers, metadata, prompts, tools, and generation settings. +/// [Serializable] public record CustomLlmModel : IJsonOnDeserialized { @@ -33,6 +36,15 @@ public record CustomLlmModel : IJsonOnDeserialized [JsonPropertyName("toolIds")] public IEnumerable? ToolIds { get; set; } + /// + /// These are version-pinned references to tools. Each entry pins a specific + /// version of a tool by `(toolId, version)`. When the same `toolId` appears + /// in both `toolIds` and `toolRefs[]`, the `toolRefs` pin wins (the + /// `toolIds` entry is dropped at write time). + /// + [JsonPropertyName("toolRefs")] + public IEnumerable? ToolRefs { get; set; } + /// /// These are the options for the knowledge base. /// @@ -85,7 +97,7 @@ public record CustomLlmModel : IJsonOnDeserialized public required string Model { get; set; } /// - /// This is the temperature that will be used for calls. Default is 0 to leverage caching for lower latency. + /// This is the temperature that will be used for calls. Default is 0.5. /// [JsonPropertyName("temperature")] public double? Temperature { get; set; } diff --git a/src/Vapi.Net/Types/CustomMessage.cs b/src/Vapi.Net/Types/CustomMessage.cs index 4c676b25..9a9329ff 100644 --- a/src/Vapi.Net/Types/CustomMessage.cs +++ b/src/Vapi.Net/Types/CustomMessage.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// A message spoken by the assistant with optional language-specific content variants. +/// [Serializable] public record CustomMessage : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/CustomTranscriber.cs b/src/Vapi.Net/Types/CustomTranscriber.cs index d272e5db..ee444f80 100644 --- a/src/Vapi.Net/Types/CustomTranscriber.cs +++ b/src/Vapi.Net/Types/CustomTranscriber.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Configuration for sending conversation audio to a custom WebSocket transcription server. +/// [Serializable] public record CustomTranscriber : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/CustomVoice.cs b/src/Vapi.Net/Types/CustomVoice.cs index 8a9cd664..0bb86ea2 100644 --- a/src/Vapi.Net/Types/CustomVoice.cs +++ b/src/Vapi.Net/Types/CustomVoice.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Configuration for synthesizing assistant speech through a custom server, including voice selection, server connection, chunking, caching, and fallback settings. +/// [Serializable] public record CustomVoice : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/CustomerCustomEndpointingRule.cs b/src/Vapi.Net/Types/CustomerCustomEndpointingRule.cs index f9077745..1b83ae48 100644 --- a/src/Vapi.Net/Types/CustomerCustomEndpointingRule.cs +++ b/src/Vapi.Net/Types/CustomerCustomEndpointingRule.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// A custom endpointing rule that matches the customer's current speech and applies a configured timeout. +/// [Serializable] public record CustomerCustomEndpointingRule : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/CustomerSpeechTimeoutOptions.cs b/src/Vapi.Net/Types/CustomerSpeechTimeoutOptions.cs index f5a0c133..581ad19c 100644 --- a/src/Vapi.Net/Types/CustomerSpeechTimeoutOptions.cs +++ b/src/Vapi.Net/Types/CustomerSpeechTimeoutOptions.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Controls how long a hook waits for customer speech, how often it can trigger, and when its trigger counter resets. +/// [Serializable] public record CustomerSpeechTimeoutOptions : IJsonOnDeserialized { @@ -11,11 +14,19 @@ public record CustomerSpeechTimeoutOptions : IJsonOnDeserialized private readonly IDictionary _extensionData = new Dictionary(); + /// + /// Controls whether the hook's trigger counter resets after the customer speaks. Defaults to `never`. + /// + [JsonPropertyName("triggerResetMode")] + public CustomerSpeechTimeoutOptionsTriggerResetMode? TriggerResetMode { get; set; } + /// /// This is the timeout in seconds before action is triggered. /// The clock starts when the assistant finishes speaking and remains active until the user speaks. /// /// @default 7.5 + /// @minimum 2 + /// @maximum 1000 /// [JsonPropertyName("timeoutSeconds")] public required double TimeoutSeconds { get; set; } @@ -28,14 +39,6 @@ public record CustomerSpeechTimeoutOptions : IJsonOnDeserialized [JsonPropertyName("triggerMaxCount")] public double? TriggerMaxCount { get; set; } - /// - /// This is whether the counter for hook trigger resets the user speaks. - /// - /// @default never - /// - [JsonPropertyName("triggerResetMode")] - public object? TriggerResetMode { get; set; } - [JsonIgnore] public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); diff --git a/src/Vapi.Net/Types/CustomerSpeechTimeoutOptionsTriggerResetMode.cs b/src/Vapi.Net/Types/CustomerSpeechTimeoutOptionsTriggerResetMode.cs new file mode 100644 index 00000000..099ef9da --- /dev/null +++ b/src/Vapi.Net/Types/CustomerSpeechTimeoutOptionsTriggerResetMode.cs @@ -0,0 +1,84 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(CustomerSpeechTimeoutOptionsTriggerResetModeSerializer))] +public enum CustomerSpeechTimeoutOptionsTriggerResetMode +{ + [EnumMember(Value = "onUserSpeech")] + OnUserSpeech, + + [EnumMember(Value = "never")] + Never, +} + +internal class CustomerSpeechTimeoutOptionsTriggerResetModeSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + CustomerSpeechTimeoutOptionsTriggerResetMode + > _stringToEnum = new() + { + { "onUserSpeech", CustomerSpeechTimeoutOptionsTriggerResetMode.OnUserSpeech }, + { "never", CustomerSpeechTimeoutOptionsTriggerResetMode.Never }, + }; + + private static readonly global::System.Collections.Generic.Dictionary< + CustomerSpeechTimeoutOptionsTriggerResetMode, + string + > _enumToString = new() + { + { CustomerSpeechTimeoutOptionsTriggerResetMode.OnUserSpeech, "onUserSpeech" }, + { CustomerSpeechTimeoutOptionsTriggerResetMode.Never, "never" }, + }; + + public override CustomerSpeechTimeoutOptionsTriggerResetMode Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + CustomerSpeechTimeoutOptionsTriggerResetMode value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override CustomerSpeechTimeoutOptionsTriggerResetMode ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + CustomerSpeechTimeoutOptionsTriggerResetMode value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/DeepInfraModel.cs b/src/Vapi.Net/Types/DeepInfraModel.cs index 1a200c60..ffbd0d5d 100644 --- a/src/Vapi.Net/Types/DeepInfraModel.cs +++ b/src/Vapi.Net/Types/DeepInfraModel.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Configuration for generating assistant responses with DeepInfra, including model, prompts, tools, knowledge-base access, and generation settings. +/// [Serializable] public record DeepInfraModel : IJsonOnDeserialized { @@ -33,6 +36,15 @@ public record DeepInfraModel : IJsonOnDeserialized [JsonPropertyName("toolIds")] public IEnumerable? ToolIds { get; set; } + /// + /// These are version-pinned references to tools. Each entry pins a specific + /// version of a tool by `(toolId, version)`. When the same `toolId` appears + /// in both `toolIds` and `toolRefs[]`, the `toolRefs` pin wins (the + /// `toolIds` entry is dropped at write time). + /// + [JsonPropertyName("toolRefs")] + public IEnumerable? ToolRefs { get; set; } + /// /// These are the options for the knowledge base. /// @@ -46,7 +58,7 @@ public record DeepInfraModel : IJsonOnDeserialized public required string Model { get; set; } /// - /// This is the temperature that will be used for calls. Default is 0 to leverage caching for lower latency. + /// This is the temperature that will be used for calls. Default is 0.5. /// [JsonPropertyName("temperature")] public double? Temperature { get; set; } diff --git a/src/Vapi.Net/Types/DeepSeekModel.cs b/src/Vapi.Net/Types/DeepSeekModel.cs index d1469c4f..f97f12d0 100644 --- a/src/Vapi.Net/Types/DeepSeekModel.cs +++ b/src/Vapi.Net/Types/DeepSeekModel.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Configuration for generating assistant responses with DeepSeek, including model, prompts, tools, knowledge-base access, and generation settings. +/// [Serializable] public record DeepSeekModel : IJsonOnDeserialized { @@ -33,6 +36,15 @@ public record DeepSeekModel : IJsonOnDeserialized [JsonPropertyName("toolIds")] public IEnumerable? ToolIds { get; set; } + /// + /// These are version-pinned references to tools. Each entry pins a specific + /// version of a tool by `(toolId, version)`. When the same `toolId` appears + /// in both `toolIds` and `toolRefs[]`, the `toolRefs` pin wins (the + /// `toolIds` entry is dropped at write time). + /// + [JsonPropertyName("toolRefs")] + public IEnumerable? ToolRefs { get; set; } + /// /// These are the options for the knowledge base. /// @@ -46,7 +58,7 @@ public record DeepSeekModel : IJsonOnDeserialized 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. + /// This is the temperature that will be used for calls. Default is 0.5. /// [JsonPropertyName("temperature")] public double? Temperature { get; set; } diff --git a/src/Vapi.Net/Types/DeepgramTranscriber.cs b/src/Vapi.Net/Types/DeepgramTranscriber.cs index 752e5fef..39f4c25b 100644 --- a/src/Vapi.Net/Types/DeepgramTranscriber.cs +++ b/src/Vapi.Net/Types/DeepgramTranscriber.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Configuration for transcribing speech during assistant conversations with Deepgram, including model, language, formatting, endpointing, vocabulary, and fallback settings. +/// [Serializable] public record DeepgramTranscriber : IJsonOnDeserialized { @@ -55,6 +58,23 @@ public record DeepgramTranscriber : IJsonOnDeserialized [JsonPropertyName("profanityFilter")] public bool? ProfanityFilter { get; set; } + /// + /// Enables redaction of sensitive information from transcripts. + /// + /// Options include: + /// - "pci": Redacts credit card numbers, expiration dates, and CVV. + /// - "pii": Redacts personally identifiable information (names, locations, identifying numbers, etc.). + /// - "phi": Redacts protected health information (medical conditions, drugs, injuries, etc.). + /// - "numbers": Redacts numerical and identifying entities (dates, account numbers, SSNs, etc.). + /// + /// Multiple values can be provided to redact different categories simultaneously. + /// Redacted content is replaced with entity labels like [CREDIT_CARD_1], [SSN_1], etc. + /// + /// See https://developers.deepgram.com/docs/redaction for details. + /// + [JsonPropertyName("redaction")] + public IEnumerable? Redaction { get; set; } + /// /// Transcripts below this confidence threshold will be discarded. /// @@ -63,12 +83,6 @@ public record DeepgramTranscriber : IJsonOnDeserialized [JsonPropertyName("confidenceThreshold")] public double? ConfidenceThreshold { get; set; } - /// - /// Eager end-of-turn confidence required to fire a eager end-of-turn event. Setting a value here will enable EagerEndOfTurn and SpeechResumed events. It is disabled by default. Only used with Flux models. - /// - [JsonPropertyName("eagerEotThreshold")] - public double? EagerEotThreshold { get; set; } - /// /// End-of-turn confidence required to finish a turn. Only used with Flux models. /// @@ -85,6 +99,14 @@ public record DeepgramTranscriber : IJsonOnDeserialized [JsonPropertyName("eotTimeoutMs")] public double? EotTimeoutMs { get; set; } + /// + /// Language hints to bias Flux Multilingual (`flux-general-multi`) toward specific languages. + /// Provide BCP-47 language codes (e.g. "en", "es", "fr"). Multiple hints can be given for + /// multilingual or code-switching scenarios. Omit for auto-detection. Only used with `flux-general-multi`. + /// + [JsonPropertyName("languages")] + public IEnumerable? Languages { 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. /// diff --git a/src/Vapi.Net/Types/DeepgramTranscriberRedactionItem.cs b/src/Vapi.Net/Types/DeepgramTranscriberRedactionItem.cs new file mode 100644 index 00000000..72ca776a --- /dev/null +++ b/src/Vapi.Net/Types/DeepgramTranscriberRedactionItem.cs @@ -0,0 +1,94 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(DeepgramTranscriberRedactionItemSerializer))] +public enum DeepgramTranscriberRedactionItem +{ + [EnumMember(Value = "pci")] + Pci, + + [EnumMember(Value = "pii")] + Pii, + + [EnumMember(Value = "phi")] + Phi, + + [EnumMember(Value = "numbers")] + Numbers, +} + +internal class DeepgramTranscriberRedactionItemSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + DeepgramTranscriberRedactionItem + > _stringToEnum = new() + { + { "pci", DeepgramTranscriberRedactionItem.Pci }, + { "pii", DeepgramTranscriberRedactionItem.Pii }, + { "phi", DeepgramTranscriberRedactionItem.Phi }, + { "numbers", DeepgramTranscriberRedactionItem.Numbers }, + }; + + private static readonly global::System.Collections.Generic.Dictionary< + DeepgramTranscriberRedactionItem, + string + > _enumToString = new() + { + { DeepgramTranscriberRedactionItem.Pci, "pci" }, + { DeepgramTranscriberRedactionItem.Pii, "pii" }, + { DeepgramTranscriberRedactionItem.Phi, "phi" }, + { DeepgramTranscriberRedactionItem.Numbers, "numbers" }, + }; + + public override DeepgramTranscriberRedactionItem Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + DeepgramTranscriberRedactionItem value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override DeepgramTranscriberRedactionItem ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + DeepgramTranscriberRedactionItem value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/DeepgramVoice.cs b/src/Vapi.Net/Types/DeepgramVoice.cs index 1f02ace7..2cff6690 100644 --- a/src/Vapi.Net/Types/DeepgramVoice.cs +++ b/src/Vapi.Net/Types/DeepgramVoice.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Configuration for synthesizing assistant speech with Deepgram, including voice and model selection, model-improvement preferences, chunking, caching, and fallback settings. +/// [Serializable] public record DeepgramVoice : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/DeepgramVoiceId.cs b/src/Vapi.Net/Types/DeepgramVoiceId.cs index b0e0fedf..2342dbee 100644 --- a/src/Vapi.Net/Types/DeepgramVoiceId.cs +++ b/src/Vapi.Net/Types/DeepgramVoiceId.cs @@ -170,6 +170,27 @@ public enum DeepgramVoiceId [EnumMember(Value = "javier")] Javier, + + [EnumMember(Value = "viktoria")] + Viktoria, + + [EnumMember(Value = "kara")] + Kara, + + [EnumMember(Value = "fabian")] + Fabian, + + [EnumMember(Value = "julius")] + Julius, + + [EnumMember(Value = "lara")] + Lara, + + [EnumMember(Value = "elara")] + Elara, + + [EnumMember(Value = "aurelia")] + Aurelia, } internal class DeepgramVoiceIdSerializer @@ -235,6 +256,13 @@ internal class DeepgramVoiceIdSerializer { "aquila", DeepgramVoiceId.Aquila }, { "selena", DeepgramVoiceId.Selena }, { "javier", DeepgramVoiceId.Javier }, + { "viktoria", DeepgramVoiceId.Viktoria }, + { "kara", DeepgramVoiceId.Kara }, + { "fabian", DeepgramVoiceId.Fabian }, + { "julius", DeepgramVoiceId.Julius }, + { "lara", DeepgramVoiceId.Lara }, + { "elara", DeepgramVoiceId.Elara }, + { "aurelia", DeepgramVoiceId.Aurelia }, }; private static readonly global::System.Collections.Generic.Dictionary< @@ -297,6 +325,13 @@ internal class DeepgramVoiceIdSerializer { DeepgramVoiceId.Aquila, "aquila" }, { DeepgramVoiceId.Selena, "selena" }, { DeepgramVoiceId.Javier, "javier" }, + { DeepgramVoiceId.Viktoria, "viktoria" }, + { DeepgramVoiceId.Kara, "kara" }, + { DeepgramVoiceId.Fabian, "fabian" }, + { DeepgramVoiceId.Julius, "julius" }, + { DeepgramVoiceId.Lara, "lara" }, + { DeepgramVoiceId.Elara, "elara" }, + { DeepgramVoiceId.Aurelia, "aurelia" }, }; public override DeepgramVoiceId Read( diff --git a/src/Vapi.Net/Types/DeveloperMessage.cs b/src/Vapi.Net/Types/DeveloperMessage.cs index d814bca5..d79f275c 100644 --- a/src/Vapi.Net/Types/DeveloperMessage.cs +++ b/src/Vapi.Net/Types/DeveloperMessage.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// A developer-authored instruction message supplied to the language model. +/// [Serializable] public record DeveloperMessage : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/DialPlanEntry.cs b/src/Vapi.Net/Types/DialPlanEntry.cs index 386e34ea..0e3e2a3a 100644 --- a/src/Vapi.Net/Types/DialPlanEntry.cs +++ b/src/Vapi.Net/Types/DialPlanEntry.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Associates a phone number with the customers to dial through that number in a batch call plan. +/// [Serializable] public record DialPlanEntry : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/DtmfTool.cs b/src/Vapi.Net/Types/DtmfTool.cs index 9e90be3e..2788ffc7 100644 --- a/src/Vapi.Net/Types/DtmfTool.cs +++ b/src/Vapi.Net/Types/DtmfTool.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// A reusable tool that lets an assistant send DTMF keypad tones during a call. +/// [Serializable] public record DtmfTool : IJsonOnDeserialized { @@ -11,10 +14,11 @@ public record DtmfTool : IJsonOnDeserialized private readonly IDictionary _extensionData = new Dictionary(); + [JsonPropertyName("latestVersion")] + public string? LatestVersion { 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. + /// Messages spoken while the tool is running. Multiple request-start messages are variants. For request-response-delayed, same timing means variants and different timings mean staged updates. /// [JsonPropertyName("messages")] public IEnumerable? Messages { get; set; } diff --git a/src/Vapi.Net/Types/Edge.cs b/src/Vapi.Net/Types/Edge.cs index 177dfc85..be5fe3fd 100644 --- a/src/Vapi.Net/Types/Edge.cs +++ b/src/Vapi.Net/Types/Edge.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// A directed connection between two workflow nodes, with an optional AI-evaluated transition condition. +/// [Serializable] public record Edge : IJsonOnDeserialized { @@ -11,12 +14,21 @@ public record Edge : IJsonOnDeserialized private readonly IDictionary _extensionData = new Dictionary(); + /// + /// Condition that must evaluate to true to follow this edge. + /// [JsonPropertyName("condition")] public AiEdgeCondition? Condition { get; set; } + /// + /// Name of the source workflow node. + /// [JsonPropertyName("from")] public required string From { get; set; } + /// + /// Name of the destination workflow node. + /// [JsonPropertyName("to")] public required string To { get; set; } diff --git a/src/Vapi.Net/Types/ElevenLabsCredential.cs b/src/Vapi.Net/Types/ElevenLabsCredential.cs index 84e750a9..39414137 100644 --- a/src/Vapi.Net/Types/ElevenLabsCredential.cs +++ b/src/Vapi.Net/Types/ElevenLabsCredential.cs @@ -20,6 +20,12 @@ public record ElevenLabsCredential : IJsonOnDeserialized [JsonPropertyName("apiKey")] public required string ApiKey { get; set; } + /// + /// ElevenLabs-only API environment for this key: the global endpoint or the EU data residency endpoint. In EU deployments, new credentials must explicitly use the EU data residency endpoint; existing credentials may omit this field on update to retain their saved endpoint. Outside EU deployments, Vapi detects an omitted endpoint automatically and null on update clears and re-detects the endpoint. + /// + [JsonPropertyName("apiUrl")] + public ElevenLabsCredentialApiUrl? ApiUrl { get; set; } + /// /// This is the unique identifier for the credential. /// diff --git a/src/Vapi.Net/Types/ElevenLabsCredentialApiUrl.cs b/src/Vapi.Net/Types/ElevenLabsCredentialApiUrl.cs new file mode 100644 index 00000000..e97b349d --- /dev/null +++ b/src/Vapi.Net/Types/ElevenLabsCredentialApiUrl.cs @@ -0,0 +1,90 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(ElevenLabsCredentialApiUrlSerializer))] +public enum ElevenLabsCredentialApiUrl +{ + [EnumMember(Value = "https://api.elevenlabs.io")] + HttpsApiElevenlabsIo, + + [EnumMember(Value = "https://api.eu.residency.elevenlabs.io")] + HttpsApiEuResidencyElevenlabsIo, +} + +internal class ElevenLabsCredentialApiUrlSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + ElevenLabsCredentialApiUrl + > _stringToEnum = new() + { + { "https://api.elevenlabs.io", ElevenLabsCredentialApiUrl.HttpsApiElevenlabsIo }, + { + "https://api.eu.residency.elevenlabs.io", + ElevenLabsCredentialApiUrl.HttpsApiEuResidencyElevenlabsIo + }, + }; + + private static readonly global::System.Collections.Generic.Dictionary< + ElevenLabsCredentialApiUrl, + string + > _enumToString = new() + { + { ElevenLabsCredentialApiUrl.HttpsApiElevenlabsIo, "https://api.elevenlabs.io" }, + { + ElevenLabsCredentialApiUrl.HttpsApiEuResidencyElevenlabsIo, + "https://api.eu.residency.elevenlabs.io" + }, + }; + + public override ElevenLabsCredentialApiUrl Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + ElevenLabsCredentialApiUrl value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override ElevenLabsCredentialApiUrl ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + ElevenLabsCredentialApiUrl value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/ElevenLabsPronunciationDictionaryLocator.cs b/src/Vapi.Net/Types/ElevenLabsPronunciationDictionaryLocator.cs index 0ebdb3a4..f6408e05 100644 --- a/src/Vapi.Net/Types/ElevenLabsPronunciationDictionaryLocator.cs +++ b/src/Vapi.Net/Types/ElevenLabsPronunciationDictionaryLocator.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Identifies a specific version of an ElevenLabs pronunciation dictionary. +/// [Serializable] public record ElevenLabsPronunciationDictionaryLocator : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/ElevenLabsTranscriber.cs b/src/Vapi.Net/Types/ElevenLabsTranscriber.cs index 16933852..eb7bc59e 100644 --- a/src/Vapi.Net/Types/ElevenLabsTranscriber.cs +++ b/src/Vapi.Net/Types/ElevenLabsTranscriber.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Configuration for transcribing speech during assistant conversations with ElevenLabs, including model, language, speech thresholds, and fallback settings. +/// [Serializable] public record ElevenLabsTranscriber : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/ElevenLabsVoice.cs b/src/Vapi.Net/Types/ElevenLabsVoice.cs index 7a56e0fa..c0ff3963 100644 --- a/src/Vapi.Net/Types/ElevenLabsVoice.cs +++ b/src/Vapi.Net/Types/ElevenLabsVoice.cs @@ -5,6 +5,9 @@ namespace Vapi.Net; +/// +/// Configuration for synthesizing assistant speech with ElevenLabs, including voice and model selection, language, voice tuning, streaming, Speech Synthesis Markup Language parsing, pronunciation dictionaries, chunking, caching, and fallback settings. +/// [Serializable] public record ElevenLabsVoice : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/EndCallTool.cs b/src/Vapi.Net/Types/EndCallTool.cs index d1087103..21e855f0 100644 --- a/src/Vapi.Net/Types/EndCallTool.cs +++ b/src/Vapi.Net/Types/EndCallTool.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// A reusable tool that lets an assistant end the active call. +/// [Serializable] public record EndCallTool : IJsonOnDeserialized { @@ -11,10 +14,11 @@ public record EndCallTool : IJsonOnDeserialized private readonly IDictionary _extensionData = new Dictionary(); + [JsonPropertyName("latestVersion")] + public string? LatestVersion { 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. + /// Messages spoken while the tool is running. Multiple request-start messages are variants. For request-response-delayed, same timing means variants and different timings mean staged updates. /// [JsonPropertyName("messages")] public IEnumerable? Messages { get; set; } diff --git a/src/Vapi.Net/Types/EndedReasonCondition.cs b/src/Vapi.Net/Types/EndedReasonCondition.cs new file mode 100644 index 00000000..c51c0f6f --- /dev/null +++ b/src/Vapi.Net/Types/EndedReasonCondition.cs @@ -0,0 +1,43 @@ +using global::System.Text.Json; +using global::System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[Serializable] +public record EndedReasonCondition : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + /// + /// This is the membership operator applied against `values`. + /// + /// - 'oneOf': the structured output runs only if the call's ended reason is in `values`. + /// - 'notOneOf': the structured output runs only if the call's ended reason is NOT in `values`. + /// + [JsonPropertyName("operator")] + public required EndedReasonConditionOperator Operator { get; set; } + + /// + /// These are the ended reasons compared against the call's ended reason. + /// + /// Any string is accepted so configurations never break when new ended + /// reasons are introduced. Must contain at least one value. + /// + [JsonPropertyName("values")] + public IEnumerable Values { get; set; } = new List(); + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/EndedReasonConditionOperator.cs b/src/Vapi.Net/Types/EndedReasonConditionOperator.cs new file mode 100644 index 00000000..6440ff6a --- /dev/null +++ b/src/Vapi.Net/Types/EndedReasonConditionOperator.cs @@ -0,0 +1,84 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(EndedReasonConditionOperatorSerializer))] +public enum EndedReasonConditionOperator +{ + [EnumMember(Value = "oneOf")] + OneOf, + + [EnumMember(Value = "notOneOf")] + NotOneOf, +} + +internal class EndedReasonConditionOperatorSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + EndedReasonConditionOperator + > _stringToEnum = new() + { + { "oneOf", EndedReasonConditionOperator.OneOf }, + { "notOneOf", EndedReasonConditionOperator.NotOneOf }, + }; + + private static readonly global::System.Collections.Generic.Dictionary< + EndedReasonConditionOperator, + string + > _enumToString = new() + { + { EndedReasonConditionOperator.OneOf, "oneOf" }, + { EndedReasonConditionOperator.NotOneOf, "notOneOf" }, + }; + + public override EndedReasonConditionOperator Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + EndedReasonConditionOperator value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override EndedReasonConditionOperator ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + EndedReasonConditionOperator value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/Eval.cs b/src/Vapi.Net/Types/Eval.cs index 93a37aa3..36f379bc 100644 --- a/src/Vapi.Net/Types/Eval.cs +++ b/src/Vapi.Net/Types/Eval.cs @@ -5,6 +5,9 @@ namespace Vapi.Net; +/// +/// A saved eval definition containing its mock conversation, checkpoints, descriptive metadata, type, and lifecycle information. +/// [Serializable] public record Eval : IJsonOnDeserialized { @@ -41,15 +44,27 @@ public IEnumerable< > >(); + /// + /// The unique identifier for the eval. + /// [JsonPropertyName("id")] public required string Id { get; set; } + /// + /// The unique identifier for the organization that owns the eval. + /// [JsonPropertyName("orgId")] public required string OrgId { get; set; } + /// + /// The ISO 8601 timestamp when the eval was created. + /// [JsonPropertyName("createdAt")] public required DateTime CreatedAt { get; set; } + /// + /// The ISO 8601 timestamp when the eval was last updated. + /// [JsonPropertyName("updatedAt")] public required DateTime UpdatedAt { get; set; } diff --git a/src/Vapi.Net/Types/EvalAnthropicModel.cs b/src/Vapi.Net/Types/EvalAnthropicModel.cs index 8b632f30..d8217362 100644 --- a/src/Vapi.Net/Types/EvalAnthropicModel.cs +++ b/src/Vapi.Net/Types/EvalAnthropicModel.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Anthropic model configuration for an LLM judge, including its messages, generation settings, and optional extended thinking. +/// [Serializable] public record EvalAnthropicModel : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/EvalAnthropicModelModel.cs b/src/Vapi.Net/Types/EvalAnthropicModelModel.cs index 3312488f..e7877c13 100644 --- a/src/Vapi.Net/Types/EvalAnthropicModelModel.cs +++ b/src/Vapi.Net/Types/EvalAnthropicModelModel.cs @@ -45,6 +45,9 @@ public enum EvalAnthropicModelModel [EnumMember(Value = "claude-sonnet-4-6")] ClaudeSonnet46, + [EnumMember(Value = "claude-sonnet-5")] + ClaudeSonnet5, + [EnumMember(Value = "claude-haiku-4-5-20251001")] ClaudeHaiku4520251001, } @@ -70,6 +73,7 @@ internal class EvalAnthropicModelModelSerializer { "claude-sonnet-4-20250514", EvalAnthropicModelModel.ClaudeSonnet420250514 }, { "claude-sonnet-4-5-20250929", EvalAnthropicModelModel.ClaudeSonnet4520250929 }, { "claude-sonnet-4-6", EvalAnthropicModelModel.ClaudeSonnet46 }, + { "claude-sonnet-5", EvalAnthropicModelModel.ClaudeSonnet5 }, { "claude-haiku-4-5-20251001", EvalAnthropicModelModel.ClaudeHaiku4520251001 }, }; @@ -91,6 +95,7 @@ internal class EvalAnthropicModelModelSerializer { EvalAnthropicModelModel.ClaudeSonnet420250514, "claude-sonnet-4-20250514" }, { EvalAnthropicModelModel.ClaudeSonnet4520250929, "claude-sonnet-4-5-20250929" }, { EvalAnthropicModelModel.ClaudeSonnet46, "claude-sonnet-4-6" }, + { EvalAnthropicModelModel.ClaudeSonnet5, "claude-sonnet-5" }, { EvalAnthropicModelModel.ClaudeHaiku4520251001, "claude-haiku-4-5-20251001" }, }; diff --git a/src/Vapi.Net/Types/EvalCustomModel.cs b/src/Vapi.Net/Types/EvalCustomModel.cs index c5a0d3a1..62493a3a 100644 --- a/src/Vapi.Net/Types/EvalCustomModel.cs +++ b/src/Vapi.Net/Types/EvalCustomModel.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// OpenAI-compatible custom model configuration for an LLM judge, including its endpoint, headers, messages, and generation settings. +/// [Serializable] public record EvalCustomModel : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/EvalGoogleModel.cs b/src/Vapi.Net/Types/EvalGoogleModel.cs index eccffe39..fe97cee8 100644 --- a/src/Vapi.Net/Types/EvalGoogleModel.cs +++ b/src/Vapi.Net/Types/EvalGoogleModel.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Google model configuration for an LLM judge, including its messages and generation settings. +/// [Serializable] public record EvalGoogleModel : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/EvalGoogleModelModel.cs b/src/Vapi.Net/Types/EvalGoogleModelModel.cs index 471eef53..d2494bb8 100644 --- a/src/Vapi.Net/Types/EvalGoogleModelModel.cs +++ b/src/Vapi.Net/Types/EvalGoogleModelModel.cs @@ -6,6 +6,12 @@ namespace Vapi.Net; [JsonConverter(typeof(EvalGoogleModelModelSerializer))] public enum EvalGoogleModelModel { + [EnumMember(Value = "gemini-3.5-flash")] + Gemini35Flash, + + [EnumMember(Value = "gemini-3.1-flash-lite")] + Gemini31FlashLite, + [EnumMember(Value = "gemini-3-flash-preview")] Gemini3FlashPreview, @@ -60,6 +66,8 @@ internal class EvalGoogleModelModelSerializer EvalGoogleModelModel > _stringToEnum = new() { + { "gemini-3.5-flash", EvalGoogleModelModel.Gemini35Flash }, + { "gemini-3.1-flash-lite", EvalGoogleModelModel.Gemini31FlashLite }, { "gemini-3-flash-preview", EvalGoogleModelModel.Gemini3FlashPreview }, { "gemini-2.5-pro", EvalGoogleModelModel.Gemini25Pro }, { "gemini-2.5-flash", EvalGoogleModelModel.Gemini25Flash }, @@ -82,6 +90,8 @@ internal class EvalGoogleModelModelSerializer string > _enumToString = new() { + { EvalGoogleModelModel.Gemini35Flash, "gemini-3.5-flash" }, + { EvalGoogleModelModel.Gemini31FlashLite, "gemini-3.1-flash-lite" }, { EvalGoogleModelModel.Gemini3FlashPreview, "gemini-3-flash-preview" }, { EvalGoogleModelModel.Gemini25Pro, "gemini-2.5-pro" }, { EvalGoogleModelModel.Gemini25Flash, "gemini-2.5-flash" }, diff --git a/src/Vapi.Net/Types/EvalGroqModelModel.cs b/src/Vapi.Net/Types/EvalGroqModelModel.cs index 5e455699..2ecc370f 100644 --- a/src/Vapi.Net/Types/EvalGroqModelModel.cs +++ b/src/Vapi.Net/Types/EvalGroqModelModel.cs @@ -36,9 +36,6 @@ public enum EvalGroqModelModel [EnumMember(Value = "moonshotai/kimi-k2-instruct-0905")] MoonshotaiKimiK2Instruct0905, - [EnumMember(Value = "meta-llama/llama-4-maverick-17b-128e-instruct")] - MetaLlamaLlama4Maverick17B128EInstruct, - [EnumMember(Value = "meta-llama/llama-4-scout-17b-16e-instruct")] MetaLlamaLlama4Scout17B16EInstruct, @@ -70,10 +67,6 @@ internal class EvalGroqModelModelSerializer { "llama3-70b-8192", EvalGroqModelModel.Llama370B8192 }, { "gemma2-9b-it", EvalGroqModelModel.Gemma29BIt }, { "moonshotai/kimi-k2-instruct-0905", EvalGroqModelModel.MoonshotaiKimiK2Instruct0905 }, - { - "meta-llama/llama-4-maverick-17b-128e-instruct", - EvalGroqModelModel.MetaLlamaLlama4Maverick17B128EInstruct - }, { "meta-llama/llama-4-scout-17b-16e-instruct", EvalGroqModelModel.MetaLlamaLlama4Scout17B16EInstruct @@ -98,10 +91,6 @@ internal class EvalGroqModelModelSerializer { EvalGroqModelModel.Llama370B8192, "llama3-70b-8192" }, { EvalGroqModelModel.Gemma29BIt, "gemma2-9b-it" }, { EvalGroqModelModel.MoonshotaiKimiK2Instruct0905, "moonshotai/kimi-k2-instruct-0905" }, - { - EvalGroqModelModel.MetaLlamaLlama4Maverick17B128EInstruct, - "meta-llama/llama-4-maverick-17b-128e-instruct" - }, { EvalGroqModelModel.MetaLlamaLlama4Scout17B16EInstruct, "meta-llama/llama-4-scout-17b-16e-instruct" diff --git a/src/Vapi.Net/Types/EvalOpenAiModel.cs b/src/Vapi.Net/Types/EvalOpenAiModel.cs index e8425391..28e58a83 100644 --- a/src/Vapi.Net/Types/EvalOpenAiModel.cs +++ b/src/Vapi.Net/Types/EvalOpenAiModel.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// OpenAI model configuration for an LLM judge, including its messages and generation settings. +/// [Serializable] public record EvalOpenAiModel : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/EvalOpenAiModelModel.cs b/src/Vapi.Net/Types/EvalOpenAiModelModel.cs index 75d126aa..ed1f18d2 100644 --- a/src/Vapi.Net/Types/EvalOpenAiModelModel.cs +++ b/src/Vapi.Net/Types/EvalOpenAiModelModel.cs @@ -6,6 +6,21 @@ namespace Vapi.Net; [JsonConverter(typeof(EvalOpenAiModelModelSerializer))] public enum EvalOpenAiModelModel { + [EnumMember(Value = "gpt-5.6-sol")] + Gpt56Sol, + + [EnumMember(Value = "gpt-5.6-terra")] + Gpt56Terra, + + [EnumMember(Value = "gpt-5.6-luna")] + Gpt56Luna, + + [EnumMember(Value = "gpt-5.5")] + Gpt55, + + [EnumMember(Value = "chat-latest")] + ChatLatest, + [EnumMember(Value = "gpt-5.4")] Gpt54, @@ -344,6 +359,15 @@ public enum EvalOpenAiModelModel [EnumMember(Value = "gpt-3.5-turbo-1106:westus")] Gpt35Turbo1106Westus, + + [EnumMember(Value = "gpt-4.1:australiaeast")] + Gpt41Australiaeast, + + [EnumMember(Value = "gpt-4o:australiaeast")] + Gpt4OAustraliaeast, + + [EnumMember(Value = "gpt-5.4-mini:australiaeast")] + Gpt54MiniAustraliaeast, } internal class EvalOpenAiModelModelSerializer @@ -354,6 +378,11 @@ internal class EvalOpenAiModelModelSerializer EvalOpenAiModelModel > _stringToEnum = new() { + { "gpt-5.6-sol", EvalOpenAiModelModel.Gpt56Sol }, + { "gpt-5.6-terra", EvalOpenAiModelModel.Gpt56Terra }, + { "gpt-5.6-luna", EvalOpenAiModelModel.Gpt56Luna }, + { "gpt-5.5", EvalOpenAiModelModel.Gpt55 }, + { "chat-latest", EvalOpenAiModelModel.ChatLatest }, { "gpt-5.4", EvalOpenAiModelModel.Gpt54 }, { "gpt-5.4-mini", EvalOpenAiModelModel.Gpt54Mini }, { "gpt-5.4-nano", EvalOpenAiModelModel.Gpt54Nano }, @@ -500,6 +529,9 @@ internal class EvalOpenAiModelModelSerializer { "gpt-3.5-turbo-0125:southcentralus", EvalOpenAiModelModel.Gpt35Turbo0125Southcentralus }, { "gpt-3.5-turbo-1106:canadaeast", EvalOpenAiModelModel.Gpt35Turbo1106Canadaeast }, { "gpt-3.5-turbo-1106:westus", EvalOpenAiModelModel.Gpt35Turbo1106Westus }, + { "gpt-4.1:australiaeast", EvalOpenAiModelModel.Gpt41Australiaeast }, + { "gpt-4o:australiaeast", EvalOpenAiModelModel.Gpt4OAustraliaeast }, + { "gpt-5.4-mini:australiaeast", EvalOpenAiModelModel.Gpt54MiniAustraliaeast }, }; private static readonly global::System.Collections.Generic.Dictionary< @@ -507,6 +539,11 @@ internal class EvalOpenAiModelModelSerializer string > _enumToString = new() { + { EvalOpenAiModelModel.Gpt56Sol, "gpt-5.6-sol" }, + { EvalOpenAiModelModel.Gpt56Terra, "gpt-5.6-terra" }, + { EvalOpenAiModelModel.Gpt56Luna, "gpt-5.6-luna" }, + { EvalOpenAiModelModel.Gpt55, "gpt-5.5" }, + { EvalOpenAiModelModel.ChatLatest, "chat-latest" }, { EvalOpenAiModelModel.Gpt54, "gpt-5.4" }, { EvalOpenAiModelModel.Gpt54Mini, "gpt-5.4-mini" }, { EvalOpenAiModelModel.Gpt54Nano, "gpt-5.4-nano" }, @@ -653,6 +690,9 @@ internal class EvalOpenAiModelModelSerializer { EvalOpenAiModelModel.Gpt35Turbo0125Southcentralus, "gpt-3.5-turbo-0125:southcentralus" }, { EvalOpenAiModelModel.Gpt35Turbo1106Canadaeast, "gpt-3.5-turbo-1106:canadaeast" }, { EvalOpenAiModelModel.Gpt35Turbo1106Westus, "gpt-3.5-turbo-1106:westus" }, + { EvalOpenAiModelModel.Gpt41Australiaeast, "gpt-4.1:australiaeast" }, + { EvalOpenAiModelModel.Gpt4OAustraliaeast, "gpt-4o:australiaeast" }, + { EvalOpenAiModelModel.Gpt54MiniAustraliaeast, "gpt-5.4-mini:australiaeast" }, }; public override EvalOpenAiModelModel Read( diff --git a/src/Vapi.Net/Types/EvalPaginatedResponse.cs b/src/Vapi.Net/Types/EvalPaginatedResponse.cs index 5530d933..48c617ad 100644 --- a/src/Vapi.Net/Types/EvalPaginatedResponse.cs +++ b/src/Vapi.Net/Types/EvalPaginatedResponse.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// A paginated collection of saved eval definitions and metadata describing the result set. +/// [Serializable] public record EvalPaginatedResponse : IJsonOnDeserialized { @@ -11,9 +14,15 @@ public record EvalPaginatedResponse : IJsonOnDeserialized private readonly IDictionary _extensionData = new Dictionary(); + /// + /// The eval definitions returned for the current page. + /// [JsonPropertyName("results")] public IEnumerable Results { get; set; } = new List(); + /// + /// Pagination metadata for the eval result set. + /// [JsonPropertyName("metadata")] public required PaginationMeta Metadata { get; set; } diff --git a/src/Vapi.Net/Types/EvalRun.cs b/src/Vapi.Net/Types/EvalRun.cs index 559d40b6..e46f308a 100644 --- a/src/Vapi.Net/Types/EvalRun.cs +++ b/src/Vapi.Net/Types/EvalRun.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// A record of an eval execution, including its target, status, results, costs, completion details, and lifecycle timestamps. +/// [Serializable] public record EvalRun : IJsonOnDeserialized { @@ -41,18 +44,33 @@ public record EvalRun : IJsonOnDeserialized [JsonPropertyName("target")] public required object Target { get; set; } + /// + /// The unique identifier for the eval run. + /// [JsonPropertyName("id")] public required string Id { get; set; } + /// + /// The unique identifier for the organization that owns the run. + /// [JsonPropertyName("orgId")] public required string OrgId { get; set; } + /// + /// The ISO 8601 timestamp when the eval run was created. + /// [JsonPropertyName("createdAt")] public required DateTime CreatedAt { get; set; } + /// + /// The ISO 8601 timestamp when the eval run started. + /// [JsonPropertyName("startedAt")] public required DateTime StartedAt { get; set; } + /// + /// The ISO 8601 timestamp when the eval run ended. + /// [JsonPropertyName("endedAt")] public required DateTime EndedAt { get; set; } diff --git a/src/Vapi.Net/Types/EvalRunPaginatedResponse.cs b/src/Vapi.Net/Types/EvalRunPaginatedResponse.cs index 484513eb..d5596593 100644 --- a/src/Vapi.Net/Types/EvalRunPaginatedResponse.cs +++ b/src/Vapi.Net/Types/EvalRunPaginatedResponse.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// A paginated collection of eval runs and metadata describing the result set. +/// [Serializable] public record EvalRunPaginatedResponse : IJsonOnDeserialized { @@ -11,9 +14,15 @@ public record EvalRunPaginatedResponse : IJsonOnDeserialized private readonly IDictionary _extensionData = new Dictionary(); + /// + /// The eval runs returned for the current page. + /// [JsonPropertyName("results")] public IEnumerable Results { get; set; } = new List(); + /// + /// Pagination metadata for the eval-run result set. + /// [JsonPropertyName("metadata")] public required PaginationMeta Metadata { get; set; } diff --git a/src/Vapi.Net/Types/EvalRunResult.cs b/src/Vapi.Net/Types/EvalRunResult.cs index 82aa14a2..96780943 100644 --- a/src/Vapi.Net/Types/EvalRunResult.cs +++ b/src/Vapi.Net/Types/EvalRunResult.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// The pass or fail result of an evaluation run, including its conversation messages and timing. +/// [Serializable] public record EvalRunResult : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/EvalRunTargetAssistant.cs b/src/Vapi.Net/Types/EvalRunTargetAssistant.cs index dd101bf3..5e1d6f31 100644 --- a/src/Vapi.Net/Types/EvalRunTargetAssistant.cs +++ b/src/Vapi.Net/Types/EvalRunTargetAssistant.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// An assistant evaluation target provided as a saved assistant ID or a transient assistant, with optional assistant overrides. +/// [Serializable] public record EvalRunTargetAssistant : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/EvalRunTargetSquad.cs b/src/Vapi.Net/Types/EvalRunTargetSquad.cs index 8ca6709c..43e9d209 100644 --- a/src/Vapi.Net/Types/EvalRunTargetSquad.cs +++ b/src/Vapi.Net/Types/EvalRunTargetSquad.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// A squad evaluation target provided as a saved squad ID or a transient squad, with optional assistant overrides. +/// [Serializable] public record EvalRunTargetSquad : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/EvaluationPlanItem.cs b/src/Vapi.Net/Types/EvaluationPlanItem.cs index 822113a8..52fd3832 100644 --- a/src/Vapi.Net/Types/EvaluationPlanItem.cs +++ b/src/Vapi.Net/Types/EvaluationPlanItem.cs @@ -27,6 +27,12 @@ public record EvaluationPlanItem : IJsonOnDeserialized [JsonPropertyName("structuredOutput")] public CreateStructuredOutputDto? StructuredOutput { get; set; } + /// + /// Optional dot-notation path to a primitive leaf when evaluating an object structured output. + /// + [JsonPropertyName("path")] + public string? Path { get; set; } + /// /// This is the comparison operator to use when evaluating the extracted value against the expected value. /// Available operators depend on the structured output's schema type: diff --git a/src/Vapi.Net/Types/EventsTableBooleanCondition.cs b/src/Vapi.Net/Types/EventsTableBooleanCondition.cs index d4773567..f9d1fbf0 100644 --- a/src/Vapi.Net/Types/EventsTableBooleanCondition.cs +++ b/src/Vapi.Net/Types/EventsTableBooleanCondition.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Filters event data by comparing a boolean field with an expected value. +/// [Serializable] public record EventsTableBooleanCondition : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/EventsTableNumberCondition.cs b/src/Vapi.Net/Types/EventsTableNumberCondition.cs index d5297aec..9ba52875 100644 --- a/src/Vapi.Net/Types/EventsTableNumberCondition.cs +++ b/src/Vapi.Net/Types/EventsTableNumberCondition.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Filters event data by comparing a numeric field with a value. +/// [Serializable] public record EventsTableNumberCondition : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/EventsTableStringCondition.cs b/src/Vapi.Net/Types/EventsTableStringCondition.cs index 0fd21002..f88ca5f6 100644 --- a/src/Vapi.Net/Types/EventsTableStringCondition.cs +++ b/src/Vapi.Net/Types/EventsTableStringCondition.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Filters event data by comparing or searching a string field. +/// [Serializable] public record EventsTableStringCondition : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/ExactReplacement.cs b/src/Vapi.Net/Types/ExactReplacement.cs index 515fda24..35a0c962 100644 --- a/src/Vapi.Net/Types/ExactReplacement.cs +++ b/src/Vapi.Net/Types/ExactReplacement.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Replaces an exact word or phrase before text is sent to a voice provider. +/// [Serializable] public record ExactReplacement : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/ExportChatDto.cs b/src/Vapi.Net/Types/ExportChatDto.cs index 538e7934..dcf10b25 100644 --- a/src/Vapi.Net/Types/ExportChatDto.cs +++ b/src/Vapi.Net/Types/ExportChatDto.cs @@ -80,6 +80,12 @@ public record ExportChatDto : IJsonOnDeserialized [JsonPropertyName("sortOrder")] public ExportChatDtoSortOrder? SortOrder { get; set; } + /// + /// This is the column to sort by. Defaults to 'createdAt'. + /// + [JsonPropertyName("sortBy")] + public ExportChatDtoSortBy? SortBy { get; set; } + /// /// This is the maximum number of items to return. Defaults to 100. /// diff --git a/src/Vapi.Net/Types/ExportChatDtoSortBy.cs b/src/Vapi.Net/Types/ExportChatDtoSortBy.cs new file mode 100644 index 00000000..dc99e354 --- /dev/null +++ b/src/Vapi.Net/Types/ExportChatDtoSortBy.cs @@ -0,0 +1,89 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(ExportChatDtoSortBySerializer))] +public enum ExportChatDtoSortBy +{ + [EnumMember(Value = "createdAt")] + CreatedAt, + + [EnumMember(Value = "duration")] + Duration, + + [EnumMember(Value = "cost")] + Cost, +} + +internal class ExportChatDtoSortBySerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + ExportChatDtoSortBy + > _stringToEnum = new() + { + { "createdAt", ExportChatDtoSortBy.CreatedAt }, + { "duration", ExportChatDtoSortBy.Duration }, + { "cost", ExportChatDtoSortBy.Cost }, + }; + + private static readonly global::System.Collections.Generic.Dictionary< + ExportChatDtoSortBy, + string + > _enumToString = new() + { + { ExportChatDtoSortBy.CreatedAt, "createdAt" }, + { ExportChatDtoSortBy.Duration, "duration" }, + { ExportChatDtoSortBy.Cost, "cost" }, + }; + + public override ExportChatDtoSortBy Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + ExportChatDtoSortBy value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override ExportChatDtoSortBy ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + ExportChatDtoSortBy value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/ExportSessionDto.cs b/src/Vapi.Net/Types/ExportSessionDto.cs index fc5890ed..7274e7f5 100644 --- a/src/Vapi.Net/Types/ExportSessionDto.cs +++ b/src/Vapi.Net/Types/ExportSessionDto.cs @@ -104,6 +104,12 @@ public record ExportSessionDto : IJsonOnDeserialized [JsonPropertyName("sortOrder")] public ExportSessionDtoSortOrder? SortOrder { get; set; } + /// + /// This is the column to sort by. Defaults to 'createdAt'. + /// + [JsonPropertyName("sortBy")] + public ExportSessionDtoSortBy? SortBy { get; set; } + /// /// This is the maximum number of items to return. Defaults to 100. /// diff --git a/src/Vapi.Net/Types/ExportSessionDtoSortBy.cs b/src/Vapi.Net/Types/ExportSessionDtoSortBy.cs new file mode 100644 index 00000000..c686b512 --- /dev/null +++ b/src/Vapi.Net/Types/ExportSessionDtoSortBy.cs @@ -0,0 +1,89 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(ExportSessionDtoSortBySerializer))] +public enum ExportSessionDtoSortBy +{ + [EnumMember(Value = "createdAt")] + CreatedAt, + + [EnumMember(Value = "duration")] + Duration, + + [EnumMember(Value = "cost")] + Cost, +} + +internal class ExportSessionDtoSortBySerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + ExportSessionDtoSortBy + > _stringToEnum = new() + { + { "createdAt", ExportSessionDtoSortBy.CreatedAt }, + { "duration", ExportSessionDtoSortBy.Duration }, + { "cost", ExportSessionDtoSortBy.Cost }, + }; + + private static readonly global::System.Collections.Generic.Dictionary< + ExportSessionDtoSortBy, + string + > _enumToString = new() + { + { ExportSessionDtoSortBy.CreatedAt, "createdAt" }, + { ExportSessionDtoSortBy.Duration, "duration" }, + { ExportSessionDtoSortBy.Cost, "cost" }, + }; + + public override ExportSessionDtoSortBy Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + ExportSessionDtoSortBy value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override ExportSessionDtoSortBy ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + ExportSessionDtoSortBy value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/FallbackAssemblyAiTranscriber.cs b/src/Vapi.Net/Types/FallbackAssemblyAiTranscriber.cs index 828fa568..f5d32937 100644 --- a/src/Vapi.Net/Types/FallbackAssemblyAiTranscriber.cs +++ b/src/Vapi.Net/Types/FallbackAssemblyAiTranscriber.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Fallback configuration for transcribing speech with AssemblyAI, including language, streaming model, endpointing, and vocabulary. +/// [Serializable] public record FallbackAssemblyAiTranscriber : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/FallbackAzureSpeechTranscriber.cs b/src/Vapi.Net/Types/FallbackAzureSpeechTranscriber.cs index 7a8ab527..c72aa3be 100644 --- a/src/Vapi.Net/Types/FallbackAzureSpeechTranscriber.cs +++ b/src/Vapi.Net/Types/FallbackAzureSpeechTranscriber.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Fallback configuration for transcribing speech with Azure Speech, including language and segmentation. +/// [Serializable] public record FallbackAzureSpeechTranscriber : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/FallbackAzureVoice.cs b/src/Vapi.Net/Types/FallbackAzureVoice.cs index 20bcb561..219c9f9c 100644 --- a/src/Vapi.Net/Types/FallbackAzureVoice.cs +++ b/src/Vapi.Net/Types/FallbackAzureVoice.cs @@ -5,6 +5,9 @@ namespace Vapi.Net; +/// +/// Fallback configuration for synthesizing assistant speech with Azure, including voice selection, speed, chunking, and caching. +/// [Serializable] public record FallbackAzureVoice : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/FallbackCartesiaTranscriber.cs b/src/Vapi.Net/Types/FallbackCartesiaTranscriber.cs index 2075f02f..be2ee9c9 100644 --- a/src/Vapi.Net/Types/FallbackCartesiaTranscriber.cs +++ b/src/Vapi.Net/Types/FallbackCartesiaTranscriber.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Fallback configuration for transcribing speech with Cartesia, including model and language. +/// [Serializable] public record FallbackCartesiaTranscriber : IJsonOnDeserialized { @@ -11,9 +14,15 @@ public record FallbackCartesiaTranscriber : IJsonOnDeserialized private readonly IDictionary _extensionData = new Dictionary(); + /// + /// The Cartesia speech-to-text model used for transcription. + /// [JsonPropertyName("model")] public FallbackCartesiaTranscriberModel? Model { get; set; } + /// + /// The language code used for transcription. + /// [JsonPropertyName("language")] public FallbackCartesiaTranscriberLanguage? Language { get; set; } diff --git a/src/Vapi.Net/Types/FallbackCartesiaTranscriberModel.cs b/src/Vapi.Net/Types/FallbackCartesiaTranscriberModel.cs index e007e685..49e5e08e 100644 --- a/src/Vapi.Net/Types/FallbackCartesiaTranscriberModel.cs +++ b/src/Vapi.Net/Types/FallbackCartesiaTranscriberModel.cs @@ -8,6 +8,9 @@ public enum FallbackCartesiaTranscriberModel { [EnumMember(Value = "ink-whisper")] InkWhisper, + + [EnumMember(Value = "ink-2")] + Ink2, } internal class FallbackCartesiaTranscriberModelSerializer @@ -16,12 +19,20 @@ internal class FallbackCartesiaTranscriberModelSerializer private static readonly global::System.Collections.Generic.Dictionary< string, FallbackCartesiaTranscriberModel - > _stringToEnum = new() { { "ink-whisper", FallbackCartesiaTranscriberModel.InkWhisper } }; + > _stringToEnum = new() + { + { "ink-whisper", FallbackCartesiaTranscriberModel.InkWhisper }, + { "ink-2", FallbackCartesiaTranscriberModel.Ink2 }, + }; private static readonly global::System.Collections.Generic.Dictionary< FallbackCartesiaTranscriberModel, string - > _enumToString = new() { { FallbackCartesiaTranscriberModel.InkWhisper, "ink-whisper" } }; + > _enumToString = new() + { + { FallbackCartesiaTranscriberModel.InkWhisper, "ink-whisper" }, + { FallbackCartesiaTranscriberModel.Ink2, "ink-2" }, + }; public override FallbackCartesiaTranscriberModel Read( ref global::System.Text.Json.Utf8JsonReader reader, diff --git a/src/Vapi.Net/Types/FallbackCartesiaVoice.cs b/src/Vapi.Net/Types/FallbackCartesiaVoice.cs index 1ddb3396..ccfa2f5e 100644 --- a/src/Vapi.Net/Types/FallbackCartesiaVoice.cs +++ b/src/Vapi.Net/Types/FallbackCartesiaVoice.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Fallback configuration for synthesizing assistant speech with Cartesia, including voice and model selection, language, generation controls, pronunciation dictionaries, chunking, and caching. +/// [Serializable] public record FallbackCartesiaVoice : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/FallbackCartesiaVoiceModel.cs b/src/Vapi.Net/Types/FallbackCartesiaVoiceModel.cs index f9434b70..f75723d7 100644 --- a/src/Vapi.Net/Types/FallbackCartesiaVoiceModel.cs +++ b/src/Vapi.Net/Types/FallbackCartesiaVoiceModel.cs @@ -6,6 +6,12 @@ namespace Vapi.Net; [JsonConverter(typeof(FallbackCartesiaVoiceModelSerializer))] public enum FallbackCartesiaVoiceModel { + [EnumMember(Value = "sonic-3.5")] + Sonic35, + + [EnumMember(Value = "sonic-3.5-2026-05-04")] + Sonic3520260504, + [EnumMember(Value = "sonic-3")] Sonic3, @@ -42,6 +48,8 @@ internal class FallbackCartesiaVoiceModelSerializer FallbackCartesiaVoiceModel > _stringToEnum = new() { + { "sonic-3.5", FallbackCartesiaVoiceModel.Sonic35 }, + { "sonic-3.5-2026-05-04", FallbackCartesiaVoiceModel.Sonic3520260504 }, { "sonic-3", FallbackCartesiaVoiceModel.Sonic3 }, { "sonic-3-2026-01-12", FallbackCartesiaVoiceModel.Sonic320260112 }, { "sonic-3-2025-10-27", FallbackCartesiaVoiceModel.Sonic320251027 }, @@ -58,6 +66,8 @@ internal class FallbackCartesiaVoiceModelSerializer string > _enumToString = new() { + { FallbackCartesiaVoiceModel.Sonic35, "sonic-3.5" }, + { FallbackCartesiaVoiceModel.Sonic3520260504, "sonic-3.5-2026-05-04" }, { FallbackCartesiaVoiceModel.Sonic3, "sonic-3" }, { FallbackCartesiaVoiceModel.Sonic320260112, "sonic-3-2026-01-12" }, { FallbackCartesiaVoiceModel.Sonic320251027, "sonic-3-2025-10-27" }, diff --git a/src/Vapi.Net/Types/FallbackCustomTranscriber.cs b/src/Vapi.Net/Types/FallbackCustomTranscriber.cs index 79777402..f7bd44c3 100644 --- a/src/Vapi.Net/Types/FallbackCustomTranscriber.cs +++ b/src/Vapi.Net/Types/FallbackCustomTranscriber.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Fallback configuration for sending conversation audio to a custom WebSocket transcription server. +/// [Serializable] public record FallbackCustomTranscriber : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/FallbackCustomVoice.cs b/src/Vapi.Net/Types/FallbackCustomVoice.cs index 171e983a..1a7cc4fc 100644 --- a/src/Vapi.Net/Types/FallbackCustomVoice.cs +++ b/src/Vapi.Net/Types/FallbackCustomVoice.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Fallback configuration for synthesizing assistant speech through a custom server, including voice selection, server connection, chunking, and caching. +/// [Serializable] public record FallbackCustomVoice : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/FallbackDeepgramTranscriber.cs b/src/Vapi.Net/Types/FallbackDeepgramTranscriber.cs index 8c9c74d9..d83dcf95 100644 --- a/src/Vapi.Net/Types/FallbackDeepgramTranscriber.cs +++ b/src/Vapi.Net/Types/FallbackDeepgramTranscriber.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Fallback configuration for transcribing speech with Deepgram, including model, language, formatting, endpointing, and vocabulary. +/// [Serializable] public record FallbackDeepgramTranscriber : IJsonOnDeserialized { @@ -55,6 +58,23 @@ public record FallbackDeepgramTranscriber : IJsonOnDeserialized [JsonPropertyName("profanityFilter")] public bool? ProfanityFilter { get; set; } + /// + /// Enables redaction of sensitive information from transcripts. + /// + /// Options include: + /// - "pci": Redacts credit card numbers, expiration dates, and CVV. + /// - "pii": Redacts personally identifiable information (names, locations, identifying numbers, etc.). + /// - "phi": Redacts protected health information (medical conditions, drugs, injuries, etc.). + /// - "numbers": Redacts numerical and identifying entities (dates, account numbers, SSNs, etc.). + /// + /// Multiple values can be provided to redact different categories simultaneously. + /// Redacted content is replaced with entity labels like [CREDIT_CARD_1], [SSN_1], etc. + /// + /// See https://developers.deepgram.com/docs/redaction for details. + /// + [JsonPropertyName("redaction")] + public IEnumerable? Redaction { get; set; } + /// /// Transcripts below this confidence threshold will be discarded. /// @@ -63,12 +83,6 @@ public record FallbackDeepgramTranscriber : IJsonOnDeserialized [JsonPropertyName("confidenceThreshold")] public double? ConfidenceThreshold { get; set; } - /// - /// Eager end-of-turn confidence required to fire a eager end-of-turn event. Setting a value here will enable EagerEndOfTurn and SpeechResumed events. It is disabled by default. Only used with Flux models. - /// - [JsonPropertyName("eagerEotThreshold")] - public double? EagerEotThreshold { get; set; } - /// /// End-of-turn confidence required to finish a turn. Only used with Flux models. /// @@ -85,6 +99,14 @@ public record FallbackDeepgramTranscriber : IJsonOnDeserialized [JsonPropertyName("eotTimeoutMs")] public double? EotTimeoutMs { get; set; } + /// + /// Language hints to bias Flux Multilingual (`flux-general-multi`) toward specific languages. + /// Provide BCP-47 language codes (e.g. "en", "es", "fr"). Multiple hints can be given for + /// multilingual or code-switching scenarios. Omit for auto-detection. Only used with `flux-general-multi`. + /// + [JsonPropertyName("languages")] + public IEnumerable? Languages { 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. /// diff --git a/src/Vapi.Net/Types/FallbackDeepgramTranscriberRedactionItem.cs b/src/Vapi.Net/Types/FallbackDeepgramTranscriberRedactionItem.cs new file mode 100644 index 00000000..b19ca396 --- /dev/null +++ b/src/Vapi.Net/Types/FallbackDeepgramTranscriberRedactionItem.cs @@ -0,0 +1,94 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(FallbackDeepgramTranscriberRedactionItemSerializer))] +public enum FallbackDeepgramTranscriberRedactionItem +{ + [EnumMember(Value = "pci")] + Pci, + + [EnumMember(Value = "pii")] + Pii, + + [EnumMember(Value = "phi")] + Phi, + + [EnumMember(Value = "numbers")] + Numbers, +} + +internal class FallbackDeepgramTranscriberRedactionItemSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + FallbackDeepgramTranscriberRedactionItem + > _stringToEnum = new() + { + { "pci", FallbackDeepgramTranscriberRedactionItem.Pci }, + { "pii", FallbackDeepgramTranscriberRedactionItem.Pii }, + { "phi", FallbackDeepgramTranscriberRedactionItem.Phi }, + { "numbers", FallbackDeepgramTranscriberRedactionItem.Numbers }, + }; + + private static readonly global::System.Collections.Generic.Dictionary< + FallbackDeepgramTranscriberRedactionItem, + string + > _enumToString = new() + { + { FallbackDeepgramTranscriberRedactionItem.Pci, "pci" }, + { FallbackDeepgramTranscriberRedactionItem.Pii, "pii" }, + { FallbackDeepgramTranscriberRedactionItem.Phi, "phi" }, + { FallbackDeepgramTranscriberRedactionItem.Numbers, "numbers" }, + }; + + public override FallbackDeepgramTranscriberRedactionItem Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + FallbackDeepgramTranscriberRedactionItem value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override FallbackDeepgramTranscriberRedactionItem ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + FallbackDeepgramTranscriberRedactionItem value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/FallbackDeepgramVoice.cs b/src/Vapi.Net/Types/FallbackDeepgramVoice.cs index 00966e12..004dde36 100644 --- a/src/Vapi.Net/Types/FallbackDeepgramVoice.cs +++ b/src/Vapi.Net/Types/FallbackDeepgramVoice.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Fallback configuration for synthesizing assistant speech with Deepgram, including voice and model selection, model-improvement preferences, chunking, and caching. +/// [Serializable] public record FallbackDeepgramVoice : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/FallbackDeepgramVoiceId.cs b/src/Vapi.Net/Types/FallbackDeepgramVoiceId.cs index eb50d0ed..6b8b237d 100644 --- a/src/Vapi.Net/Types/FallbackDeepgramVoiceId.cs +++ b/src/Vapi.Net/Types/FallbackDeepgramVoiceId.cs @@ -170,6 +170,27 @@ public enum FallbackDeepgramVoiceId [EnumMember(Value = "javier")] Javier, + + [EnumMember(Value = "viktoria")] + Viktoria, + + [EnumMember(Value = "kara")] + Kara, + + [EnumMember(Value = "fabian")] + Fabian, + + [EnumMember(Value = "julius")] + Julius, + + [EnumMember(Value = "lara")] + Lara, + + [EnumMember(Value = "elara")] + Elara, + + [EnumMember(Value = "aurelia")] + Aurelia, } internal class FallbackDeepgramVoiceIdSerializer @@ -235,6 +256,13 @@ internal class FallbackDeepgramVoiceIdSerializer { "aquila", FallbackDeepgramVoiceId.Aquila }, { "selena", FallbackDeepgramVoiceId.Selena }, { "javier", FallbackDeepgramVoiceId.Javier }, + { "viktoria", FallbackDeepgramVoiceId.Viktoria }, + { "kara", FallbackDeepgramVoiceId.Kara }, + { "fabian", FallbackDeepgramVoiceId.Fabian }, + { "julius", FallbackDeepgramVoiceId.Julius }, + { "lara", FallbackDeepgramVoiceId.Lara }, + { "elara", FallbackDeepgramVoiceId.Elara }, + { "aurelia", FallbackDeepgramVoiceId.Aurelia }, }; private static readonly global::System.Collections.Generic.Dictionary< @@ -297,6 +325,13 @@ internal class FallbackDeepgramVoiceIdSerializer { FallbackDeepgramVoiceId.Aquila, "aquila" }, { FallbackDeepgramVoiceId.Selena, "selena" }, { FallbackDeepgramVoiceId.Javier, "javier" }, + { FallbackDeepgramVoiceId.Viktoria, "viktoria" }, + { FallbackDeepgramVoiceId.Kara, "kara" }, + { FallbackDeepgramVoiceId.Fabian, "fabian" }, + { FallbackDeepgramVoiceId.Julius, "julius" }, + { FallbackDeepgramVoiceId.Lara, "lara" }, + { FallbackDeepgramVoiceId.Elara, "elara" }, + { FallbackDeepgramVoiceId.Aurelia, "aurelia" }, }; public override FallbackDeepgramVoiceId Read( diff --git a/src/Vapi.Net/Types/FallbackElevenLabsTranscriber.cs b/src/Vapi.Net/Types/FallbackElevenLabsTranscriber.cs index bfc7d0f8..0339c299 100644 --- a/src/Vapi.Net/Types/FallbackElevenLabsTranscriber.cs +++ b/src/Vapi.Net/Types/FallbackElevenLabsTranscriber.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Fallback configuration for transcribing speech with ElevenLabs, including model, language, and speech thresholds. +/// [Serializable] public record FallbackElevenLabsTranscriber : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/FallbackElevenLabsVoice.cs b/src/Vapi.Net/Types/FallbackElevenLabsVoice.cs index 0866658c..9c03ff83 100644 --- a/src/Vapi.Net/Types/FallbackElevenLabsVoice.cs +++ b/src/Vapi.Net/Types/FallbackElevenLabsVoice.cs @@ -5,6 +5,9 @@ namespace Vapi.Net; +/// +/// Fallback configuration for synthesizing assistant speech with ElevenLabs, including voice and model selection, language, voice tuning, streaming, Speech Synthesis Markup Language parsing, pronunciation dictionaries, chunking, and caching. +/// [Serializable] public record FallbackElevenLabsVoice : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/FallbackGladiaTranscriber.cs b/src/Vapi.Net/Types/FallbackGladiaTranscriber.cs index d8ca9044..d41a7bd3 100644 --- a/src/Vapi.Net/Types/FallbackGladiaTranscriber.cs +++ b/src/Vapi.Net/Types/FallbackGladiaTranscriber.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Fallback configuration for transcribing speech with Gladia, including language behavior, audio processing, endpointing, vocabulary, and region. +/// [Serializable] public record FallbackGladiaTranscriber : IJsonOnDeserialized { @@ -33,7 +36,7 @@ public record FallbackGladiaTranscriber : IJsonOnDeserialized /// Defines the languages to use for the transcription. Required when languageBehaviour is 'manual'. /// [JsonPropertyName("languages")] - public FallbackGladiaTranscriberLanguages? Languages { get; set; } + public IEnumerable? Languages { 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. diff --git a/src/Vapi.Net/Types/FallbackGladiaTranscriberLanguages.cs b/src/Vapi.Net/Types/FallbackGladiaTranscriberLanguages.cs deleted file mode 100644 index 04becc51..00000000 --- a/src/Vapi.Net/Types/FallbackGladiaTranscriberLanguages.cs +++ /dev/null @@ -1,569 +0,0 @@ -using global::System.Runtime.Serialization; -using global::System.Text.Json.Serialization; - -namespace Vapi.Net; - -[JsonConverter(typeof(FallbackGladiaTranscriberLanguagesSerializer))] -public enum FallbackGladiaTranscriberLanguages -{ - [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, -} - -internal class FallbackGladiaTranscriberLanguagesSerializer - : global::System.Text.Json.Serialization.JsonConverter -{ - private static readonly global::System.Collections.Generic.Dictionary< - string, - FallbackGladiaTranscriberLanguages - > _stringToEnum = new() - { - { "af", FallbackGladiaTranscriberLanguages.Af }, - { "sq", FallbackGladiaTranscriberLanguages.Sq }, - { "am", FallbackGladiaTranscriberLanguages.Am }, - { "ar", FallbackGladiaTranscriberLanguages.Ar }, - { "hy", FallbackGladiaTranscriberLanguages.Hy }, - { "as", FallbackGladiaTranscriberLanguages.As }, - { "az", FallbackGladiaTranscriberLanguages.Az }, - { "ba", FallbackGladiaTranscriberLanguages.Ba }, - { "eu", FallbackGladiaTranscriberLanguages.Eu }, - { "be", FallbackGladiaTranscriberLanguages.Be }, - { "bn", FallbackGladiaTranscriberLanguages.Bn }, - { "bs", FallbackGladiaTranscriberLanguages.Bs }, - { "br", FallbackGladiaTranscriberLanguages.Br }, - { "bg", FallbackGladiaTranscriberLanguages.Bg }, - { "ca", FallbackGladiaTranscriberLanguages.Ca }, - { "zh", FallbackGladiaTranscriberLanguages.Zh }, - { "hr", FallbackGladiaTranscriberLanguages.Hr }, - { "cs", FallbackGladiaTranscriberLanguages.Cs }, - { "da", FallbackGladiaTranscriberLanguages.Da }, - { "nl", FallbackGladiaTranscriberLanguages.Nl }, - { "en", FallbackGladiaTranscriberLanguages.En }, - { "et", FallbackGladiaTranscriberLanguages.Et }, - { "fo", FallbackGladiaTranscriberLanguages.Fo }, - { "fi", FallbackGladiaTranscriberLanguages.Fi }, - { "fr", FallbackGladiaTranscriberLanguages.Fr }, - { "gl", FallbackGladiaTranscriberLanguages.Gl }, - { "ka", FallbackGladiaTranscriberLanguages.Ka }, - { "de", FallbackGladiaTranscriberLanguages.De }, - { "el", FallbackGladiaTranscriberLanguages.El }, - { "gu", FallbackGladiaTranscriberLanguages.Gu }, - { "ht", FallbackGladiaTranscriberLanguages.Ht }, - { "ha", FallbackGladiaTranscriberLanguages.Ha }, - { "haw", FallbackGladiaTranscriberLanguages.Haw }, - { "he", FallbackGladiaTranscriberLanguages.He }, - { "hi", FallbackGladiaTranscriberLanguages.Hi }, - { "hu", FallbackGladiaTranscriberLanguages.Hu }, - { "is", FallbackGladiaTranscriberLanguages.Is }, - { "id", FallbackGladiaTranscriberLanguages.Id }, - { "it", FallbackGladiaTranscriberLanguages.It }, - { "ja", FallbackGladiaTranscriberLanguages.Ja }, - { "jv", FallbackGladiaTranscriberLanguages.Jv }, - { "kn", FallbackGladiaTranscriberLanguages.Kn }, - { "kk", FallbackGladiaTranscriberLanguages.Kk }, - { "km", FallbackGladiaTranscriberLanguages.Km }, - { "ko", FallbackGladiaTranscriberLanguages.Ko }, - { "lo", FallbackGladiaTranscriberLanguages.Lo }, - { "la", FallbackGladiaTranscriberLanguages.La }, - { "lv", FallbackGladiaTranscriberLanguages.Lv }, - { "ln", FallbackGladiaTranscriberLanguages.Ln }, - { "lt", FallbackGladiaTranscriberLanguages.Lt }, - { "lb", FallbackGladiaTranscriberLanguages.Lb }, - { "mk", FallbackGladiaTranscriberLanguages.Mk }, - { "mg", FallbackGladiaTranscriberLanguages.Mg }, - { "ms", FallbackGladiaTranscriberLanguages.Ms }, - { "ml", FallbackGladiaTranscriberLanguages.Ml }, - { "mt", FallbackGladiaTranscriberLanguages.Mt }, - { "mi", FallbackGladiaTranscriberLanguages.Mi }, - { "mr", FallbackGladiaTranscriberLanguages.Mr }, - { "mn", FallbackGladiaTranscriberLanguages.Mn }, - { "my", FallbackGladiaTranscriberLanguages.My }, - { "ne", FallbackGladiaTranscriberLanguages.Ne }, - { "no", FallbackGladiaTranscriberLanguages.No }, - { "nn", FallbackGladiaTranscriberLanguages.Nn }, - { "oc", FallbackGladiaTranscriberLanguages.Oc }, - { "ps", FallbackGladiaTranscriberLanguages.Ps }, - { "fa", FallbackGladiaTranscriberLanguages.Fa }, - { "pl", FallbackGladiaTranscriberLanguages.Pl }, - { "pt", FallbackGladiaTranscriberLanguages.Pt }, - { "pa", FallbackGladiaTranscriberLanguages.Pa }, - { "ro", FallbackGladiaTranscriberLanguages.Ro }, - { "ru", FallbackGladiaTranscriberLanguages.Ru }, - { "sa", FallbackGladiaTranscriberLanguages.Sa }, - { "sr", FallbackGladiaTranscriberLanguages.Sr }, - { "sn", FallbackGladiaTranscriberLanguages.Sn }, - { "sd", FallbackGladiaTranscriberLanguages.Sd }, - { "si", FallbackGladiaTranscriberLanguages.Si }, - { "sk", FallbackGladiaTranscriberLanguages.Sk }, - { "sl", FallbackGladiaTranscriberLanguages.Sl }, - { "so", FallbackGladiaTranscriberLanguages.So }, - { "es", FallbackGladiaTranscriberLanguages.Es }, - { "su", FallbackGladiaTranscriberLanguages.Su }, - { "sw", FallbackGladiaTranscriberLanguages.Sw }, - { "sv", FallbackGladiaTranscriberLanguages.Sv }, - { "tl", FallbackGladiaTranscriberLanguages.Tl }, - { "tg", FallbackGladiaTranscriberLanguages.Tg }, - { "ta", FallbackGladiaTranscriberLanguages.Ta }, - { "tt", FallbackGladiaTranscriberLanguages.Tt }, - { "te", FallbackGladiaTranscriberLanguages.Te }, - { "th", FallbackGladiaTranscriberLanguages.Th }, - { "bo", FallbackGladiaTranscriberLanguages.Bo }, - { "tr", FallbackGladiaTranscriberLanguages.Tr }, - { "tk", FallbackGladiaTranscriberLanguages.Tk }, - { "uk", FallbackGladiaTranscriberLanguages.Uk }, - { "ur", FallbackGladiaTranscriberLanguages.Ur }, - { "uz", FallbackGladiaTranscriberLanguages.Uz }, - { "vi", FallbackGladiaTranscriberLanguages.Vi }, - { "cy", FallbackGladiaTranscriberLanguages.Cy }, - { "yi", FallbackGladiaTranscriberLanguages.Yi }, - { "yo", FallbackGladiaTranscriberLanguages.Yo }, - }; - - private static readonly global::System.Collections.Generic.Dictionary< - FallbackGladiaTranscriberLanguages, - string - > _enumToString = new() - { - { FallbackGladiaTranscriberLanguages.Af, "af" }, - { FallbackGladiaTranscriberLanguages.Sq, "sq" }, - { FallbackGladiaTranscriberLanguages.Am, "am" }, - { FallbackGladiaTranscriberLanguages.Ar, "ar" }, - { FallbackGladiaTranscriberLanguages.Hy, "hy" }, - { FallbackGladiaTranscriberLanguages.As, "as" }, - { FallbackGladiaTranscriberLanguages.Az, "az" }, - { FallbackGladiaTranscriberLanguages.Ba, "ba" }, - { FallbackGladiaTranscriberLanguages.Eu, "eu" }, - { FallbackGladiaTranscriberLanguages.Be, "be" }, - { FallbackGladiaTranscriberLanguages.Bn, "bn" }, - { FallbackGladiaTranscriberLanguages.Bs, "bs" }, - { FallbackGladiaTranscriberLanguages.Br, "br" }, - { FallbackGladiaTranscriberLanguages.Bg, "bg" }, - { FallbackGladiaTranscriberLanguages.Ca, "ca" }, - { FallbackGladiaTranscriberLanguages.Zh, "zh" }, - { FallbackGladiaTranscriberLanguages.Hr, "hr" }, - { FallbackGladiaTranscriberLanguages.Cs, "cs" }, - { FallbackGladiaTranscriberLanguages.Da, "da" }, - { FallbackGladiaTranscriberLanguages.Nl, "nl" }, - { FallbackGladiaTranscriberLanguages.En, "en" }, - { FallbackGladiaTranscriberLanguages.Et, "et" }, - { FallbackGladiaTranscriberLanguages.Fo, "fo" }, - { FallbackGladiaTranscriberLanguages.Fi, "fi" }, - { FallbackGladiaTranscriberLanguages.Fr, "fr" }, - { FallbackGladiaTranscriberLanguages.Gl, "gl" }, - { FallbackGladiaTranscriberLanguages.Ka, "ka" }, - { FallbackGladiaTranscriberLanguages.De, "de" }, - { FallbackGladiaTranscriberLanguages.El, "el" }, - { FallbackGladiaTranscriberLanguages.Gu, "gu" }, - { FallbackGladiaTranscriberLanguages.Ht, "ht" }, - { FallbackGladiaTranscriberLanguages.Ha, "ha" }, - { FallbackGladiaTranscriberLanguages.Haw, "haw" }, - { FallbackGladiaTranscriberLanguages.He, "he" }, - { FallbackGladiaTranscriberLanguages.Hi, "hi" }, - { FallbackGladiaTranscriberLanguages.Hu, "hu" }, - { FallbackGladiaTranscriberLanguages.Is, "is" }, - { FallbackGladiaTranscriberLanguages.Id, "id" }, - { FallbackGladiaTranscriberLanguages.It, "it" }, - { FallbackGladiaTranscriberLanguages.Ja, "ja" }, - { FallbackGladiaTranscriberLanguages.Jv, "jv" }, - { FallbackGladiaTranscriberLanguages.Kn, "kn" }, - { FallbackGladiaTranscriberLanguages.Kk, "kk" }, - { FallbackGladiaTranscriberLanguages.Km, "km" }, - { FallbackGladiaTranscriberLanguages.Ko, "ko" }, - { FallbackGladiaTranscriberLanguages.Lo, "lo" }, - { FallbackGladiaTranscriberLanguages.La, "la" }, - { FallbackGladiaTranscriberLanguages.Lv, "lv" }, - { FallbackGladiaTranscriberLanguages.Ln, "ln" }, - { FallbackGladiaTranscriberLanguages.Lt, "lt" }, - { FallbackGladiaTranscriberLanguages.Lb, "lb" }, - { FallbackGladiaTranscriberLanguages.Mk, "mk" }, - { FallbackGladiaTranscriberLanguages.Mg, "mg" }, - { FallbackGladiaTranscriberLanguages.Ms, "ms" }, - { FallbackGladiaTranscriberLanguages.Ml, "ml" }, - { FallbackGladiaTranscriberLanguages.Mt, "mt" }, - { FallbackGladiaTranscriberLanguages.Mi, "mi" }, - { FallbackGladiaTranscriberLanguages.Mr, "mr" }, - { FallbackGladiaTranscriberLanguages.Mn, "mn" }, - { FallbackGladiaTranscriberLanguages.My, "my" }, - { FallbackGladiaTranscriberLanguages.Ne, "ne" }, - { FallbackGladiaTranscriberLanguages.No, "no" }, - { FallbackGladiaTranscriberLanguages.Nn, "nn" }, - { FallbackGladiaTranscriberLanguages.Oc, "oc" }, - { FallbackGladiaTranscriberLanguages.Ps, "ps" }, - { FallbackGladiaTranscriberLanguages.Fa, "fa" }, - { FallbackGladiaTranscriberLanguages.Pl, "pl" }, - { FallbackGladiaTranscriberLanguages.Pt, "pt" }, - { FallbackGladiaTranscriberLanguages.Pa, "pa" }, - { FallbackGladiaTranscriberLanguages.Ro, "ro" }, - { FallbackGladiaTranscriberLanguages.Ru, "ru" }, - { FallbackGladiaTranscriberLanguages.Sa, "sa" }, - { FallbackGladiaTranscriberLanguages.Sr, "sr" }, - { FallbackGladiaTranscriberLanguages.Sn, "sn" }, - { FallbackGladiaTranscriberLanguages.Sd, "sd" }, - { FallbackGladiaTranscriberLanguages.Si, "si" }, - { FallbackGladiaTranscriberLanguages.Sk, "sk" }, - { FallbackGladiaTranscriberLanguages.Sl, "sl" }, - { FallbackGladiaTranscriberLanguages.So, "so" }, - { FallbackGladiaTranscriberLanguages.Es, "es" }, - { FallbackGladiaTranscriberLanguages.Su, "su" }, - { FallbackGladiaTranscriberLanguages.Sw, "sw" }, - { FallbackGladiaTranscriberLanguages.Sv, "sv" }, - { FallbackGladiaTranscriberLanguages.Tl, "tl" }, - { FallbackGladiaTranscriberLanguages.Tg, "tg" }, - { FallbackGladiaTranscriberLanguages.Ta, "ta" }, - { FallbackGladiaTranscriberLanguages.Tt, "tt" }, - { FallbackGladiaTranscriberLanguages.Te, "te" }, - { FallbackGladiaTranscriberLanguages.Th, "th" }, - { FallbackGladiaTranscriberLanguages.Bo, "bo" }, - { FallbackGladiaTranscriberLanguages.Tr, "tr" }, - { FallbackGladiaTranscriberLanguages.Tk, "tk" }, - { FallbackGladiaTranscriberLanguages.Uk, "uk" }, - { FallbackGladiaTranscriberLanguages.Ur, "ur" }, - { FallbackGladiaTranscriberLanguages.Uz, "uz" }, - { FallbackGladiaTranscriberLanguages.Vi, "vi" }, - { FallbackGladiaTranscriberLanguages.Cy, "cy" }, - { FallbackGladiaTranscriberLanguages.Yi, "yi" }, - { FallbackGladiaTranscriberLanguages.Yo, "yo" }, - }; - - public override FallbackGladiaTranscriberLanguages Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options - ) - { - var stringValue = - reader.GetString() - ?? throw new global::System.Exception("The JSON value could not be read as a string."); - return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; - } - - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - FallbackGladiaTranscriberLanguages value, - global::System.Text.Json.JsonSerializerOptions options - ) - { - writer.WriteStringValue( - _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null - ); - } - - public override FallbackGladiaTranscriberLanguages ReadAsPropertyName( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options - ) - { - var stringValue = - reader.GetString() - ?? throw new global::System.Exception( - "The JSON property name could not be read as a string." - ); - return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; - } - - public override void WriteAsPropertyName( - global::System.Text.Json.Utf8JsonWriter writer, - FallbackGladiaTranscriberLanguages value, - global::System.Text.Json.JsonSerializerOptions options - ) - { - writer.WritePropertyName( - _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() - ); - } -} diff --git a/src/Vapi.Net/Types/FallbackGladiaTranscriberLanguagesItem.cs b/src/Vapi.Net/Types/FallbackGladiaTranscriberLanguagesItem.cs new file mode 100644 index 00000000..653b922f --- /dev/null +++ b/src/Vapi.Net/Types/FallbackGladiaTranscriberLanguagesItem.cs @@ -0,0 +1,569 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(FallbackGladiaTranscriberLanguagesItemSerializer))] +public enum FallbackGladiaTranscriberLanguagesItem +{ + [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, +} + +internal class FallbackGladiaTranscriberLanguagesItemSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + FallbackGladiaTranscriberLanguagesItem + > _stringToEnum = new() + { + { "af", FallbackGladiaTranscriberLanguagesItem.Af }, + { "sq", FallbackGladiaTranscriberLanguagesItem.Sq }, + { "am", FallbackGladiaTranscriberLanguagesItem.Am }, + { "ar", FallbackGladiaTranscriberLanguagesItem.Ar }, + { "hy", FallbackGladiaTranscriberLanguagesItem.Hy }, + { "as", FallbackGladiaTranscriberLanguagesItem.As }, + { "az", FallbackGladiaTranscriberLanguagesItem.Az }, + { "ba", FallbackGladiaTranscriberLanguagesItem.Ba }, + { "eu", FallbackGladiaTranscriberLanguagesItem.Eu }, + { "be", FallbackGladiaTranscriberLanguagesItem.Be }, + { "bn", FallbackGladiaTranscriberLanguagesItem.Bn }, + { "bs", FallbackGladiaTranscriberLanguagesItem.Bs }, + { "br", FallbackGladiaTranscriberLanguagesItem.Br }, + { "bg", FallbackGladiaTranscriberLanguagesItem.Bg }, + { "ca", FallbackGladiaTranscriberLanguagesItem.Ca }, + { "zh", FallbackGladiaTranscriberLanguagesItem.Zh }, + { "hr", FallbackGladiaTranscriberLanguagesItem.Hr }, + { "cs", FallbackGladiaTranscriberLanguagesItem.Cs }, + { "da", FallbackGladiaTranscriberLanguagesItem.Da }, + { "nl", FallbackGladiaTranscriberLanguagesItem.Nl }, + { "en", FallbackGladiaTranscriberLanguagesItem.En }, + { "et", FallbackGladiaTranscriberLanguagesItem.Et }, + { "fo", FallbackGladiaTranscriberLanguagesItem.Fo }, + { "fi", FallbackGladiaTranscriberLanguagesItem.Fi }, + { "fr", FallbackGladiaTranscriberLanguagesItem.Fr }, + { "gl", FallbackGladiaTranscriberLanguagesItem.Gl }, + { "ka", FallbackGladiaTranscriberLanguagesItem.Ka }, + { "de", FallbackGladiaTranscriberLanguagesItem.De }, + { "el", FallbackGladiaTranscriberLanguagesItem.El }, + { "gu", FallbackGladiaTranscriberLanguagesItem.Gu }, + { "ht", FallbackGladiaTranscriberLanguagesItem.Ht }, + { "ha", FallbackGladiaTranscriberLanguagesItem.Ha }, + { "haw", FallbackGladiaTranscriberLanguagesItem.Haw }, + { "he", FallbackGladiaTranscriberLanguagesItem.He }, + { "hi", FallbackGladiaTranscriberLanguagesItem.Hi }, + { "hu", FallbackGladiaTranscriberLanguagesItem.Hu }, + { "is", FallbackGladiaTranscriberLanguagesItem.Is }, + { "id", FallbackGladiaTranscriberLanguagesItem.Id }, + { "it", FallbackGladiaTranscriberLanguagesItem.It }, + { "ja", FallbackGladiaTranscriberLanguagesItem.Ja }, + { "jv", FallbackGladiaTranscriberLanguagesItem.Jv }, + { "kn", FallbackGladiaTranscriberLanguagesItem.Kn }, + { "kk", FallbackGladiaTranscriberLanguagesItem.Kk }, + { "km", FallbackGladiaTranscriberLanguagesItem.Km }, + { "ko", FallbackGladiaTranscriberLanguagesItem.Ko }, + { "lo", FallbackGladiaTranscriberLanguagesItem.Lo }, + { "la", FallbackGladiaTranscriberLanguagesItem.La }, + { "lv", FallbackGladiaTranscriberLanguagesItem.Lv }, + { "ln", FallbackGladiaTranscriberLanguagesItem.Ln }, + { "lt", FallbackGladiaTranscriberLanguagesItem.Lt }, + { "lb", FallbackGladiaTranscriberLanguagesItem.Lb }, + { "mk", FallbackGladiaTranscriberLanguagesItem.Mk }, + { "mg", FallbackGladiaTranscriberLanguagesItem.Mg }, + { "ms", FallbackGladiaTranscriberLanguagesItem.Ms }, + { "ml", FallbackGladiaTranscriberLanguagesItem.Ml }, + { "mt", FallbackGladiaTranscriberLanguagesItem.Mt }, + { "mi", FallbackGladiaTranscriberLanguagesItem.Mi }, + { "mr", FallbackGladiaTranscriberLanguagesItem.Mr }, + { "mn", FallbackGladiaTranscriberLanguagesItem.Mn }, + { "my", FallbackGladiaTranscriberLanguagesItem.My }, + { "ne", FallbackGladiaTranscriberLanguagesItem.Ne }, + { "no", FallbackGladiaTranscriberLanguagesItem.No }, + { "nn", FallbackGladiaTranscriberLanguagesItem.Nn }, + { "oc", FallbackGladiaTranscriberLanguagesItem.Oc }, + { "ps", FallbackGladiaTranscriberLanguagesItem.Ps }, + { "fa", FallbackGladiaTranscriberLanguagesItem.Fa }, + { "pl", FallbackGladiaTranscriberLanguagesItem.Pl }, + { "pt", FallbackGladiaTranscriberLanguagesItem.Pt }, + { "pa", FallbackGladiaTranscriberLanguagesItem.Pa }, + { "ro", FallbackGladiaTranscriberLanguagesItem.Ro }, + { "ru", FallbackGladiaTranscriberLanguagesItem.Ru }, + { "sa", FallbackGladiaTranscriberLanguagesItem.Sa }, + { "sr", FallbackGladiaTranscriberLanguagesItem.Sr }, + { "sn", FallbackGladiaTranscriberLanguagesItem.Sn }, + { "sd", FallbackGladiaTranscriberLanguagesItem.Sd }, + { "si", FallbackGladiaTranscriberLanguagesItem.Si }, + { "sk", FallbackGladiaTranscriberLanguagesItem.Sk }, + { "sl", FallbackGladiaTranscriberLanguagesItem.Sl }, + { "so", FallbackGladiaTranscriberLanguagesItem.So }, + { "es", FallbackGladiaTranscriberLanguagesItem.Es }, + { "su", FallbackGladiaTranscriberLanguagesItem.Su }, + { "sw", FallbackGladiaTranscriberLanguagesItem.Sw }, + { "sv", FallbackGladiaTranscriberLanguagesItem.Sv }, + { "tl", FallbackGladiaTranscriberLanguagesItem.Tl }, + { "tg", FallbackGladiaTranscriberLanguagesItem.Tg }, + { "ta", FallbackGladiaTranscriberLanguagesItem.Ta }, + { "tt", FallbackGladiaTranscriberLanguagesItem.Tt }, + { "te", FallbackGladiaTranscriberLanguagesItem.Te }, + { "th", FallbackGladiaTranscriberLanguagesItem.Th }, + { "bo", FallbackGladiaTranscriberLanguagesItem.Bo }, + { "tr", FallbackGladiaTranscriberLanguagesItem.Tr }, + { "tk", FallbackGladiaTranscriberLanguagesItem.Tk }, + { "uk", FallbackGladiaTranscriberLanguagesItem.Uk }, + { "ur", FallbackGladiaTranscriberLanguagesItem.Ur }, + { "uz", FallbackGladiaTranscriberLanguagesItem.Uz }, + { "vi", FallbackGladiaTranscriberLanguagesItem.Vi }, + { "cy", FallbackGladiaTranscriberLanguagesItem.Cy }, + { "yi", FallbackGladiaTranscriberLanguagesItem.Yi }, + { "yo", FallbackGladiaTranscriberLanguagesItem.Yo }, + }; + + private static readonly global::System.Collections.Generic.Dictionary< + FallbackGladiaTranscriberLanguagesItem, + string + > _enumToString = new() + { + { FallbackGladiaTranscriberLanguagesItem.Af, "af" }, + { FallbackGladiaTranscriberLanguagesItem.Sq, "sq" }, + { FallbackGladiaTranscriberLanguagesItem.Am, "am" }, + { FallbackGladiaTranscriberLanguagesItem.Ar, "ar" }, + { FallbackGladiaTranscriberLanguagesItem.Hy, "hy" }, + { FallbackGladiaTranscriberLanguagesItem.As, "as" }, + { FallbackGladiaTranscriberLanguagesItem.Az, "az" }, + { FallbackGladiaTranscriberLanguagesItem.Ba, "ba" }, + { FallbackGladiaTranscriberLanguagesItem.Eu, "eu" }, + { FallbackGladiaTranscriberLanguagesItem.Be, "be" }, + { FallbackGladiaTranscriberLanguagesItem.Bn, "bn" }, + { FallbackGladiaTranscriberLanguagesItem.Bs, "bs" }, + { FallbackGladiaTranscriberLanguagesItem.Br, "br" }, + { FallbackGladiaTranscriberLanguagesItem.Bg, "bg" }, + { FallbackGladiaTranscriberLanguagesItem.Ca, "ca" }, + { FallbackGladiaTranscriberLanguagesItem.Zh, "zh" }, + { FallbackGladiaTranscriberLanguagesItem.Hr, "hr" }, + { FallbackGladiaTranscriberLanguagesItem.Cs, "cs" }, + { FallbackGladiaTranscriberLanguagesItem.Da, "da" }, + { FallbackGladiaTranscriberLanguagesItem.Nl, "nl" }, + { FallbackGladiaTranscriberLanguagesItem.En, "en" }, + { FallbackGladiaTranscriberLanguagesItem.Et, "et" }, + { FallbackGladiaTranscriberLanguagesItem.Fo, "fo" }, + { FallbackGladiaTranscriberLanguagesItem.Fi, "fi" }, + { FallbackGladiaTranscriberLanguagesItem.Fr, "fr" }, + { FallbackGladiaTranscriberLanguagesItem.Gl, "gl" }, + { FallbackGladiaTranscriberLanguagesItem.Ka, "ka" }, + { FallbackGladiaTranscriberLanguagesItem.De, "de" }, + { FallbackGladiaTranscriberLanguagesItem.El, "el" }, + { FallbackGladiaTranscriberLanguagesItem.Gu, "gu" }, + { FallbackGladiaTranscriberLanguagesItem.Ht, "ht" }, + { FallbackGladiaTranscriberLanguagesItem.Ha, "ha" }, + { FallbackGladiaTranscriberLanguagesItem.Haw, "haw" }, + { FallbackGladiaTranscriberLanguagesItem.He, "he" }, + { FallbackGladiaTranscriberLanguagesItem.Hi, "hi" }, + { FallbackGladiaTranscriberLanguagesItem.Hu, "hu" }, + { FallbackGladiaTranscriberLanguagesItem.Is, "is" }, + { FallbackGladiaTranscriberLanguagesItem.Id, "id" }, + { FallbackGladiaTranscriberLanguagesItem.It, "it" }, + { FallbackGladiaTranscriberLanguagesItem.Ja, "ja" }, + { FallbackGladiaTranscriberLanguagesItem.Jv, "jv" }, + { FallbackGladiaTranscriberLanguagesItem.Kn, "kn" }, + { FallbackGladiaTranscriberLanguagesItem.Kk, "kk" }, + { FallbackGladiaTranscriberLanguagesItem.Km, "km" }, + { FallbackGladiaTranscriberLanguagesItem.Ko, "ko" }, + { FallbackGladiaTranscriberLanguagesItem.Lo, "lo" }, + { FallbackGladiaTranscriberLanguagesItem.La, "la" }, + { FallbackGladiaTranscriberLanguagesItem.Lv, "lv" }, + { FallbackGladiaTranscriberLanguagesItem.Ln, "ln" }, + { FallbackGladiaTranscriberLanguagesItem.Lt, "lt" }, + { FallbackGladiaTranscriberLanguagesItem.Lb, "lb" }, + { FallbackGladiaTranscriberLanguagesItem.Mk, "mk" }, + { FallbackGladiaTranscriberLanguagesItem.Mg, "mg" }, + { FallbackGladiaTranscriberLanguagesItem.Ms, "ms" }, + { FallbackGladiaTranscriberLanguagesItem.Ml, "ml" }, + { FallbackGladiaTranscriberLanguagesItem.Mt, "mt" }, + { FallbackGladiaTranscriberLanguagesItem.Mi, "mi" }, + { FallbackGladiaTranscriberLanguagesItem.Mr, "mr" }, + { FallbackGladiaTranscriberLanguagesItem.Mn, "mn" }, + { FallbackGladiaTranscriberLanguagesItem.My, "my" }, + { FallbackGladiaTranscriberLanguagesItem.Ne, "ne" }, + { FallbackGladiaTranscriberLanguagesItem.No, "no" }, + { FallbackGladiaTranscriberLanguagesItem.Nn, "nn" }, + { FallbackGladiaTranscriberLanguagesItem.Oc, "oc" }, + { FallbackGladiaTranscriberLanguagesItem.Ps, "ps" }, + { FallbackGladiaTranscriberLanguagesItem.Fa, "fa" }, + { FallbackGladiaTranscriberLanguagesItem.Pl, "pl" }, + { FallbackGladiaTranscriberLanguagesItem.Pt, "pt" }, + { FallbackGladiaTranscriberLanguagesItem.Pa, "pa" }, + { FallbackGladiaTranscriberLanguagesItem.Ro, "ro" }, + { FallbackGladiaTranscriberLanguagesItem.Ru, "ru" }, + { FallbackGladiaTranscriberLanguagesItem.Sa, "sa" }, + { FallbackGladiaTranscriberLanguagesItem.Sr, "sr" }, + { FallbackGladiaTranscriberLanguagesItem.Sn, "sn" }, + { FallbackGladiaTranscriberLanguagesItem.Sd, "sd" }, + { FallbackGladiaTranscriberLanguagesItem.Si, "si" }, + { FallbackGladiaTranscriberLanguagesItem.Sk, "sk" }, + { FallbackGladiaTranscriberLanguagesItem.Sl, "sl" }, + { FallbackGladiaTranscriberLanguagesItem.So, "so" }, + { FallbackGladiaTranscriberLanguagesItem.Es, "es" }, + { FallbackGladiaTranscriberLanguagesItem.Su, "su" }, + { FallbackGladiaTranscriberLanguagesItem.Sw, "sw" }, + { FallbackGladiaTranscriberLanguagesItem.Sv, "sv" }, + { FallbackGladiaTranscriberLanguagesItem.Tl, "tl" }, + { FallbackGladiaTranscriberLanguagesItem.Tg, "tg" }, + { FallbackGladiaTranscriberLanguagesItem.Ta, "ta" }, + { FallbackGladiaTranscriberLanguagesItem.Tt, "tt" }, + { FallbackGladiaTranscriberLanguagesItem.Te, "te" }, + { FallbackGladiaTranscriberLanguagesItem.Th, "th" }, + { FallbackGladiaTranscriberLanguagesItem.Bo, "bo" }, + { FallbackGladiaTranscriberLanguagesItem.Tr, "tr" }, + { FallbackGladiaTranscriberLanguagesItem.Tk, "tk" }, + { FallbackGladiaTranscriberLanguagesItem.Uk, "uk" }, + { FallbackGladiaTranscriberLanguagesItem.Ur, "ur" }, + { FallbackGladiaTranscriberLanguagesItem.Uz, "uz" }, + { FallbackGladiaTranscriberLanguagesItem.Vi, "vi" }, + { FallbackGladiaTranscriberLanguagesItem.Cy, "cy" }, + { FallbackGladiaTranscriberLanguagesItem.Yi, "yi" }, + { FallbackGladiaTranscriberLanguagesItem.Yo, "yo" }, + }; + + public override FallbackGladiaTranscriberLanguagesItem Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + FallbackGladiaTranscriberLanguagesItem value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override FallbackGladiaTranscriberLanguagesItem ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + FallbackGladiaTranscriberLanguagesItem value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/FallbackGoogleTranscriber.cs b/src/Vapi.Net/Types/FallbackGoogleTranscriber.cs index ea2fba7e..754220c4 100644 --- a/src/Vapi.Net/Types/FallbackGoogleTranscriber.cs +++ b/src/Vapi.Net/Types/FallbackGoogleTranscriber.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Fallback configuration for transcribing speech with Google, including model and language. +/// [Serializable] public record FallbackGoogleTranscriber : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/FallbackGoogleTranscriberModel.cs b/src/Vapi.Net/Types/FallbackGoogleTranscriberModel.cs index a067ba0b..8fdaea2d 100644 --- a/src/Vapi.Net/Types/FallbackGoogleTranscriberModel.cs +++ b/src/Vapi.Net/Types/FallbackGoogleTranscriberModel.cs @@ -6,6 +6,12 @@ namespace Vapi.Net; [JsonConverter(typeof(FallbackGoogleTranscriberModelSerializer))] public enum FallbackGoogleTranscriberModel { + [EnumMember(Value = "gemini-3.5-flash")] + Gemini35Flash, + + [EnumMember(Value = "gemini-3.1-flash-lite")] + Gemini31FlashLite, + [EnumMember(Value = "gemini-3-flash-preview")] Gemini3FlashPreview, @@ -60,6 +66,8 @@ internal class FallbackGoogleTranscriberModelSerializer FallbackGoogleTranscriberModel > _stringToEnum = new() { + { "gemini-3.5-flash", FallbackGoogleTranscriberModel.Gemini35Flash }, + { "gemini-3.1-flash-lite", FallbackGoogleTranscriberModel.Gemini31FlashLite }, { "gemini-3-flash-preview", FallbackGoogleTranscriberModel.Gemini3FlashPreview }, { "gemini-2.5-pro", FallbackGoogleTranscriberModel.Gemini25Pro }, { "gemini-2.5-flash", FallbackGoogleTranscriberModel.Gemini25Flash }, @@ -88,6 +96,8 @@ internal class FallbackGoogleTranscriberModelSerializer string > _enumToString = new() { + { FallbackGoogleTranscriberModel.Gemini35Flash, "gemini-3.5-flash" }, + { FallbackGoogleTranscriberModel.Gemini31FlashLite, "gemini-3.1-flash-lite" }, { FallbackGoogleTranscriberModel.Gemini3FlashPreview, "gemini-3-flash-preview" }, { FallbackGoogleTranscriberModel.Gemini25Pro, "gemini-2.5-pro" }, { FallbackGoogleTranscriberModel.Gemini25Flash, "gemini-2.5-flash" }, diff --git a/src/Vapi.Net/Types/FallbackHumeVoice.cs b/src/Vapi.Net/Types/FallbackHumeVoice.cs index 2d96a97c..0c92974e 100644 --- a/src/Vapi.Net/Types/FallbackHumeVoice.cs +++ b/src/Vapi.Net/Types/FallbackHumeVoice.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Fallback configuration for synthesizing assistant speech with Hume, including model and voice selection, custom voice metadata, chunking, and caching. +/// [Serializable] public record FallbackHumeVoice : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/FallbackInworldVoice.cs b/src/Vapi.Net/Types/FallbackInworldVoice.cs index 22d8c149..c28bc840 100644 --- a/src/Vapi.Net/Types/FallbackInworldVoice.cs +++ b/src/Vapi.Net/Types/FallbackInworldVoice.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Fallback configuration for synthesizing assistant speech with Inworld, including voice and model selection, language, temperature, speaking rate, chunking, and caching. +/// [Serializable] public record FallbackInworldVoice : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/FallbackLmntVoice.cs b/src/Vapi.Net/Types/FallbackLmntVoice.cs index 4bb9a87d..1c234d9f 100644 --- a/src/Vapi.Net/Types/FallbackLmntVoice.cs +++ b/src/Vapi.Net/Types/FallbackLmntVoice.cs @@ -5,6 +5,9 @@ namespace Vapi.Net; +/// +/// Fallback configuration for synthesizing assistant speech with LMNT, including voice selection, language, speed, chunking, and caching. +/// [Serializable] public record FallbackLmntVoice : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/FallbackMicrosoftVoice.cs b/src/Vapi.Net/Types/FallbackMicrosoftVoice.cs new file mode 100644 index 00000000..cda52bf8 --- /dev/null +++ b/src/Vapi.Net/Types/FallbackMicrosoftVoice.cs @@ -0,0 +1,67 @@ +using global::System.Text.Json; +using global::System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[Serializable] +public record FallbackMicrosoftVoice : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + /// + /// This is the flag to toggle voice caching for the assistant. + /// + [JsonPropertyName("cachingEnabled")] + public bool? CachingEnabled { get; set; } + + /// + /// MAI-Voice-2 voice ID. Built-in voices listed in enum. + /// + [JsonPropertyName("voiceId")] + public required FallbackMicrosoftVoiceVoiceId VoiceId { get; set; } + + /// + /// Speaking style applied via mstts:express-as on every request. Unknown styles are ignored by Azure and fall back to neutral. + /// + [JsonPropertyName("style")] + public FallbackMicrosoftVoiceStyle? Style { get; set; } + + /// + /// Style intensity (0.01–2). Default 1 = the predefined style strength. Only applies when `style` is set. + /// + [JsonPropertyName("styleDegree")] + public double? StyleDegree { get; set; } + + /// + /// Role-play (age/gender imitation). Requires `style` to be set; ignored otherwise. + /// + [JsonPropertyName("role")] + public FallbackMicrosoftVoiceRole? Role { get; set; } + + /// + /// 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; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/FallbackMicrosoftVoiceRole.cs b/src/Vapi.Net/Types/FallbackMicrosoftVoiceRole.cs new file mode 100644 index 00000000..e5999d54 --- /dev/null +++ b/src/Vapi.Net/Types/FallbackMicrosoftVoiceRole.cs @@ -0,0 +1,114 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(FallbackMicrosoftVoiceRoleSerializer))] +public enum FallbackMicrosoftVoiceRole +{ + [EnumMember(Value = "Girl")] + Girl, + + [EnumMember(Value = "Boy")] + Boy, + + [EnumMember(Value = "YoungAdultFemale")] + YoungAdultFemale, + + [EnumMember(Value = "YoungAdultMale")] + YoungAdultMale, + + [EnumMember(Value = "OlderAdultFemale")] + OlderAdultFemale, + + [EnumMember(Value = "OlderAdultMale")] + OlderAdultMale, + + [EnumMember(Value = "SeniorFemale")] + SeniorFemale, + + [EnumMember(Value = "SeniorMale")] + SeniorMale, +} + +internal class FallbackMicrosoftVoiceRoleSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + FallbackMicrosoftVoiceRole + > _stringToEnum = new() + { + { "Girl", FallbackMicrosoftVoiceRole.Girl }, + { "Boy", FallbackMicrosoftVoiceRole.Boy }, + { "YoungAdultFemale", FallbackMicrosoftVoiceRole.YoungAdultFemale }, + { "YoungAdultMale", FallbackMicrosoftVoiceRole.YoungAdultMale }, + { "OlderAdultFemale", FallbackMicrosoftVoiceRole.OlderAdultFemale }, + { "OlderAdultMale", FallbackMicrosoftVoiceRole.OlderAdultMale }, + { "SeniorFemale", FallbackMicrosoftVoiceRole.SeniorFemale }, + { "SeniorMale", FallbackMicrosoftVoiceRole.SeniorMale }, + }; + + private static readonly global::System.Collections.Generic.Dictionary< + FallbackMicrosoftVoiceRole, + string + > _enumToString = new() + { + { FallbackMicrosoftVoiceRole.Girl, "Girl" }, + { FallbackMicrosoftVoiceRole.Boy, "Boy" }, + { FallbackMicrosoftVoiceRole.YoungAdultFemale, "YoungAdultFemale" }, + { FallbackMicrosoftVoiceRole.YoungAdultMale, "YoungAdultMale" }, + { FallbackMicrosoftVoiceRole.OlderAdultFemale, "OlderAdultFemale" }, + { FallbackMicrosoftVoiceRole.OlderAdultMale, "OlderAdultMale" }, + { FallbackMicrosoftVoiceRole.SeniorFemale, "SeniorFemale" }, + { FallbackMicrosoftVoiceRole.SeniorMale, "SeniorMale" }, + }; + + public override FallbackMicrosoftVoiceRole Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + FallbackMicrosoftVoiceRole value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override FallbackMicrosoftVoiceRole ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + FallbackMicrosoftVoiceRole value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/FallbackMicrosoftVoiceStyle.cs b/src/Vapi.Net/Types/FallbackMicrosoftVoiceStyle.cs new file mode 100644 index 00000000..cde3733e --- /dev/null +++ b/src/Vapi.Net/Types/FallbackMicrosoftVoiceStyle.cs @@ -0,0 +1,219 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(FallbackMicrosoftVoiceStyleSerializer))] +public enum FallbackMicrosoftVoiceStyle +{ + [EnumMember(Value = "adventurous")] + Adventurous, + + [EnumMember(Value = "angry")] + Angry, + + [EnumMember(Value = "caring")] + Caring, + + [EnumMember(Value = "cheerful")] + Cheerful, + + [EnumMember(Value = "confused")] + Confused, + + [EnumMember(Value = "curious")] + Curious, + + [EnumMember(Value = "determined")] + Determined, + + [EnumMember(Value = "disappointed")] + Disappointed, + + [EnumMember(Value = "disgusted")] + Disgusted, + + [EnumMember(Value = "embarrassed")] + Embarrassed, + + [EnumMember(Value = "empathy")] + Empathy, + + [EnumMember(Value = "encouraging")] + Encouraging, + + [EnumMember(Value = "excited")] + Excited, + + [EnumMember(Value = "fearful")] + Fearful, + + [EnumMember(Value = "friendly")] + Friendly, + + [EnumMember(Value = "happy")] + Happy, + + [EnumMember(Value = "hopeful")] + Hopeful, + + [EnumMember(Value = "jealous")] + Jealous, + + [EnumMember(Value = "joyful")] + Joyful, + + [EnumMember(Value = "nostalgic")] + Nostalgic, + + [EnumMember(Value = "reflective")] + Reflective, + + [EnumMember(Value = "regretful")] + Regretful, + + [EnumMember(Value = "relieved")] + Relieved, + + [EnumMember(Value = "sad")] + Sad, + + [EnumMember(Value = "serious")] + Serious, + + [EnumMember(Value = "shouting")] + Shouting, + + [EnumMember(Value = "softvoice")] + Softvoice, + + [EnumMember(Value = "surprised")] + Surprised, + + [EnumMember(Value = "whispering")] + Whispering, +} + +internal class FallbackMicrosoftVoiceStyleSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + FallbackMicrosoftVoiceStyle + > _stringToEnum = new() + { + { "adventurous", FallbackMicrosoftVoiceStyle.Adventurous }, + { "angry", FallbackMicrosoftVoiceStyle.Angry }, + { "caring", FallbackMicrosoftVoiceStyle.Caring }, + { "cheerful", FallbackMicrosoftVoiceStyle.Cheerful }, + { "confused", FallbackMicrosoftVoiceStyle.Confused }, + { "curious", FallbackMicrosoftVoiceStyle.Curious }, + { "determined", FallbackMicrosoftVoiceStyle.Determined }, + { "disappointed", FallbackMicrosoftVoiceStyle.Disappointed }, + { "disgusted", FallbackMicrosoftVoiceStyle.Disgusted }, + { "embarrassed", FallbackMicrosoftVoiceStyle.Embarrassed }, + { "empathy", FallbackMicrosoftVoiceStyle.Empathy }, + { "encouraging", FallbackMicrosoftVoiceStyle.Encouraging }, + { "excited", FallbackMicrosoftVoiceStyle.Excited }, + { "fearful", FallbackMicrosoftVoiceStyle.Fearful }, + { "friendly", FallbackMicrosoftVoiceStyle.Friendly }, + { "happy", FallbackMicrosoftVoiceStyle.Happy }, + { "hopeful", FallbackMicrosoftVoiceStyle.Hopeful }, + { "jealous", FallbackMicrosoftVoiceStyle.Jealous }, + { "joyful", FallbackMicrosoftVoiceStyle.Joyful }, + { "nostalgic", FallbackMicrosoftVoiceStyle.Nostalgic }, + { "reflective", FallbackMicrosoftVoiceStyle.Reflective }, + { "regretful", FallbackMicrosoftVoiceStyle.Regretful }, + { "relieved", FallbackMicrosoftVoiceStyle.Relieved }, + { "sad", FallbackMicrosoftVoiceStyle.Sad }, + { "serious", FallbackMicrosoftVoiceStyle.Serious }, + { "shouting", FallbackMicrosoftVoiceStyle.Shouting }, + { "softvoice", FallbackMicrosoftVoiceStyle.Softvoice }, + { "surprised", FallbackMicrosoftVoiceStyle.Surprised }, + { "whispering", FallbackMicrosoftVoiceStyle.Whispering }, + }; + + private static readonly global::System.Collections.Generic.Dictionary< + FallbackMicrosoftVoiceStyle, + string + > _enumToString = new() + { + { FallbackMicrosoftVoiceStyle.Adventurous, "adventurous" }, + { FallbackMicrosoftVoiceStyle.Angry, "angry" }, + { FallbackMicrosoftVoiceStyle.Caring, "caring" }, + { FallbackMicrosoftVoiceStyle.Cheerful, "cheerful" }, + { FallbackMicrosoftVoiceStyle.Confused, "confused" }, + { FallbackMicrosoftVoiceStyle.Curious, "curious" }, + { FallbackMicrosoftVoiceStyle.Determined, "determined" }, + { FallbackMicrosoftVoiceStyle.Disappointed, "disappointed" }, + { FallbackMicrosoftVoiceStyle.Disgusted, "disgusted" }, + { FallbackMicrosoftVoiceStyle.Embarrassed, "embarrassed" }, + { FallbackMicrosoftVoiceStyle.Empathy, "empathy" }, + { FallbackMicrosoftVoiceStyle.Encouraging, "encouraging" }, + { FallbackMicrosoftVoiceStyle.Excited, "excited" }, + { FallbackMicrosoftVoiceStyle.Fearful, "fearful" }, + { FallbackMicrosoftVoiceStyle.Friendly, "friendly" }, + { FallbackMicrosoftVoiceStyle.Happy, "happy" }, + { FallbackMicrosoftVoiceStyle.Hopeful, "hopeful" }, + { FallbackMicrosoftVoiceStyle.Jealous, "jealous" }, + { FallbackMicrosoftVoiceStyle.Joyful, "joyful" }, + { FallbackMicrosoftVoiceStyle.Nostalgic, "nostalgic" }, + { FallbackMicrosoftVoiceStyle.Reflective, "reflective" }, + { FallbackMicrosoftVoiceStyle.Regretful, "regretful" }, + { FallbackMicrosoftVoiceStyle.Relieved, "relieved" }, + { FallbackMicrosoftVoiceStyle.Sad, "sad" }, + { FallbackMicrosoftVoiceStyle.Serious, "serious" }, + { FallbackMicrosoftVoiceStyle.Shouting, "shouting" }, + { FallbackMicrosoftVoiceStyle.Softvoice, "softvoice" }, + { FallbackMicrosoftVoiceStyle.Surprised, "surprised" }, + { FallbackMicrosoftVoiceStyle.Whispering, "whispering" }, + }; + + public override FallbackMicrosoftVoiceStyle Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + FallbackMicrosoftVoiceStyle value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override FallbackMicrosoftVoiceStyle ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + FallbackMicrosoftVoiceStyle value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/FallbackMicrosoftVoiceVoiceId.cs b/src/Vapi.Net/Types/FallbackMicrosoftVoiceVoiceId.cs new file mode 100644 index 00000000..1b54e391 --- /dev/null +++ b/src/Vapi.Net/Types/FallbackMicrosoftVoiceVoiceId.cs @@ -0,0 +1,304 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(FallbackMicrosoftVoiceVoiceIdSerializer))] +public enum FallbackMicrosoftVoiceVoiceId +{ + [EnumMember(Value = "de-DE-Klaus:MAI-Voice-2")] + DeDeKlausMaiVoice2, + + [EnumMember(Value = "de-DE-Mia:MAI-Voice-2")] + DeDeMiaMaiVoice2, + + [EnumMember(Value = "en-AU-Lisa:MAI-Voice-2")] + EnAuLisaMaiVoice2, + + [EnumMember(Value = "en-US-Ethan:MAI-Voice-2")] + EnUsEthanMaiVoice2, + + [EnumMember(Value = "en-US-Grant:MAI-Voice-2")] + EnUsGrantMaiVoice2, + + [EnumMember(Value = "en-US-Harper:MAI-Voice-2")] + EnUsHarperMaiVoice2, + + [EnumMember(Value = "en-US-Iris:MAI-Voice-2")] + EnUsIrisMaiVoice2, + + [EnumMember(Value = "en-US-Jasper:MAI-Voice-2")] + EnUsJasperMaiVoice2, + + [EnumMember(Value = "en-US-Olivia:MAI-Voice-2")] + EnUsOliviaMaiVoice2, + + [EnumMember(Value = "es-ES-Marta:MAI-Voice-2")] + EsEsMartaMaiVoice2, + + [EnumMember(Value = "es-MX-Alejo:MAI-Voice-2")] + EsMxAlejoMaiVoice2, + + [EnumMember(Value = "es-MX-Valeria:MAI-Voice-2")] + EsMxValeriaMaiVoice2, + + [EnumMember(Value = "fr-FR-Marc:MAI-Voice-2")] + FrFrMarcMaiVoice2, + + [EnumMember(Value = "fr-FR-Soleil:MAI-Voice-2")] + FrFrSoleilMaiVoice2, + + [EnumMember(Value = "hi-IN-Arjun:MAI-Voice-2")] + HiInArjunMaiVoice2, + + [EnumMember(Value = "hi-IN-Dhruv:MAI-Voice-2")] + HiInDhruvMaiVoice2, + + [EnumMember(Value = "hi-IN-Kavya:MAI-Voice-2")] + HiInKavyaMaiVoice2, + + [EnumMember(Value = "hi-IN-Priya:MAI-Voice-2")] + HiInPriyaMaiVoice2, + + [EnumMember(Value = "hu-HU-Bence:MAI-Voice-2")] + HuHuBenceMaiVoice2, + + [EnumMember(Value = "hu-HU-Levente:MAI-Voice-2")] + HuHuLeventeMaiVoice2, + + [EnumMember(Value = "hu-HU-Lilla:MAI-Voice-2")] + HuHuLillaMaiVoice2, + + [EnumMember(Value = "hu-HU-Réka:MAI-Voice-2")] + HuHuRekaMaiVoice2, + + [EnumMember(Value = "it-IT-Luca:MAI-Voice-2")] + ItItLucaMaiVoice2, + + [EnumMember(Value = "it-IT-Rosa:MAI-Voice-2")] + ItItRosaMaiVoice2, + + [EnumMember(Value = "ko-KR-Hana:MAI-Voice-2")] + KoKrHanaMaiVoice2, + + [EnumMember(Value = "ko-KR-Junho:MAI-Voice-2")] + KoKrJunhoMaiVoice2, + + [EnumMember(Value = "nl-NL-Fleur:MAI-Voice-2")] + NlNlFleurMaiVoice2, + + [EnumMember(Value = "nl-NL-Sander:MAI-Voice-2")] + NlNlSanderMaiVoice2, + + [EnumMember(Value = "pt-BR-Caio:MAI-Voice-2")] + PtBrCaioMaiVoice2, + + [EnumMember(Value = "pt-BR-Luana:MAI-Voice-2")] + PtBrLuanaMaiVoice2, + + [EnumMember(Value = "pt-BR-Pedro:MAI-Voice-2")] + PtBrPedroMaiVoice2, + + [EnumMember(Value = "pt-BR-Rafael:MAI-Voice-2")] + PtBrRafaelMaiVoice2, + + [EnumMember(Value = "pt-PT-Rui:MAI-Voice-2")] + PtPtRuiMaiVoice2, + + [EnumMember(Value = "ro-RO-Andrei:MAI-Voice-2")] + RoRoAndreiMaiVoice2, + + [EnumMember(Value = "ro-RO-Elena:MAI-Voice-2")] + RoRoElenaMaiVoice2, + + [EnumMember(Value = "ro-RO-Ioana:MAI-Voice-2")] + RoRoIoanaMaiVoice2, + + [EnumMember(Value = "ro-RO-Radu:MAI-Voice-2")] + RoRoRaduMaiVoice2, + + [EnumMember(Value = "ru-RU-Lev:MAI-Voice-2")] + RuRuLevMaiVoice2, + + [EnumMember(Value = "ru-RU-Masha:MAI-Voice-2")] + RuRuMashaMaiVoice2, + + [EnumMember(Value = "th-TH-Krit:MAI-Voice-2")] + ThThKritMaiVoice2, + + [EnumMember(Value = "th-TH-Nattapong:MAI-Voice-2")] + ThThNattapongMaiVoice2, + + [EnumMember(Value = "tr-TR-Aydin:MAI-Voice-2")] + TrTrAydinMaiVoice2, + + [EnumMember(Value = "tr-TR-Elif:MAI-Voice-2")] + TrTrElifMaiVoice2, + + [EnumMember(Value = "zh-CN-Bo:MAI-Voice-2")] + ZhCnBoMaiVoice2, + + [EnumMember(Value = "zh-CN-Lan:MAI-Voice-2")] + ZhCnLanMaiVoice2, + + [EnumMember(Value = "zh-CN-Mei:MAI-Voice-2")] + ZhCnMeiMaiVoice2, +} + +internal class FallbackMicrosoftVoiceVoiceIdSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + FallbackMicrosoftVoiceVoiceId + > _stringToEnum = new() + { + { "de-DE-Klaus:MAI-Voice-2", FallbackMicrosoftVoiceVoiceId.DeDeKlausMaiVoice2 }, + { "de-DE-Mia:MAI-Voice-2", FallbackMicrosoftVoiceVoiceId.DeDeMiaMaiVoice2 }, + { "en-AU-Lisa:MAI-Voice-2", FallbackMicrosoftVoiceVoiceId.EnAuLisaMaiVoice2 }, + { "en-US-Ethan:MAI-Voice-2", FallbackMicrosoftVoiceVoiceId.EnUsEthanMaiVoice2 }, + { "en-US-Grant:MAI-Voice-2", FallbackMicrosoftVoiceVoiceId.EnUsGrantMaiVoice2 }, + { "en-US-Harper:MAI-Voice-2", FallbackMicrosoftVoiceVoiceId.EnUsHarperMaiVoice2 }, + { "en-US-Iris:MAI-Voice-2", FallbackMicrosoftVoiceVoiceId.EnUsIrisMaiVoice2 }, + { "en-US-Jasper:MAI-Voice-2", FallbackMicrosoftVoiceVoiceId.EnUsJasperMaiVoice2 }, + { "en-US-Olivia:MAI-Voice-2", FallbackMicrosoftVoiceVoiceId.EnUsOliviaMaiVoice2 }, + { "es-ES-Marta:MAI-Voice-2", FallbackMicrosoftVoiceVoiceId.EsEsMartaMaiVoice2 }, + { "es-MX-Alejo:MAI-Voice-2", FallbackMicrosoftVoiceVoiceId.EsMxAlejoMaiVoice2 }, + { "es-MX-Valeria:MAI-Voice-2", FallbackMicrosoftVoiceVoiceId.EsMxValeriaMaiVoice2 }, + { "fr-FR-Marc:MAI-Voice-2", FallbackMicrosoftVoiceVoiceId.FrFrMarcMaiVoice2 }, + { "fr-FR-Soleil:MAI-Voice-2", FallbackMicrosoftVoiceVoiceId.FrFrSoleilMaiVoice2 }, + { "hi-IN-Arjun:MAI-Voice-2", FallbackMicrosoftVoiceVoiceId.HiInArjunMaiVoice2 }, + { "hi-IN-Dhruv:MAI-Voice-2", FallbackMicrosoftVoiceVoiceId.HiInDhruvMaiVoice2 }, + { "hi-IN-Kavya:MAI-Voice-2", FallbackMicrosoftVoiceVoiceId.HiInKavyaMaiVoice2 }, + { "hi-IN-Priya:MAI-Voice-2", FallbackMicrosoftVoiceVoiceId.HiInPriyaMaiVoice2 }, + { "hu-HU-Bence:MAI-Voice-2", FallbackMicrosoftVoiceVoiceId.HuHuBenceMaiVoice2 }, + { "hu-HU-Levente:MAI-Voice-2", FallbackMicrosoftVoiceVoiceId.HuHuLeventeMaiVoice2 }, + { "hu-HU-Lilla:MAI-Voice-2", FallbackMicrosoftVoiceVoiceId.HuHuLillaMaiVoice2 }, + { "hu-HU-Réka:MAI-Voice-2", FallbackMicrosoftVoiceVoiceId.HuHuRekaMaiVoice2 }, + { "it-IT-Luca:MAI-Voice-2", FallbackMicrosoftVoiceVoiceId.ItItLucaMaiVoice2 }, + { "it-IT-Rosa:MAI-Voice-2", FallbackMicrosoftVoiceVoiceId.ItItRosaMaiVoice2 }, + { "ko-KR-Hana:MAI-Voice-2", FallbackMicrosoftVoiceVoiceId.KoKrHanaMaiVoice2 }, + { "ko-KR-Junho:MAI-Voice-2", FallbackMicrosoftVoiceVoiceId.KoKrJunhoMaiVoice2 }, + { "nl-NL-Fleur:MAI-Voice-2", FallbackMicrosoftVoiceVoiceId.NlNlFleurMaiVoice2 }, + { "nl-NL-Sander:MAI-Voice-2", FallbackMicrosoftVoiceVoiceId.NlNlSanderMaiVoice2 }, + { "pt-BR-Caio:MAI-Voice-2", FallbackMicrosoftVoiceVoiceId.PtBrCaioMaiVoice2 }, + { "pt-BR-Luana:MAI-Voice-2", FallbackMicrosoftVoiceVoiceId.PtBrLuanaMaiVoice2 }, + { "pt-BR-Pedro:MAI-Voice-2", FallbackMicrosoftVoiceVoiceId.PtBrPedroMaiVoice2 }, + { "pt-BR-Rafael:MAI-Voice-2", FallbackMicrosoftVoiceVoiceId.PtBrRafaelMaiVoice2 }, + { "pt-PT-Rui:MAI-Voice-2", FallbackMicrosoftVoiceVoiceId.PtPtRuiMaiVoice2 }, + { "ro-RO-Andrei:MAI-Voice-2", FallbackMicrosoftVoiceVoiceId.RoRoAndreiMaiVoice2 }, + { "ro-RO-Elena:MAI-Voice-2", FallbackMicrosoftVoiceVoiceId.RoRoElenaMaiVoice2 }, + { "ro-RO-Ioana:MAI-Voice-2", FallbackMicrosoftVoiceVoiceId.RoRoIoanaMaiVoice2 }, + { "ro-RO-Radu:MAI-Voice-2", FallbackMicrosoftVoiceVoiceId.RoRoRaduMaiVoice2 }, + { "ru-RU-Lev:MAI-Voice-2", FallbackMicrosoftVoiceVoiceId.RuRuLevMaiVoice2 }, + { "ru-RU-Masha:MAI-Voice-2", FallbackMicrosoftVoiceVoiceId.RuRuMashaMaiVoice2 }, + { "th-TH-Krit:MAI-Voice-2", FallbackMicrosoftVoiceVoiceId.ThThKritMaiVoice2 }, + { "th-TH-Nattapong:MAI-Voice-2", FallbackMicrosoftVoiceVoiceId.ThThNattapongMaiVoice2 }, + { "tr-TR-Aydin:MAI-Voice-2", FallbackMicrosoftVoiceVoiceId.TrTrAydinMaiVoice2 }, + { "tr-TR-Elif:MAI-Voice-2", FallbackMicrosoftVoiceVoiceId.TrTrElifMaiVoice2 }, + { "zh-CN-Bo:MAI-Voice-2", FallbackMicrosoftVoiceVoiceId.ZhCnBoMaiVoice2 }, + { "zh-CN-Lan:MAI-Voice-2", FallbackMicrosoftVoiceVoiceId.ZhCnLanMaiVoice2 }, + { "zh-CN-Mei:MAI-Voice-2", FallbackMicrosoftVoiceVoiceId.ZhCnMeiMaiVoice2 }, + }; + + private static readonly global::System.Collections.Generic.Dictionary< + FallbackMicrosoftVoiceVoiceId, + string + > _enumToString = new() + { + { FallbackMicrosoftVoiceVoiceId.DeDeKlausMaiVoice2, "de-DE-Klaus:MAI-Voice-2" }, + { FallbackMicrosoftVoiceVoiceId.DeDeMiaMaiVoice2, "de-DE-Mia:MAI-Voice-2" }, + { FallbackMicrosoftVoiceVoiceId.EnAuLisaMaiVoice2, "en-AU-Lisa:MAI-Voice-2" }, + { FallbackMicrosoftVoiceVoiceId.EnUsEthanMaiVoice2, "en-US-Ethan:MAI-Voice-2" }, + { FallbackMicrosoftVoiceVoiceId.EnUsGrantMaiVoice2, "en-US-Grant:MAI-Voice-2" }, + { FallbackMicrosoftVoiceVoiceId.EnUsHarperMaiVoice2, "en-US-Harper:MAI-Voice-2" }, + { FallbackMicrosoftVoiceVoiceId.EnUsIrisMaiVoice2, "en-US-Iris:MAI-Voice-2" }, + { FallbackMicrosoftVoiceVoiceId.EnUsJasperMaiVoice2, "en-US-Jasper:MAI-Voice-2" }, + { FallbackMicrosoftVoiceVoiceId.EnUsOliviaMaiVoice2, "en-US-Olivia:MAI-Voice-2" }, + { FallbackMicrosoftVoiceVoiceId.EsEsMartaMaiVoice2, "es-ES-Marta:MAI-Voice-2" }, + { FallbackMicrosoftVoiceVoiceId.EsMxAlejoMaiVoice2, "es-MX-Alejo:MAI-Voice-2" }, + { FallbackMicrosoftVoiceVoiceId.EsMxValeriaMaiVoice2, "es-MX-Valeria:MAI-Voice-2" }, + { FallbackMicrosoftVoiceVoiceId.FrFrMarcMaiVoice2, "fr-FR-Marc:MAI-Voice-2" }, + { FallbackMicrosoftVoiceVoiceId.FrFrSoleilMaiVoice2, "fr-FR-Soleil:MAI-Voice-2" }, + { FallbackMicrosoftVoiceVoiceId.HiInArjunMaiVoice2, "hi-IN-Arjun:MAI-Voice-2" }, + { FallbackMicrosoftVoiceVoiceId.HiInDhruvMaiVoice2, "hi-IN-Dhruv:MAI-Voice-2" }, + { FallbackMicrosoftVoiceVoiceId.HiInKavyaMaiVoice2, "hi-IN-Kavya:MAI-Voice-2" }, + { FallbackMicrosoftVoiceVoiceId.HiInPriyaMaiVoice2, "hi-IN-Priya:MAI-Voice-2" }, + { FallbackMicrosoftVoiceVoiceId.HuHuBenceMaiVoice2, "hu-HU-Bence:MAI-Voice-2" }, + { FallbackMicrosoftVoiceVoiceId.HuHuLeventeMaiVoice2, "hu-HU-Levente:MAI-Voice-2" }, + { FallbackMicrosoftVoiceVoiceId.HuHuLillaMaiVoice2, "hu-HU-Lilla:MAI-Voice-2" }, + { FallbackMicrosoftVoiceVoiceId.HuHuRekaMaiVoice2, "hu-HU-Réka:MAI-Voice-2" }, + { FallbackMicrosoftVoiceVoiceId.ItItLucaMaiVoice2, "it-IT-Luca:MAI-Voice-2" }, + { FallbackMicrosoftVoiceVoiceId.ItItRosaMaiVoice2, "it-IT-Rosa:MAI-Voice-2" }, + { FallbackMicrosoftVoiceVoiceId.KoKrHanaMaiVoice2, "ko-KR-Hana:MAI-Voice-2" }, + { FallbackMicrosoftVoiceVoiceId.KoKrJunhoMaiVoice2, "ko-KR-Junho:MAI-Voice-2" }, + { FallbackMicrosoftVoiceVoiceId.NlNlFleurMaiVoice2, "nl-NL-Fleur:MAI-Voice-2" }, + { FallbackMicrosoftVoiceVoiceId.NlNlSanderMaiVoice2, "nl-NL-Sander:MAI-Voice-2" }, + { FallbackMicrosoftVoiceVoiceId.PtBrCaioMaiVoice2, "pt-BR-Caio:MAI-Voice-2" }, + { FallbackMicrosoftVoiceVoiceId.PtBrLuanaMaiVoice2, "pt-BR-Luana:MAI-Voice-2" }, + { FallbackMicrosoftVoiceVoiceId.PtBrPedroMaiVoice2, "pt-BR-Pedro:MAI-Voice-2" }, + { FallbackMicrosoftVoiceVoiceId.PtBrRafaelMaiVoice2, "pt-BR-Rafael:MAI-Voice-2" }, + { FallbackMicrosoftVoiceVoiceId.PtPtRuiMaiVoice2, "pt-PT-Rui:MAI-Voice-2" }, + { FallbackMicrosoftVoiceVoiceId.RoRoAndreiMaiVoice2, "ro-RO-Andrei:MAI-Voice-2" }, + { FallbackMicrosoftVoiceVoiceId.RoRoElenaMaiVoice2, "ro-RO-Elena:MAI-Voice-2" }, + { FallbackMicrosoftVoiceVoiceId.RoRoIoanaMaiVoice2, "ro-RO-Ioana:MAI-Voice-2" }, + { FallbackMicrosoftVoiceVoiceId.RoRoRaduMaiVoice2, "ro-RO-Radu:MAI-Voice-2" }, + { FallbackMicrosoftVoiceVoiceId.RuRuLevMaiVoice2, "ru-RU-Lev:MAI-Voice-2" }, + { FallbackMicrosoftVoiceVoiceId.RuRuMashaMaiVoice2, "ru-RU-Masha:MAI-Voice-2" }, + { FallbackMicrosoftVoiceVoiceId.ThThKritMaiVoice2, "th-TH-Krit:MAI-Voice-2" }, + { FallbackMicrosoftVoiceVoiceId.ThThNattapongMaiVoice2, "th-TH-Nattapong:MAI-Voice-2" }, + { FallbackMicrosoftVoiceVoiceId.TrTrAydinMaiVoice2, "tr-TR-Aydin:MAI-Voice-2" }, + { FallbackMicrosoftVoiceVoiceId.TrTrElifMaiVoice2, "tr-TR-Elif:MAI-Voice-2" }, + { FallbackMicrosoftVoiceVoiceId.ZhCnBoMaiVoice2, "zh-CN-Bo:MAI-Voice-2" }, + { FallbackMicrosoftVoiceVoiceId.ZhCnLanMaiVoice2, "zh-CN-Lan:MAI-Voice-2" }, + { FallbackMicrosoftVoiceVoiceId.ZhCnMeiMaiVoice2, "zh-CN-Mei:MAI-Voice-2" }, + }; + + public override FallbackMicrosoftVoiceVoiceId Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + FallbackMicrosoftVoiceVoiceId value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override FallbackMicrosoftVoiceVoiceId ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + FallbackMicrosoftVoiceVoiceId value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/FallbackNeuphonicVoice.cs b/src/Vapi.Net/Types/FallbackNeuphonicVoice.cs index 96832a9d..209f52af 100644 --- a/src/Vapi.Net/Types/FallbackNeuphonicVoice.cs +++ b/src/Vapi.Net/Types/FallbackNeuphonicVoice.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Fallback configuration for synthesizing assistant speech with Neuphonic, including voice and model selection, language, speed, chunking, and caching. +/// [Serializable] public record FallbackNeuphonicVoice : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/FallbackOpenAiTranscriber.cs b/src/Vapi.Net/Types/FallbackOpenAiTranscriber.cs index 9cea1be0..1ad8e867 100644 --- a/src/Vapi.Net/Types/FallbackOpenAiTranscriber.cs +++ b/src/Vapi.Net/Types/FallbackOpenAiTranscriber.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Fallback configuration for transcribing speech with OpenAI, including model and language. +/// [Serializable] public record FallbackOpenAiTranscriber : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/FallbackOpenAiVoice.cs b/src/Vapi.Net/Types/FallbackOpenAiVoice.cs index fd0ed6b6..20e0a128 100644 --- a/src/Vapi.Net/Types/FallbackOpenAiVoice.cs +++ b/src/Vapi.Net/Types/FallbackOpenAiVoice.cs @@ -5,6 +5,9 @@ namespace Vapi.Net; +/// +/// Fallback configuration for synthesizing assistant speech with OpenAI, including voice and model selection, delivery instructions, speed, chunking, and caching. +/// [Serializable] public record FallbackOpenAiVoice : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/FallbackPlan.cs b/src/Vapi.Net/Types/FallbackPlan.cs index 87ffca15..e8f418f7 100644 --- a/src/Vapi.Net/Types/FallbackPlan.cs +++ b/src/Vapi.Net/Types/FallbackPlan.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Lists backup voice configurations that can be used if the primary voice provider fails. +/// [Serializable] public record FallbackPlan : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/FallbackPlayHtVoice.cs b/src/Vapi.Net/Types/FallbackPlayHtVoice.cs index da018175..864debf5 100644 --- a/src/Vapi.Net/Types/FallbackPlayHtVoice.cs +++ b/src/Vapi.Net/Types/FallbackPlayHtVoice.cs @@ -5,6 +5,9 @@ namespace Vapi.Net; +/// +/// Fallback configuration for synthesizing assistant speech with PlayHT, including voice and model selection, language, emotion and style guidance, chunking, and caching. +/// [Serializable] public record FallbackPlayHtVoice : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/FallbackRimeAiVoice.cs b/src/Vapi.Net/Types/FallbackRimeAiVoice.cs index a99fe399..6b73a758 100644 --- a/src/Vapi.Net/Types/FallbackRimeAiVoice.cs +++ b/src/Vapi.Net/Types/FallbackRimeAiVoice.cs @@ -5,6 +5,9 @@ namespace Vapi.Net; +/// +/// Fallback configuration for synthesizing assistant speech with Rime AI, including voice and model selection, language, speed, pauses, phonemization, latency, chunking, and caching. +/// [Serializable] public record FallbackRimeAiVoice : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/FallbackSesameVoice.cs b/src/Vapi.Net/Types/FallbackSesameVoice.cs index 2b07efe9..33da0164 100644 --- a/src/Vapi.Net/Types/FallbackSesameVoice.cs +++ b/src/Vapi.Net/Types/FallbackSesameVoice.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Fallback configuration for synthesizing assistant speech with Sesame, including voice and model selection, chunking, and caching. +/// [Serializable] public record FallbackSesameVoice : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/FallbackSmallestAiVoice.cs b/src/Vapi.Net/Types/FallbackSmallestAiVoice.cs index dcb6b411..5ae0cfc4 100644 --- a/src/Vapi.Net/Types/FallbackSmallestAiVoice.cs +++ b/src/Vapi.Net/Types/FallbackSmallestAiVoice.cs @@ -5,6 +5,9 @@ namespace Vapi.Net; +/// +/// Fallback configuration for synthesizing assistant speech with Smallest AI, including voice and model selection, speed, chunking, and caching. +/// [Serializable] public record FallbackSmallestAiVoice : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/FallbackSonioxTranscriber.cs b/src/Vapi.Net/Types/FallbackSonioxTranscriber.cs index 3dd1fb6a..26fb72cc 100644 --- a/src/Vapi.Net/Types/FallbackSonioxTranscriber.cs +++ b/src/Vapi.Net/Types/FallbackSonioxTranscriber.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Fallback configuration for transcribing speech with Soniox, including model, language detection, endpointing, and vocabulary. +/// [Serializable] public record FallbackSonioxTranscriber : IJsonOnDeserialized { @@ -18,13 +21,19 @@ public record FallbackSonioxTranscriber : IJsonOnDeserialized public FallbackSonioxTranscriberModel? Model { get; set; } /// - /// The language for transcription. Uses ISO 639-1 codes. Soniox supports 60+ languages with a single universal model. + /// Single language for transcription as an ISO 639-1 code (e.g., `en`, `es`). For multi-language hints or to enable Soniox auto-detect, use `languages` instead — when `languages` is set (including to an empty array), this field is ignored when building the Soniox request. Defaults to `en` if neither this nor `languages` is set. /// [JsonPropertyName("language")] public FallbackSonioxTranscriberLanguage? Language { get; set; } /// - /// When enabled, restricts transcription to the language specified in the language field. When disabled, the model can detect and transcribe any of 60+ supported languages. Defaults to true. + /// Language hints sent to Soniox as `language_hints`. Provide `[lang1, lang2, ...]` (ISO 639-1 codes) to bias recognition toward specific languages, or provide an explicit empty array `[]` to enable Soniox auto-detect across all 60+ supported languages. When set (including the empty array), this field takes precedence over the singular `language` field. When omitted, falls back to the singular `language` (which defaults to `en` if also unset). Best accuracy is achieved with a single language. + /// + [JsonPropertyName("languages")] + public IEnumerable? Languages { get; set; } + + /// + /// When `true`, Soniox strictly restricts transcription to the languages in `languages` (or the singular `language` if `languages` is unset). When `false`, Soniox biases toward those languages but still allows transcription in other languages. Has no effect when no language hints are sent (e.g., `languages: []` for auto-detect). Defaults to `true` (strict mode). /// [JsonPropertyName("languageHintsStrict")] public bool? LanguageHintsStrict { get; set; } @@ -41,6 +50,12 @@ public record FallbackSonioxTranscriber : IJsonOnDeserialized [JsonPropertyName("customVocabulary")] public IEnumerable? CustomVocabulary { get; set; } + /// + /// General context key-value pairs that guide the AI model during transcription. Helps adapt vocabulary to the correct domain, improving accuracy. Recommended: 10 or fewer pairs. Maps to Soniox context.general. + /// + [JsonPropertyName("contextGeneral")] + public IEnumerable? ContextGeneral { get; set; } + [JsonIgnore] public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); diff --git a/src/Vapi.Net/Types/FallbackSonioxTranscriberLanguagesItem.cs b/src/Vapi.Net/Types/FallbackSonioxTranscriberLanguagesItem.cs new file mode 100644 index 00000000..69af1791 --- /dev/null +++ b/src/Vapi.Net/Types/FallbackSonioxTranscriberLanguagesItem.cs @@ -0,0 +1,999 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(FallbackSonioxTranscriberLanguagesItemSerializer))] +public enum FallbackSonioxTranscriberLanguagesItem +{ + [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, +} + +internal class FallbackSonioxTranscriberLanguagesItemSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + FallbackSonioxTranscriberLanguagesItem + > _stringToEnum = new() + { + { "aa", FallbackSonioxTranscriberLanguagesItem.Aa }, + { "ab", FallbackSonioxTranscriberLanguagesItem.Ab }, + { "ae", FallbackSonioxTranscriberLanguagesItem.Ae }, + { "af", FallbackSonioxTranscriberLanguagesItem.Af }, + { "ak", FallbackSonioxTranscriberLanguagesItem.Ak }, + { "am", FallbackSonioxTranscriberLanguagesItem.Am }, + { "an", FallbackSonioxTranscriberLanguagesItem.An }, + { "ar", FallbackSonioxTranscriberLanguagesItem.Ar }, + { "as", FallbackSonioxTranscriberLanguagesItem.As }, + { "av", FallbackSonioxTranscriberLanguagesItem.Av }, + { "ay", FallbackSonioxTranscriberLanguagesItem.Ay }, + { "az", FallbackSonioxTranscriberLanguagesItem.Az }, + { "ba", FallbackSonioxTranscriberLanguagesItem.Ba }, + { "be", FallbackSonioxTranscriberLanguagesItem.Be }, + { "bg", FallbackSonioxTranscriberLanguagesItem.Bg }, + { "bh", FallbackSonioxTranscriberLanguagesItem.Bh }, + { "bi", FallbackSonioxTranscriberLanguagesItem.Bi }, + { "bm", FallbackSonioxTranscriberLanguagesItem.Bm }, + { "bn", FallbackSonioxTranscriberLanguagesItem.Bn }, + { "bo", FallbackSonioxTranscriberLanguagesItem.Bo }, + { "br", FallbackSonioxTranscriberLanguagesItem.Br }, + { "bs", FallbackSonioxTranscriberLanguagesItem.Bs }, + { "ca", FallbackSonioxTranscriberLanguagesItem.Ca }, + { "ce", FallbackSonioxTranscriberLanguagesItem.Ce }, + { "ch", FallbackSonioxTranscriberLanguagesItem.Ch }, + { "co", FallbackSonioxTranscriberLanguagesItem.Co }, + { "cr", FallbackSonioxTranscriberLanguagesItem.Cr }, + { "cs", FallbackSonioxTranscriberLanguagesItem.Cs }, + { "cu", FallbackSonioxTranscriberLanguagesItem.Cu }, + { "cv", FallbackSonioxTranscriberLanguagesItem.Cv }, + { "cy", FallbackSonioxTranscriberLanguagesItem.Cy }, + { "da", FallbackSonioxTranscriberLanguagesItem.Da }, + { "de", FallbackSonioxTranscriberLanguagesItem.De }, + { "dv", FallbackSonioxTranscriberLanguagesItem.Dv }, + { "dz", FallbackSonioxTranscriberLanguagesItem.Dz }, + { "ee", FallbackSonioxTranscriberLanguagesItem.Ee }, + { "el", FallbackSonioxTranscriberLanguagesItem.El }, + { "en", FallbackSonioxTranscriberLanguagesItem.En }, + { "eo", FallbackSonioxTranscriberLanguagesItem.Eo }, + { "es", FallbackSonioxTranscriberLanguagesItem.Es }, + { "et", FallbackSonioxTranscriberLanguagesItem.Et }, + { "eu", FallbackSonioxTranscriberLanguagesItem.Eu }, + { "fa", FallbackSonioxTranscriberLanguagesItem.Fa }, + { "ff", FallbackSonioxTranscriberLanguagesItem.Ff }, + { "fi", FallbackSonioxTranscriberLanguagesItem.Fi }, + { "fj", FallbackSonioxTranscriberLanguagesItem.Fj }, + { "fo", FallbackSonioxTranscriberLanguagesItem.Fo }, + { "fr", FallbackSonioxTranscriberLanguagesItem.Fr }, + { "fy", FallbackSonioxTranscriberLanguagesItem.Fy }, + { "ga", FallbackSonioxTranscriberLanguagesItem.Ga }, + { "gd", FallbackSonioxTranscriberLanguagesItem.Gd }, + { "gl", FallbackSonioxTranscriberLanguagesItem.Gl }, + { "gn", FallbackSonioxTranscriberLanguagesItem.Gn }, + { "gu", FallbackSonioxTranscriberLanguagesItem.Gu }, + { "gv", FallbackSonioxTranscriberLanguagesItem.Gv }, + { "ha", FallbackSonioxTranscriberLanguagesItem.Ha }, + { "he", FallbackSonioxTranscriberLanguagesItem.He }, + { "hi", FallbackSonioxTranscriberLanguagesItem.Hi }, + { "ho", FallbackSonioxTranscriberLanguagesItem.Ho }, + { "hr", FallbackSonioxTranscriberLanguagesItem.Hr }, + { "ht", FallbackSonioxTranscriberLanguagesItem.Ht }, + { "hu", FallbackSonioxTranscriberLanguagesItem.Hu }, + { "hy", FallbackSonioxTranscriberLanguagesItem.Hy }, + { "hz", FallbackSonioxTranscriberLanguagesItem.Hz }, + { "ia", FallbackSonioxTranscriberLanguagesItem.Ia }, + { "id", FallbackSonioxTranscriberLanguagesItem.Id }, + { "ie", FallbackSonioxTranscriberLanguagesItem.Ie }, + { "ig", FallbackSonioxTranscriberLanguagesItem.Ig }, + { "ii", FallbackSonioxTranscriberLanguagesItem.Ii }, + { "ik", FallbackSonioxTranscriberLanguagesItem.Ik }, + { "io", FallbackSonioxTranscriberLanguagesItem.Io }, + { "is", FallbackSonioxTranscriberLanguagesItem.Is }, + { "it", FallbackSonioxTranscriberLanguagesItem.It }, + { "iu", FallbackSonioxTranscriberLanguagesItem.Iu }, + { "ja", FallbackSonioxTranscriberLanguagesItem.Ja }, + { "jv", FallbackSonioxTranscriberLanguagesItem.Jv }, + { "ka", FallbackSonioxTranscriberLanguagesItem.Ka }, + { "kg", FallbackSonioxTranscriberLanguagesItem.Kg }, + { "ki", FallbackSonioxTranscriberLanguagesItem.Ki }, + { "kj", FallbackSonioxTranscriberLanguagesItem.Kj }, + { "kk", FallbackSonioxTranscriberLanguagesItem.Kk }, + { "kl", FallbackSonioxTranscriberLanguagesItem.Kl }, + { "km", FallbackSonioxTranscriberLanguagesItem.Km }, + { "kn", FallbackSonioxTranscriberLanguagesItem.Kn }, + { "ko", FallbackSonioxTranscriberLanguagesItem.Ko }, + { "kr", FallbackSonioxTranscriberLanguagesItem.Kr }, + { "ks", FallbackSonioxTranscriberLanguagesItem.Ks }, + { "ku", FallbackSonioxTranscriberLanguagesItem.Ku }, + { "kv", FallbackSonioxTranscriberLanguagesItem.Kv }, + { "kw", FallbackSonioxTranscriberLanguagesItem.Kw }, + { "ky", FallbackSonioxTranscriberLanguagesItem.Ky }, + { "la", FallbackSonioxTranscriberLanguagesItem.La }, + { "lb", FallbackSonioxTranscriberLanguagesItem.Lb }, + { "lg", FallbackSonioxTranscriberLanguagesItem.Lg }, + { "li", FallbackSonioxTranscriberLanguagesItem.Li }, + { "ln", FallbackSonioxTranscriberLanguagesItem.Ln }, + { "lo", FallbackSonioxTranscriberLanguagesItem.Lo }, + { "lt", FallbackSonioxTranscriberLanguagesItem.Lt }, + { "lu", FallbackSonioxTranscriberLanguagesItem.Lu }, + { "lv", FallbackSonioxTranscriberLanguagesItem.Lv }, + { "mg", FallbackSonioxTranscriberLanguagesItem.Mg }, + { "mh", FallbackSonioxTranscriberLanguagesItem.Mh }, + { "mi", FallbackSonioxTranscriberLanguagesItem.Mi }, + { "mk", FallbackSonioxTranscriberLanguagesItem.Mk }, + { "ml", FallbackSonioxTranscriberLanguagesItem.Ml }, + { "mn", FallbackSonioxTranscriberLanguagesItem.Mn }, + { "mr", FallbackSonioxTranscriberLanguagesItem.Mr }, + { "ms", FallbackSonioxTranscriberLanguagesItem.Ms }, + { "mt", FallbackSonioxTranscriberLanguagesItem.Mt }, + { "my", FallbackSonioxTranscriberLanguagesItem.My }, + { "na", FallbackSonioxTranscriberLanguagesItem.Na }, + { "nb", FallbackSonioxTranscriberLanguagesItem.Nb }, + { "nd", FallbackSonioxTranscriberLanguagesItem.Nd }, + { "ne", FallbackSonioxTranscriberLanguagesItem.Ne }, + { "ng", FallbackSonioxTranscriberLanguagesItem.Ng }, + { "nl", FallbackSonioxTranscriberLanguagesItem.Nl }, + { "nn", FallbackSonioxTranscriberLanguagesItem.Nn }, + { "no", FallbackSonioxTranscriberLanguagesItem.No }, + { "nr", FallbackSonioxTranscriberLanguagesItem.Nr }, + { "nv", FallbackSonioxTranscriberLanguagesItem.Nv }, + { "ny", FallbackSonioxTranscriberLanguagesItem.Ny }, + { "oc", FallbackSonioxTranscriberLanguagesItem.Oc }, + { "oj", FallbackSonioxTranscriberLanguagesItem.Oj }, + { "om", FallbackSonioxTranscriberLanguagesItem.Om }, + { "or", FallbackSonioxTranscriberLanguagesItem.Or }, + { "os", FallbackSonioxTranscriberLanguagesItem.Os }, + { "pa", FallbackSonioxTranscriberLanguagesItem.Pa }, + { "pi", FallbackSonioxTranscriberLanguagesItem.Pi }, + { "pl", FallbackSonioxTranscriberLanguagesItem.Pl }, + { "ps", FallbackSonioxTranscriberLanguagesItem.Ps }, + { "pt", FallbackSonioxTranscriberLanguagesItem.Pt }, + { "qu", FallbackSonioxTranscriberLanguagesItem.Qu }, + { "rm", FallbackSonioxTranscriberLanguagesItem.Rm }, + { "rn", FallbackSonioxTranscriberLanguagesItem.Rn }, + { "ro", FallbackSonioxTranscriberLanguagesItem.Ro }, + { "ru", FallbackSonioxTranscriberLanguagesItem.Ru }, + { "rw", FallbackSonioxTranscriberLanguagesItem.Rw }, + { "sa", FallbackSonioxTranscriberLanguagesItem.Sa }, + { "sc", FallbackSonioxTranscriberLanguagesItem.Sc }, + { "sd", FallbackSonioxTranscriberLanguagesItem.Sd }, + { "se", FallbackSonioxTranscriberLanguagesItem.Se }, + { "sg", FallbackSonioxTranscriberLanguagesItem.Sg }, + { "si", FallbackSonioxTranscriberLanguagesItem.Si }, + { "sk", FallbackSonioxTranscriberLanguagesItem.Sk }, + { "sl", FallbackSonioxTranscriberLanguagesItem.Sl }, + { "sm", FallbackSonioxTranscriberLanguagesItem.Sm }, + { "sn", FallbackSonioxTranscriberLanguagesItem.Sn }, + { "so", FallbackSonioxTranscriberLanguagesItem.So }, + { "sq", FallbackSonioxTranscriberLanguagesItem.Sq }, + { "sr", FallbackSonioxTranscriberLanguagesItem.Sr }, + { "ss", FallbackSonioxTranscriberLanguagesItem.Ss }, + { "st", FallbackSonioxTranscriberLanguagesItem.St }, + { "su", FallbackSonioxTranscriberLanguagesItem.Su }, + { "sv", FallbackSonioxTranscriberLanguagesItem.Sv }, + { "sw", FallbackSonioxTranscriberLanguagesItem.Sw }, + { "ta", FallbackSonioxTranscriberLanguagesItem.Ta }, + { "te", FallbackSonioxTranscriberLanguagesItem.Te }, + { "tg", FallbackSonioxTranscriberLanguagesItem.Tg }, + { "th", FallbackSonioxTranscriberLanguagesItem.Th }, + { "ti", FallbackSonioxTranscriberLanguagesItem.Ti }, + { "tk", FallbackSonioxTranscriberLanguagesItem.Tk }, + { "tl", FallbackSonioxTranscriberLanguagesItem.Tl }, + { "tn", FallbackSonioxTranscriberLanguagesItem.Tn }, + { "to", FallbackSonioxTranscriberLanguagesItem.To }, + { "tr", FallbackSonioxTranscriberLanguagesItem.Tr }, + { "ts", FallbackSonioxTranscriberLanguagesItem.Ts }, + { "tt", FallbackSonioxTranscriberLanguagesItem.Tt }, + { "tw", FallbackSonioxTranscriberLanguagesItem.Tw }, + { "ty", FallbackSonioxTranscriberLanguagesItem.Ty }, + { "ug", FallbackSonioxTranscriberLanguagesItem.Ug }, + { "uk", FallbackSonioxTranscriberLanguagesItem.Uk }, + { "ur", FallbackSonioxTranscriberLanguagesItem.Ur }, + { "uz", FallbackSonioxTranscriberLanguagesItem.Uz }, + { "ve", FallbackSonioxTranscriberLanguagesItem.Ve }, + { "vi", FallbackSonioxTranscriberLanguagesItem.Vi }, + { "vo", FallbackSonioxTranscriberLanguagesItem.Vo }, + { "wa", FallbackSonioxTranscriberLanguagesItem.Wa }, + { "wo", FallbackSonioxTranscriberLanguagesItem.Wo }, + { "xh", FallbackSonioxTranscriberLanguagesItem.Xh }, + { "yi", FallbackSonioxTranscriberLanguagesItem.Yi }, + { "yue", FallbackSonioxTranscriberLanguagesItem.Yue }, + { "yo", FallbackSonioxTranscriberLanguagesItem.Yo }, + { "za", FallbackSonioxTranscriberLanguagesItem.Za }, + { "zh", FallbackSonioxTranscriberLanguagesItem.Zh }, + { "zu", FallbackSonioxTranscriberLanguagesItem.Zu }, + }; + + private static readonly global::System.Collections.Generic.Dictionary< + FallbackSonioxTranscriberLanguagesItem, + string + > _enumToString = new() + { + { FallbackSonioxTranscriberLanguagesItem.Aa, "aa" }, + { FallbackSonioxTranscriberLanguagesItem.Ab, "ab" }, + { FallbackSonioxTranscriberLanguagesItem.Ae, "ae" }, + { FallbackSonioxTranscriberLanguagesItem.Af, "af" }, + { FallbackSonioxTranscriberLanguagesItem.Ak, "ak" }, + { FallbackSonioxTranscriberLanguagesItem.Am, "am" }, + { FallbackSonioxTranscriberLanguagesItem.An, "an" }, + { FallbackSonioxTranscriberLanguagesItem.Ar, "ar" }, + { FallbackSonioxTranscriberLanguagesItem.As, "as" }, + { FallbackSonioxTranscriberLanguagesItem.Av, "av" }, + { FallbackSonioxTranscriberLanguagesItem.Ay, "ay" }, + { FallbackSonioxTranscriberLanguagesItem.Az, "az" }, + { FallbackSonioxTranscriberLanguagesItem.Ba, "ba" }, + { FallbackSonioxTranscriberLanguagesItem.Be, "be" }, + { FallbackSonioxTranscriberLanguagesItem.Bg, "bg" }, + { FallbackSonioxTranscriberLanguagesItem.Bh, "bh" }, + { FallbackSonioxTranscriberLanguagesItem.Bi, "bi" }, + { FallbackSonioxTranscriberLanguagesItem.Bm, "bm" }, + { FallbackSonioxTranscriberLanguagesItem.Bn, "bn" }, + { FallbackSonioxTranscriberLanguagesItem.Bo, "bo" }, + { FallbackSonioxTranscriberLanguagesItem.Br, "br" }, + { FallbackSonioxTranscriberLanguagesItem.Bs, "bs" }, + { FallbackSonioxTranscriberLanguagesItem.Ca, "ca" }, + { FallbackSonioxTranscriberLanguagesItem.Ce, "ce" }, + { FallbackSonioxTranscriberLanguagesItem.Ch, "ch" }, + { FallbackSonioxTranscriberLanguagesItem.Co, "co" }, + { FallbackSonioxTranscriberLanguagesItem.Cr, "cr" }, + { FallbackSonioxTranscriberLanguagesItem.Cs, "cs" }, + { FallbackSonioxTranscriberLanguagesItem.Cu, "cu" }, + { FallbackSonioxTranscriberLanguagesItem.Cv, "cv" }, + { FallbackSonioxTranscriberLanguagesItem.Cy, "cy" }, + { FallbackSonioxTranscriberLanguagesItem.Da, "da" }, + { FallbackSonioxTranscriberLanguagesItem.De, "de" }, + { FallbackSonioxTranscriberLanguagesItem.Dv, "dv" }, + { FallbackSonioxTranscriberLanguagesItem.Dz, "dz" }, + { FallbackSonioxTranscriberLanguagesItem.Ee, "ee" }, + { FallbackSonioxTranscriberLanguagesItem.El, "el" }, + { FallbackSonioxTranscriberLanguagesItem.En, "en" }, + { FallbackSonioxTranscriberLanguagesItem.Eo, "eo" }, + { FallbackSonioxTranscriberLanguagesItem.Es, "es" }, + { FallbackSonioxTranscriberLanguagesItem.Et, "et" }, + { FallbackSonioxTranscriberLanguagesItem.Eu, "eu" }, + { FallbackSonioxTranscriberLanguagesItem.Fa, "fa" }, + { FallbackSonioxTranscriberLanguagesItem.Ff, "ff" }, + { FallbackSonioxTranscriberLanguagesItem.Fi, "fi" }, + { FallbackSonioxTranscriberLanguagesItem.Fj, "fj" }, + { FallbackSonioxTranscriberLanguagesItem.Fo, "fo" }, + { FallbackSonioxTranscriberLanguagesItem.Fr, "fr" }, + { FallbackSonioxTranscriberLanguagesItem.Fy, "fy" }, + { FallbackSonioxTranscriberLanguagesItem.Ga, "ga" }, + { FallbackSonioxTranscriberLanguagesItem.Gd, "gd" }, + { FallbackSonioxTranscriberLanguagesItem.Gl, "gl" }, + { FallbackSonioxTranscriberLanguagesItem.Gn, "gn" }, + { FallbackSonioxTranscriberLanguagesItem.Gu, "gu" }, + { FallbackSonioxTranscriberLanguagesItem.Gv, "gv" }, + { FallbackSonioxTranscriberLanguagesItem.Ha, "ha" }, + { FallbackSonioxTranscriberLanguagesItem.He, "he" }, + { FallbackSonioxTranscriberLanguagesItem.Hi, "hi" }, + { FallbackSonioxTranscriberLanguagesItem.Ho, "ho" }, + { FallbackSonioxTranscriberLanguagesItem.Hr, "hr" }, + { FallbackSonioxTranscriberLanguagesItem.Ht, "ht" }, + { FallbackSonioxTranscriberLanguagesItem.Hu, "hu" }, + { FallbackSonioxTranscriberLanguagesItem.Hy, "hy" }, + { FallbackSonioxTranscriberLanguagesItem.Hz, "hz" }, + { FallbackSonioxTranscriberLanguagesItem.Ia, "ia" }, + { FallbackSonioxTranscriberLanguagesItem.Id, "id" }, + { FallbackSonioxTranscriberLanguagesItem.Ie, "ie" }, + { FallbackSonioxTranscriberLanguagesItem.Ig, "ig" }, + { FallbackSonioxTranscriberLanguagesItem.Ii, "ii" }, + { FallbackSonioxTranscriberLanguagesItem.Ik, "ik" }, + { FallbackSonioxTranscriberLanguagesItem.Io, "io" }, + { FallbackSonioxTranscriberLanguagesItem.Is, "is" }, + { FallbackSonioxTranscriberLanguagesItem.It, "it" }, + { FallbackSonioxTranscriberLanguagesItem.Iu, "iu" }, + { FallbackSonioxTranscriberLanguagesItem.Ja, "ja" }, + { FallbackSonioxTranscriberLanguagesItem.Jv, "jv" }, + { FallbackSonioxTranscriberLanguagesItem.Ka, "ka" }, + { FallbackSonioxTranscriberLanguagesItem.Kg, "kg" }, + { FallbackSonioxTranscriberLanguagesItem.Ki, "ki" }, + { FallbackSonioxTranscriberLanguagesItem.Kj, "kj" }, + { FallbackSonioxTranscriberLanguagesItem.Kk, "kk" }, + { FallbackSonioxTranscriberLanguagesItem.Kl, "kl" }, + { FallbackSonioxTranscriberLanguagesItem.Km, "km" }, + { FallbackSonioxTranscriberLanguagesItem.Kn, "kn" }, + { FallbackSonioxTranscriberLanguagesItem.Ko, "ko" }, + { FallbackSonioxTranscriberLanguagesItem.Kr, "kr" }, + { FallbackSonioxTranscriberLanguagesItem.Ks, "ks" }, + { FallbackSonioxTranscriberLanguagesItem.Ku, "ku" }, + { FallbackSonioxTranscriberLanguagesItem.Kv, "kv" }, + { FallbackSonioxTranscriberLanguagesItem.Kw, "kw" }, + { FallbackSonioxTranscriberLanguagesItem.Ky, "ky" }, + { FallbackSonioxTranscriberLanguagesItem.La, "la" }, + { FallbackSonioxTranscriberLanguagesItem.Lb, "lb" }, + { FallbackSonioxTranscriberLanguagesItem.Lg, "lg" }, + { FallbackSonioxTranscriberLanguagesItem.Li, "li" }, + { FallbackSonioxTranscriberLanguagesItem.Ln, "ln" }, + { FallbackSonioxTranscriberLanguagesItem.Lo, "lo" }, + { FallbackSonioxTranscriberLanguagesItem.Lt, "lt" }, + { FallbackSonioxTranscriberLanguagesItem.Lu, "lu" }, + { FallbackSonioxTranscriberLanguagesItem.Lv, "lv" }, + { FallbackSonioxTranscriberLanguagesItem.Mg, "mg" }, + { FallbackSonioxTranscriberLanguagesItem.Mh, "mh" }, + { FallbackSonioxTranscriberLanguagesItem.Mi, "mi" }, + { FallbackSonioxTranscriberLanguagesItem.Mk, "mk" }, + { FallbackSonioxTranscriberLanguagesItem.Ml, "ml" }, + { FallbackSonioxTranscriberLanguagesItem.Mn, "mn" }, + { FallbackSonioxTranscriberLanguagesItem.Mr, "mr" }, + { FallbackSonioxTranscriberLanguagesItem.Ms, "ms" }, + { FallbackSonioxTranscriberLanguagesItem.Mt, "mt" }, + { FallbackSonioxTranscriberLanguagesItem.My, "my" }, + { FallbackSonioxTranscriberLanguagesItem.Na, "na" }, + { FallbackSonioxTranscriberLanguagesItem.Nb, "nb" }, + { FallbackSonioxTranscriberLanguagesItem.Nd, "nd" }, + { FallbackSonioxTranscriberLanguagesItem.Ne, "ne" }, + { FallbackSonioxTranscriberLanguagesItem.Ng, "ng" }, + { FallbackSonioxTranscriberLanguagesItem.Nl, "nl" }, + { FallbackSonioxTranscriberLanguagesItem.Nn, "nn" }, + { FallbackSonioxTranscriberLanguagesItem.No, "no" }, + { FallbackSonioxTranscriberLanguagesItem.Nr, "nr" }, + { FallbackSonioxTranscriberLanguagesItem.Nv, "nv" }, + { FallbackSonioxTranscriberLanguagesItem.Ny, "ny" }, + { FallbackSonioxTranscriberLanguagesItem.Oc, "oc" }, + { FallbackSonioxTranscriberLanguagesItem.Oj, "oj" }, + { FallbackSonioxTranscriberLanguagesItem.Om, "om" }, + { FallbackSonioxTranscriberLanguagesItem.Or, "or" }, + { FallbackSonioxTranscriberLanguagesItem.Os, "os" }, + { FallbackSonioxTranscriberLanguagesItem.Pa, "pa" }, + { FallbackSonioxTranscriberLanguagesItem.Pi, "pi" }, + { FallbackSonioxTranscriberLanguagesItem.Pl, "pl" }, + { FallbackSonioxTranscriberLanguagesItem.Ps, "ps" }, + { FallbackSonioxTranscriberLanguagesItem.Pt, "pt" }, + { FallbackSonioxTranscriberLanguagesItem.Qu, "qu" }, + { FallbackSonioxTranscriberLanguagesItem.Rm, "rm" }, + { FallbackSonioxTranscriberLanguagesItem.Rn, "rn" }, + { FallbackSonioxTranscriberLanguagesItem.Ro, "ro" }, + { FallbackSonioxTranscriberLanguagesItem.Ru, "ru" }, + { FallbackSonioxTranscriberLanguagesItem.Rw, "rw" }, + { FallbackSonioxTranscriberLanguagesItem.Sa, "sa" }, + { FallbackSonioxTranscriberLanguagesItem.Sc, "sc" }, + { FallbackSonioxTranscriberLanguagesItem.Sd, "sd" }, + { FallbackSonioxTranscriberLanguagesItem.Se, "se" }, + { FallbackSonioxTranscriberLanguagesItem.Sg, "sg" }, + { FallbackSonioxTranscriberLanguagesItem.Si, "si" }, + { FallbackSonioxTranscriberLanguagesItem.Sk, "sk" }, + { FallbackSonioxTranscriberLanguagesItem.Sl, "sl" }, + { FallbackSonioxTranscriberLanguagesItem.Sm, "sm" }, + { FallbackSonioxTranscriberLanguagesItem.Sn, "sn" }, + { FallbackSonioxTranscriberLanguagesItem.So, "so" }, + { FallbackSonioxTranscriberLanguagesItem.Sq, "sq" }, + { FallbackSonioxTranscriberLanguagesItem.Sr, "sr" }, + { FallbackSonioxTranscriberLanguagesItem.Ss, "ss" }, + { FallbackSonioxTranscriberLanguagesItem.St, "st" }, + { FallbackSonioxTranscriberLanguagesItem.Su, "su" }, + { FallbackSonioxTranscriberLanguagesItem.Sv, "sv" }, + { FallbackSonioxTranscriberLanguagesItem.Sw, "sw" }, + { FallbackSonioxTranscriberLanguagesItem.Ta, "ta" }, + { FallbackSonioxTranscriberLanguagesItem.Te, "te" }, + { FallbackSonioxTranscriberLanguagesItem.Tg, "tg" }, + { FallbackSonioxTranscriberLanguagesItem.Th, "th" }, + { FallbackSonioxTranscriberLanguagesItem.Ti, "ti" }, + { FallbackSonioxTranscriberLanguagesItem.Tk, "tk" }, + { FallbackSonioxTranscriberLanguagesItem.Tl, "tl" }, + { FallbackSonioxTranscriberLanguagesItem.Tn, "tn" }, + { FallbackSonioxTranscriberLanguagesItem.To, "to" }, + { FallbackSonioxTranscriberLanguagesItem.Tr, "tr" }, + { FallbackSonioxTranscriberLanguagesItem.Ts, "ts" }, + { FallbackSonioxTranscriberLanguagesItem.Tt, "tt" }, + { FallbackSonioxTranscriberLanguagesItem.Tw, "tw" }, + { FallbackSonioxTranscriberLanguagesItem.Ty, "ty" }, + { FallbackSonioxTranscriberLanguagesItem.Ug, "ug" }, + { FallbackSonioxTranscriberLanguagesItem.Uk, "uk" }, + { FallbackSonioxTranscriberLanguagesItem.Ur, "ur" }, + { FallbackSonioxTranscriberLanguagesItem.Uz, "uz" }, + { FallbackSonioxTranscriberLanguagesItem.Ve, "ve" }, + { FallbackSonioxTranscriberLanguagesItem.Vi, "vi" }, + { FallbackSonioxTranscriberLanguagesItem.Vo, "vo" }, + { FallbackSonioxTranscriberLanguagesItem.Wa, "wa" }, + { FallbackSonioxTranscriberLanguagesItem.Wo, "wo" }, + { FallbackSonioxTranscriberLanguagesItem.Xh, "xh" }, + { FallbackSonioxTranscriberLanguagesItem.Yi, "yi" }, + { FallbackSonioxTranscriberLanguagesItem.Yue, "yue" }, + { FallbackSonioxTranscriberLanguagesItem.Yo, "yo" }, + { FallbackSonioxTranscriberLanguagesItem.Za, "za" }, + { FallbackSonioxTranscriberLanguagesItem.Zh, "zh" }, + { FallbackSonioxTranscriberLanguagesItem.Zu, "zu" }, + }; + + public override FallbackSonioxTranscriberLanguagesItem Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + FallbackSonioxTranscriberLanguagesItem value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override FallbackSonioxTranscriberLanguagesItem ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + FallbackSonioxTranscriberLanguagesItem value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/FallbackSonioxTranscriberModel.cs b/src/Vapi.Net/Types/FallbackSonioxTranscriberModel.cs index 5fc285d1..0c3f643e 100644 --- a/src/Vapi.Net/Types/FallbackSonioxTranscriberModel.cs +++ b/src/Vapi.Net/Types/FallbackSonioxTranscriberModel.cs @@ -8,6 +8,9 @@ public enum FallbackSonioxTranscriberModel { [EnumMember(Value = "stt-rt-v4")] SttRtV4, + + [EnumMember(Value = "stt-rt-v5")] + SttRtV5, } internal class FallbackSonioxTranscriberModelSerializer @@ -16,12 +19,20 @@ internal class FallbackSonioxTranscriberModelSerializer private static readonly global::System.Collections.Generic.Dictionary< string, FallbackSonioxTranscriberModel - > _stringToEnum = new() { { "stt-rt-v4", FallbackSonioxTranscriberModel.SttRtV4 } }; + > _stringToEnum = new() + { + { "stt-rt-v4", FallbackSonioxTranscriberModel.SttRtV4 }, + { "stt-rt-v5", FallbackSonioxTranscriberModel.SttRtV5 }, + }; private static readonly global::System.Collections.Generic.Dictionary< FallbackSonioxTranscriberModel, string - > _enumToString = new() { { FallbackSonioxTranscriberModel.SttRtV4, "stt-rt-v4" } }; + > _enumToString = new() + { + { FallbackSonioxTranscriberModel.SttRtV4, "stt-rt-v4" }, + { FallbackSonioxTranscriberModel.SttRtV5, "stt-rt-v5" }, + }; public override FallbackSonioxTranscriberModel Read( ref global::System.Text.Json.Utf8JsonReader reader, diff --git a/src/Vapi.Net/Types/FallbackSpeechmaticsTranscriber.cs b/src/Vapi.Net/Types/FallbackSpeechmaticsTranscriber.cs index 4dbf8304..42609cc2 100644 --- a/src/Vapi.Net/Types/FallbackSpeechmaticsTranscriber.cs +++ b/src/Vapi.Net/Types/FallbackSpeechmaticsTranscriber.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Fallback configuration for transcribing speech with Speechmatics, including language, region, diarization, vocabulary, endpointing, and formatting. +/// [Serializable] public record FallbackSpeechmaticsTranscriber : IJsonOnDeserialized { @@ -17,6 +20,9 @@ public record FallbackSpeechmaticsTranscriber : IJsonOnDeserialized [JsonPropertyName("model")] public FallbackSpeechmaticsTranscriberModel? Model { get; set; } + /// + /// Language used for transcription. Set to `auto` to detect the language automatically. + /// [JsonPropertyName("language")] public FallbackSpeechmaticsTranscriberLanguage? Language { get; set; } @@ -52,6 +58,9 @@ public record FallbackSpeechmaticsTranscriber : IJsonOnDeserialized [JsonPropertyName("maxDelay")] public double? MaxDelay { get; set; } + /// + /// Words and phrases that Speechmatics should recognize more accurately, with optional phonetic alternatives. + /// [JsonPropertyName("customVocabulary")] public IEnumerable CustomVocabulary { get; set; } = new List(); diff --git a/src/Vapi.Net/Types/FallbackTalkscriberTranscriber.cs b/src/Vapi.Net/Types/FallbackTalkscriberTranscriber.cs index ce03f5c2..57501629 100644 --- a/src/Vapi.Net/Types/FallbackTalkscriberTranscriber.cs +++ b/src/Vapi.Net/Types/FallbackTalkscriberTranscriber.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Fallback configuration for transcribing speech with Talkscriber, including model and language. +/// [Serializable] public record FallbackTalkscriberTranscriber : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/FallbackTavusVoice.cs b/src/Vapi.Net/Types/FallbackTavusVoice.cs index 901cfa94..e09e6a0e 100644 --- a/src/Vapi.Net/Types/FallbackTavusVoice.cs +++ b/src/Vapi.Net/Types/FallbackTavusVoice.cs @@ -5,6 +5,9 @@ namespace Vapi.Net; +/// +/// Fallback configuration for using Tavus as the assistant's voice provider, including persona, callback, context, greeting, conversation properties, chunking, and caching. +/// [Serializable] public record FallbackTavusVoice : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/FallbackTranscriberPlan.cs b/src/Vapi.Net/Types/FallbackTranscriberPlan.cs index 9689acf3..e4d76a6f 100644 --- a/src/Vapi.Net/Types/FallbackTranscriberPlan.cs +++ b/src/Vapi.Net/Types/FallbackTranscriberPlan.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Lists backup transcriber configurations that can be used if the primary transcriber fails. +/// [Serializable] public record FallbackTranscriberPlan : IJsonOnDeserialized { @@ -11,8 +14,11 @@ public record FallbackTranscriberPlan : IJsonOnDeserialized private readonly IDictionary _extensionData = new Dictionary(); + /// + /// Transcriber configurations available when the primary transcriber fails. + /// [JsonPropertyName("transcribers")] - public IEnumerable Transcribers { get; set; } = new List(); + public IEnumerable? Transcribers { get; set; } [JsonIgnore] public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); diff --git a/src/Vapi.Net/Types/FallbackVapiVoice.cs b/src/Vapi.Net/Types/FallbackVapiVoice.cs index 9934d61b..bb725265 100644 --- a/src/Vapi.Net/Types/FallbackVapiVoice.cs +++ b/src/Vapi.Net/Types/FallbackVapiVoice.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Fallback configuration for synthesizing assistant speech with Vapi, including voice selection, speed, pronunciation dictionary, chunking, and caching. +/// [Serializable] public record FallbackVapiVoice : IJsonOnDeserialized { @@ -23,6 +26,12 @@ public record FallbackVapiVoice : IJsonOnDeserialized [JsonPropertyName("voiceId")] public required FallbackVapiVoiceVoiceId VoiceId { get; set; } + /// + /// The Vapi voice routing generation. `latest` auto-updates to the newest generation; version 1 uses legacy mappings; version 2 can use xAI-backed voices when available. When omitted, Version 1 is used. Accepts the string channel ('latest', '1', '2'); legacy numeric values (1, 2) are also accepted and coerced to their string form. + /// + [JsonPropertyName("version")] + public FallbackVapiVoiceVersion? Version { get; set; } + /// /// This is the speed multiplier that will be used. /// @@ -31,6 +40,12 @@ public record FallbackVapiVoice : IJsonOnDeserialized [JsonPropertyName("speed")] public double? Speed { get; set; } + /// + /// Language for Vapi voice synthesis. For Version 2, omit this field or set `auto` for automatic language detection. Version 1 supports legacy Vapi language values. + /// + [JsonPropertyName("language")] + public FallbackVapiVoiceLanguage? Language { get; set; } + /// /// List of pronunciation dictionary locators for custom word pronunciations. /// diff --git a/src/Vapi.Net/Types/FallbackVapiVoiceLanguage.cs b/src/Vapi.Net/Types/FallbackVapiVoiceLanguage.cs new file mode 100644 index 00000000..1b6e263c --- /dev/null +++ b/src/Vapi.Net/Types/FallbackVapiVoiceLanguage.cs @@ -0,0 +1,359 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(FallbackVapiVoiceLanguageSerializer))] +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, + + [EnumMember(Value = "auto")] + Auto, + + [EnumMember(Value = "en")] + En, + + [EnumMember(Value = "ar")] + Ar, + + [EnumMember(Value = "ar-EG")] + ArEg, + + [EnumMember(Value = "bn")] + Bn, + + [EnumMember(Value = "es")] + Es, + + [EnumMember(Value = "fr")] + Fr, + + [EnumMember(Value = "gu")] + Gu, + + [EnumMember(Value = "he")] + He, + + [EnumMember(Value = "ka")] + Ka, + + [EnumMember(Value = "kn")] + Kn, + + [EnumMember(Value = "ml")] + Ml, + + [EnumMember(Value = "mr")] + Mr, + + [EnumMember(Value = "pa")] + Pa, + + [EnumMember(Value = "pt")] + Pt, + + [EnumMember(Value = "te")] + Te, + + [EnumMember(Value = "th")] + Th, + + [EnumMember(Value = "tl")] + Tl, +} + +internal class FallbackVapiVoiceLanguageSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + FallbackVapiVoiceLanguage + > _stringToEnum = new() + { + { "en-US", FallbackVapiVoiceLanguage.EnUs }, + { "en-GB", FallbackVapiVoiceLanguage.EnGb }, + { "en-AU", FallbackVapiVoiceLanguage.EnAu }, + { "en-CA", FallbackVapiVoiceLanguage.EnCa }, + { "ja", FallbackVapiVoiceLanguage.Ja }, + { "zh", FallbackVapiVoiceLanguage.Zh }, + { "de", FallbackVapiVoiceLanguage.De }, + { "hi", FallbackVapiVoiceLanguage.Hi }, + { "fr-FR", FallbackVapiVoiceLanguage.FrFr }, + { "fr-CA", FallbackVapiVoiceLanguage.FrCa }, + { "ko", FallbackVapiVoiceLanguage.Ko }, + { "pt-BR", FallbackVapiVoiceLanguage.PtBr }, + { "pt-PT", FallbackVapiVoiceLanguage.PtPt }, + { "it", FallbackVapiVoiceLanguage.It }, + { "es-ES", FallbackVapiVoiceLanguage.EsEs }, + { "es-MX", FallbackVapiVoiceLanguage.EsMx }, + { "id", FallbackVapiVoiceLanguage.Id }, + { "nl", FallbackVapiVoiceLanguage.Nl }, + { "tr", FallbackVapiVoiceLanguage.Tr }, + { "fil", FallbackVapiVoiceLanguage.Fil }, + { "pl", FallbackVapiVoiceLanguage.Pl }, + { "sv", FallbackVapiVoiceLanguage.Sv }, + { "bg", FallbackVapiVoiceLanguage.Bg }, + { "ro", FallbackVapiVoiceLanguage.Ro }, + { "ar-SA", FallbackVapiVoiceLanguage.ArSa }, + { "ar-AE", FallbackVapiVoiceLanguage.ArAe }, + { "cs", FallbackVapiVoiceLanguage.Cs }, + { "el", FallbackVapiVoiceLanguage.El }, + { "fi", FallbackVapiVoiceLanguage.Fi }, + { "hr", FallbackVapiVoiceLanguage.Hr }, + { "ms", FallbackVapiVoiceLanguage.Ms }, + { "sk", FallbackVapiVoiceLanguage.Sk }, + { "da", FallbackVapiVoiceLanguage.Da }, + { "ta", FallbackVapiVoiceLanguage.Ta }, + { "uk", FallbackVapiVoiceLanguage.Uk }, + { "ru", FallbackVapiVoiceLanguage.Ru }, + { "hu", FallbackVapiVoiceLanguage.Hu }, + { "no", FallbackVapiVoiceLanguage.No }, + { "vi", FallbackVapiVoiceLanguage.Vi }, + { "auto", FallbackVapiVoiceLanguage.Auto }, + { "en", FallbackVapiVoiceLanguage.En }, + { "ar", FallbackVapiVoiceLanguage.Ar }, + { "ar-EG", FallbackVapiVoiceLanguage.ArEg }, + { "bn", FallbackVapiVoiceLanguage.Bn }, + { "es", FallbackVapiVoiceLanguage.Es }, + { "fr", FallbackVapiVoiceLanguage.Fr }, + { "gu", FallbackVapiVoiceLanguage.Gu }, + { "he", FallbackVapiVoiceLanguage.He }, + { "ka", FallbackVapiVoiceLanguage.Ka }, + { "kn", FallbackVapiVoiceLanguage.Kn }, + { "ml", FallbackVapiVoiceLanguage.Ml }, + { "mr", FallbackVapiVoiceLanguage.Mr }, + { "pa", FallbackVapiVoiceLanguage.Pa }, + { "pt", FallbackVapiVoiceLanguage.Pt }, + { "te", FallbackVapiVoiceLanguage.Te }, + { "th", FallbackVapiVoiceLanguage.Th }, + { "tl", FallbackVapiVoiceLanguage.Tl }, + }; + + private static readonly global::System.Collections.Generic.Dictionary< + FallbackVapiVoiceLanguage, + string + > _enumToString = new() + { + { FallbackVapiVoiceLanguage.EnUs, "en-US" }, + { FallbackVapiVoiceLanguage.EnGb, "en-GB" }, + { FallbackVapiVoiceLanguage.EnAu, "en-AU" }, + { FallbackVapiVoiceLanguage.EnCa, "en-CA" }, + { FallbackVapiVoiceLanguage.Ja, "ja" }, + { FallbackVapiVoiceLanguage.Zh, "zh" }, + { FallbackVapiVoiceLanguage.De, "de" }, + { FallbackVapiVoiceLanguage.Hi, "hi" }, + { FallbackVapiVoiceLanguage.FrFr, "fr-FR" }, + { FallbackVapiVoiceLanguage.FrCa, "fr-CA" }, + { FallbackVapiVoiceLanguage.Ko, "ko" }, + { FallbackVapiVoiceLanguage.PtBr, "pt-BR" }, + { FallbackVapiVoiceLanguage.PtPt, "pt-PT" }, + { FallbackVapiVoiceLanguage.It, "it" }, + { FallbackVapiVoiceLanguage.EsEs, "es-ES" }, + { FallbackVapiVoiceLanguage.EsMx, "es-MX" }, + { FallbackVapiVoiceLanguage.Id, "id" }, + { FallbackVapiVoiceLanguage.Nl, "nl" }, + { FallbackVapiVoiceLanguage.Tr, "tr" }, + { FallbackVapiVoiceLanguage.Fil, "fil" }, + { FallbackVapiVoiceLanguage.Pl, "pl" }, + { FallbackVapiVoiceLanguage.Sv, "sv" }, + { FallbackVapiVoiceLanguage.Bg, "bg" }, + { FallbackVapiVoiceLanguage.Ro, "ro" }, + { FallbackVapiVoiceLanguage.ArSa, "ar-SA" }, + { FallbackVapiVoiceLanguage.ArAe, "ar-AE" }, + { FallbackVapiVoiceLanguage.Cs, "cs" }, + { FallbackVapiVoiceLanguage.El, "el" }, + { FallbackVapiVoiceLanguage.Fi, "fi" }, + { FallbackVapiVoiceLanguage.Hr, "hr" }, + { FallbackVapiVoiceLanguage.Ms, "ms" }, + { FallbackVapiVoiceLanguage.Sk, "sk" }, + { FallbackVapiVoiceLanguage.Da, "da" }, + { FallbackVapiVoiceLanguage.Ta, "ta" }, + { FallbackVapiVoiceLanguage.Uk, "uk" }, + { FallbackVapiVoiceLanguage.Ru, "ru" }, + { FallbackVapiVoiceLanguage.Hu, "hu" }, + { FallbackVapiVoiceLanguage.No, "no" }, + { FallbackVapiVoiceLanguage.Vi, "vi" }, + { FallbackVapiVoiceLanguage.Auto, "auto" }, + { FallbackVapiVoiceLanguage.En, "en" }, + { FallbackVapiVoiceLanguage.Ar, "ar" }, + { FallbackVapiVoiceLanguage.ArEg, "ar-EG" }, + { FallbackVapiVoiceLanguage.Bn, "bn" }, + { FallbackVapiVoiceLanguage.Es, "es" }, + { FallbackVapiVoiceLanguage.Fr, "fr" }, + { FallbackVapiVoiceLanguage.Gu, "gu" }, + { FallbackVapiVoiceLanguage.He, "he" }, + { FallbackVapiVoiceLanguage.Ka, "ka" }, + { FallbackVapiVoiceLanguage.Kn, "kn" }, + { FallbackVapiVoiceLanguage.Ml, "ml" }, + { FallbackVapiVoiceLanguage.Mr, "mr" }, + { FallbackVapiVoiceLanguage.Pa, "pa" }, + { FallbackVapiVoiceLanguage.Pt, "pt" }, + { FallbackVapiVoiceLanguage.Te, "te" }, + { FallbackVapiVoiceLanguage.Th, "th" }, + { FallbackVapiVoiceLanguage.Tl, "tl" }, + }; + + public override FallbackVapiVoiceLanguage Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + FallbackVapiVoiceLanguage value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override FallbackVapiVoiceLanguage ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + FallbackVapiVoiceLanguage value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/FallbackVapiVoiceVersion.cs b/src/Vapi.Net/Types/FallbackVapiVoiceVersion.cs new file mode 100644 index 00000000..c81e6b66 --- /dev/null +++ b/src/Vapi.Net/Types/FallbackVapiVoiceVersion.cs @@ -0,0 +1,89 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(FallbackVapiVoiceVersionSerializer))] +public enum FallbackVapiVoiceVersion +{ + [EnumMember(Value = "1")] + One, + + [EnumMember(Value = "2")] + Two, + + [EnumMember(Value = "latest")] + Latest, +} + +internal class FallbackVapiVoiceVersionSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + FallbackVapiVoiceVersion + > _stringToEnum = new() + { + { "1", FallbackVapiVoiceVersion.One }, + { "2", FallbackVapiVoiceVersion.Two }, + { "latest", FallbackVapiVoiceVersion.Latest }, + }; + + private static readonly global::System.Collections.Generic.Dictionary< + FallbackVapiVoiceVersion, + string + > _enumToString = new() + { + { FallbackVapiVoiceVersion.One, "1" }, + { FallbackVapiVoiceVersion.Two, "2" }, + { FallbackVapiVoiceVersion.Latest, "latest" }, + }; + + public override FallbackVapiVoiceVersion Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + FallbackVapiVoiceVersion value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override FallbackVapiVoiceVersion ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + FallbackVapiVoiceVersion value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/FallbackVapiVoiceVoiceId.cs b/src/Vapi.Net/Types/FallbackVapiVoiceVoiceId.cs index 178febc1..70bbf700 100644 --- a/src/Vapi.Net/Types/FallbackVapiVoiceVoiceId.cs +++ b/src/Vapi.Net/Types/FallbackVapiVoiceVoiceId.cs @@ -12,6 +12,27 @@ public enum FallbackVapiVoiceVoiceId [EnumMember(Value = "Godfrey")] Godfrey, + [EnumMember(Value = "Elliot")] + Elliot, + + [EnumMember(Value = "Savannah")] + Savannah, + + [EnumMember(Value = "Nico")] + Nico, + + [EnumMember(Value = "Kai")] + Kai, + + [EnumMember(Value = "Emma")] + Emma, + + [EnumMember(Value = "Sagar")] + Sagar, + + [EnumMember(Value = "Neil")] + Neil, + [EnumMember(Value = "Layla")] Layla, @@ -21,9 +42,6 @@ public enum FallbackVapiVoiceVoiceId [EnumMember(Value = "Gustavo")] Gustavo, - [EnumMember(Value = "Elliot")] - Elliot, - [EnumMember(Value = "Kylie")] Kylie, @@ -33,9 +51,6 @@ public enum FallbackVapiVoiceVoiceId [EnumMember(Value = "Lily")] Lily, - [EnumMember(Value = "Savannah")] - Savannah, - [EnumMember(Value = "Hana")] Hana, @@ -54,21 +69,6 @@ public enum FallbackVapiVoiceVoiceId [EnumMember(Value = "Spencer")] Spencer, - [EnumMember(Value = "Nico")] - Nico, - - [EnumMember(Value = "Kai")] - Kai, - - [EnumMember(Value = "Emma")] - Emma, - - [EnumMember(Value = "Sagar")] - Sagar, - - [EnumMember(Value = "Neil")] - Neil, - [EnumMember(Value = "Naina")] Naina, @@ -107,25 +107,25 @@ internal class FallbackVapiVoiceVoiceIdSerializer { { "Clara", FallbackVapiVoiceVoiceId.Clara }, { "Godfrey", FallbackVapiVoiceVoiceId.Godfrey }, + { "Elliot", FallbackVapiVoiceVoiceId.Elliot }, + { "Savannah", FallbackVapiVoiceVoiceId.Savannah }, + { "Nico", FallbackVapiVoiceVoiceId.Nico }, + { "Kai", FallbackVapiVoiceVoiceId.Kai }, + { "Emma", FallbackVapiVoiceVoiceId.Emma }, + { "Sagar", FallbackVapiVoiceVoiceId.Sagar }, + { "Neil", FallbackVapiVoiceVoiceId.Neil }, { "Layla", FallbackVapiVoiceVoiceId.Layla }, { "Sid", FallbackVapiVoiceVoiceId.Sid }, { "Gustavo", FallbackVapiVoiceVoiceId.Gustavo }, - { "Elliot", FallbackVapiVoiceVoiceId.Elliot }, { "Kylie", FallbackVapiVoiceVoiceId.Kylie }, { "Rohan", FallbackVapiVoiceVoiceId.Rohan }, { "Lily", FallbackVapiVoiceVoiceId.Lily }, - { "Savannah", FallbackVapiVoiceVoiceId.Savannah }, { "Hana", FallbackVapiVoiceVoiceId.Hana }, { "Neha", FallbackVapiVoiceVoiceId.Neha }, { "Cole", FallbackVapiVoiceVoiceId.Cole }, { "Harry", FallbackVapiVoiceVoiceId.Harry }, { "Paige", FallbackVapiVoiceVoiceId.Paige }, { "Spencer", FallbackVapiVoiceVoiceId.Spencer }, - { "Nico", FallbackVapiVoiceVoiceId.Nico }, - { "Kai", FallbackVapiVoiceVoiceId.Kai }, - { "Emma", FallbackVapiVoiceVoiceId.Emma }, - { "Sagar", FallbackVapiVoiceVoiceId.Sagar }, - { "Neil", FallbackVapiVoiceVoiceId.Neil }, { "Naina", FallbackVapiVoiceVoiceId.Naina }, { "Leah", FallbackVapiVoiceVoiceId.Leah }, { "Tara", FallbackVapiVoiceVoiceId.Tara }, @@ -144,25 +144,25 @@ internal class FallbackVapiVoiceVoiceIdSerializer { { FallbackVapiVoiceVoiceId.Clara, "Clara" }, { FallbackVapiVoiceVoiceId.Godfrey, "Godfrey" }, + { FallbackVapiVoiceVoiceId.Elliot, "Elliot" }, + { FallbackVapiVoiceVoiceId.Savannah, "Savannah" }, + { FallbackVapiVoiceVoiceId.Nico, "Nico" }, + { FallbackVapiVoiceVoiceId.Kai, "Kai" }, + { FallbackVapiVoiceVoiceId.Emma, "Emma" }, + { FallbackVapiVoiceVoiceId.Sagar, "Sagar" }, + { FallbackVapiVoiceVoiceId.Neil, "Neil" }, { FallbackVapiVoiceVoiceId.Layla, "Layla" }, { FallbackVapiVoiceVoiceId.Sid, "Sid" }, { FallbackVapiVoiceVoiceId.Gustavo, "Gustavo" }, - { FallbackVapiVoiceVoiceId.Elliot, "Elliot" }, { FallbackVapiVoiceVoiceId.Kylie, "Kylie" }, { FallbackVapiVoiceVoiceId.Rohan, "Rohan" }, { FallbackVapiVoiceVoiceId.Lily, "Lily" }, - { FallbackVapiVoiceVoiceId.Savannah, "Savannah" }, { FallbackVapiVoiceVoiceId.Hana, "Hana" }, { FallbackVapiVoiceVoiceId.Neha, "Neha" }, { FallbackVapiVoiceVoiceId.Cole, "Cole" }, { FallbackVapiVoiceVoiceId.Harry, "Harry" }, { FallbackVapiVoiceVoiceId.Paige, "Paige" }, { FallbackVapiVoiceVoiceId.Spencer, "Spencer" }, - { FallbackVapiVoiceVoiceId.Nico, "Nico" }, - { FallbackVapiVoiceVoiceId.Kai, "Kai" }, - { FallbackVapiVoiceVoiceId.Emma, "Emma" }, - { FallbackVapiVoiceVoiceId.Sagar, "Sagar" }, - { FallbackVapiVoiceVoiceId.Neil, "Neil" }, { FallbackVapiVoiceVoiceId.Naina, "Naina" }, { FallbackVapiVoiceVoiceId.Leah, "Leah" }, { FallbackVapiVoiceVoiceId.Tara, "Tara" }, diff --git a/src/Vapi.Net/Types/FallbackWellSaidVoice.cs b/src/Vapi.Net/Types/FallbackWellSaidVoice.cs index 69406fa7..b8ec74de 100644 --- a/src/Vapi.Net/Types/FallbackWellSaidVoice.cs +++ b/src/Vapi.Net/Types/FallbackWellSaidVoice.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Fallback configuration for synthesizing assistant speech with WellSaid, including voice and model selection, Speech Synthesis Markup Language support, voice libraries, chunking, and caching. +/// [Serializable] public record FallbackWellSaidVoice : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/FallbackXaiTranscriber.cs b/src/Vapi.Net/Types/FallbackXaiTranscriber.cs new file mode 100644 index 00000000..0ef276ba --- /dev/null +++ b/src/Vapi.Net/Types/FallbackXaiTranscriber.cs @@ -0,0 +1,37 @@ +using global::System.Text.Json; +using global::System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[Serializable] +public record FallbackXaiTranscriber : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + /// + /// The xAI speech-to-text model to use. xAI currently exposes a single STT model — placeholder for future model selection. + /// + [JsonPropertyName("model")] + public FallbackXaiTranscriberModel? Model { get; set; } + + /// + /// Single language for transcription as an ISO 639-1 code (e.g., `en`, `es`). Defaults to `en` if not set. xAI auto-detects when omitted via the API but Vapi defaults to English for deterministic behavior. + /// + [JsonPropertyName("language")] + public FallbackXaiTranscriberLanguage? Language { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/FallbackXaiTranscriberLanguage.cs b/src/Vapi.Net/Types/FallbackXaiTranscriberLanguage.cs new file mode 100644 index 00000000..60bc37ab --- /dev/null +++ b/src/Vapi.Net/Types/FallbackXaiTranscriberLanguage.cs @@ -0,0 +1,199 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(FallbackXaiTranscriberLanguageSerializer))] +public enum FallbackXaiTranscriberLanguage +{ + [EnumMember(Value = "ar")] + Ar, + + [EnumMember(Value = "cs")] + Cs, + + [EnumMember(Value = "da")] + Da, + + [EnumMember(Value = "nl")] + Nl, + + [EnumMember(Value = "en")] + En, + + [EnumMember(Value = "fil")] + Fil, + + [EnumMember(Value = "fr")] + Fr, + + [EnumMember(Value = "de")] + De, + + [EnumMember(Value = "hi")] + Hi, + + [EnumMember(Value = "id")] + Id, + + [EnumMember(Value = "it")] + It, + + [EnumMember(Value = "ja")] + Ja, + + [EnumMember(Value = "ko")] + Ko, + + [EnumMember(Value = "mk")] + Mk, + + [EnumMember(Value = "ms")] + Ms, + + [EnumMember(Value = "fa")] + Fa, + + [EnumMember(Value = "pl")] + Pl, + + [EnumMember(Value = "pt")] + Pt, + + [EnumMember(Value = "ro")] + Ro, + + [EnumMember(Value = "ru")] + Ru, + + [EnumMember(Value = "es")] + Es, + + [EnumMember(Value = "sv")] + Sv, + + [EnumMember(Value = "th")] + Th, + + [EnumMember(Value = "tr")] + Tr, + + [EnumMember(Value = "vi")] + Vi, +} + +internal class FallbackXaiTranscriberLanguageSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + FallbackXaiTranscriberLanguage + > _stringToEnum = new() + { + { "ar", FallbackXaiTranscriberLanguage.Ar }, + { "cs", FallbackXaiTranscriberLanguage.Cs }, + { "da", FallbackXaiTranscriberLanguage.Da }, + { "nl", FallbackXaiTranscriberLanguage.Nl }, + { "en", FallbackXaiTranscriberLanguage.En }, + { "fil", FallbackXaiTranscriberLanguage.Fil }, + { "fr", FallbackXaiTranscriberLanguage.Fr }, + { "de", FallbackXaiTranscriberLanguage.De }, + { "hi", FallbackXaiTranscriberLanguage.Hi }, + { "id", FallbackXaiTranscriberLanguage.Id }, + { "it", FallbackXaiTranscriberLanguage.It }, + { "ja", FallbackXaiTranscriberLanguage.Ja }, + { "ko", FallbackXaiTranscriberLanguage.Ko }, + { "mk", FallbackXaiTranscriberLanguage.Mk }, + { "ms", FallbackXaiTranscriberLanguage.Ms }, + { "fa", FallbackXaiTranscriberLanguage.Fa }, + { "pl", FallbackXaiTranscriberLanguage.Pl }, + { "pt", FallbackXaiTranscriberLanguage.Pt }, + { "ro", FallbackXaiTranscriberLanguage.Ro }, + { "ru", FallbackXaiTranscriberLanguage.Ru }, + { "es", FallbackXaiTranscriberLanguage.Es }, + { "sv", FallbackXaiTranscriberLanguage.Sv }, + { "th", FallbackXaiTranscriberLanguage.Th }, + { "tr", FallbackXaiTranscriberLanguage.Tr }, + { "vi", FallbackXaiTranscriberLanguage.Vi }, + }; + + private static readonly global::System.Collections.Generic.Dictionary< + FallbackXaiTranscriberLanguage, + string + > _enumToString = new() + { + { FallbackXaiTranscriberLanguage.Ar, "ar" }, + { FallbackXaiTranscriberLanguage.Cs, "cs" }, + { FallbackXaiTranscriberLanguage.Da, "da" }, + { FallbackXaiTranscriberLanguage.Nl, "nl" }, + { FallbackXaiTranscriberLanguage.En, "en" }, + { FallbackXaiTranscriberLanguage.Fil, "fil" }, + { FallbackXaiTranscriberLanguage.Fr, "fr" }, + { FallbackXaiTranscriberLanguage.De, "de" }, + { FallbackXaiTranscriberLanguage.Hi, "hi" }, + { FallbackXaiTranscriberLanguage.Id, "id" }, + { FallbackXaiTranscriberLanguage.It, "it" }, + { FallbackXaiTranscriberLanguage.Ja, "ja" }, + { FallbackXaiTranscriberLanguage.Ko, "ko" }, + { FallbackXaiTranscriberLanguage.Mk, "mk" }, + { FallbackXaiTranscriberLanguage.Ms, "ms" }, + { FallbackXaiTranscriberLanguage.Fa, "fa" }, + { FallbackXaiTranscriberLanguage.Pl, "pl" }, + { FallbackXaiTranscriberLanguage.Pt, "pt" }, + { FallbackXaiTranscriberLanguage.Ro, "ro" }, + { FallbackXaiTranscriberLanguage.Ru, "ru" }, + { FallbackXaiTranscriberLanguage.Es, "es" }, + { FallbackXaiTranscriberLanguage.Sv, "sv" }, + { FallbackXaiTranscriberLanguage.Th, "th" }, + { FallbackXaiTranscriberLanguage.Tr, "tr" }, + { FallbackXaiTranscriberLanguage.Vi, "vi" }, + }; + + public override FallbackXaiTranscriberLanguage Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + FallbackXaiTranscriberLanguage value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override FallbackXaiTranscriberLanguage ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + FallbackXaiTranscriberLanguage value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/FallbackXaiTranscriberModel.cs b/src/Vapi.Net/Types/FallbackXaiTranscriberModel.cs new file mode 100644 index 00000000..62e7771c --- /dev/null +++ b/src/Vapi.Net/Types/FallbackXaiTranscriberModel.cs @@ -0,0 +1,73 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(FallbackXaiTranscriberModelSerializer))] +public enum FallbackXaiTranscriberModel +{ + [EnumMember(Value = "default")] + Default, +} + +internal class FallbackXaiTranscriberModelSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + FallbackXaiTranscriberModel + > _stringToEnum = new() { { "default", FallbackXaiTranscriberModel.Default } }; + + private static readonly global::System.Collections.Generic.Dictionary< + FallbackXaiTranscriberModel, + string + > _enumToString = new() { { FallbackXaiTranscriberModel.Default, "default" } }; + + public override FallbackXaiTranscriberModel Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + FallbackXaiTranscriberModel value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override FallbackXaiTranscriberModel ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + FallbackXaiTranscriberModel value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/FallbackXaiVoice.cs b/src/Vapi.Net/Types/FallbackXaiVoice.cs new file mode 100644 index 00000000..225825a7 --- /dev/null +++ b/src/Vapi.Net/Types/FallbackXaiVoice.cs @@ -0,0 +1,55 @@ +using global::System.Text.Json; +using global::System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[Serializable] +public record FallbackXaiVoice : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + /// + /// This is the flag to toggle voice caching for the assistant. + /// + [JsonPropertyName("cachingEnabled")] + public bool? CachingEnabled { get; set; } + + /// + /// Built-in voices: eve, ara, rex, sal, leo. Cloned voice IDs are also accepted. + /// + [JsonPropertyName("voiceId")] + public required FallbackXaiVoiceVoiceId VoiceId { get; set; } + + /// + /// BCP-47 language code for xAI TTS synthesis. + /// + [JsonPropertyName("language")] + public FallbackXaiVoiceLanguage? Language { get; set; } + + /// + /// Speed multiplier for xAI TTS synthesis. + /// + [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; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/FallbackXaiVoiceLanguage.cs b/src/Vapi.Net/Types/FallbackXaiVoiceLanguage.cs new file mode 100644 index 00000000..6f8d27aa --- /dev/null +++ b/src/Vapi.Net/Types/FallbackXaiVoiceLanguage.cs @@ -0,0 +1,179 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(FallbackXaiVoiceLanguageSerializer))] +public enum FallbackXaiVoiceLanguage +{ + [EnumMember(Value = "auto")] + Auto, + + [EnumMember(Value = "en")] + En, + + [EnumMember(Value = "ar-EG")] + ArEg, + + [EnumMember(Value = "ar-SA")] + ArSa, + + [EnumMember(Value = "ar-AE")] + ArAe, + + [EnumMember(Value = "bn")] + Bn, + + [EnumMember(Value = "zh")] + Zh, + + [EnumMember(Value = "fr")] + Fr, + + [EnumMember(Value = "de")] + De, + + [EnumMember(Value = "hi")] + Hi, + + [EnumMember(Value = "id")] + Id, + + [EnumMember(Value = "it")] + It, + + [EnumMember(Value = "ja")] + Ja, + + [EnumMember(Value = "ko")] + Ko, + + [EnumMember(Value = "pt-BR")] + PtBr, + + [EnumMember(Value = "pt-PT")] + PtPt, + + [EnumMember(Value = "ru")] + Ru, + + [EnumMember(Value = "es-MX")] + EsMx, + + [EnumMember(Value = "es-ES")] + EsEs, + + [EnumMember(Value = "tr")] + Tr, + + [EnumMember(Value = "vi")] + Vi, +} + +internal class FallbackXaiVoiceLanguageSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + FallbackXaiVoiceLanguage + > _stringToEnum = new() + { + { "auto", FallbackXaiVoiceLanguage.Auto }, + { "en", FallbackXaiVoiceLanguage.En }, + { "ar-EG", FallbackXaiVoiceLanguage.ArEg }, + { "ar-SA", FallbackXaiVoiceLanguage.ArSa }, + { "ar-AE", FallbackXaiVoiceLanguage.ArAe }, + { "bn", FallbackXaiVoiceLanguage.Bn }, + { "zh", FallbackXaiVoiceLanguage.Zh }, + { "fr", FallbackXaiVoiceLanguage.Fr }, + { "de", FallbackXaiVoiceLanguage.De }, + { "hi", FallbackXaiVoiceLanguage.Hi }, + { "id", FallbackXaiVoiceLanguage.Id }, + { "it", FallbackXaiVoiceLanguage.It }, + { "ja", FallbackXaiVoiceLanguage.Ja }, + { "ko", FallbackXaiVoiceLanguage.Ko }, + { "pt-BR", FallbackXaiVoiceLanguage.PtBr }, + { "pt-PT", FallbackXaiVoiceLanguage.PtPt }, + { "ru", FallbackXaiVoiceLanguage.Ru }, + { "es-MX", FallbackXaiVoiceLanguage.EsMx }, + { "es-ES", FallbackXaiVoiceLanguage.EsEs }, + { "tr", FallbackXaiVoiceLanguage.Tr }, + { "vi", FallbackXaiVoiceLanguage.Vi }, + }; + + private static readonly global::System.Collections.Generic.Dictionary< + FallbackXaiVoiceLanguage, + string + > _enumToString = new() + { + { FallbackXaiVoiceLanguage.Auto, "auto" }, + { FallbackXaiVoiceLanguage.En, "en" }, + { FallbackXaiVoiceLanguage.ArEg, "ar-EG" }, + { FallbackXaiVoiceLanguage.ArSa, "ar-SA" }, + { FallbackXaiVoiceLanguage.ArAe, "ar-AE" }, + { FallbackXaiVoiceLanguage.Bn, "bn" }, + { FallbackXaiVoiceLanguage.Zh, "zh" }, + { FallbackXaiVoiceLanguage.Fr, "fr" }, + { FallbackXaiVoiceLanguage.De, "de" }, + { FallbackXaiVoiceLanguage.Hi, "hi" }, + { FallbackXaiVoiceLanguage.Id, "id" }, + { FallbackXaiVoiceLanguage.It, "it" }, + { FallbackXaiVoiceLanguage.Ja, "ja" }, + { FallbackXaiVoiceLanguage.Ko, "ko" }, + { FallbackXaiVoiceLanguage.PtBr, "pt-BR" }, + { FallbackXaiVoiceLanguage.PtPt, "pt-PT" }, + { FallbackXaiVoiceLanguage.Ru, "ru" }, + { FallbackXaiVoiceLanguage.EsMx, "es-MX" }, + { FallbackXaiVoiceLanguage.EsEs, "es-ES" }, + { FallbackXaiVoiceLanguage.Tr, "tr" }, + { FallbackXaiVoiceLanguage.Vi, "vi" }, + }; + + public override FallbackXaiVoiceLanguage Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + FallbackXaiVoiceLanguage value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override FallbackXaiVoiceLanguage ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + FallbackXaiVoiceLanguage value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/FallbackXaiVoiceVoiceId.cs b/src/Vapi.Net/Types/FallbackXaiVoiceVoiceId.cs new file mode 100644 index 00000000..8f6e1391 --- /dev/null +++ b/src/Vapi.Net/Types/FallbackXaiVoiceVoiceId.cs @@ -0,0 +1,99 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(FallbackXaiVoiceVoiceIdSerializer))] +public enum FallbackXaiVoiceVoiceId +{ + [EnumMember(Value = "eve")] + Eve, + + [EnumMember(Value = "ara")] + Ara, + + [EnumMember(Value = "rex")] + Rex, + + [EnumMember(Value = "sal")] + Sal, + + [EnumMember(Value = "leo")] + Leo, +} + +internal class FallbackXaiVoiceVoiceIdSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + FallbackXaiVoiceVoiceId + > _stringToEnum = new() + { + { "eve", FallbackXaiVoiceVoiceId.Eve }, + { "ara", FallbackXaiVoiceVoiceId.Ara }, + { "rex", FallbackXaiVoiceVoiceId.Rex }, + { "sal", FallbackXaiVoiceVoiceId.Sal }, + { "leo", FallbackXaiVoiceVoiceId.Leo }, + }; + + private static readonly global::System.Collections.Generic.Dictionary< + FallbackXaiVoiceVoiceId, + string + > _enumToString = new() + { + { FallbackXaiVoiceVoiceId.Eve, "eve" }, + { FallbackXaiVoiceVoiceId.Ara, "ara" }, + { FallbackXaiVoiceVoiceId.Rex, "rex" }, + { FallbackXaiVoiceVoiceId.Sal, "sal" }, + { FallbackXaiVoiceVoiceId.Leo, "leo" }, + }; + + public override FallbackXaiVoiceVoiceId Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + FallbackXaiVoiceVoiceId value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override FallbackXaiVoiceVoiceId ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + FallbackXaiVoiceVoiceId value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/File.cs b/src/Vapi.Net/Types/File.cs index 5799455f..0620aedc 100644 --- a/src/Vapi.Net/Types/File.cs +++ b/src/Vapi.Net/Types/File.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// An uploaded file record, including its processing status, storage details, extracted-text location, metadata, and lifecycle timestamps. +/// [Serializable] public record File : IJsonOnDeserialized { @@ -11,9 +14,15 @@ public record File : IJsonOnDeserialized private readonly IDictionary _extensionData = new Dictionary(); + /// + /// The object type. This is always `file`. + /// [JsonPropertyName("object")] public FileObject? Object { get; set; } + /// + /// The current processing status of the uploaded file. + /// [JsonPropertyName("status")] public FileStatus? Status { get; set; } @@ -23,36 +32,69 @@ public record File : IJsonOnDeserialized [JsonPropertyName("name")] public string? Name { get; set; } + /// + /// The original name of the uploaded file. + /// [JsonPropertyName("originalName")] public string? OriginalName { get; set; } + /// + /// The size of the uploaded file in bytes. + /// [JsonPropertyName("bytes")] public double? Bytes { get; set; } + /// + /// The intended use assigned to the uploaded file. + /// [JsonPropertyName("purpose")] public string? Purpose { get; set; } + /// + /// The MIME type of the uploaded file. + /// [JsonPropertyName("mimetype")] public string? Mimetype { get; set; } + /// + /// The object-storage key for the uploaded file. + /// [JsonPropertyName("key")] public string? Key { get; set; } + /// + /// The object-storage path for the uploaded file. + /// [JsonPropertyName("path")] public string? Path { get; set; } + /// + /// The object-storage bucket containing the uploaded file. + /// [JsonPropertyName("bucket")] public string? Bucket { get; set; } + /// + /// The URL used to access the uploaded file. + /// [JsonPropertyName("url")] public string? Url { get; set; } + /// + /// The URL used to access text extracted from the file. + /// [JsonPropertyName("parsedTextUrl")] public string? ParsedTextUrl { get; set; } + /// + /// The size of the extracted text in bytes. + /// [JsonPropertyName("parsedTextBytes")] public double? ParsedTextBytes { get; set; } + /// + /// Additional metadata associated with the uploaded file. + /// [JsonPropertyName("metadata")] public object? Metadata { get; set; } diff --git a/src/Vapi.Net/Types/FilterDateTypeColumnOnCallTable.cs b/src/Vapi.Net/Types/FilterDateTypeColumnOnCallTable.cs index 38368b33..b5b7679e 100644 --- a/src/Vapi.Net/Types/FilterDateTypeColumnOnCallTable.cs +++ b/src/Vapi.Net/Types/FilterDateTypeColumnOnCallTable.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Filters call records by comparing a start or end timestamp with a date. +/// [Serializable] public record FilterDateTypeColumnOnCallTable : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/FilterNumberArrayTypeColumnOnCallTable.cs b/src/Vapi.Net/Types/FilterNumberArrayTypeColumnOnCallTable.cs index 7df0999d..6556d48f 100644 --- a/src/Vapi.Net/Types/FilterNumberArrayTypeColumnOnCallTable.cs +++ b/src/Vapi.Net/Types/FilterNumberArrayTypeColumnOnCallTable.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Filters numeric call fields using a list of values or an emptiness test. +/// [Serializable] public record FilterNumberArrayTypeColumnOnCallTable : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/FilterNumberTypeColumnOnCallTable.cs b/src/Vapi.Net/Types/FilterNumberTypeColumnOnCallTable.cs index 130be359..b48272cd 100644 --- a/src/Vapi.Net/Types/FilterNumberTypeColumnOnCallTable.cs +++ b/src/Vapi.Net/Types/FilterNumberTypeColumnOnCallTable.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Filters call records by comparing a numeric field with a value. +/// [Serializable] public record FilterNumberTypeColumnOnCallTable : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/FilterStringArrayTypeColumnOnCallTable.cs b/src/Vapi.Net/Types/FilterStringArrayTypeColumnOnCallTable.cs index 115868ce..0ed78250 100644 --- a/src/Vapi.Net/Types/FilterStringArrayTypeColumnOnCallTable.cs +++ b/src/Vapi.Net/Types/FilterStringArrayTypeColumnOnCallTable.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Filters string-valued call fields using a list of values or an emptiness test. +/// [Serializable] public record FilterStringArrayTypeColumnOnCallTable : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/FilterStringTypeColumnOnCallTable.cs b/src/Vapi.Net/Types/FilterStringTypeColumnOnCallTable.cs index 9ec3767d..3950d97b 100644 --- a/src/Vapi.Net/Types/FilterStringTypeColumnOnCallTable.cs +++ b/src/Vapi.Net/Types/FilterStringTypeColumnOnCallTable.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Filters call records by comparing or searching a string-valued field. +/// [Serializable] public record FilterStringTypeColumnOnCallTable : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/FilterStructuredOutputColumnOnCallTable.cs b/src/Vapi.Net/Types/FilterStructuredOutputColumnOnCallTable.cs index 499b29c0..d42f6639 100644 --- a/src/Vapi.Net/Types/FilterStructuredOutputColumnOnCallTable.cs +++ b/src/Vapi.Net/Types/FilterStructuredOutputColumnOnCallTable.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Filters a structured-output value stored on a call using comparison, membership, containment, or emptiness operators. +/// [Serializable] public record FilterStructuredOutputColumnOnCallTable : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/FormatPlan.cs b/src/Vapi.Net/Types/FormatPlan.cs index c47c83b1..37c63f1d 100644 --- a/src/Vapi.Net/Types/FormatPlan.cs +++ b/src/Vapi.Net/Types/FormatPlan.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Controls text normalization before voice synthesis, including built-in formatters, number handling, and custom replacements. +/// [Serializable] public record FormatPlan : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/FourierDenoisingPlan.cs b/src/Vapi.Net/Types/FourierDenoisingPlan.cs index a5cd74d2..4abcb31b 100644 --- a/src/Vapi.Net/Types/FourierDenoisingPlan.cs +++ b/src/Vapi.Net/Types/FourierDenoisingPlan.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Configuration for Fourier denoising, including media detection, thresholds, baseline calculation, and analysis window. +/// [Serializable] public record FourierDenoisingPlan : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/FunctionCallHookAction.cs b/src/Vapi.Net/Types/FunctionCallHookAction.cs index 5694acab..e7f57450 100644 --- a/src/Vapi.Net/Types/FunctionCallHookAction.cs +++ b/src/Vapi.Net/Types/FunctionCallHookAction.cs @@ -12,9 +12,7 @@ public record FunctionCallHookAction : IJsonOnDeserialized new Dictionary(); /// - /// 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. + /// Messages spoken while the tool is running. Multiple request-start messages are variants. For request-response-delayed, same timing means variants and different timings mean staged updates. /// [JsonPropertyName("messages")] public IEnumerable? Messages { get; set; } diff --git a/src/Vapi.Net/Types/FunctionTool.cs b/src/Vapi.Net/Types/FunctionTool.cs index 289929ea..046288ce 100644 --- a/src/Vapi.Net/Types/FunctionTool.cs +++ b/src/Vapi.Net/Types/FunctionTool.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// A reusable custom function tool that sends model-generated arguments to a configured server and returns the result to the assistant. +/// [Serializable] public record FunctionTool : IJsonOnDeserialized { @@ -11,10 +14,11 @@ public record FunctionTool : IJsonOnDeserialized private readonly IDictionary _extensionData = new Dictionary(); + [JsonPropertyName("latestVersion")] + public string? LatestVersion { 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. + /// Messages spoken while the tool is running. Multiple request-start messages are variants. For request-response-delayed, same timing means variants and different timings mean staged updates. /// [JsonPropertyName("messages")] public IEnumerable? Messages { get; set; } diff --git a/src/Vapi.Net/Types/FunctionToolWithToolCall.cs b/src/Vapi.Net/Types/FunctionToolWithToolCall.cs index a60dc3ea..b4afe0a0 100644 --- a/src/Vapi.Net/Types/FunctionToolWithToolCall.cs +++ b/src/Vapi.Net/Types/FunctionToolWithToolCall.cs @@ -12,9 +12,7 @@ public record FunctionToolWithToolCall : IJsonOnDeserialized new Dictionary(); /// - /// 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. + /// Messages spoken while the tool is running. Multiple request-start messages are variants. For request-response-delayed, same timing means variants and different timings mean staged updates. /// [JsonPropertyName("messages")] public IEnumerable? Messages { get; set; } diff --git a/src/Vapi.Net/Types/GcpKey.cs b/src/Vapi.Net/Types/GcpKey.cs index 73d7c9e6..f3c7e586 100644 --- a/src/Vapi.Net/Types/GcpKey.cs +++ b/src/Vapi.Net/Types/GcpKey.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Google Cloud service-account key used to authenticate access to Google Cloud resources. +/// [Serializable] public record GcpKey : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/GeminiMultimodalLivePrebuiltVoiceConfig.cs b/src/Vapi.Net/Types/GeminiMultimodalLivePrebuiltVoiceConfig.cs index 520bb615..1fcc6d03 100644 --- a/src/Vapi.Net/Types/GeminiMultimodalLivePrebuiltVoiceConfig.cs +++ b/src/Vapi.Net/Types/GeminiMultimodalLivePrebuiltVoiceConfig.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Selects a prebuilt voice for Gemini Multimodal Live audio output. +/// [Serializable] public record GeminiMultimodalLivePrebuiltVoiceConfig : IJsonOnDeserialized { @@ -11,6 +14,9 @@ public record GeminiMultimodalLivePrebuiltVoiceConfig : IJsonOnDeserialized private readonly IDictionary _extensionData = new Dictionary(); + /// + /// Prebuilt Gemini voice used for audio output. + /// [JsonPropertyName("voiceName")] public required GeminiMultimodalLivePrebuiltVoiceConfigVoiceName VoiceName { get; set; } diff --git a/src/Vapi.Net/Types/GeminiMultimodalLiveSpeechConfig.cs b/src/Vapi.Net/Types/GeminiMultimodalLiveSpeechConfig.cs index 2832368d..2558b1b5 100644 --- a/src/Vapi.Net/Types/GeminiMultimodalLiveSpeechConfig.cs +++ b/src/Vapi.Net/Types/GeminiMultimodalLiveSpeechConfig.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Speech-output configuration for Gemini Multimodal Live. +/// [Serializable] public record GeminiMultimodalLiveSpeechConfig : IJsonOnDeserialized { @@ -11,6 +14,9 @@ public record GeminiMultimodalLiveSpeechConfig : IJsonOnDeserialized private readonly IDictionary _extensionData = new Dictionary(); + /// + /// Voice configuration used for Gemini Multimodal Live speech output. + /// [JsonPropertyName("voiceConfig")] public required GeminiMultimodalLiveVoiceConfig VoiceConfig { get; set; } diff --git a/src/Vapi.Net/Types/GeminiMultimodalLiveVoiceConfig.cs b/src/Vapi.Net/Types/GeminiMultimodalLiveVoiceConfig.cs index 52394f15..c69dd385 100644 --- a/src/Vapi.Net/Types/GeminiMultimodalLiveVoiceConfig.cs +++ b/src/Vapi.Net/Types/GeminiMultimodalLiveVoiceConfig.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Voice selection configuration for Gemini Multimodal Live. +/// [Serializable] public record GeminiMultimodalLiveVoiceConfig : IJsonOnDeserialized { @@ -11,6 +14,9 @@ public record GeminiMultimodalLiveVoiceConfig : IJsonOnDeserialized private readonly IDictionary _extensionData = new Dictionary(); + /// + /// Prebuilt voice used for Gemini Multimodal Live speech output. + /// [JsonPropertyName("prebuiltVoiceConfig")] public required GeminiMultimodalLivePrebuiltVoiceConfig PrebuiltVoiceConfig { get; set; } diff --git a/src/Vapi.Net/Types/GetChatPaginatedDto.cs b/src/Vapi.Net/Types/GetChatPaginatedDto.cs index 188bc3a3..4b495fb9 100644 --- a/src/Vapi.Net/Types/GetChatPaginatedDto.cs +++ b/src/Vapi.Net/Types/GetChatPaginatedDto.cs @@ -59,6 +59,12 @@ public record GetChatPaginatedDto : IJsonOnDeserialized [JsonPropertyName("sortOrder")] public GetChatPaginatedDtoSortOrder? SortOrder { get; set; } + /// + /// This is the column to sort by. Defaults to 'createdAt'. + /// + [JsonPropertyName("sortBy")] + public GetChatPaginatedDtoSortBy? SortBy { get; set; } + /// /// This is the maximum number of items to return. Defaults to 100. /// diff --git a/src/Vapi.Net/Types/GetChatPaginatedDtoSortBy.cs b/src/Vapi.Net/Types/GetChatPaginatedDtoSortBy.cs new file mode 100644 index 00000000..91bb9f7c --- /dev/null +++ b/src/Vapi.Net/Types/GetChatPaginatedDtoSortBy.cs @@ -0,0 +1,89 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(GetChatPaginatedDtoSortBySerializer))] +public enum GetChatPaginatedDtoSortBy +{ + [EnumMember(Value = "createdAt")] + CreatedAt, + + [EnumMember(Value = "duration")] + Duration, + + [EnumMember(Value = "cost")] + Cost, +} + +internal class GetChatPaginatedDtoSortBySerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + GetChatPaginatedDtoSortBy + > _stringToEnum = new() + { + { "createdAt", GetChatPaginatedDtoSortBy.CreatedAt }, + { "duration", GetChatPaginatedDtoSortBy.Duration }, + { "cost", GetChatPaginatedDtoSortBy.Cost }, + }; + + private static readonly global::System.Collections.Generic.Dictionary< + GetChatPaginatedDtoSortBy, + string + > _enumToString = new() + { + { GetChatPaginatedDtoSortBy.CreatedAt, "createdAt" }, + { GetChatPaginatedDtoSortBy.Duration, "duration" }, + { GetChatPaginatedDtoSortBy.Cost, "cost" }, + }; + + public override GetChatPaginatedDtoSortBy Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + GetChatPaginatedDtoSortBy value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override GetChatPaginatedDtoSortBy ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + GetChatPaginatedDtoSortBy value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/GetEvalPaginatedDto.cs b/src/Vapi.Net/Types/GetEvalPaginatedDto.cs index d9895d3a..6894aac5 100644 --- a/src/Vapi.Net/Types/GetEvalPaginatedDto.cs +++ b/src/Vapi.Net/Types/GetEvalPaginatedDto.cs @@ -26,6 +26,12 @@ public record GetEvalPaginatedDto : IJsonOnDeserialized [JsonPropertyName("sortOrder")] public GetEvalPaginatedDtoSortOrder? SortOrder { get; set; } + /// + /// This is the column to sort by. Defaults to 'createdAt'. + /// + [JsonPropertyName("sortBy")] + public GetEvalPaginatedDtoSortBy? SortBy { get; set; } + /// /// This is the maximum number of items to return. Defaults to 100. /// diff --git a/src/Vapi.Net/Types/GetEvalPaginatedDtoSortBy.cs b/src/Vapi.Net/Types/GetEvalPaginatedDtoSortBy.cs new file mode 100644 index 00000000..c426c1e3 --- /dev/null +++ b/src/Vapi.Net/Types/GetEvalPaginatedDtoSortBy.cs @@ -0,0 +1,89 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(GetEvalPaginatedDtoSortBySerializer))] +public enum GetEvalPaginatedDtoSortBy +{ + [EnumMember(Value = "createdAt")] + CreatedAt, + + [EnumMember(Value = "duration")] + Duration, + + [EnumMember(Value = "cost")] + Cost, +} + +internal class GetEvalPaginatedDtoSortBySerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + GetEvalPaginatedDtoSortBy + > _stringToEnum = new() + { + { "createdAt", GetEvalPaginatedDtoSortBy.CreatedAt }, + { "duration", GetEvalPaginatedDtoSortBy.Duration }, + { "cost", GetEvalPaginatedDtoSortBy.Cost }, + }; + + private static readonly global::System.Collections.Generic.Dictionary< + GetEvalPaginatedDtoSortBy, + string + > _enumToString = new() + { + { GetEvalPaginatedDtoSortBy.CreatedAt, "createdAt" }, + { GetEvalPaginatedDtoSortBy.Duration, "duration" }, + { GetEvalPaginatedDtoSortBy.Cost, "cost" }, + }; + + public override GetEvalPaginatedDtoSortBy Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + GetEvalPaginatedDtoSortBy value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override GetEvalPaginatedDtoSortBy ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + GetEvalPaginatedDtoSortBy value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/GetEvalRunPaginatedDto.cs b/src/Vapi.Net/Types/GetEvalRunPaginatedDto.cs index ba9ce0b4..239f40c3 100644 --- a/src/Vapi.Net/Types/GetEvalRunPaginatedDto.cs +++ b/src/Vapi.Net/Types/GetEvalRunPaginatedDto.cs @@ -26,6 +26,12 @@ public record GetEvalRunPaginatedDto : IJsonOnDeserialized [JsonPropertyName("sortOrder")] public GetEvalRunPaginatedDtoSortOrder? SortOrder { get; set; } + /// + /// This is the column to sort by. Defaults to 'createdAt'. + /// + [JsonPropertyName("sortBy")] + public GetEvalRunPaginatedDtoSortBy? SortBy { get; set; } + /// /// This is the maximum number of items to return. Defaults to 100. /// diff --git a/src/Vapi.Net/Types/GetEvalRunPaginatedDtoSortBy.cs b/src/Vapi.Net/Types/GetEvalRunPaginatedDtoSortBy.cs new file mode 100644 index 00000000..5e6348da --- /dev/null +++ b/src/Vapi.Net/Types/GetEvalRunPaginatedDtoSortBy.cs @@ -0,0 +1,89 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(GetEvalRunPaginatedDtoSortBySerializer))] +public enum GetEvalRunPaginatedDtoSortBy +{ + [EnumMember(Value = "createdAt")] + CreatedAt, + + [EnumMember(Value = "duration")] + Duration, + + [EnumMember(Value = "cost")] + Cost, +} + +internal class GetEvalRunPaginatedDtoSortBySerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + GetEvalRunPaginatedDtoSortBy + > _stringToEnum = new() + { + { "createdAt", GetEvalRunPaginatedDtoSortBy.CreatedAt }, + { "duration", GetEvalRunPaginatedDtoSortBy.Duration }, + { "cost", GetEvalRunPaginatedDtoSortBy.Cost }, + }; + + private static readonly global::System.Collections.Generic.Dictionary< + GetEvalRunPaginatedDtoSortBy, + string + > _enumToString = new() + { + { GetEvalRunPaginatedDtoSortBy.CreatedAt, "createdAt" }, + { GetEvalRunPaginatedDtoSortBy.Duration, "duration" }, + { GetEvalRunPaginatedDtoSortBy.Cost, "cost" }, + }; + + public override GetEvalRunPaginatedDtoSortBy Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + GetEvalRunPaginatedDtoSortBy value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override GetEvalRunPaginatedDtoSortBy ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + GetEvalRunPaginatedDtoSortBy value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/GetSessionPaginatedDto.cs b/src/Vapi.Net/Types/GetSessionPaginatedDto.cs index 75095a07..61311c8b 100644 --- a/src/Vapi.Net/Types/GetSessionPaginatedDto.cs +++ b/src/Vapi.Net/Types/GetSessionPaginatedDto.cs @@ -83,6 +83,12 @@ public record GetSessionPaginatedDto : IJsonOnDeserialized [JsonPropertyName("sortOrder")] public GetSessionPaginatedDtoSortOrder? SortOrder { get; set; } + /// + /// This is the column to sort by. Defaults to 'createdAt'. + /// + [JsonPropertyName("sortBy")] + public GetSessionPaginatedDtoSortBy? SortBy { get; set; } + /// /// This is the maximum number of items to return. Defaults to 100. /// diff --git a/src/Vapi.Net/Types/GetSessionPaginatedDtoSortBy.cs b/src/Vapi.Net/Types/GetSessionPaginatedDtoSortBy.cs new file mode 100644 index 00000000..e27b6c96 --- /dev/null +++ b/src/Vapi.Net/Types/GetSessionPaginatedDtoSortBy.cs @@ -0,0 +1,89 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(GetSessionPaginatedDtoSortBySerializer))] +public enum GetSessionPaginatedDtoSortBy +{ + [EnumMember(Value = "createdAt")] + CreatedAt, + + [EnumMember(Value = "duration")] + Duration, + + [EnumMember(Value = "cost")] + Cost, +} + +internal class GetSessionPaginatedDtoSortBySerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + GetSessionPaginatedDtoSortBy + > _stringToEnum = new() + { + { "createdAt", GetSessionPaginatedDtoSortBy.CreatedAt }, + { "duration", GetSessionPaginatedDtoSortBy.Duration }, + { "cost", GetSessionPaginatedDtoSortBy.Cost }, + }; + + private static readonly global::System.Collections.Generic.Dictionary< + GetSessionPaginatedDtoSortBy, + string + > _enumToString = new() + { + { GetSessionPaginatedDtoSortBy.CreatedAt, "createdAt" }, + { GetSessionPaginatedDtoSortBy.Duration, "duration" }, + { GetSessionPaginatedDtoSortBy.Cost, "cost" }, + }; + + public override GetSessionPaginatedDtoSortBy Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + GetSessionPaginatedDtoSortBy value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override GetSessionPaginatedDtoSortBy ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + GetSessionPaginatedDtoSortBy value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/TrieveKnowledgeBaseCreate.cs b/src/Vapi.Net/Types/GetToolDraftsDto.cs similarity index 61% rename from src/Vapi.Net/Types/TrieveKnowledgeBaseCreate.cs rename to src/Vapi.Net/Types/GetToolDraftsDto.cs index 5dea7ebe..076e9a23 100644 --- a/src/Vapi.Net/Types/TrieveKnowledgeBaseCreate.cs +++ b/src/Vapi.Net/Types/GetToolDraftsDto.cs @@ -5,24 +5,26 @@ namespace Vapi.Net; [Serializable] -public record TrieveKnowledgeBaseCreate : IJsonOnDeserialized +public record GetToolDraftsDto : IJsonOnDeserialized { [JsonExtensionData] private readonly IDictionary _extensionData = new Dictionary(); /// - /// This is to create a new dataset on Trieve. + /// Opaque base64-encoded keyset cursor. Omit on first page. /// - [JsonPropertyName("type")] - public required TrieveKnowledgeBaseCreateType Type { get; set; } + [JsonPropertyName("cursor")] + public string? Cursor { get; set; } /// - /// These are the chunk plans used to create the dataset. + /// Page size, defaults to 25, capped at 100. /// - [JsonPropertyName("chunkPlans")] - public IEnumerable ChunkPlans { get; set; } = - new List(); + [JsonPropertyName("limit")] + public double? Limit { get; set; } + + [JsonPropertyName("createdBy")] + public string? CreatedBy { get; set; } [JsonIgnore] public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); diff --git a/src/Vapi.Net/Types/GhlTool.cs b/src/Vapi.Net/Types/GhlTool.cs index 27125476..e1ec0ded 100644 --- a/src/Vapi.Net/Types/GhlTool.cs +++ b/src/Vapi.Net/Types/GhlTool.cs @@ -11,10 +11,11 @@ public record GhlTool : IJsonOnDeserialized private readonly IDictionary _extensionData = new Dictionary(); + [JsonPropertyName("latestVersion")] + public string? LatestVersion { 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. + /// Messages spoken while the tool is running. Multiple request-start messages are variants. For request-response-delayed, same timing means variants and different timings mean staged updates. /// [JsonPropertyName("messages")] public IEnumerable? Messages { get; set; } diff --git a/src/Vapi.Net/Types/GhlToolMetadata.cs b/src/Vapi.Net/Types/GhlToolMetadata.cs index b45f6e7b..e9b1d6b4 100644 --- a/src/Vapi.Net/Types/GhlToolMetadata.cs +++ b/src/Vapi.Net/Types/GhlToolMetadata.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// GHL workflow and location identifiers attached to a tool. +/// [Serializable] public record GhlToolMetadata : IJsonOnDeserialized { @@ -11,9 +14,15 @@ public record GhlToolMetadata : IJsonOnDeserialized private readonly IDictionary _extensionData = new Dictionary(); + /// + /// GHL workflow identifier associated with the tool. + /// [JsonPropertyName("workflowId")] public string? WorkflowId { get; set; } + /// + /// GHL location identifier associated with the tool. + /// [JsonPropertyName("locationId")] public string? LocationId { get; set; } diff --git a/src/Vapi.Net/Types/GhlToolWithToolCall.cs b/src/Vapi.Net/Types/GhlToolWithToolCall.cs index a5f3ca17..89c394cc 100644 --- a/src/Vapi.Net/Types/GhlToolWithToolCall.cs +++ b/src/Vapi.Net/Types/GhlToolWithToolCall.cs @@ -12,9 +12,7 @@ public record GhlToolWithToolCall : IJsonOnDeserialized new Dictionary(); /// - /// 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. + /// Messages spoken while the tool is running. Multiple request-start messages are variants. For request-response-delayed, same timing means variants and different timings mean staged updates. /// [JsonPropertyName("messages")] public IEnumerable? Messages { get; set; } diff --git a/src/Vapi.Net/Types/GladiaCustomVocabularyConfigDto.cs b/src/Vapi.Net/Types/GladiaCustomVocabularyConfigDto.cs index 27d58fae..679ee2e5 100644 --- a/src/Vapi.Net/Types/GladiaCustomVocabularyConfigDto.cs +++ b/src/Vapi.Net/Types/GladiaCustomVocabularyConfigDto.cs @@ -5,6 +5,9 @@ namespace Vapi.Net; +/// +/// Custom vocabulary configuration for Gladia transcription, including vocabulary items and default recognition intensity. +/// [Serializable] public record GladiaCustomVocabularyConfigDto : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/GladiaTranscriber.cs b/src/Vapi.Net/Types/GladiaTranscriber.cs index a71b5c98..78ca222e 100644 --- a/src/Vapi.Net/Types/GladiaTranscriber.cs +++ b/src/Vapi.Net/Types/GladiaTranscriber.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Configuration for transcribing speech during assistant conversations with Gladia, including language behavior, audio processing, endpointing, vocabulary, region, and fallback settings. +/// [Serializable] public record GladiaTranscriber : IJsonOnDeserialized { @@ -33,7 +36,7 @@ public record GladiaTranscriber : IJsonOnDeserialized /// Defines the languages to use for the transcription. Required when languageBehaviour is 'manual'. /// [JsonPropertyName("languages")] - public GladiaTranscriberLanguages? Languages { get; set; } + public IEnumerable? Languages { 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. diff --git a/src/Vapi.Net/Types/GladiaTranscriberLanguages.cs b/src/Vapi.Net/Types/GladiaTranscriberLanguages.cs deleted file mode 100644 index cb710f08..00000000 --- a/src/Vapi.Net/Types/GladiaTranscriberLanguages.cs +++ /dev/null @@ -1,569 +0,0 @@ -using global::System.Runtime.Serialization; -using global::System.Text.Json.Serialization; - -namespace Vapi.Net; - -[JsonConverter(typeof(GladiaTranscriberLanguagesSerializer))] -public enum GladiaTranscriberLanguages -{ - [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, -} - -internal class GladiaTranscriberLanguagesSerializer - : global::System.Text.Json.Serialization.JsonConverter -{ - private static readonly global::System.Collections.Generic.Dictionary< - string, - GladiaTranscriberLanguages - > _stringToEnum = new() - { - { "af", GladiaTranscriberLanguages.Af }, - { "sq", GladiaTranscriberLanguages.Sq }, - { "am", GladiaTranscriberLanguages.Am }, - { "ar", GladiaTranscriberLanguages.Ar }, - { "hy", GladiaTranscriberLanguages.Hy }, - { "as", GladiaTranscriberLanguages.As }, - { "az", GladiaTranscriberLanguages.Az }, - { "ba", GladiaTranscriberLanguages.Ba }, - { "eu", GladiaTranscriberLanguages.Eu }, - { "be", GladiaTranscriberLanguages.Be }, - { "bn", GladiaTranscriberLanguages.Bn }, - { "bs", GladiaTranscriberLanguages.Bs }, - { "br", GladiaTranscriberLanguages.Br }, - { "bg", GladiaTranscriberLanguages.Bg }, - { "ca", GladiaTranscriberLanguages.Ca }, - { "zh", GladiaTranscriberLanguages.Zh }, - { "hr", GladiaTranscriberLanguages.Hr }, - { "cs", GladiaTranscriberLanguages.Cs }, - { "da", GladiaTranscriberLanguages.Da }, - { "nl", GladiaTranscriberLanguages.Nl }, - { "en", GladiaTranscriberLanguages.En }, - { "et", GladiaTranscriberLanguages.Et }, - { "fo", GladiaTranscriberLanguages.Fo }, - { "fi", GladiaTranscriberLanguages.Fi }, - { "fr", GladiaTranscriberLanguages.Fr }, - { "gl", GladiaTranscriberLanguages.Gl }, - { "ka", GladiaTranscriberLanguages.Ka }, - { "de", GladiaTranscriberLanguages.De }, - { "el", GladiaTranscriberLanguages.El }, - { "gu", GladiaTranscriberLanguages.Gu }, - { "ht", GladiaTranscriberLanguages.Ht }, - { "ha", GladiaTranscriberLanguages.Ha }, - { "haw", GladiaTranscriberLanguages.Haw }, - { "he", GladiaTranscriberLanguages.He }, - { "hi", GladiaTranscriberLanguages.Hi }, - { "hu", GladiaTranscriberLanguages.Hu }, - { "is", GladiaTranscriberLanguages.Is }, - { "id", GladiaTranscriberLanguages.Id }, - { "it", GladiaTranscriberLanguages.It }, - { "ja", GladiaTranscriberLanguages.Ja }, - { "jv", GladiaTranscriberLanguages.Jv }, - { "kn", GladiaTranscriberLanguages.Kn }, - { "kk", GladiaTranscriberLanguages.Kk }, - { "km", GladiaTranscriberLanguages.Km }, - { "ko", GladiaTranscriberLanguages.Ko }, - { "lo", GladiaTranscriberLanguages.Lo }, - { "la", GladiaTranscriberLanguages.La }, - { "lv", GladiaTranscriberLanguages.Lv }, - { "ln", GladiaTranscriberLanguages.Ln }, - { "lt", GladiaTranscriberLanguages.Lt }, - { "lb", GladiaTranscriberLanguages.Lb }, - { "mk", GladiaTranscriberLanguages.Mk }, - { "mg", GladiaTranscriberLanguages.Mg }, - { "ms", GladiaTranscriberLanguages.Ms }, - { "ml", GladiaTranscriberLanguages.Ml }, - { "mt", GladiaTranscriberLanguages.Mt }, - { "mi", GladiaTranscriberLanguages.Mi }, - { "mr", GladiaTranscriberLanguages.Mr }, - { "mn", GladiaTranscriberLanguages.Mn }, - { "my", GladiaTranscriberLanguages.My }, - { "ne", GladiaTranscriberLanguages.Ne }, - { "no", GladiaTranscriberLanguages.No }, - { "nn", GladiaTranscriberLanguages.Nn }, - { "oc", GladiaTranscriberLanguages.Oc }, - { "ps", GladiaTranscriberLanguages.Ps }, - { "fa", GladiaTranscriberLanguages.Fa }, - { "pl", GladiaTranscriberLanguages.Pl }, - { "pt", GladiaTranscriberLanguages.Pt }, - { "pa", GladiaTranscriberLanguages.Pa }, - { "ro", GladiaTranscriberLanguages.Ro }, - { "ru", GladiaTranscriberLanguages.Ru }, - { "sa", GladiaTranscriberLanguages.Sa }, - { "sr", GladiaTranscriberLanguages.Sr }, - { "sn", GladiaTranscriberLanguages.Sn }, - { "sd", GladiaTranscriberLanguages.Sd }, - { "si", GladiaTranscriberLanguages.Si }, - { "sk", GladiaTranscriberLanguages.Sk }, - { "sl", GladiaTranscriberLanguages.Sl }, - { "so", GladiaTranscriberLanguages.So }, - { "es", GladiaTranscriberLanguages.Es }, - { "su", GladiaTranscriberLanguages.Su }, - { "sw", GladiaTranscriberLanguages.Sw }, - { "sv", GladiaTranscriberLanguages.Sv }, - { "tl", GladiaTranscriberLanguages.Tl }, - { "tg", GladiaTranscriberLanguages.Tg }, - { "ta", GladiaTranscriberLanguages.Ta }, - { "tt", GladiaTranscriberLanguages.Tt }, - { "te", GladiaTranscriberLanguages.Te }, - { "th", GladiaTranscriberLanguages.Th }, - { "bo", GladiaTranscriberLanguages.Bo }, - { "tr", GladiaTranscriberLanguages.Tr }, - { "tk", GladiaTranscriberLanguages.Tk }, - { "uk", GladiaTranscriberLanguages.Uk }, - { "ur", GladiaTranscriberLanguages.Ur }, - { "uz", GladiaTranscriberLanguages.Uz }, - { "vi", GladiaTranscriberLanguages.Vi }, - { "cy", GladiaTranscriberLanguages.Cy }, - { "yi", GladiaTranscriberLanguages.Yi }, - { "yo", GladiaTranscriberLanguages.Yo }, - }; - - private static readonly global::System.Collections.Generic.Dictionary< - GladiaTranscriberLanguages, - string - > _enumToString = new() - { - { GladiaTranscriberLanguages.Af, "af" }, - { GladiaTranscriberLanguages.Sq, "sq" }, - { GladiaTranscriberLanguages.Am, "am" }, - { GladiaTranscriberLanguages.Ar, "ar" }, - { GladiaTranscriberLanguages.Hy, "hy" }, - { GladiaTranscriberLanguages.As, "as" }, - { GladiaTranscriberLanguages.Az, "az" }, - { GladiaTranscriberLanguages.Ba, "ba" }, - { GladiaTranscriberLanguages.Eu, "eu" }, - { GladiaTranscriberLanguages.Be, "be" }, - { GladiaTranscriberLanguages.Bn, "bn" }, - { GladiaTranscriberLanguages.Bs, "bs" }, - { GladiaTranscriberLanguages.Br, "br" }, - { GladiaTranscriberLanguages.Bg, "bg" }, - { GladiaTranscriberLanguages.Ca, "ca" }, - { GladiaTranscriberLanguages.Zh, "zh" }, - { GladiaTranscriberLanguages.Hr, "hr" }, - { GladiaTranscriberLanguages.Cs, "cs" }, - { GladiaTranscriberLanguages.Da, "da" }, - { GladiaTranscriberLanguages.Nl, "nl" }, - { GladiaTranscriberLanguages.En, "en" }, - { GladiaTranscriberLanguages.Et, "et" }, - { GladiaTranscriberLanguages.Fo, "fo" }, - { GladiaTranscriberLanguages.Fi, "fi" }, - { GladiaTranscriberLanguages.Fr, "fr" }, - { GladiaTranscriberLanguages.Gl, "gl" }, - { GladiaTranscriberLanguages.Ka, "ka" }, - { GladiaTranscriberLanguages.De, "de" }, - { GladiaTranscriberLanguages.El, "el" }, - { GladiaTranscriberLanguages.Gu, "gu" }, - { GladiaTranscriberLanguages.Ht, "ht" }, - { GladiaTranscriberLanguages.Ha, "ha" }, - { GladiaTranscriberLanguages.Haw, "haw" }, - { GladiaTranscriberLanguages.He, "he" }, - { GladiaTranscriberLanguages.Hi, "hi" }, - { GladiaTranscriberLanguages.Hu, "hu" }, - { GladiaTranscriberLanguages.Is, "is" }, - { GladiaTranscriberLanguages.Id, "id" }, - { GladiaTranscriberLanguages.It, "it" }, - { GladiaTranscriberLanguages.Ja, "ja" }, - { GladiaTranscriberLanguages.Jv, "jv" }, - { GladiaTranscriberLanguages.Kn, "kn" }, - { GladiaTranscriberLanguages.Kk, "kk" }, - { GladiaTranscriberLanguages.Km, "km" }, - { GladiaTranscriberLanguages.Ko, "ko" }, - { GladiaTranscriberLanguages.Lo, "lo" }, - { GladiaTranscriberLanguages.La, "la" }, - { GladiaTranscriberLanguages.Lv, "lv" }, - { GladiaTranscriberLanguages.Ln, "ln" }, - { GladiaTranscriberLanguages.Lt, "lt" }, - { GladiaTranscriberLanguages.Lb, "lb" }, - { GladiaTranscriberLanguages.Mk, "mk" }, - { GladiaTranscriberLanguages.Mg, "mg" }, - { GladiaTranscriberLanguages.Ms, "ms" }, - { GladiaTranscriberLanguages.Ml, "ml" }, - { GladiaTranscriberLanguages.Mt, "mt" }, - { GladiaTranscriberLanguages.Mi, "mi" }, - { GladiaTranscriberLanguages.Mr, "mr" }, - { GladiaTranscriberLanguages.Mn, "mn" }, - { GladiaTranscriberLanguages.My, "my" }, - { GladiaTranscriberLanguages.Ne, "ne" }, - { GladiaTranscriberLanguages.No, "no" }, - { GladiaTranscriberLanguages.Nn, "nn" }, - { GladiaTranscriberLanguages.Oc, "oc" }, - { GladiaTranscriberLanguages.Ps, "ps" }, - { GladiaTranscriberLanguages.Fa, "fa" }, - { GladiaTranscriberLanguages.Pl, "pl" }, - { GladiaTranscriberLanguages.Pt, "pt" }, - { GladiaTranscriberLanguages.Pa, "pa" }, - { GladiaTranscriberLanguages.Ro, "ro" }, - { GladiaTranscriberLanguages.Ru, "ru" }, - { GladiaTranscriberLanguages.Sa, "sa" }, - { GladiaTranscriberLanguages.Sr, "sr" }, - { GladiaTranscriberLanguages.Sn, "sn" }, - { GladiaTranscriberLanguages.Sd, "sd" }, - { GladiaTranscriberLanguages.Si, "si" }, - { GladiaTranscriberLanguages.Sk, "sk" }, - { GladiaTranscriberLanguages.Sl, "sl" }, - { GladiaTranscriberLanguages.So, "so" }, - { GladiaTranscriberLanguages.Es, "es" }, - { GladiaTranscriberLanguages.Su, "su" }, - { GladiaTranscriberLanguages.Sw, "sw" }, - { GladiaTranscriberLanguages.Sv, "sv" }, - { GladiaTranscriberLanguages.Tl, "tl" }, - { GladiaTranscriberLanguages.Tg, "tg" }, - { GladiaTranscriberLanguages.Ta, "ta" }, - { GladiaTranscriberLanguages.Tt, "tt" }, - { GladiaTranscriberLanguages.Te, "te" }, - { GladiaTranscriberLanguages.Th, "th" }, - { GladiaTranscriberLanguages.Bo, "bo" }, - { GladiaTranscriberLanguages.Tr, "tr" }, - { GladiaTranscriberLanguages.Tk, "tk" }, - { GladiaTranscriberLanguages.Uk, "uk" }, - { GladiaTranscriberLanguages.Ur, "ur" }, - { GladiaTranscriberLanguages.Uz, "uz" }, - { GladiaTranscriberLanguages.Vi, "vi" }, - { GladiaTranscriberLanguages.Cy, "cy" }, - { GladiaTranscriberLanguages.Yi, "yi" }, - { GladiaTranscriberLanguages.Yo, "yo" }, - }; - - public override GladiaTranscriberLanguages Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options - ) - { - var stringValue = - reader.GetString() - ?? throw new global::System.Exception("The JSON value could not be read as a string."); - return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; - } - - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - GladiaTranscriberLanguages value, - global::System.Text.Json.JsonSerializerOptions options - ) - { - writer.WriteStringValue( - _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null - ); - } - - public override GladiaTranscriberLanguages ReadAsPropertyName( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options - ) - { - var stringValue = - reader.GetString() - ?? throw new global::System.Exception( - "The JSON property name could not be read as a string." - ); - return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; - } - - public override void WriteAsPropertyName( - global::System.Text.Json.Utf8JsonWriter writer, - GladiaTranscriberLanguages value, - global::System.Text.Json.JsonSerializerOptions options - ) - { - writer.WritePropertyName( - _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() - ); - } -} diff --git a/src/Vapi.Net/Types/GladiaTranscriberLanguagesItem.cs b/src/Vapi.Net/Types/GladiaTranscriberLanguagesItem.cs new file mode 100644 index 00000000..aee75ae8 --- /dev/null +++ b/src/Vapi.Net/Types/GladiaTranscriberLanguagesItem.cs @@ -0,0 +1,569 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(GladiaTranscriberLanguagesItemSerializer))] +public enum GladiaTranscriberLanguagesItem +{ + [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, +} + +internal class GladiaTranscriberLanguagesItemSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + GladiaTranscriberLanguagesItem + > _stringToEnum = new() + { + { "af", GladiaTranscriberLanguagesItem.Af }, + { "sq", GladiaTranscriberLanguagesItem.Sq }, + { "am", GladiaTranscriberLanguagesItem.Am }, + { "ar", GladiaTranscriberLanguagesItem.Ar }, + { "hy", GladiaTranscriberLanguagesItem.Hy }, + { "as", GladiaTranscriberLanguagesItem.As }, + { "az", GladiaTranscriberLanguagesItem.Az }, + { "ba", GladiaTranscriberLanguagesItem.Ba }, + { "eu", GladiaTranscriberLanguagesItem.Eu }, + { "be", GladiaTranscriberLanguagesItem.Be }, + { "bn", GladiaTranscriberLanguagesItem.Bn }, + { "bs", GladiaTranscriberLanguagesItem.Bs }, + { "br", GladiaTranscriberLanguagesItem.Br }, + { "bg", GladiaTranscriberLanguagesItem.Bg }, + { "ca", GladiaTranscriberLanguagesItem.Ca }, + { "zh", GladiaTranscriberLanguagesItem.Zh }, + { "hr", GladiaTranscriberLanguagesItem.Hr }, + { "cs", GladiaTranscriberLanguagesItem.Cs }, + { "da", GladiaTranscriberLanguagesItem.Da }, + { "nl", GladiaTranscriberLanguagesItem.Nl }, + { "en", GladiaTranscriberLanguagesItem.En }, + { "et", GladiaTranscriberLanguagesItem.Et }, + { "fo", GladiaTranscriberLanguagesItem.Fo }, + { "fi", GladiaTranscriberLanguagesItem.Fi }, + { "fr", GladiaTranscriberLanguagesItem.Fr }, + { "gl", GladiaTranscriberLanguagesItem.Gl }, + { "ka", GladiaTranscriberLanguagesItem.Ka }, + { "de", GladiaTranscriberLanguagesItem.De }, + { "el", GladiaTranscriberLanguagesItem.El }, + { "gu", GladiaTranscriberLanguagesItem.Gu }, + { "ht", GladiaTranscriberLanguagesItem.Ht }, + { "ha", GladiaTranscriberLanguagesItem.Ha }, + { "haw", GladiaTranscriberLanguagesItem.Haw }, + { "he", GladiaTranscriberLanguagesItem.He }, + { "hi", GladiaTranscriberLanguagesItem.Hi }, + { "hu", GladiaTranscriberLanguagesItem.Hu }, + { "is", GladiaTranscriberLanguagesItem.Is }, + { "id", GladiaTranscriberLanguagesItem.Id }, + { "it", GladiaTranscriberLanguagesItem.It }, + { "ja", GladiaTranscriberLanguagesItem.Ja }, + { "jv", GladiaTranscriberLanguagesItem.Jv }, + { "kn", GladiaTranscriberLanguagesItem.Kn }, + { "kk", GladiaTranscriberLanguagesItem.Kk }, + { "km", GladiaTranscriberLanguagesItem.Km }, + { "ko", GladiaTranscriberLanguagesItem.Ko }, + { "lo", GladiaTranscriberLanguagesItem.Lo }, + { "la", GladiaTranscriberLanguagesItem.La }, + { "lv", GladiaTranscriberLanguagesItem.Lv }, + { "ln", GladiaTranscriberLanguagesItem.Ln }, + { "lt", GladiaTranscriberLanguagesItem.Lt }, + { "lb", GladiaTranscriberLanguagesItem.Lb }, + { "mk", GladiaTranscriberLanguagesItem.Mk }, + { "mg", GladiaTranscriberLanguagesItem.Mg }, + { "ms", GladiaTranscriberLanguagesItem.Ms }, + { "ml", GladiaTranscriberLanguagesItem.Ml }, + { "mt", GladiaTranscriberLanguagesItem.Mt }, + { "mi", GladiaTranscriberLanguagesItem.Mi }, + { "mr", GladiaTranscriberLanguagesItem.Mr }, + { "mn", GladiaTranscriberLanguagesItem.Mn }, + { "my", GladiaTranscriberLanguagesItem.My }, + { "ne", GladiaTranscriberLanguagesItem.Ne }, + { "no", GladiaTranscriberLanguagesItem.No }, + { "nn", GladiaTranscriberLanguagesItem.Nn }, + { "oc", GladiaTranscriberLanguagesItem.Oc }, + { "ps", GladiaTranscriberLanguagesItem.Ps }, + { "fa", GladiaTranscriberLanguagesItem.Fa }, + { "pl", GladiaTranscriberLanguagesItem.Pl }, + { "pt", GladiaTranscriberLanguagesItem.Pt }, + { "pa", GladiaTranscriberLanguagesItem.Pa }, + { "ro", GladiaTranscriberLanguagesItem.Ro }, + { "ru", GladiaTranscriberLanguagesItem.Ru }, + { "sa", GladiaTranscriberLanguagesItem.Sa }, + { "sr", GladiaTranscriberLanguagesItem.Sr }, + { "sn", GladiaTranscriberLanguagesItem.Sn }, + { "sd", GladiaTranscriberLanguagesItem.Sd }, + { "si", GladiaTranscriberLanguagesItem.Si }, + { "sk", GladiaTranscriberLanguagesItem.Sk }, + { "sl", GladiaTranscriberLanguagesItem.Sl }, + { "so", GladiaTranscriberLanguagesItem.So }, + { "es", GladiaTranscriberLanguagesItem.Es }, + { "su", GladiaTranscriberLanguagesItem.Su }, + { "sw", GladiaTranscriberLanguagesItem.Sw }, + { "sv", GladiaTranscriberLanguagesItem.Sv }, + { "tl", GladiaTranscriberLanguagesItem.Tl }, + { "tg", GladiaTranscriberLanguagesItem.Tg }, + { "ta", GladiaTranscriberLanguagesItem.Ta }, + { "tt", GladiaTranscriberLanguagesItem.Tt }, + { "te", GladiaTranscriberLanguagesItem.Te }, + { "th", GladiaTranscriberLanguagesItem.Th }, + { "bo", GladiaTranscriberLanguagesItem.Bo }, + { "tr", GladiaTranscriberLanguagesItem.Tr }, + { "tk", GladiaTranscriberLanguagesItem.Tk }, + { "uk", GladiaTranscriberLanguagesItem.Uk }, + { "ur", GladiaTranscriberLanguagesItem.Ur }, + { "uz", GladiaTranscriberLanguagesItem.Uz }, + { "vi", GladiaTranscriberLanguagesItem.Vi }, + { "cy", GladiaTranscriberLanguagesItem.Cy }, + { "yi", GladiaTranscriberLanguagesItem.Yi }, + { "yo", GladiaTranscriberLanguagesItem.Yo }, + }; + + private static readonly global::System.Collections.Generic.Dictionary< + GladiaTranscriberLanguagesItem, + string + > _enumToString = new() + { + { GladiaTranscriberLanguagesItem.Af, "af" }, + { GladiaTranscriberLanguagesItem.Sq, "sq" }, + { GladiaTranscriberLanguagesItem.Am, "am" }, + { GladiaTranscriberLanguagesItem.Ar, "ar" }, + { GladiaTranscriberLanguagesItem.Hy, "hy" }, + { GladiaTranscriberLanguagesItem.As, "as" }, + { GladiaTranscriberLanguagesItem.Az, "az" }, + { GladiaTranscriberLanguagesItem.Ba, "ba" }, + { GladiaTranscriberLanguagesItem.Eu, "eu" }, + { GladiaTranscriberLanguagesItem.Be, "be" }, + { GladiaTranscriberLanguagesItem.Bn, "bn" }, + { GladiaTranscriberLanguagesItem.Bs, "bs" }, + { GladiaTranscriberLanguagesItem.Br, "br" }, + { GladiaTranscriberLanguagesItem.Bg, "bg" }, + { GladiaTranscriberLanguagesItem.Ca, "ca" }, + { GladiaTranscriberLanguagesItem.Zh, "zh" }, + { GladiaTranscriberLanguagesItem.Hr, "hr" }, + { GladiaTranscriberLanguagesItem.Cs, "cs" }, + { GladiaTranscriberLanguagesItem.Da, "da" }, + { GladiaTranscriberLanguagesItem.Nl, "nl" }, + { GladiaTranscriberLanguagesItem.En, "en" }, + { GladiaTranscriberLanguagesItem.Et, "et" }, + { GladiaTranscriberLanguagesItem.Fo, "fo" }, + { GladiaTranscriberLanguagesItem.Fi, "fi" }, + { GladiaTranscriberLanguagesItem.Fr, "fr" }, + { GladiaTranscriberLanguagesItem.Gl, "gl" }, + { GladiaTranscriberLanguagesItem.Ka, "ka" }, + { GladiaTranscriberLanguagesItem.De, "de" }, + { GladiaTranscriberLanguagesItem.El, "el" }, + { GladiaTranscriberLanguagesItem.Gu, "gu" }, + { GladiaTranscriberLanguagesItem.Ht, "ht" }, + { GladiaTranscriberLanguagesItem.Ha, "ha" }, + { GladiaTranscriberLanguagesItem.Haw, "haw" }, + { GladiaTranscriberLanguagesItem.He, "he" }, + { GladiaTranscriberLanguagesItem.Hi, "hi" }, + { GladiaTranscriberLanguagesItem.Hu, "hu" }, + { GladiaTranscriberLanguagesItem.Is, "is" }, + { GladiaTranscriberLanguagesItem.Id, "id" }, + { GladiaTranscriberLanguagesItem.It, "it" }, + { GladiaTranscriberLanguagesItem.Ja, "ja" }, + { GladiaTranscriberLanguagesItem.Jv, "jv" }, + { GladiaTranscriberLanguagesItem.Kn, "kn" }, + { GladiaTranscriberLanguagesItem.Kk, "kk" }, + { GladiaTranscriberLanguagesItem.Km, "km" }, + { GladiaTranscriberLanguagesItem.Ko, "ko" }, + { GladiaTranscriberLanguagesItem.Lo, "lo" }, + { GladiaTranscriberLanguagesItem.La, "la" }, + { GladiaTranscriberLanguagesItem.Lv, "lv" }, + { GladiaTranscriberLanguagesItem.Ln, "ln" }, + { GladiaTranscriberLanguagesItem.Lt, "lt" }, + { GladiaTranscriberLanguagesItem.Lb, "lb" }, + { GladiaTranscriberLanguagesItem.Mk, "mk" }, + { GladiaTranscriberLanguagesItem.Mg, "mg" }, + { GladiaTranscriberLanguagesItem.Ms, "ms" }, + { GladiaTranscriberLanguagesItem.Ml, "ml" }, + { GladiaTranscriberLanguagesItem.Mt, "mt" }, + { GladiaTranscriberLanguagesItem.Mi, "mi" }, + { GladiaTranscriberLanguagesItem.Mr, "mr" }, + { GladiaTranscriberLanguagesItem.Mn, "mn" }, + { GladiaTranscriberLanguagesItem.My, "my" }, + { GladiaTranscriberLanguagesItem.Ne, "ne" }, + { GladiaTranscriberLanguagesItem.No, "no" }, + { GladiaTranscriberLanguagesItem.Nn, "nn" }, + { GladiaTranscriberLanguagesItem.Oc, "oc" }, + { GladiaTranscriberLanguagesItem.Ps, "ps" }, + { GladiaTranscriberLanguagesItem.Fa, "fa" }, + { GladiaTranscriberLanguagesItem.Pl, "pl" }, + { GladiaTranscriberLanguagesItem.Pt, "pt" }, + { GladiaTranscriberLanguagesItem.Pa, "pa" }, + { GladiaTranscriberLanguagesItem.Ro, "ro" }, + { GladiaTranscriberLanguagesItem.Ru, "ru" }, + { GladiaTranscriberLanguagesItem.Sa, "sa" }, + { GladiaTranscriberLanguagesItem.Sr, "sr" }, + { GladiaTranscriberLanguagesItem.Sn, "sn" }, + { GladiaTranscriberLanguagesItem.Sd, "sd" }, + { GladiaTranscriberLanguagesItem.Si, "si" }, + { GladiaTranscriberLanguagesItem.Sk, "sk" }, + { GladiaTranscriberLanguagesItem.Sl, "sl" }, + { GladiaTranscriberLanguagesItem.So, "so" }, + { GladiaTranscriberLanguagesItem.Es, "es" }, + { GladiaTranscriberLanguagesItem.Su, "su" }, + { GladiaTranscriberLanguagesItem.Sw, "sw" }, + { GladiaTranscriberLanguagesItem.Sv, "sv" }, + { GladiaTranscriberLanguagesItem.Tl, "tl" }, + { GladiaTranscriberLanguagesItem.Tg, "tg" }, + { GladiaTranscriberLanguagesItem.Ta, "ta" }, + { GladiaTranscriberLanguagesItem.Tt, "tt" }, + { GladiaTranscriberLanguagesItem.Te, "te" }, + { GladiaTranscriberLanguagesItem.Th, "th" }, + { GladiaTranscriberLanguagesItem.Bo, "bo" }, + { GladiaTranscriberLanguagesItem.Tr, "tr" }, + { GladiaTranscriberLanguagesItem.Tk, "tk" }, + { GladiaTranscriberLanguagesItem.Uk, "uk" }, + { GladiaTranscriberLanguagesItem.Ur, "ur" }, + { GladiaTranscriberLanguagesItem.Uz, "uz" }, + { GladiaTranscriberLanguagesItem.Vi, "vi" }, + { GladiaTranscriberLanguagesItem.Cy, "cy" }, + { GladiaTranscriberLanguagesItem.Yi, "yi" }, + { GladiaTranscriberLanguagesItem.Yo, "yo" }, + }; + + public override GladiaTranscriberLanguagesItem Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + GladiaTranscriberLanguagesItem value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override GladiaTranscriberLanguagesItem ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + GladiaTranscriberLanguagesItem value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/GladiaVocabularyItemDto.cs b/src/Vapi.Net/Types/GladiaVocabularyItemDto.cs index 5e62ca0f..378cdbc0 100644 --- a/src/Vapi.Net/Types/GladiaVocabularyItemDto.cs +++ b/src/Vapi.Net/Types/GladiaVocabularyItemDto.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// A Gladia custom vocabulary word or phrase with optional pronunciations, intensity, and language. +/// [Serializable] public record GladiaVocabularyItemDto : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/GlobalNodePlan.cs b/src/Vapi.Net/Types/GlobalNodePlan.cs index 34ff062b..58714662 100644 --- a/src/Vapi.Net/Types/GlobalNodePlan.cs +++ b/src/Vapi.Net/Types/GlobalNodePlan.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Controls whether a conversation node can be entered globally and the condition evaluated before that node runs. +/// [Serializable] public record GlobalNodePlan : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/GoHighLevelCalendarAvailabilityTool.cs b/src/Vapi.Net/Types/GoHighLevelCalendarAvailabilityTool.cs index 25019f23..bcf629af 100644 --- a/src/Vapi.Net/Types/GoHighLevelCalendarAvailabilityTool.cs +++ b/src/Vapi.Net/Types/GoHighLevelCalendarAvailabilityTool.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// A reusable tool that checks calendar availability in a connected GoHighLevel account. +/// [Serializable] public record GoHighLevelCalendarAvailabilityTool : IJsonOnDeserialized { @@ -11,10 +14,11 @@ public record GoHighLevelCalendarAvailabilityTool : IJsonOnDeserialized private readonly IDictionary _extensionData = new Dictionary(); + [JsonPropertyName("latestVersion")] + public string? LatestVersion { 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. + /// Messages spoken while the tool is running. Multiple request-start messages are variants. For request-response-delayed, same timing means variants and different timings mean staged updates. /// [JsonPropertyName("messages")] public IEnumerable? Messages { get; set; } diff --git a/src/Vapi.Net/Types/GoHighLevelCalendarAvailabilityToolWithToolCall.cs b/src/Vapi.Net/Types/GoHighLevelCalendarAvailabilityToolWithToolCall.cs index d47d511e..ec462a03 100644 --- a/src/Vapi.Net/Types/GoHighLevelCalendarAvailabilityToolWithToolCall.cs +++ b/src/Vapi.Net/Types/GoHighLevelCalendarAvailabilityToolWithToolCall.cs @@ -12,9 +12,7 @@ public record GoHighLevelCalendarAvailabilityToolWithToolCall : IJsonOnDeseriali new Dictionary(); /// - /// 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. + /// Messages spoken while the tool is running. Multiple request-start messages are variants. For request-response-delayed, same timing means variants and different timings mean staged updates. /// [JsonPropertyName("messages")] public IEnumerable? Messages { get; set; } diff --git a/src/Vapi.Net/Types/GoHighLevelCalendarEventCreateTool.cs b/src/Vapi.Net/Types/GoHighLevelCalendarEventCreateTool.cs index ddcdedf2..d79ee2d1 100644 --- a/src/Vapi.Net/Types/GoHighLevelCalendarEventCreateTool.cs +++ b/src/Vapi.Net/Types/GoHighLevelCalendarEventCreateTool.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// A reusable tool that adds calendar events to a connected GoHighLevel account. +/// [Serializable] public record GoHighLevelCalendarEventCreateTool : IJsonOnDeserialized { @@ -11,10 +14,11 @@ public record GoHighLevelCalendarEventCreateTool : IJsonOnDeserialized private readonly IDictionary _extensionData = new Dictionary(); + [JsonPropertyName("latestVersion")] + public string? LatestVersion { 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. + /// Messages spoken while the tool is running. Multiple request-start messages are variants. For request-response-delayed, same timing means variants and different timings mean staged updates. /// [JsonPropertyName("messages")] public IEnumerable? Messages { get; set; } diff --git a/src/Vapi.Net/Types/GoHighLevelCalendarEventCreateToolWithToolCall.cs b/src/Vapi.Net/Types/GoHighLevelCalendarEventCreateToolWithToolCall.cs index edc7661a..13c2251a 100644 --- a/src/Vapi.Net/Types/GoHighLevelCalendarEventCreateToolWithToolCall.cs +++ b/src/Vapi.Net/Types/GoHighLevelCalendarEventCreateToolWithToolCall.cs @@ -12,9 +12,7 @@ public record GoHighLevelCalendarEventCreateToolWithToolCall : IJsonOnDeserializ new Dictionary(); /// - /// 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. + /// Messages spoken while the tool is running. Multiple request-start messages are variants. For request-response-delayed, same timing means variants and different timings mean staged updates. /// [JsonPropertyName("messages")] public IEnumerable? Messages { get; set; } diff --git a/src/Vapi.Net/Types/GoHighLevelContactCreateTool.cs b/src/Vapi.Net/Types/GoHighLevelContactCreateTool.cs index 0bd1bc43..149aab6d 100644 --- a/src/Vapi.Net/Types/GoHighLevelContactCreateTool.cs +++ b/src/Vapi.Net/Types/GoHighLevelContactCreateTool.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// A reusable tool that adds contacts to a connected GoHighLevel account. +/// [Serializable] public record GoHighLevelContactCreateTool : IJsonOnDeserialized { @@ -11,10 +14,11 @@ public record GoHighLevelContactCreateTool : IJsonOnDeserialized private readonly IDictionary _extensionData = new Dictionary(); + [JsonPropertyName("latestVersion")] + public string? LatestVersion { 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. + /// Messages spoken while the tool is running. Multiple request-start messages are variants. For request-response-delayed, same timing means variants and different timings mean staged updates. /// [JsonPropertyName("messages")] public IEnumerable? Messages { get; set; } diff --git a/src/Vapi.Net/Types/GoHighLevelContactCreateToolWithToolCall.cs b/src/Vapi.Net/Types/GoHighLevelContactCreateToolWithToolCall.cs index a9f85da4..7713ed4e 100644 --- a/src/Vapi.Net/Types/GoHighLevelContactCreateToolWithToolCall.cs +++ b/src/Vapi.Net/Types/GoHighLevelContactCreateToolWithToolCall.cs @@ -12,9 +12,7 @@ public record GoHighLevelContactCreateToolWithToolCall : IJsonOnDeserialized new Dictionary(); /// - /// 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. + /// Messages spoken while the tool is running. Multiple request-start messages are variants. For request-response-delayed, same timing means variants and different timings mean staged updates. /// [JsonPropertyName("messages")] public IEnumerable? Messages { get; set; } diff --git a/src/Vapi.Net/Types/GoHighLevelContactGetTool.cs b/src/Vapi.Net/Types/GoHighLevelContactGetTool.cs index dc8fe1df..79d9689e 100644 --- a/src/Vapi.Net/Types/GoHighLevelContactGetTool.cs +++ b/src/Vapi.Net/Types/GoHighLevelContactGetTool.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// A reusable tool that retrieves contacts from a connected GoHighLevel account. +/// [Serializable] public record GoHighLevelContactGetTool : IJsonOnDeserialized { @@ -11,10 +14,11 @@ public record GoHighLevelContactGetTool : IJsonOnDeserialized private readonly IDictionary _extensionData = new Dictionary(); + [JsonPropertyName("latestVersion")] + public string? LatestVersion { 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. + /// Messages spoken while the tool is running. Multiple request-start messages are variants. For request-response-delayed, same timing means variants and different timings mean staged updates. /// [JsonPropertyName("messages")] public IEnumerable? Messages { get; set; } diff --git a/src/Vapi.Net/Types/GoHighLevelContactGetToolWithToolCall.cs b/src/Vapi.Net/Types/GoHighLevelContactGetToolWithToolCall.cs index 0dbacd54..6fc50b89 100644 --- a/src/Vapi.Net/Types/GoHighLevelContactGetToolWithToolCall.cs +++ b/src/Vapi.Net/Types/GoHighLevelContactGetToolWithToolCall.cs @@ -12,9 +12,7 @@ public record GoHighLevelContactGetToolWithToolCall : IJsonOnDeserialized new Dictionary(); /// - /// 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. + /// Messages spoken while the tool is running. Multiple request-start messages are variants. For request-response-delayed, same timing means variants and different timings mean staged updates. /// [JsonPropertyName("messages")] public IEnumerable? Messages { get; set; } diff --git a/src/Vapi.Net/Types/GoogleCalendarCheckAvailabilityTool.cs b/src/Vapi.Net/Types/GoogleCalendarCheckAvailabilityTool.cs index c28754f3..ab31018c 100644 --- a/src/Vapi.Net/Types/GoogleCalendarCheckAvailabilityTool.cs +++ b/src/Vapi.Net/Types/GoogleCalendarCheckAvailabilityTool.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// A reusable tool that checks availability in a connected Google Calendar. +/// [Serializable] public record GoogleCalendarCheckAvailabilityTool : IJsonOnDeserialized { @@ -11,10 +14,11 @@ public record GoogleCalendarCheckAvailabilityTool : IJsonOnDeserialized private readonly IDictionary _extensionData = new Dictionary(); + [JsonPropertyName("latestVersion")] + public string? LatestVersion { 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. + /// Messages spoken while the tool is running. Multiple request-start messages are variants. For request-response-delayed, same timing means variants and different timings mean staged updates. /// [JsonPropertyName("messages")] public IEnumerable? Messages { get; set; } diff --git a/src/Vapi.Net/Types/GoogleCalendarCreateEventTool.cs b/src/Vapi.Net/Types/GoogleCalendarCreateEventTool.cs index df52102f..4f211535 100644 --- a/src/Vapi.Net/Types/GoogleCalendarCreateEventTool.cs +++ b/src/Vapi.Net/Types/GoogleCalendarCreateEventTool.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// A reusable tool that adds events to a connected Google Calendar. +/// [Serializable] public record GoogleCalendarCreateEventTool : IJsonOnDeserialized { @@ -11,10 +14,11 @@ public record GoogleCalendarCreateEventTool : IJsonOnDeserialized private readonly IDictionary _extensionData = new Dictionary(); + [JsonPropertyName("latestVersion")] + public string? LatestVersion { 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. + /// Messages spoken while the tool is running. Multiple request-start messages are variants. For request-response-delayed, same timing means variants and different timings mean staged updates. /// [JsonPropertyName("messages")] public IEnumerable? Messages { get; set; } diff --git a/src/Vapi.Net/Types/GoogleCalendarCreateEventToolWithToolCall.cs b/src/Vapi.Net/Types/GoogleCalendarCreateEventToolWithToolCall.cs index d7c634c7..d54ded3e 100644 --- a/src/Vapi.Net/Types/GoogleCalendarCreateEventToolWithToolCall.cs +++ b/src/Vapi.Net/Types/GoogleCalendarCreateEventToolWithToolCall.cs @@ -12,9 +12,7 @@ public record GoogleCalendarCreateEventToolWithToolCall : IJsonOnDeserialized new Dictionary(); /// - /// 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. + /// Messages spoken while the tool is running. Multiple request-start messages are variants. For request-response-delayed, same timing means variants and different timings mean staged updates. /// [JsonPropertyName("messages")] public IEnumerable? Messages { get; set; } diff --git a/src/Vapi.Net/Types/GoogleModel.cs b/src/Vapi.Net/Types/GoogleModel.cs index 76e4e263..9e398455 100644 --- a/src/Vapi.Net/Types/GoogleModel.cs +++ b/src/Vapi.Net/Types/GoogleModel.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Configuration for generating assistant responses with Google, including model, prompts, tools, knowledge-base access, realtime settings, and generation settings. +/// [Serializable] public record GoogleModel : IJsonOnDeserialized { @@ -33,6 +36,15 @@ public record GoogleModel : IJsonOnDeserialized [JsonPropertyName("toolIds")] public IEnumerable? ToolIds { get; set; } + /// + /// These are version-pinned references to tools. Each entry pins a specific + /// version of a tool by `(toolId, version)`. When the same `toolId` appears + /// in both `toolIds` and `toolRefs[]`, the `toolRefs` pin wins (the + /// `toolIds` entry is dropped at write time). + /// + [JsonPropertyName("toolRefs")] + public IEnumerable? ToolRefs { get; set; } + /// /// These are the options for the knowledge base. /// @@ -53,7 +65,7 @@ public record GoogleModel : IJsonOnDeserialized public GoogleRealtimeConfig? RealtimeConfig { get; set; } /// - /// This is the temperature that will be used for calls. Default is 0 to leverage caching for lower latency. + /// This is the temperature that will be used for calls. Default is 0.5. /// [JsonPropertyName("temperature")] public double? Temperature { get; set; } diff --git a/src/Vapi.Net/Types/GoogleModelModel.cs b/src/Vapi.Net/Types/GoogleModelModel.cs index fa305c29..0364ad45 100644 --- a/src/Vapi.Net/Types/GoogleModelModel.cs +++ b/src/Vapi.Net/Types/GoogleModelModel.cs @@ -6,6 +6,12 @@ namespace Vapi.Net; [JsonConverter(typeof(GoogleModelModelSerializer))] public enum GoogleModelModel { + [EnumMember(Value = "gemini-3.5-flash")] + Gemini35Flash, + + [EnumMember(Value = "gemini-3.1-flash-lite")] + Gemini31FlashLite, + [EnumMember(Value = "gemini-3-flash-preview")] Gemini3FlashPreview, @@ -60,6 +66,8 @@ internal class GoogleModelModelSerializer GoogleModelModel > _stringToEnum = new() { + { "gemini-3.5-flash", GoogleModelModel.Gemini35Flash }, + { "gemini-3.1-flash-lite", GoogleModelModel.Gemini31FlashLite }, { "gemini-3-flash-preview", GoogleModelModel.Gemini3FlashPreview }, { "gemini-2.5-pro", GoogleModelModel.Gemini25Pro }, { "gemini-2.5-flash", GoogleModelModel.Gemini25Flash }, @@ -82,6 +90,8 @@ internal class GoogleModelModelSerializer string > _enumToString = new() { + { GoogleModelModel.Gemini35Flash, "gemini-3.5-flash" }, + { GoogleModelModel.Gemini31FlashLite, "gemini-3.1-flash-lite" }, { GoogleModelModel.Gemini3FlashPreview, "gemini-3-flash-preview" }, { GoogleModelModel.Gemini25Pro, "gemini-2.5-pro" }, { GoogleModelModel.Gemini25Flash, "gemini-2.5-flash" }, diff --git a/src/Vapi.Net/Types/GoogleRealtimeConfig.cs b/src/Vapi.Net/Types/GoogleRealtimeConfig.cs index 3e399d0c..9695bb05 100644 --- a/src/Vapi.Net/Types/GoogleRealtimeConfig.cs +++ b/src/Vapi.Net/Types/GoogleRealtimeConfig.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Realtime Gemini generation and speech-output settings, including sampling, repetition penalties, and voice configuration. +/// [Serializable] public record GoogleRealtimeConfig : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/GoogleSheetsRowAppendTool.cs b/src/Vapi.Net/Types/GoogleSheetsRowAppendTool.cs index 81441286..8dead187 100644 --- a/src/Vapi.Net/Types/GoogleSheetsRowAppendTool.cs +++ b/src/Vapi.Net/Types/GoogleSheetsRowAppendTool.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// A reusable tool that appends rows to a connected Google Sheet. +/// [Serializable] public record GoogleSheetsRowAppendTool : IJsonOnDeserialized { @@ -11,10 +14,11 @@ public record GoogleSheetsRowAppendTool : IJsonOnDeserialized private readonly IDictionary _extensionData = new Dictionary(); + [JsonPropertyName("latestVersion")] + public string? LatestVersion { 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. + /// Messages spoken while the tool is running. Multiple request-start messages are variants. For request-response-delayed, same timing means variants and different timings mean staged updates. /// [JsonPropertyName("messages")] public IEnumerable? Messages { get; set; } diff --git a/src/Vapi.Net/Types/GoogleSheetsRowAppendToolWithToolCall.cs b/src/Vapi.Net/Types/GoogleSheetsRowAppendToolWithToolCall.cs index 637e86e7..1391ea27 100644 --- a/src/Vapi.Net/Types/GoogleSheetsRowAppendToolWithToolCall.cs +++ b/src/Vapi.Net/Types/GoogleSheetsRowAppendToolWithToolCall.cs @@ -12,9 +12,7 @@ public record GoogleSheetsRowAppendToolWithToolCall : IJsonOnDeserialized new Dictionary(); /// - /// 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. + /// Messages spoken while the tool is running. Multiple request-start messages are variants. For request-response-delayed, same timing means variants and different timings mean staged updates. /// [JsonPropertyName("messages")] public IEnumerable? Messages { get; set; } diff --git a/src/Vapi.Net/Types/GoogleTranscriber.cs b/src/Vapi.Net/Types/GoogleTranscriber.cs index 509e2fdd..7f8f5284 100644 --- a/src/Vapi.Net/Types/GoogleTranscriber.cs +++ b/src/Vapi.Net/Types/GoogleTranscriber.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Configuration for transcribing speech during assistant conversations with Google, including model, language, and fallback settings. +/// [Serializable] public record GoogleTranscriber : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/GoogleTranscriberModel.cs b/src/Vapi.Net/Types/GoogleTranscriberModel.cs index f833c580..36db72b1 100644 --- a/src/Vapi.Net/Types/GoogleTranscriberModel.cs +++ b/src/Vapi.Net/Types/GoogleTranscriberModel.cs @@ -6,6 +6,12 @@ namespace Vapi.Net; [JsonConverter(typeof(GoogleTranscriberModelSerializer))] public enum GoogleTranscriberModel { + [EnumMember(Value = "gemini-3.5-flash")] + Gemini35Flash, + + [EnumMember(Value = "gemini-3.1-flash-lite")] + Gemini31FlashLite, + [EnumMember(Value = "gemini-3-flash-preview")] Gemini3FlashPreview, @@ -60,6 +66,8 @@ internal class GoogleTranscriberModelSerializer GoogleTranscriberModel > _stringToEnum = new() { + { "gemini-3.5-flash", GoogleTranscriberModel.Gemini35Flash }, + { "gemini-3.1-flash-lite", GoogleTranscriberModel.Gemini31FlashLite }, { "gemini-3-flash-preview", GoogleTranscriberModel.Gemini3FlashPreview }, { "gemini-2.5-pro", GoogleTranscriberModel.Gemini25Pro }, { "gemini-2.5-flash", GoogleTranscriberModel.Gemini25Flash }, @@ -82,6 +90,8 @@ internal class GoogleTranscriberModelSerializer string > _enumToString = new() { + { GoogleTranscriberModel.Gemini35Flash, "gemini-3.5-flash" }, + { GoogleTranscriberModel.Gemini31FlashLite, "gemini-3.1-flash-lite" }, { GoogleTranscriberModel.Gemini3FlashPreview, "gemini-3-flash-preview" }, { GoogleTranscriberModel.Gemini25Pro, "gemini-2.5-pro" }, { GoogleTranscriberModel.Gemini25Flash, "gemini-2.5-flash" }, diff --git a/src/Vapi.Net/Types/GoogleVoicemailDetectionPlan.cs b/src/Vapi.Net/Types/GoogleVoicemailDetectionPlan.cs index 064f8307..deaa85d5 100644 --- a/src/Vapi.Net/Types/GoogleVoicemailDetectionPlan.cs +++ b/src/Vapi.Net/Types/GoogleVoicemailDetectionPlan.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Configuration for detecting voicemail with Google, including detection type, maximum beep wait, and retry backoff. +/// [Serializable] public record GoogleVoicemailDetectionPlan : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/GroqModel.cs b/src/Vapi.Net/Types/GroqModel.cs index 6fd1bfc4..51e4e47b 100644 --- a/src/Vapi.Net/Types/GroqModel.cs +++ b/src/Vapi.Net/Types/GroqModel.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Configuration for generating assistant responses with Groq, including model, prompts, tools, knowledge-base access, and generation settings. +/// [Serializable] public record GroqModel : IJsonOnDeserialized { @@ -33,6 +36,15 @@ public record GroqModel : IJsonOnDeserialized [JsonPropertyName("toolIds")] public IEnumerable? ToolIds { get; set; } + /// + /// These are version-pinned references to tools. Each entry pins a specific + /// version of a tool by `(toolId, version)`. When the same `toolId` appears + /// in both `toolIds` and `toolRefs[]`, the `toolRefs` pin wins (the + /// `toolIds` entry is dropped at write time). + /// + [JsonPropertyName("toolRefs")] + public IEnumerable? ToolRefs { get; set; } + /// /// These are the options for the knowledge base. /// @@ -46,7 +58,7 @@ public record GroqModel : IJsonOnDeserialized public required GroqModelModel Model { get; set; } /// - /// This is the temperature that will be used for calls. Default is 0 to leverage caching for lower latency. + /// This is the temperature that will be used for calls. Default is 0.5. /// [JsonPropertyName("temperature")] public double? Temperature { get; set; } diff --git a/src/Vapi.Net/Types/GroqModelModel.cs b/src/Vapi.Net/Types/GroqModelModel.cs index 8002a33e..9a59abff 100644 --- a/src/Vapi.Net/Types/GroqModelModel.cs +++ b/src/Vapi.Net/Types/GroqModelModel.cs @@ -36,9 +36,6 @@ public enum GroqModelModel [EnumMember(Value = "moonshotai/kimi-k2-instruct-0905")] MoonshotaiKimiK2Instruct0905, - [EnumMember(Value = "meta-llama/llama-4-maverick-17b-128e-instruct")] - MetaLlamaLlama4Maverick17B128EInstruct, - [EnumMember(Value = "meta-llama/llama-4-scout-17b-16e-instruct")] MetaLlamaLlama4Scout17B16EInstruct, @@ -70,10 +67,6 @@ internal class GroqModelModelSerializer { "llama3-70b-8192", GroqModelModel.Llama370B8192 }, { "gemma2-9b-it", GroqModelModel.Gemma29BIt }, { "moonshotai/kimi-k2-instruct-0905", GroqModelModel.MoonshotaiKimiK2Instruct0905 }, - { - "meta-llama/llama-4-maverick-17b-128e-instruct", - GroqModelModel.MetaLlamaLlama4Maverick17B128EInstruct - }, { "meta-llama/llama-4-scout-17b-16e-instruct", GroqModelModel.MetaLlamaLlama4Scout17B16EInstruct @@ -98,10 +91,6 @@ internal class GroqModelModelSerializer { GroqModelModel.Llama370B8192, "llama3-70b-8192" }, { GroqModelModel.Gemma29BIt, "gemma2-9b-it" }, { GroqModelModel.MoonshotaiKimiK2Instruct0905, "moonshotai/kimi-k2-instruct-0905" }, - { - GroqModelModel.MetaLlamaLlama4Maverick17B128EInstruct, - "meta-llama/llama-4-maverick-17b-128e-instruct" - }, { GroqModelModel.MetaLlamaLlama4Scout17B16EInstruct, "meta-llama/llama-4-scout-17b-16e-instruct" diff --git a/src/Vapi.Net/Types/GroupCondition.cs b/src/Vapi.Net/Types/GroupCondition.cs index 80a5ff86..26916b59 100644 --- a/src/Vapi.Net/Types/GroupCondition.cs +++ b/src/Vapi.Net/Types/GroupCondition.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Combines nested regular-expression, Liquid, or grouped conditions with an `AND` or `OR` operator. +/// [Serializable] public record GroupCondition : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/HandoffDestinationAssistant.cs b/src/Vapi.Net/Types/HandoffDestinationAssistant.cs index 45a0bddb..6085f18f 100644 --- a/src/Vapi.Net/Types/HandoffDestinationAssistant.cs +++ b/src/Vapi.Net/Types/HandoffDestinationAssistant.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Routes a handoff to a saved or transient assistant, with optional context engineering, variable extraction, and assistant overrides. +/// [Serializable] public record HandoffDestinationAssistant : IJsonOnDeserialized { @@ -11,6 +14,9 @@ public record HandoffDestinationAssistant : IJsonOnDeserialized private readonly IDictionary _extensionData = new Dictionary(); + /// + /// Selects an assistant as the handoff destination. + /// [JsonPropertyName("type")] public required HandoffDestinationAssistantType Type { get; set; } diff --git a/src/Vapi.Net/Types/HandoffDestinationDynamic.cs b/src/Vapi.Net/Types/HandoffDestinationDynamic.cs index 6c3f2cf9..6ff316c3 100644 --- a/src/Vapi.Net/Types/HandoffDestinationDynamic.cs +++ b/src/Vapi.Net/Types/HandoffDestinationDynamic.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Uses a webhook response to select the handoff destination at runtime. +/// [Serializable] public record HandoffDestinationDynamic : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/HandoffDestinationSquad.cs b/src/Vapi.Net/Types/HandoffDestinationSquad.cs index 0e6356b2..6fb7fc93 100644 --- a/src/Vapi.Net/Types/HandoffDestinationSquad.cs +++ b/src/Vapi.Net/Types/HandoffDestinationSquad.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Routes a handoff to a saved or transient squad, with optional entry assistant, context engineering, variable extraction, and overrides. +/// [Serializable] public record HandoffDestinationSquad : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/HandoffTool.cs b/src/Vapi.Net/Types/HandoffTool.cs index 6ad44cb7..df194588 100644 --- a/src/Vapi.Net/Types/HandoffTool.cs +++ b/src/Vapi.Net/Types/HandoffTool.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// A reusable tool that hands a conversation to another assistant, squad, or dynamically selected destination. +/// [Serializable] public record HandoffTool : IJsonOnDeserialized { @@ -11,10 +14,11 @@ public record HandoffTool : IJsonOnDeserialized private readonly IDictionary _extensionData = new Dictionary(); + [JsonPropertyName("latestVersion")] + public string? LatestVersion { 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. + /// Messages spoken while the tool is running. Multiple request-start messages are variants. For request-response-delayed, same timing means variants and different timings mean staged updates. /// [JsonPropertyName("messages")] public IEnumerable? Messages { get; set; } diff --git a/src/Vapi.Net/Types/HmacAuthenticationPlan.cs b/src/Vapi.Net/Types/HmacAuthenticationPlan.cs index 7b513b98..3fafef5d 100644 --- a/src/Vapi.Net/Types/HmacAuthenticationPlan.cs +++ b/src/Vapi.Net/Types/HmacAuthenticationPlan.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Configuration for signing outbound requests with an HMAC secret, including algorithm, headers, payload format, and signature encoding. +/// [Serializable] public record HmacAuthenticationPlan : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/HumeVoice.cs b/src/Vapi.Net/Types/HumeVoice.cs index 40b6f22d..1300a63d 100644 --- a/src/Vapi.Net/Types/HumeVoice.cs +++ b/src/Vapi.Net/Types/HumeVoice.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Configuration for synthesizing assistant speech with Hume, including model and voice selection, custom voice metadata, chunking, caching, and fallback settings. +/// [Serializable] public record HumeVoice : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/ImportTwilioPhoneNumberDto.cs b/src/Vapi.Net/Types/ImportTwilioPhoneNumberDto.cs index 2fcedf2a..de3f4b16 100644 --- a/src/Vapi.Net/Types/ImportTwilioPhoneNumberDto.cs +++ b/src/Vapi.Net/Types/ImportTwilioPhoneNumberDto.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Configuration for importing a Twilio phone number into Vapi, including Twilio credentials, routing target, fallback destination, hooks, SMS, and server settings. +/// [Serializable] public record ImportTwilioPhoneNumberDto : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/InflectionAiModel.cs b/src/Vapi.Net/Types/InflectionAiModel.cs index 7cc6eb0f..a6b44a3b 100644 --- a/src/Vapi.Net/Types/InflectionAiModel.cs +++ b/src/Vapi.Net/Types/InflectionAiModel.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Configuration for generating assistant responses with Inflection AI, including model, prompts, tools, knowledge-base access, and generation settings. +/// [Serializable] public record InflectionAiModel : IJsonOnDeserialized { @@ -33,6 +36,15 @@ public record InflectionAiModel : IJsonOnDeserialized [JsonPropertyName("toolIds")] public IEnumerable? ToolIds { get; set; } + /// + /// These are version-pinned references to tools. Each entry pins a specific + /// version of a tool by `(toolId, version)`. When the same `toolId` appears + /// in both `toolIds` and `toolRefs[]`, the `toolRefs` pin wins (the + /// `toolIds` entry is dropped at write time). + /// + [JsonPropertyName("toolRefs")] + public IEnumerable? ToolRefs { get; set; } + /// /// These are the options for the knowledge base. /// @@ -46,7 +58,7 @@ public record InflectionAiModel : IJsonOnDeserialized public required InflectionAiModelModel Model { get; set; } /// - /// This is the temperature that will be used for calls. Default is 0 to leverage caching for lower latency. + /// This is the temperature that will be used for calls. Default is 0.5. /// [JsonPropertyName("temperature")] public double? Temperature { get; set; } diff --git a/src/Vapi.Net/Types/Insight.cs b/src/Vapi.Net/Types/Insight.cs index 767bff81..6ec72e67 100644 --- a/src/Vapi.Net/Types/Insight.cs +++ b/src/Vapi.Net/Types/Insight.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// A saved insight returned by the API, including its visualization type, identity, organization, and lifecycle timestamps. +/// [Serializable] public record Insight : IJsonOnDeserialized { @@ -47,6 +50,12 @@ public record Insight : IJsonOnDeserialized [JsonPropertyName("updatedAt")] public required DateTime UpdatedAt { get; set; } + /// + /// Stable server-owned identifier for system-created insights. + /// + [JsonPropertyName("systemKey")] + public string? SystemKey { get; set; } + [JsonIgnore] public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); diff --git a/src/Vapi.Net/Types/InsightFormula.cs b/src/Vapi.Net/Types/InsightFormula.cs index e1f79596..de4abf68 100644 --- a/src/Vapi.Net/Types/InsightFormula.cs +++ b/src/Vapi.Net/Types/InsightFormula.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// A formula used to calculate an insight from its query results, with an optional display name. +/// [Serializable] public record InsightFormula : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/InsightPaginatedResponse.cs b/src/Vapi.Net/Types/InsightPaginatedResponse.cs index 24bfed7f..bda22280 100644 --- a/src/Vapi.Net/Types/InsightPaginatedResponse.cs +++ b/src/Vapi.Net/Types/InsightPaginatedResponse.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// A paginated collection of saved reporting insights and metadata describing the result set. +/// [Serializable] public record InsightPaginatedResponse : IJsonOnDeserialized { @@ -11,9 +14,15 @@ public record InsightPaginatedResponse : IJsonOnDeserialized private readonly IDictionary _extensionData = new Dictionary(); + /// + /// The reporting insights returned for the current page. + /// [JsonPropertyName("results")] public IEnumerable Results { get; set; } = new List(); + /// + /// Pagination metadata for the insight result set. + /// [JsonPropertyName("metadata")] public required PaginationMeta Metadata { get; set; } diff --git a/src/Vapi.Net/Types/InsightRunFormatPlan.cs b/src/Vapi.Net/Types/InsightRunFormatPlan.cs index 01e172e6..24e5eaca 100644 --- a/src/Vapi.Net/Types/InsightRunFormatPlan.cs +++ b/src/Vapi.Net/Types/InsightRunFormatPlan.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Selects whether an insight run returns raw data or Recharts-formatted data. +/// [Serializable] public record InsightRunFormatPlan : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/InsightRunResponse.cs b/src/Vapi.Net/Types/InsightRunResponse.cs index 4cfa5885..81f74a69 100644 --- a/src/Vapi.Net/Types/InsightRunResponse.cs +++ b/src/Vapi.Net/Types/InsightRunResponse.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Metadata identifying a saved insight run and its lifecycle timestamps. +/// [Serializable] public record InsightRunResponse : IJsonOnDeserialized { @@ -11,18 +14,33 @@ public record InsightRunResponse : IJsonOnDeserialized private readonly IDictionary _extensionData = new Dictionary(); + /// + /// The unique identifier for the insight run. + /// [JsonPropertyName("id")] public required string Id { get; set; } + /// + /// The unique identifier for the insight that was run. + /// [JsonPropertyName("insightId")] public required string InsightId { get; set; } + /// + /// The unique identifier for the organization that owns the run. + /// [JsonPropertyName("orgId")] public required string OrgId { get; set; } + /// + /// The ISO 8601 timestamp when the insight run was created. + /// [JsonPropertyName("createdAt")] public required DateTime CreatedAt { get; set; } + /// + /// The ISO 8601 timestamp when the insight run was last updated. + /// [JsonPropertyName("updatedAt")] public required DateTime UpdatedAt { get; set; } diff --git a/src/Vapi.Net/Types/InsightTimeRange.cs b/src/Vapi.Net/Types/InsightTimeRange.cs index e19e3a65..0a49976f 100644 --- a/src/Vapi.Net/Types/InsightTimeRange.cs +++ b/src/Vapi.Net/Types/InsightTimeRange.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Start, end, and timezone used to limit an insight query by time. +/// [Serializable] public record InsightTimeRange : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/InsightTimeRangeWithStep.cs b/src/Vapi.Net/Types/InsightTimeRangeWithStep.cs index fdefd68a..2326e383 100644 --- a/src/Vapi.Net/Types/InsightTimeRangeWithStep.cs +++ b/src/Vapi.Net/Types/InsightTimeRangeWithStep.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Start, end, timezone, and aggregation step used for a time-series insight query. +/// [Serializable] public record InsightTimeRangeWithStep : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/InviteUserDto.cs b/src/Vapi.Net/Types/InviteUserDto.cs index ae19b25d..a485fdd3 100644 --- a/src/Vapi.Net/Types/InviteUserDto.cs +++ b/src/Vapi.Net/Types/InviteUserDto.cs @@ -1,5 +1,6 @@ using global::System.Text.Json; using global::System.Text.Json.Serialization; +using OneOf; using Vapi.Net.Core; namespace Vapi.Net; @@ -15,7 +16,7 @@ public record InviteUserDto : IJsonOnDeserialized public IEnumerable Emails { get; set; } = new List(); [JsonPropertyName("role")] - public required InviteUserDtoRole Role { get; set; } + public required OneOf Role { get; set; } [JsonPropertyName("redirectTo")] public string? RedirectTo { get; set; } diff --git a/src/Vapi.Net/Types/InviteUserDtoRole.cs b/src/Vapi.Net/Types/InviteUserDtoRoleZero.cs similarity index 75% rename from src/Vapi.Net/Types/InviteUserDtoRole.cs rename to src/Vapi.Net/Types/InviteUserDtoRoleZero.cs index 5424d9d0..46837109 100644 --- a/src/Vapi.Net/Types/InviteUserDtoRole.cs +++ b/src/Vapi.Net/Types/InviteUserDtoRoleZero.cs @@ -3,8 +3,8 @@ namespace Vapi.Net; -[JsonConverter(typeof(InviteUserDtoRoleSerializer))] -public enum InviteUserDtoRole +[JsonConverter(typeof(InviteUserDtoRoleZeroSerializer))] +public enum InviteUserDtoRoleZero { [EnumMember(Value = "admin")] Admin, @@ -16,30 +16,30 @@ public enum InviteUserDtoRole Viewer, } -internal class InviteUserDtoRoleSerializer - : global::System.Text.Json.Serialization.JsonConverter +internal class InviteUserDtoRoleZeroSerializer + : global::System.Text.Json.Serialization.JsonConverter { private static readonly global::System.Collections.Generic.Dictionary< string, - InviteUserDtoRole + InviteUserDtoRoleZero > _stringToEnum = new() { - { "admin", InviteUserDtoRole.Admin }, - { "editor", InviteUserDtoRole.Editor }, - { "viewer", InviteUserDtoRole.Viewer }, + { "admin", InviteUserDtoRoleZero.Admin }, + { "editor", InviteUserDtoRoleZero.Editor }, + { "viewer", InviteUserDtoRoleZero.Viewer }, }; private static readonly global::System.Collections.Generic.Dictionary< - InviteUserDtoRole, + InviteUserDtoRoleZero, string > _enumToString = new() { - { InviteUserDtoRole.Admin, "admin" }, - { InviteUserDtoRole.Editor, "editor" }, - { InviteUserDtoRole.Viewer, "viewer" }, + { InviteUserDtoRoleZero.Admin, "admin" }, + { InviteUserDtoRoleZero.Editor, "editor" }, + { InviteUserDtoRoleZero.Viewer, "viewer" }, }; - public override InviteUserDtoRole Read( + public override InviteUserDtoRoleZero Read( ref global::System.Text.Json.Utf8JsonReader reader, global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options @@ -53,7 +53,7 @@ public override InviteUserDtoRole Read( public override void Write( global::System.Text.Json.Utf8JsonWriter writer, - InviteUserDtoRole value, + InviteUserDtoRoleZero value, global::System.Text.Json.JsonSerializerOptions options ) { @@ -62,7 +62,7 @@ public override void Write( ); } - public override InviteUserDtoRole ReadAsPropertyName( + public override InviteUserDtoRoleZero ReadAsPropertyName( ref global::System.Text.Json.Utf8JsonReader reader, global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options @@ -78,7 +78,7 @@ public override InviteUserDtoRole ReadAsPropertyName( public override void WriteAsPropertyName( global::System.Text.Json.Utf8JsonWriter writer, - InviteUserDtoRole value, + InviteUserDtoRoleZero value, global::System.Text.Json.JsonSerializerOptions options ) { diff --git a/src/Vapi.Net/Types/InworldVoice.cs b/src/Vapi.Net/Types/InworldVoice.cs index 8743bf1b..7a25a505 100644 --- a/src/Vapi.Net/Types/InworldVoice.cs +++ b/src/Vapi.Net/Types/InworldVoice.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Configuration for synthesizing assistant speech with Inworld, including voice and model selection, language, temperature, speaking rate, chunking, caching, and fallback settings. +/// [Serializable] public record InworldVoice : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/JsonQueryOnCallTableWithNumberTypeColumn.cs b/src/Vapi.Net/Types/JsonQueryOnCallTableWithNumberTypeColumn.cs index 745f54a3..f7c8294e 100644 --- a/src/Vapi.Net/Types/JsonQueryOnCallTableWithNumberTypeColumn.cs +++ b/src/Vapi.Net/Types/JsonQueryOnCallTableWithNumberTypeColumn.cs @@ -5,6 +5,9 @@ namespace Vapi.Net; +/// +/// VapiQL JSON query that aggregates a numeric call-table column with optional call filters. +/// [Serializable] public record JsonQueryOnCallTableWithNumberTypeColumn : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/JsonQueryOnCallTableWithStringTypeColumn.cs b/src/Vapi.Net/Types/JsonQueryOnCallTableWithStringTypeColumn.cs index 6c8d554e..269130c6 100644 --- a/src/Vapi.Net/Types/JsonQueryOnCallTableWithStringTypeColumn.cs +++ b/src/Vapi.Net/Types/JsonQueryOnCallTableWithStringTypeColumn.cs @@ -5,6 +5,9 @@ namespace Vapi.Net; +/// +/// VapiQL JSON query that counts values from a string-valued call-table column with optional call filters. +/// [Serializable] public record JsonQueryOnCallTableWithStringTypeColumn : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/JsonQueryOnCallTableWithStructuredOutputColumn.cs b/src/Vapi.Net/Types/JsonQueryOnCallTableWithStructuredOutputColumn.cs index e6cad31f..0269b3ce 100644 --- a/src/Vapi.Net/Types/JsonQueryOnCallTableWithStructuredOutputColumn.cs +++ b/src/Vapi.Net/Types/JsonQueryOnCallTableWithStructuredOutputColumn.cs @@ -5,6 +5,9 @@ namespace Vapi.Net; +/// +/// VapiQL JSON query that aggregates or counts a structured-output value stored on call records. +/// [Serializable] public record JsonQueryOnCallTableWithStructuredOutputColumn : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/JsonQueryOnEventsTable.cs b/src/Vapi.Net/Types/JsonQueryOnEventsTable.cs index 0ef0338e..050f2aad 100644 --- a/src/Vapi.Net/Types/JsonQueryOnEventsTable.cs +++ b/src/Vapi.Net/Types/JsonQueryOnEventsTable.cs @@ -5,6 +5,9 @@ namespace Vapi.Net; +/// +/// VapiQL JSON query that counts or calculates the percentage of matching events using optional typed event-data filters. +/// [Serializable] public record JsonQueryOnEventsTable : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/JsonQueryOnEventsTableOn.cs b/src/Vapi.Net/Types/JsonQueryOnEventsTableOn.cs index 62ebcf62..70184509 100644 --- a/src/Vapi.Net/Types/JsonQueryOnEventsTableOn.cs +++ b/src/Vapi.Net/Types/JsonQueryOnEventsTableOn.cs @@ -261,6 +261,9 @@ public enum JsonQueryOnEventsTableOn [EnumMember(Value = "assistant.analysis.structuredOutputGenerated")] AssistantAnalysisStructuredOutputGenerated, + [EnumMember(Value = "assistant.analysis.structuredOutputSkipped")] + AssistantAnalysisStructuredOutputSkipped, + [EnumMember(Value = "pipeline.turnStarted")] PipelineTurnStarted, @@ -472,6 +475,10 @@ internal class JsonQueryOnEventsTableOnSerializer "assistant.analysis.structuredOutputGenerated", JsonQueryOnEventsTableOn.AssistantAnalysisStructuredOutputGenerated }, + { + "assistant.analysis.structuredOutputSkipped", + JsonQueryOnEventsTableOn.AssistantAnalysisStructuredOutputSkipped + }, { "pipeline.turnStarted", JsonQueryOnEventsTableOn.PipelineTurnStarted }, { "pipeline.cleared", JsonQueryOnEventsTableOn.PipelineCleared }, { "pipeline.botSpeechStarted", JsonQueryOnEventsTableOn.PipelineBotSpeechStarted }, @@ -666,6 +673,10 @@ internal class JsonQueryOnEventsTableOnSerializer JsonQueryOnEventsTableOn.AssistantAnalysisStructuredOutputGenerated, "assistant.analysis.structuredOutputGenerated" }, + { + JsonQueryOnEventsTableOn.AssistantAnalysisStructuredOutputSkipped, + "assistant.analysis.structuredOutputSkipped" + }, { JsonQueryOnEventsTableOn.PipelineTurnStarted, "pipeline.turnStarted" }, { JsonQueryOnEventsTableOn.PipelineCleared, "pipeline.cleared" }, { JsonQueryOnEventsTableOn.PipelineBotSpeechStarted, "pipeline.botSpeechStarted" }, diff --git a/src/Vapi.Net/Types/JsonSchema.cs b/src/Vapi.Net/Types/JsonSchema.cs index 1aedf780..d7d56ef5 100644 --- a/src/Vapi.Net/Types/JsonSchema.cs +++ b/src/Vapi.Net/Types/JsonSchema.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// JSON Schema definition used to describe structured data for extraction, validation, or model output. +/// [Serializable] public record JsonSchema : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/KeypadInputPlan.cs b/src/Vapi.Net/Types/KeypadInputPlan.cs index 13ffef34..13d97075 100644 --- a/src/Vapi.Net/Types/KeypadInputPlan.cs +++ b/src/Vapi.Net/Types/KeypadInputPlan.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Controls collection of dual-tone multi-frequency (DTMF) keypad input, including enablement, processing timeout, and delimiters. +/// [Serializable] public record KeypadInputPlan : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/KnowledgeBase.cs b/src/Vapi.Net/Types/KnowledgeBase.cs index 1764e14b..14711e70 100644 --- a/src/Vapi.Net/Types/KnowledgeBase.cs +++ b/src/Vapi.Net/Types/KnowledgeBase.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// A knowledge-base configuration, including its provider, model, description, and associated files. +/// [Serializable] public record KnowledgeBase : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/KnowledgeBaseCost.cs b/src/Vapi.Net/Types/KnowledgeBaseCost.cs index 7f267e7c..9d538e36 100644 --- a/src/Vapi.Net/Types/KnowledgeBaseCost.cs +++ b/src/Vapi.Net/Types/KnowledgeBaseCost.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Knowledge-base model cost, including model, token usage, and amount. +/// [Serializable] public record KnowledgeBaseCost : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/KnowledgeBaseModel.cs b/src/Vapi.Net/Types/KnowledgeBaseModel.cs index dbb05c63..557bd874 100644 --- a/src/Vapi.Net/Types/KnowledgeBaseModel.cs +++ b/src/Vapi.Net/Types/KnowledgeBaseModel.cs @@ -6,6 +6,12 @@ namespace Vapi.Net; [JsonConverter(typeof(KnowledgeBaseModelSerializer))] public enum KnowledgeBaseModel { + [EnumMember(Value = "gemini-3.5-flash")] + Gemini35Flash, + + [EnumMember(Value = "gemini-3.1-flash-lite")] + Gemini31FlashLite, + [EnumMember(Value = "gemini-3-flash-preview")] Gemini3FlashPreview, @@ -60,6 +66,8 @@ internal class KnowledgeBaseModelSerializer KnowledgeBaseModel > _stringToEnum = new() { + { "gemini-3.5-flash", KnowledgeBaseModel.Gemini35Flash }, + { "gemini-3.1-flash-lite", KnowledgeBaseModel.Gemini31FlashLite }, { "gemini-3-flash-preview", KnowledgeBaseModel.Gemini3FlashPreview }, { "gemini-2.5-pro", KnowledgeBaseModel.Gemini25Pro }, { "gemini-2.5-flash", KnowledgeBaseModel.Gemini25Flash }, @@ -82,6 +90,8 @@ internal class KnowledgeBaseModelSerializer string > _enumToString = new() { + { KnowledgeBaseModel.Gemini35Flash, "gemini-3.5-flash" }, + { KnowledgeBaseModel.Gemini31FlashLite, "gemini-3.1-flash-lite" }, { KnowledgeBaseModel.Gemini3FlashPreview, "gemini-3-flash-preview" }, { KnowledgeBaseModel.Gemini25Pro, "gemini-2.5-pro" }, { KnowledgeBaseModel.Gemini25Flash, "gemini-2.5-flash" }, diff --git a/src/Vapi.Net/Types/LangfuseObservabilityPlan.cs b/src/Vapi.Net/Types/LangfuseObservabilityPlan.cs index db30994d..80a8ce25 100644 --- a/src/Vapi.Net/Types/LangfuseObservabilityPlan.cs +++ b/src/Vapi.Net/Types/LangfuseObservabilityPlan.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Configuration for sending assistant call traces to Langfuse, including prompt version linkage, trace naming, tags, and metadata. +/// [Serializable] public record LangfuseObservabilityPlan : IJsonOnDeserialized { @@ -11,6 +14,9 @@ public record LangfuseObservabilityPlan : IJsonOnDeserialized private readonly IDictionary _extensionData = new Dictionary(); + /// + /// Routes assistant call observability data to Langfuse. + /// [JsonPropertyName("provider")] public required LangfuseObservabilityPlanProvider Provider { get; set; } diff --git a/src/Vapi.Net/Types/LegacyAssistantVersion.cs b/src/Vapi.Net/Types/LegacyAssistantVersion.cs new file mode 100644 index 00000000..50c53d15 --- /dev/null +++ b/src/Vapi.Net/Types/LegacyAssistantVersion.cs @@ -0,0 +1,40 @@ +using global::System.Text.Json; +using global::System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[Serializable] +public record LegacyAssistantVersion : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("id")] + public required string Id { get; set; } + + [JsonPropertyName("assistantId")] + public required string AssistantId { get; set; } + + [JsonPropertyName("orgId")] + public required string OrgId { get; set; } + + [JsonPropertyName("data")] + public string? Data { get; set; } + + [JsonPropertyName("createdAt")] + public required DateTime CreatedAt { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/LegacyAssistantVersionPaginatedResponse.cs b/src/Vapi.Net/Types/LegacyAssistantVersionPaginatedResponse.cs new file mode 100644 index 00000000..6e0de0f3 --- /dev/null +++ b/src/Vapi.Net/Types/LegacyAssistantVersionPaginatedResponse.cs @@ -0,0 +1,35 @@ +using global::System.Text.Json; +using global::System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[Serializable] +public record LegacyAssistantVersionPaginatedResponse : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("results")] + public IEnumerable Results { get; set; } = + new List(); + + [JsonPropertyName("metadata")] + public required PaginationMeta Metadata { get; set; } + + [JsonPropertyName("nextPageState")] + public string? NextPageState { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/LineInsight.cs b/src/Vapi.Net/Types/LineInsight.cs index 38d38319..5aa5d345 100644 --- a/src/Vapi.Net/Types/LineInsight.cs +++ b/src/Vapi.Net/Types/LineInsight.cs @@ -5,6 +5,9 @@ namespace Vapi.Net; +/// +/// A saved line-chart insight containing its call-data queries, formulas, grouping, stepped time range, metadata, and lifecycle information. +/// [Serializable] public record LineInsight : IJsonOnDeserialized { @@ -44,6 +47,9 @@ public record LineInsight : IJsonOnDeserialized [JsonPropertyName("metadata")] public LineInsightMetadata? Metadata { get; set; } + /// + /// The time range and interval used to aggregate the line-chart data. + /// [JsonPropertyName("timeRange")] public InsightTimeRangeWithStep? TimeRange { get; set; } @@ -98,6 +104,12 @@ public IEnumerable< [JsonPropertyName("updatedAt")] public required DateTime UpdatedAt { get; set; } + /// + /// Stable server-owned identifier for system-created insights. + /// + [JsonPropertyName("systemKey")] + public string? SystemKey { get; set; } + [JsonIgnore] public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); diff --git a/src/Vapi.Net/Types/LineInsightMetadata.cs b/src/Vapi.Net/Types/LineInsightMetadata.cs index c50b04c5..fe77d765 100644 --- a/src/Vapi.Net/Types/LineInsightMetadata.cs +++ b/src/Vapi.Net/Types/LineInsightMetadata.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Display settings for a line insight, including chart name, axis labels, and optional y-axis bounds. +/// [Serializable] public record LineInsightMetadata : IJsonOnDeserialized { @@ -11,18 +14,33 @@ public record LineInsightMetadata : IJsonOnDeserialized private readonly IDictionary _extensionData = new Dictionary(); + /// + /// Label displayed on the chart's x-axis. + /// [JsonPropertyName("xAxisLabel")] public string? XAxisLabel { get; set; } + /// + /// Label displayed on the chart's y-axis. + /// [JsonPropertyName("yAxisLabel")] public string? YAxisLabel { get; set; } + /// + /// Minimum value displayed on the chart's y-axis. + /// [JsonPropertyName("yAxisMin")] public double? YAxisMin { get; set; } + /// + /// Maximum value displayed on the chart's y-axis. + /// [JsonPropertyName("yAxisMax")] public double? YAxisMax { get; set; } + /// + /// Display name for the insight chart. + /// [JsonPropertyName("name")] public string? Name { get; set; } diff --git a/src/Vapi.Net/Types/LiquidCondition.cs b/src/Vapi.Net/Types/LiquidCondition.cs index 42015e49..359e6d29 100644 --- a/src/Vapi.Net/Types/LiquidCondition.cs +++ b/src/Vapi.Net/Types/LiquidCondition.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Evaluates a Liquid template that must return `true` or `false`. +/// [Serializable] public record LiquidCondition : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/LivekitSmartEndpointingPlan.cs b/src/Vapi.Net/Types/LivekitSmartEndpointingPlan.cs index ca2cb271..de66fe9b 100644 --- a/src/Vapi.Net/Types/LivekitSmartEndpointingPlan.cs +++ b/src/Vapi.Net/Types/LivekitSmartEndpointingPlan.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Configuration for using LiveKit smart endpointing, including provider selection and wait-function behavior. +/// [Serializable] public record LivekitSmartEndpointingPlan : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/LmntVoice.cs b/src/Vapi.Net/Types/LmntVoice.cs index dc19b3a6..c5dc26da 100644 --- a/src/Vapi.Net/Types/LmntVoice.cs +++ b/src/Vapi.Net/Types/LmntVoice.cs @@ -5,6 +5,9 @@ namespace Vapi.Net; +/// +/// Configuration for synthesizing assistant speech with LMNT, including voice selection, language, speed, chunking, caching, and fallback settings. +/// [Serializable] public record LmntVoice : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/MakeTool.cs b/src/Vapi.Net/Types/MakeTool.cs index 7fe067bb..271be96b 100644 --- a/src/Vapi.Net/Types/MakeTool.cs +++ b/src/Vapi.Net/Types/MakeTool.cs @@ -11,10 +11,11 @@ public record MakeTool : IJsonOnDeserialized private readonly IDictionary _extensionData = new Dictionary(); + [JsonPropertyName("latestVersion")] + public string? LatestVersion { 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. + /// Messages spoken while the tool is running. Multiple request-start messages are variants. For request-response-delayed, same timing means variants and different timings mean staged updates. /// [JsonPropertyName("messages")] public IEnumerable? Messages { get; set; } diff --git a/src/Vapi.Net/Types/MakeToolWithToolCall.cs b/src/Vapi.Net/Types/MakeToolWithToolCall.cs index 6e847676..1e8a2ae4 100644 --- a/src/Vapi.Net/Types/MakeToolWithToolCall.cs +++ b/src/Vapi.Net/Types/MakeToolWithToolCall.cs @@ -12,9 +12,7 @@ public record MakeToolWithToolCall : IJsonOnDeserialized new Dictionary(); /// - /// 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. + /// Messages spoken while the tool is running. Multiple request-start messages are variants. For request-response-delayed, same timing means variants and different timings mean staged updates. /// [JsonPropertyName("messages")] public IEnumerable? Messages { get; set; } diff --git a/src/Vapi.Net/Types/McpTool.cs b/src/Vapi.Net/Types/McpTool.cs index 454f6e9b..93579212 100644 --- a/src/Vapi.Net/Types/McpTool.cs +++ b/src/Vapi.Net/Types/McpTool.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// A reusable tool that connects an assistant to a Model Context Protocol server and exposes its available tools. +/// [Serializable] public record McpTool : IJsonOnDeserialized { @@ -11,10 +14,11 @@ public record McpTool : IJsonOnDeserialized private readonly IDictionary _extensionData = new Dictionary(); + [JsonPropertyName("latestVersion")] + public string? LatestVersion { 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. + /// Messages spoken while the tool is running. Multiple request-start messages are variants. For request-response-delayed, same timing means variants and different timings mean staged updates. /// [JsonPropertyName("messages")] public IEnumerable? Messages { get; set; } @@ -145,6 +149,9 @@ public record McpTool : IJsonOnDeserialized [JsonPropertyName("rejectionPlan")] public ToolRejectionPlan? RejectionPlan { get; set; } + /// + /// Connection metadata for the MCP server, including its communication protocol. + /// [JsonPropertyName("metadata")] public McpToolMetadata? Metadata { get; set; } diff --git a/src/Vapi.Net/Types/McpToolMessages.cs b/src/Vapi.Net/Types/McpToolMessages.cs index b14c32b9..1e4dbe8b 100644 --- a/src/Vapi.Net/Types/McpToolMessages.cs +++ b/src/Vapi.Net/Types/McpToolMessages.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Per-tool message overrides for a tool discovered through an MCP server. +/// [Serializable] public record McpToolMessages : IJsonOnDeserialized { @@ -18,7 +21,7 @@ public record McpToolMessages : IJsonOnDeserialized public required string Name { get; set; } /// - /// Custom messages for this specific tool. Set to an empty array to suppress all messages for this tool. If not provided, the tool will use the default messages from the parent MCP tool configuration. + /// Custom messages for this specific tool. Set to an empty array to suppress all messages for this tool. If not provided, the tool will use the default messages from the parent MCP tool configuration. Multiple request-start messages are variants. For request-response-delayed, same timing means variants and different timings mean staged updates. /// [JsonPropertyName("messages")] public IEnumerable? Messages { get; set; } diff --git a/src/Vapi.Net/Types/McpToolMetadata.cs b/src/Vapi.Net/Types/McpToolMetadata.cs index c0092602..9a5dd106 100644 --- a/src/Vapi.Net/Types/McpToolMetadata.cs +++ b/src/Vapi.Net/Types/McpToolMetadata.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Protocol metadata used to communicate with an MCP server. +/// [Serializable] public record McpToolMetadata : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/MessageAddHookAction.cs b/src/Vapi.Net/Types/MessageAddHookAction.cs index 55384ff2..0277e805 100644 --- a/src/Vapi.Net/Types/MessageAddHookAction.cs +++ b/src/Vapi.Net/Types/MessageAddHookAction.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// A hook action that adds an OpenAI-format message to the conversation and can trigger an assistant response. +/// [Serializable] public record MessageAddHookAction : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/MessageTarget.cs b/src/Vapi.Net/Types/MessageTarget.cs index 40be6cba..bcc174f4 100644 --- a/src/Vapi.Net/Types/MessageTarget.cs +++ b/src/Vapi.Net/Types/MessageTarget.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Selects a conversation message by participant role and position for condition evaluation. +/// [Serializable] public record MessageTarget : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/TrieveCredential.cs b/src/Vapi.Net/Types/MicrosoftCredential.cs similarity index 83% rename from src/Vapi.Net/Types/TrieveCredential.cs rename to src/Vapi.Net/Types/MicrosoftCredential.cs index 3f45bd92..0a08c28c 100644 --- a/src/Vapi.Net/Types/TrieveCredential.cs +++ b/src/Vapi.Net/Types/MicrosoftCredential.cs @@ -5,14 +5,14 @@ namespace Vapi.Net; [Serializable] -public record TrieveCredential : IJsonOnDeserialized +public record MicrosoftCredential : IJsonOnDeserialized { [JsonExtensionData] private readonly IDictionary _extensionData = new Dictionary(); [JsonPropertyName("provider")] - public required TrieveCredentialProvider Provider { get; set; } + public required MicrosoftCredentialProvider Provider { get; set; } /// /// This is not returned in the API. @@ -20,6 +20,12 @@ public record TrieveCredential : IJsonOnDeserialized [JsonPropertyName("apiKey")] public required string ApiKey { get; set; } + /// + /// Azure region for the Speech resource. Defaults to `eastus` when omitted. MAI-Voice-2 is preview and region-limited. + /// + [JsonPropertyName("region")] + public string? Region { get; set; } + /// /// This is the unique identifier for the credential. /// diff --git a/src/Vapi.Net/Types/MicrosoftCredentialProvider.cs b/src/Vapi.Net/Types/MicrosoftCredentialProvider.cs new file mode 100644 index 00000000..a7ac1734 --- /dev/null +++ b/src/Vapi.Net/Types/MicrosoftCredentialProvider.cs @@ -0,0 +1,73 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(MicrosoftCredentialProviderSerializer))] +public enum MicrosoftCredentialProvider +{ + [EnumMember(Value = "microsoft")] + Microsoft, +} + +internal class MicrosoftCredentialProviderSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + MicrosoftCredentialProvider + > _stringToEnum = new() { { "microsoft", MicrosoftCredentialProvider.Microsoft } }; + + private static readonly global::System.Collections.Generic.Dictionary< + MicrosoftCredentialProvider, + string + > _enumToString = new() { { MicrosoftCredentialProvider.Microsoft, "microsoft" } }; + + public override MicrosoftCredentialProvider Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + MicrosoftCredentialProvider value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override MicrosoftCredentialProvider ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + MicrosoftCredentialProvider value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/MicrosoftVoice.cs b/src/Vapi.Net/Types/MicrosoftVoice.cs new file mode 100644 index 00000000..c58c1a48 --- /dev/null +++ b/src/Vapi.Net/Types/MicrosoftVoice.cs @@ -0,0 +1,73 @@ +using global::System.Text.Json; +using global::System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[Serializable] +public record MicrosoftVoice : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + /// + /// This is the flag to toggle voice caching for the assistant. + /// + [JsonPropertyName("cachingEnabled")] + public bool? CachingEnabled { get; set; } + + /// + /// MAI-Voice-2 voice ID. Built-in voices listed in enum. + /// + [JsonPropertyName("voiceId")] + public required MicrosoftVoiceVoiceId VoiceId { get; set; } + + /// + /// Speaking style applied via mstts:express-as on every request. Unknown styles are ignored by Azure and fall back to neutral. + /// + [JsonPropertyName("style")] + public MicrosoftVoiceStyle? Style { get; set; } + + /// + /// Style intensity (0.01–2). Default 1 = the predefined style strength. Only applies when `style` is set. + /// + [JsonPropertyName("styleDegree")] + public double? StyleDegree { get; set; } + + /// + /// Role-play (age/gender imitation). Requires `style` to be set; ignored otherwise. + /// + [JsonPropertyName("role")] + public MicrosoftVoiceRole? Role { 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 speed multiplier that will be used. + /// + [JsonPropertyName("speed")] + public double? Speed { 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; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/MicrosoftVoiceRole.cs b/src/Vapi.Net/Types/MicrosoftVoiceRole.cs new file mode 100644 index 00000000..30719c03 --- /dev/null +++ b/src/Vapi.Net/Types/MicrosoftVoiceRole.cs @@ -0,0 +1,114 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(MicrosoftVoiceRoleSerializer))] +public enum MicrosoftVoiceRole +{ + [EnumMember(Value = "Girl")] + Girl, + + [EnumMember(Value = "Boy")] + Boy, + + [EnumMember(Value = "YoungAdultFemale")] + YoungAdultFemale, + + [EnumMember(Value = "YoungAdultMale")] + YoungAdultMale, + + [EnumMember(Value = "OlderAdultFemale")] + OlderAdultFemale, + + [EnumMember(Value = "OlderAdultMale")] + OlderAdultMale, + + [EnumMember(Value = "SeniorFemale")] + SeniorFemale, + + [EnumMember(Value = "SeniorMale")] + SeniorMale, +} + +internal class MicrosoftVoiceRoleSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + MicrosoftVoiceRole + > _stringToEnum = new() + { + { "Girl", MicrosoftVoiceRole.Girl }, + { "Boy", MicrosoftVoiceRole.Boy }, + { "YoungAdultFemale", MicrosoftVoiceRole.YoungAdultFemale }, + { "YoungAdultMale", MicrosoftVoiceRole.YoungAdultMale }, + { "OlderAdultFemale", MicrosoftVoiceRole.OlderAdultFemale }, + { "OlderAdultMale", MicrosoftVoiceRole.OlderAdultMale }, + { "SeniorFemale", MicrosoftVoiceRole.SeniorFemale }, + { "SeniorMale", MicrosoftVoiceRole.SeniorMale }, + }; + + private static readonly global::System.Collections.Generic.Dictionary< + MicrosoftVoiceRole, + string + > _enumToString = new() + { + { MicrosoftVoiceRole.Girl, "Girl" }, + { MicrosoftVoiceRole.Boy, "Boy" }, + { MicrosoftVoiceRole.YoungAdultFemale, "YoungAdultFemale" }, + { MicrosoftVoiceRole.YoungAdultMale, "YoungAdultMale" }, + { MicrosoftVoiceRole.OlderAdultFemale, "OlderAdultFemale" }, + { MicrosoftVoiceRole.OlderAdultMale, "OlderAdultMale" }, + { MicrosoftVoiceRole.SeniorFemale, "SeniorFemale" }, + { MicrosoftVoiceRole.SeniorMale, "SeniorMale" }, + }; + + public override MicrosoftVoiceRole Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + MicrosoftVoiceRole value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override MicrosoftVoiceRole ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + MicrosoftVoiceRole value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/MicrosoftVoiceStyle.cs b/src/Vapi.Net/Types/MicrosoftVoiceStyle.cs new file mode 100644 index 00000000..6bbd2a0d --- /dev/null +++ b/src/Vapi.Net/Types/MicrosoftVoiceStyle.cs @@ -0,0 +1,219 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(MicrosoftVoiceStyleSerializer))] +public enum MicrosoftVoiceStyle +{ + [EnumMember(Value = "adventurous")] + Adventurous, + + [EnumMember(Value = "angry")] + Angry, + + [EnumMember(Value = "caring")] + Caring, + + [EnumMember(Value = "cheerful")] + Cheerful, + + [EnumMember(Value = "confused")] + Confused, + + [EnumMember(Value = "curious")] + Curious, + + [EnumMember(Value = "determined")] + Determined, + + [EnumMember(Value = "disappointed")] + Disappointed, + + [EnumMember(Value = "disgusted")] + Disgusted, + + [EnumMember(Value = "embarrassed")] + Embarrassed, + + [EnumMember(Value = "empathy")] + Empathy, + + [EnumMember(Value = "encouraging")] + Encouraging, + + [EnumMember(Value = "excited")] + Excited, + + [EnumMember(Value = "fearful")] + Fearful, + + [EnumMember(Value = "friendly")] + Friendly, + + [EnumMember(Value = "happy")] + Happy, + + [EnumMember(Value = "hopeful")] + Hopeful, + + [EnumMember(Value = "jealous")] + Jealous, + + [EnumMember(Value = "joyful")] + Joyful, + + [EnumMember(Value = "nostalgic")] + Nostalgic, + + [EnumMember(Value = "reflective")] + Reflective, + + [EnumMember(Value = "regretful")] + Regretful, + + [EnumMember(Value = "relieved")] + Relieved, + + [EnumMember(Value = "sad")] + Sad, + + [EnumMember(Value = "serious")] + Serious, + + [EnumMember(Value = "shouting")] + Shouting, + + [EnumMember(Value = "softvoice")] + Softvoice, + + [EnumMember(Value = "surprised")] + Surprised, + + [EnumMember(Value = "whispering")] + Whispering, +} + +internal class MicrosoftVoiceStyleSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + MicrosoftVoiceStyle + > _stringToEnum = new() + { + { "adventurous", MicrosoftVoiceStyle.Adventurous }, + { "angry", MicrosoftVoiceStyle.Angry }, + { "caring", MicrosoftVoiceStyle.Caring }, + { "cheerful", MicrosoftVoiceStyle.Cheerful }, + { "confused", MicrosoftVoiceStyle.Confused }, + { "curious", MicrosoftVoiceStyle.Curious }, + { "determined", MicrosoftVoiceStyle.Determined }, + { "disappointed", MicrosoftVoiceStyle.Disappointed }, + { "disgusted", MicrosoftVoiceStyle.Disgusted }, + { "embarrassed", MicrosoftVoiceStyle.Embarrassed }, + { "empathy", MicrosoftVoiceStyle.Empathy }, + { "encouraging", MicrosoftVoiceStyle.Encouraging }, + { "excited", MicrosoftVoiceStyle.Excited }, + { "fearful", MicrosoftVoiceStyle.Fearful }, + { "friendly", MicrosoftVoiceStyle.Friendly }, + { "happy", MicrosoftVoiceStyle.Happy }, + { "hopeful", MicrosoftVoiceStyle.Hopeful }, + { "jealous", MicrosoftVoiceStyle.Jealous }, + { "joyful", MicrosoftVoiceStyle.Joyful }, + { "nostalgic", MicrosoftVoiceStyle.Nostalgic }, + { "reflective", MicrosoftVoiceStyle.Reflective }, + { "regretful", MicrosoftVoiceStyle.Regretful }, + { "relieved", MicrosoftVoiceStyle.Relieved }, + { "sad", MicrosoftVoiceStyle.Sad }, + { "serious", MicrosoftVoiceStyle.Serious }, + { "shouting", MicrosoftVoiceStyle.Shouting }, + { "softvoice", MicrosoftVoiceStyle.Softvoice }, + { "surprised", MicrosoftVoiceStyle.Surprised }, + { "whispering", MicrosoftVoiceStyle.Whispering }, + }; + + private static readonly global::System.Collections.Generic.Dictionary< + MicrosoftVoiceStyle, + string + > _enumToString = new() + { + { MicrosoftVoiceStyle.Adventurous, "adventurous" }, + { MicrosoftVoiceStyle.Angry, "angry" }, + { MicrosoftVoiceStyle.Caring, "caring" }, + { MicrosoftVoiceStyle.Cheerful, "cheerful" }, + { MicrosoftVoiceStyle.Confused, "confused" }, + { MicrosoftVoiceStyle.Curious, "curious" }, + { MicrosoftVoiceStyle.Determined, "determined" }, + { MicrosoftVoiceStyle.Disappointed, "disappointed" }, + { MicrosoftVoiceStyle.Disgusted, "disgusted" }, + { MicrosoftVoiceStyle.Embarrassed, "embarrassed" }, + { MicrosoftVoiceStyle.Empathy, "empathy" }, + { MicrosoftVoiceStyle.Encouraging, "encouraging" }, + { MicrosoftVoiceStyle.Excited, "excited" }, + { MicrosoftVoiceStyle.Fearful, "fearful" }, + { MicrosoftVoiceStyle.Friendly, "friendly" }, + { MicrosoftVoiceStyle.Happy, "happy" }, + { MicrosoftVoiceStyle.Hopeful, "hopeful" }, + { MicrosoftVoiceStyle.Jealous, "jealous" }, + { MicrosoftVoiceStyle.Joyful, "joyful" }, + { MicrosoftVoiceStyle.Nostalgic, "nostalgic" }, + { MicrosoftVoiceStyle.Reflective, "reflective" }, + { MicrosoftVoiceStyle.Regretful, "regretful" }, + { MicrosoftVoiceStyle.Relieved, "relieved" }, + { MicrosoftVoiceStyle.Sad, "sad" }, + { MicrosoftVoiceStyle.Serious, "serious" }, + { MicrosoftVoiceStyle.Shouting, "shouting" }, + { MicrosoftVoiceStyle.Softvoice, "softvoice" }, + { MicrosoftVoiceStyle.Surprised, "surprised" }, + { MicrosoftVoiceStyle.Whispering, "whispering" }, + }; + + public override MicrosoftVoiceStyle Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + MicrosoftVoiceStyle value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override MicrosoftVoiceStyle ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + MicrosoftVoiceStyle value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/MicrosoftVoiceVoiceId.cs b/src/Vapi.Net/Types/MicrosoftVoiceVoiceId.cs new file mode 100644 index 00000000..ca343a1a --- /dev/null +++ b/src/Vapi.Net/Types/MicrosoftVoiceVoiceId.cs @@ -0,0 +1,304 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(MicrosoftVoiceVoiceIdSerializer))] +public enum MicrosoftVoiceVoiceId +{ + [EnumMember(Value = "de-DE-Klaus:MAI-Voice-2")] + DeDeKlausMaiVoice2, + + [EnumMember(Value = "de-DE-Mia:MAI-Voice-2")] + DeDeMiaMaiVoice2, + + [EnumMember(Value = "en-AU-Lisa:MAI-Voice-2")] + EnAuLisaMaiVoice2, + + [EnumMember(Value = "en-US-Ethan:MAI-Voice-2")] + EnUsEthanMaiVoice2, + + [EnumMember(Value = "en-US-Grant:MAI-Voice-2")] + EnUsGrantMaiVoice2, + + [EnumMember(Value = "en-US-Harper:MAI-Voice-2")] + EnUsHarperMaiVoice2, + + [EnumMember(Value = "en-US-Iris:MAI-Voice-2")] + EnUsIrisMaiVoice2, + + [EnumMember(Value = "en-US-Jasper:MAI-Voice-2")] + EnUsJasperMaiVoice2, + + [EnumMember(Value = "en-US-Olivia:MAI-Voice-2")] + EnUsOliviaMaiVoice2, + + [EnumMember(Value = "es-ES-Marta:MAI-Voice-2")] + EsEsMartaMaiVoice2, + + [EnumMember(Value = "es-MX-Alejo:MAI-Voice-2")] + EsMxAlejoMaiVoice2, + + [EnumMember(Value = "es-MX-Valeria:MAI-Voice-2")] + EsMxValeriaMaiVoice2, + + [EnumMember(Value = "fr-FR-Marc:MAI-Voice-2")] + FrFrMarcMaiVoice2, + + [EnumMember(Value = "fr-FR-Soleil:MAI-Voice-2")] + FrFrSoleilMaiVoice2, + + [EnumMember(Value = "hi-IN-Arjun:MAI-Voice-2")] + HiInArjunMaiVoice2, + + [EnumMember(Value = "hi-IN-Dhruv:MAI-Voice-2")] + HiInDhruvMaiVoice2, + + [EnumMember(Value = "hi-IN-Kavya:MAI-Voice-2")] + HiInKavyaMaiVoice2, + + [EnumMember(Value = "hi-IN-Priya:MAI-Voice-2")] + HiInPriyaMaiVoice2, + + [EnumMember(Value = "hu-HU-Bence:MAI-Voice-2")] + HuHuBenceMaiVoice2, + + [EnumMember(Value = "hu-HU-Levente:MAI-Voice-2")] + HuHuLeventeMaiVoice2, + + [EnumMember(Value = "hu-HU-Lilla:MAI-Voice-2")] + HuHuLillaMaiVoice2, + + [EnumMember(Value = "hu-HU-Réka:MAI-Voice-2")] + HuHuRekaMaiVoice2, + + [EnumMember(Value = "it-IT-Luca:MAI-Voice-2")] + ItItLucaMaiVoice2, + + [EnumMember(Value = "it-IT-Rosa:MAI-Voice-2")] + ItItRosaMaiVoice2, + + [EnumMember(Value = "ko-KR-Hana:MAI-Voice-2")] + KoKrHanaMaiVoice2, + + [EnumMember(Value = "ko-KR-Junho:MAI-Voice-2")] + KoKrJunhoMaiVoice2, + + [EnumMember(Value = "nl-NL-Fleur:MAI-Voice-2")] + NlNlFleurMaiVoice2, + + [EnumMember(Value = "nl-NL-Sander:MAI-Voice-2")] + NlNlSanderMaiVoice2, + + [EnumMember(Value = "pt-BR-Caio:MAI-Voice-2")] + PtBrCaioMaiVoice2, + + [EnumMember(Value = "pt-BR-Luana:MAI-Voice-2")] + PtBrLuanaMaiVoice2, + + [EnumMember(Value = "pt-BR-Pedro:MAI-Voice-2")] + PtBrPedroMaiVoice2, + + [EnumMember(Value = "pt-BR-Rafael:MAI-Voice-2")] + PtBrRafaelMaiVoice2, + + [EnumMember(Value = "pt-PT-Rui:MAI-Voice-2")] + PtPtRuiMaiVoice2, + + [EnumMember(Value = "ro-RO-Andrei:MAI-Voice-2")] + RoRoAndreiMaiVoice2, + + [EnumMember(Value = "ro-RO-Elena:MAI-Voice-2")] + RoRoElenaMaiVoice2, + + [EnumMember(Value = "ro-RO-Ioana:MAI-Voice-2")] + RoRoIoanaMaiVoice2, + + [EnumMember(Value = "ro-RO-Radu:MAI-Voice-2")] + RoRoRaduMaiVoice2, + + [EnumMember(Value = "ru-RU-Lev:MAI-Voice-2")] + RuRuLevMaiVoice2, + + [EnumMember(Value = "ru-RU-Masha:MAI-Voice-2")] + RuRuMashaMaiVoice2, + + [EnumMember(Value = "th-TH-Krit:MAI-Voice-2")] + ThThKritMaiVoice2, + + [EnumMember(Value = "th-TH-Nattapong:MAI-Voice-2")] + ThThNattapongMaiVoice2, + + [EnumMember(Value = "tr-TR-Aydin:MAI-Voice-2")] + TrTrAydinMaiVoice2, + + [EnumMember(Value = "tr-TR-Elif:MAI-Voice-2")] + TrTrElifMaiVoice2, + + [EnumMember(Value = "zh-CN-Bo:MAI-Voice-2")] + ZhCnBoMaiVoice2, + + [EnumMember(Value = "zh-CN-Lan:MAI-Voice-2")] + ZhCnLanMaiVoice2, + + [EnumMember(Value = "zh-CN-Mei:MAI-Voice-2")] + ZhCnMeiMaiVoice2, +} + +internal class MicrosoftVoiceVoiceIdSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + MicrosoftVoiceVoiceId + > _stringToEnum = new() + { + { "de-DE-Klaus:MAI-Voice-2", MicrosoftVoiceVoiceId.DeDeKlausMaiVoice2 }, + { "de-DE-Mia:MAI-Voice-2", MicrosoftVoiceVoiceId.DeDeMiaMaiVoice2 }, + { "en-AU-Lisa:MAI-Voice-2", MicrosoftVoiceVoiceId.EnAuLisaMaiVoice2 }, + { "en-US-Ethan:MAI-Voice-2", MicrosoftVoiceVoiceId.EnUsEthanMaiVoice2 }, + { "en-US-Grant:MAI-Voice-2", MicrosoftVoiceVoiceId.EnUsGrantMaiVoice2 }, + { "en-US-Harper:MAI-Voice-2", MicrosoftVoiceVoiceId.EnUsHarperMaiVoice2 }, + { "en-US-Iris:MAI-Voice-2", MicrosoftVoiceVoiceId.EnUsIrisMaiVoice2 }, + { "en-US-Jasper:MAI-Voice-2", MicrosoftVoiceVoiceId.EnUsJasperMaiVoice2 }, + { "en-US-Olivia:MAI-Voice-2", MicrosoftVoiceVoiceId.EnUsOliviaMaiVoice2 }, + { "es-ES-Marta:MAI-Voice-2", MicrosoftVoiceVoiceId.EsEsMartaMaiVoice2 }, + { "es-MX-Alejo:MAI-Voice-2", MicrosoftVoiceVoiceId.EsMxAlejoMaiVoice2 }, + { "es-MX-Valeria:MAI-Voice-2", MicrosoftVoiceVoiceId.EsMxValeriaMaiVoice2 }, + { "fr-FR-Marc:MAI-Voice-2", MicrosoftVoiceVoiceId.FrFrMarcMaiVoice2 }, + { "fr-FR-Soleil:MAI-Voice-2", MicrosoftVoiceVoiceId.FrFrSoleilMaiVoice2 }, + { "hi-IN-Arjun:MAI-Voice-2", MicrosoftVoiceVoiceId.HiInArjunMaiVoice2 }, + { "hi-IN-Dhruv:MAI-Voice-2", MicrosoftVoiceVoiceId.HiInDhruvMaiVoice2 }, + { "hi-IN-Kavya:MAI-Voice-2", MicrosoftVoiceVoiceId.HiInKavyaMaiVoice2 }, + { "hi-IN-Priya:MAI-Voice-2", MicrosoftVoiceVoiceId.HiInPriyaMaiVoice2 }, + { "hu-HU-Bence:MAI-Voice-2", MicrosoftVoiceVoiceId.HuHuBenceMaiVoice2 }, + { "hu-HU-Levente:MAI-Voice-2", MicrosoftVoiceVoiceId.HuHuLeventeMaiVoice2 }, + { "hu-HU-Lilla:MAI-Voice-2", MicrosoftVoiceVoiceId.HuHuLillaMaiVoice2 }, + { "hu-HU-Réka:MAI-Voice-2", MicrosoftVoiceVoiceId.HuHuRekaMaiVoice2 }, + { "it-IT-Luca:MAI-Voice-2", MicrosoftVoiceVoiceId.ItItLucaMaiVoice2 }, + { "it-IT-Rosa:MAI-Voice-2", MicrosoftVoiceVoiceId.ItItRosaMaiVoice2 }, + { "ko-KR-Hana:MAI-Voice-2", MicrosoftVoiceVoiceId.KoKrHanaMaiVoice2 }, + { "ko-KR-Junho:MAI-Voice-2", MicrosoftVoiceVoiceId.KoKrJunhoMaiVoice2 }, + { "nl-NL-Fleur:MAI-Voice-2", MicrosoftVoiceVoiceId.NlNlFleurMaiVoice2 }, + { "nl-NL-Sander:MAI-Voice-2", MicrosoftVoiceVoiceId.NlNlSanderMaiVoice2 }, + { "pt-BR-Caio:MAI-Voice-2", MicrosoftVoiceVoiceId.PtBrCaioMaiVoice2 }, + { "pt-BR-Luana:MAI-Voice-2", MicrosoftVoiceVoiceId.PtBrLuanaMaiVoice2 }, + { "pt-BR-Pedro:MAI-Voice-2", MicrosoftVoiceVoiceId.PtBrPedroMaiVoice2 }, + { "pt-BR-Rafael:MAI-Voice-2", MicrosoftVoiceVoiceId.PtBrRafaelMaiVoice2 }, + { "pt-PT-Rui:MAI-Voice-2", MicrosoftVoiceVoiceId.PtPtRuiMaiVoice2 }, + { "ro-RO-Andrei:MAI-Voice-2", MicrosoftVoiceVoiceId.RoRoAndreiMaiVoice2 }, + { "ro-RO-Elena:MAI-Voice-2", MicrosoftVoiceVoiceId.RoRoElenaMaiVoice2 }, + { "ro-RO-Ioana:MAI-Voice-2", MicrosoftVoiceVoiceId.RoRoIoanaMaiVoice2 }, + { "ro-RO-Radu:MAI-Voice-2", MicrosoftVoiceVoiceId.RoRoRaduMaiVoice2 }, + { "ru-RU-Lev:MAI-Voice-2", MicrosoftVoiceVoiceId.RuRuLevMaiVoice2 }, + { "ru-RU-Masha:MAI-Voice-2", MicrosoftVoiceVoiceId.RuRuMashaMaiVoice2 }, + { "th-TH-Krit:MAI-Voice-2", MicrosoftVoiceVoiceId.ThThKritMaiVoice2 }, + { "th-TH-Nattapong:MAI-Voice-2", MicrosoftVoiceVoiceId.ThThNattapongMaiVoice2 }, + { "tr-TR-Aydin:MAI-Voice-2", MicrosoftVoiceVoiceId.TrTrAydinMaiVoice2 }, + { "tr-TR-Elif:MAI-Voice-2", MicrosoftVoiceVoiceId.TrTrElifMaiVoice2 }, + { "zh-CN-Bo:MAI-Voice-2", MicrosoftVoiceVoiceId.ZhCnBoMaiVoice2 }, + { "zh-CN-Lan:MAI-Voice-2", MicrosoftVoiceVoiceId.ZhCnLanMaiVoice2 }, + { "zh-CN-Mei:MAI-Voice-2", MicrosoftVoiceVoiceId.ZhCnMeiMaiVoice2 }, + }; + + private static readonly global::System.Collections.Generic.Dictionary< + MicrosoftVoiceVoiceId, + string + > _enumToString = new() + { + { MicrosoftVoiceVoiceId.DeDeKlausMaiVoice2, "de-DE-Klaus:MAI-Voice-2" }, + { MicrosoftVoiceVoiceId.DeDeMiaMaiVoice2, "de-DE-Mia:MAI-Voice-2" }, + { MicrosoftVoiceVoiceId.EnAuLisaMaiVoice2, "en-AU-Lisa:MAI-Voice-2" }, + { MicrosoftVoiceVoiceId.EnUsEthanMaiVoice2, "en-US-Ethan:MAI-Voice-2" }, + { MicrosoftVoiceVoiceId.EnUsGrantMaiVoice2, "en-US-Grant:MAI-Voice-2" }, + { MicrosoftVoiceVoiceId.EnUsHarperMaiVoice2, "en-US-Harper:MAI-Voice-2" }, + { MicrosoftVoiceVoiceId.EnUsIrisMaiVoice2, "en-US-Iris:MAI-Voice-2" }, + { MicrosoftVoiceVoiceId.EnUsJasperMaiVoice2, "en-US-Jasper:MAI-Voice-2" }, + { MicrosoftVoiceVoiceId.EnUsOliviaMaiVoice2, "en-US-Olivia:MAI-Voice-2" }, + { MicrosoftVoiceVoiceId.EsEsMartaMaiVoice2, "es-ES-Marta:MAI-Voice-2" }, + { MicrosoftVoiceVoiceId.EsMxAlejoMaiVoice2, "es-MX-Alejo:MAI-Voice-2" }, + { MicrosoftVoiceVoiceId.EsMxValeriaMaiVoice2, "es-MX-Valeria:MAI-Voice-2" }, + { MicrosoftVoiceVoiceId.FrFrMarcMaiVoice2, "fr-FR-Marc:MAI-Voice-2" }, + { MicrosoftVoiceVoiceId.FrFrSoleilMaiVoice2, "fr-FR-Soleil:MAI-Voice-2" }, + { MicrosoftVoiceVoiceId.HiInArjunMaiVoice2, "hi-IN-Arjun:MAI-Voice-2" }, + { MicrosoftVoiceVoiceId.HiInDhruvMaiVoice2, "hi-IN-Dhruv:MAI-Voice-2" }, + { MicrosoftVoiceVoiceId.HiInKavyaMaiVoice2, "hi-IN-Kavya:MAI-Voice-2" }, + { MicrosoftVoiceVoiceId.HiInPriyaMaiVoice2, "hi-IN-Priya:MAI-Voice-2" }, + { MicrosoftVoiceVoiceId.HuHuBenceMaiVoice2, "hu-HU-Bence:MAI-Voice-2" }, + { MicrosoftVoiceVoiceId.HuHuLeventeMaiVoice2, "hu-HU-Levente:MAI-Voice-2" }, + { MicrosoftVoiceVoiceId.HuHuLillaMaiVoice2, "hu-HU-Lilla:MAI-Voice-2" }, + { MicrosoftVoiceVoiceId.HuHuRekaMaiVoice2, "hu-HU-Réka:MAI-Voice-2" }, + { MicrosoftVoiceVoiceId.ItItLucaMaiVoice2, "it-IT-Luca:MAI-Voice-2" }, + { MicrosoftVoiceVoiceId.ItItRosaMaiVoice2, "it-IT-Rosa:MAI-Voice-2" }, + { MicrosoftVoiceVoiceId.KoKrHanaMaiVoice2, "ko-KR-Hana:MAI-Voice-2" }, + { MicrosoftVoiceVoiceId.KoKrJunhoMaiVoice2, "ko-KR-Junho:MAI-Voice-2" }, + { MicrosoftVoiceVoiceId.NlNlFleurMaiVoice2, "nl-NL-Fleur:MAI-Voice-2" }, + { MicrosoftVoiceVoiceId.NlNlSanderMaiVoice2, "nl-NL-Sander:MAI-Voice-2" }, + { MicrosoftVoiceVoiceId.PtBrCaioMaiVoice2, "pt-BR-Caio:MAI-Voice-2" }, + { MicrosoftVoiceVoiceId.PtBrLuanaMaiVoice2, "pt-BR-Luana:MAI-Voice-2" }, + { MicrosoftVoiceVoiceId.PtBrPedroMaiVoice2, "pt-BR-Pedro:MAI-Voice-2" }, + { MicrosoftVoiceVoiceId.PtBrRafaelMaiVoice2, "pt-BR-Rafael:MAI-Voice-2" }, + { MicrosoftVoiceVoiceId.PtPtRuiMaiVoice2, "pt-PT-Rui:MAI-Voice-2" }, + { MicrosoftVoiceVoiceId.RoRoAndreiMaiVoice2, "ro-RO-Andrei:MAI-Voice-2" }, + { MicrosoftVoiceVoiceId.RoRoElenaMaiVoice2, "ro-RO-Elena:MAI-Voice-2" }, + { MicrosoftVoiceVoiceId.RoRoIoanaMaiVoice2, "ro-RO-Ioana:MAI-Voice-2" }, + { MicrosoftVoiceVoiceId.RoRoRaduMaiVoice2, "ro-RO-Radu:MAI-Voice-2" }, + { MicrosoftVoiceVoiceId.RuRuLevMaiVoice2, "ru-RU-Lev:MAI-Voice-2" }, + { MicrosoftVoiceVoiceId.RuRuMashaMaiVoice2, "ru-RU-Masha:MAI-Voice-2" }, + { MicrosoftVoiceVoiceId.ThThKritMaiVoice2, "th-TH-Krit:MAI-Voice-2" }, + { MicrosoftVoiceVoiceId.ThThNattapongMaiVoice2, "th-TH-Nattapong:MAI-Voice-2" }, + { MicrosoftVoiceVoiceId.TrTrAydinMaiVoice2, "tr-TR-Aydin:MAI-Voice-2" }, + { MicrosoftVoiceVoiceId.TrTrElifMaiVoice2, "tr-TR-Elif:MAI-Voice-2" }, + { MicrosoftVoiceVoiceId.ZhCnBoMaiVoice2, "zh-CN-Bo:MAI-Voice-2" }, + { MicrosoftVoiceVoiceId.ZhCnLanMaiVoice2, "zh-CN-Lan:MAI-Voice-2" }, + { MicrosoftVoiceVoiceId.ZhCnMeiMaiVoice2, "zh-CN-Mei:MAI-Voice-2" }, + }; + + public override MicrosoftVoiceVoiceId Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + MicrosoftVoiceVoiceId value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override MicrosoftVoiceVoiceId ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + MicrosoftVoiceVoiceId value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/MinCallDurationCondition.cs b/src/Vapi.Net/Types/MinCallDurationCondition.cs new file mode 100644 index 00000000..03271d65 --- /dev/null +++ b/src/Vapi.Net/Types/MinCallDurationCondition.cs @@ -0,0 +1,35 @@ +using global::System.Text.Json; +using global::System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[Serializable] +public record MinCallDurationCondition : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + /// + /// This is the minimum call duration in seconds required for the structured + /// output to run. + /// + /// When timestamps are unavailable (for example, chat sessions have no call + /// timestamps), this check passes and does not block the structured output. + /// + [JsonPropertyName("seconds")] + public required double Seconds { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/MinMessagesCondition.cs b/src/Vapi.Net/Types/MinMessagesCondition.cs new file mode 100644 index 00000000..f9ffcc97 --- /dev/null +++ b/src/Vapi.Net/Types/MinMessagesCondition.cs @@ -0,0 +1,35 @@ +using global::System.Text.Json; +using global::System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[Serializable] +public record MinMessagesCondition : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + /// + /// This is the minimum number of conversation messages required for the + /// structured output to run. + /// + /// A count of 0 removes the runtime default minimum, so the structured output + /// runs regardless of how few messages the conversation has. + /// + [JsonPropertyName("count")] + public required double Count { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/MinimaxLlmModel.cs b/src/Vapi.Net/Types/MinimaxLlmModel.cs index f53db672..3ef7b50a 100644 --- a/src/Vapi.Net/Types/MinimaxLlmModel.cs +++ b/src/Vapi.Net/Types/MinimaxLlmModel.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Configuration for generating assistant responses with MiniMax, including model, prompts, tools, knowledge-base access, and generation settings. +/// [Serializable] public record MinimaxLlmModel : IJsonOnDeserialized { @@ -33,6 +36,15 @@ public record MinimaxLlmModel : IJsonOnDeserialized [JsonPropertyName("toolIds")] public IEnumerable? ToolIds { get; set; } + /// + /// These are version-pinned references to tools. Each entry pins a specific + /// version of a tool by `(toolId, version)`. When the same `toolId` appears + /// in both `toolIds` and `toolRefs[]`, the `toolRefs` pin wins (the + /// `toolIds` entry is dropped at write time). + /// + [JsonPropertyName("toolRefs")] + public IEnumerable? ToolRefs { get; set; } + /// /// These are the options for the knowledge base. /// @@ -46,7 +58,7 @@ public record MinimaxLlmModel : IJsonOnDeserialized public required MinimaxLlmModelModel Model { get; set; } /// - /// This is the temperature that will be used for calls. Default is 0 to leverage caching for lower latency. + /// This is the temperature that will be used for calls. Default is 0.5. /// [JsonPropertyName("temperature")] public double? Temperature { get; set; } diff --git a/src/Vapi.Net/Types/MinimaxVoice.cs b/src/Vapi.Net/Types/MinimaxVoice.cs index 96e6e6cf..28547d52 100644 --- a/src/Vapi.Net/Types/MinimaxVoice.cs +++ b/src/Vapi.Net/Types/MinimaxVoice.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Configuration for synthesizing assistant speech with MiniMax, including voice and model selection, emotion, pitch, speed, volume, region, language, text normalization, chunking, caching, and fallback settings. +/// [Serializable] public record MinimaxVoice : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/ModelCost.cs b/src/Vapi.Net/Types/ModelCost.cs index d69c89b2..44127c24 100644 --- a/src/Vapi.Net/Types/ModelCost.cs +++ b/src/Vapi.Net/Types/ModelCost.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Language-model cost for a call, including model, token usage, and amount. +/// [Serializable] public record ModelCost : IJsonOnDeserialized { @@ -43,6 +46,14 @@ public record ModelCost : IJsonOnDeserialized [JsonPropertyName("cachedPromptTokens")] public double? CachedPromptTokens { get; set; } + /// + /// This is the number of reasoning tokens generated in the call. This is only applicable to reasoning models (e.g., OpenAI o-series, GPT-5) on providers that report them. + /// + /// This is a **subset of `completionTokens`**, not an addition to it: reasoning tokens are already counted in `completionTokens` and are already billed at the output-token rate. It is reported separately for visibility only and does not affect `cost`. + /// + [JsonPropertyName("reasoningTokens")] + public double? ReasoningTokens { get; set; } + /// /// This is the cost of the component in USD. /// diff --git a/src/Vapi.Net/Types/Monitor.cs b/src/Vapi.Net/Types/Monitor.cs index a3134a45..dc70f4e6 100644 --- a/src/Vapi.Net/Types/Monitor.cs +++ b/src/Vapi.Net/Types/Monitor.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Live monitoring data for a call, including attached monitor results and listening and control URLs. +/// [Serializable] public record Monitor : IJsonOnDeserialized { @@ -11,6 +14,9 @@ public record Monitor : IJsonOnDeserialized private readonly IDictionary _extensionData = new Dictionary(); + /// + /// Results produced by monitors attached to the call. + /// [JsonPropertyName("monitors")] public IEnumerable? Monitors { get; set; } diff --git a/src/Vapi.Net/Types/MonitorPlan.cs b/src/Vapi.Net/Types/MonitorPlan.cs index d37d9055..531e4a21 100644 --- a/src/Vapi.Net/Types/MonitorPlan.cs +++ b/src/Vapi.Net/Types/MonitorPlan.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Controls real-time listening and control for assistant calls, authentication requirements for monitor URLs, and attached monitors. +/// [Serializable] public record MonitorPlan : IJsonOnDeserialized { @@ -54,11 +57,7 @@ public record MonitorPlan : IJsonOnDeserialized public bool? ControlAuthenticationEnabled { get; set; } /// - /// This the set of monitor ids that are attached to the assistant. - /// The source of truth for the monitor ids is the assistant_monitor join table. - /// This field can be used for transient assistants and to update assistants with new monitor ids. - /// - /// @default [] + /// IDs of the monitors attached to the assistant. Use this field for transient assistants or to update the monitors attached to an existing assistant. Defaults to an empty array. /// [JsonPropertyName("monitorIds")] public IEnumerable? MonitorIds { get; set; } diff --git a/src/Vapi.Net/Types/MonitorResult.cs b/src/Vapi.Net/Types/MonitorResult.cs index 609f4578..d0f23567 100644 --- a/src/Vapi.Net/Types/MonitorResult.cs +++ b/src/Vapi.Net/Types/MonitorResult.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Result of evaluating an attached monitor's filter for a call. +/// [Serializable] public record MonitorResult : IJsonOnDeserialized { @@ -11,9 +14,15 @@ public record MonitorResult : IJsonOnDeserialized private readonly IDictionary _extensionData = new Dictionary(); + /// + /// Unique identifier of the monitor that produced this result. + /// [JsonPropertyName("monitorId")] public required string MonitorId { get; set; } + /// + /// Whether the monitor's filter matched the call. + /// [JsonPropertyName("filterPassed")] public required bool FilterPassed { get; set; } diff --git a/src/Vapi.Net/Types/Mono.cs b/src/Vapi.Net/Types/Mono.cs index cb665fbc..bd6cf6ca 100644 --- a/src/Vapi.Net/Types/Mono.cs +++ b/src/Vapi.Net/Types/Mono.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Mono recording URLs for the combined call and isolated assistant and customer audio. +/// [Serializable] public record Mono : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/NeuphonicVoice.cs b/src/Vapi.Net/Types/NeuphonicVoice.cs index e6e14457..c7137cfd 100644 --- a/src/Vapi.Net/Types/NeuphonicVoice.cs +++ b/src/Vapi.Net/Types/NeuphonicVoice.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Configuration for synthesizing assistant speech with Neuphonic, including voice and model selection, language, speed, chunking, caching, and fallback settings. +/// [Serializable] public record NeuphonicVoice : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/NodeArtifact.cs b/src/Vapi.Net/Types/NodeArtifact.cs index 939adc46..d1ae39dc 100644 --- a/src/Vapi.Net/Types/NodeArtifact.cs +++ b/src/Vapi.Net/Types/NodeArtifact.cs @@ -5,6 +5,9 @@ namespace Vapi.Net; +/// +/// Messages and variable values captured while a workflow node was active. +/// [Serializable] public record NodeArtifact : IJsonOnDeserialized { @@ -17,7 +20,7 @@ public record NodeArtifact : IJsonOnDeserialized /// [JsonPropertyName("messages")] public IEnumerable< - OneOf + OneOf >? Messages { get; set; } /// diff --git a/src/Vapi.Net/Types/NumberComparatorScorecardMetricCondition.cs b/src/Vapi.Net/Types/NumberComparatorScorecardMetricCondition.cs new file mode 100644 index 00000000..55515e88 --- /dev/null +++ b/src/Vapi.Net/Types/NumberComparatorScorecardMetricCondition.cs @@ -0,0 +1,53 @@ +using global::System.Text.Json; +using global::System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[Serializable] +public record NumberComparatorScorecardMetricCondition : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + /// + /// This is the type of the condition. Currently only 'comparator' is supported. + /// + [JsonPropertyName("type")] + public required NumberComparatorScorecardMetricConditionType Type { get; set; } + + /// + /// This is the comparator that will be used to compare the result of the structured output with the value specified. + /// Only '=', '!=', '>', '<', '>=', and '<=' are supported for number conditions + /// Only '=' is supported for boolean conditions. + /// + [JsonPropertyName("comparator")] + public required NumberComparatorScorecardMetricConditionComparator Comparator { get; set; } + + /// + /// This is the value that will be used to compare the result of the structured output with the comparator. + /// If the result of the comparison is true, the points will be added to the overall score. + /// + [JsonPropertyName("value")] + public required double Value { get; set; } + + /// + /// These are the points that will be added to the overall score if the condition is met. + /// The points must be between 0 and 100. + /// + [JsonPropertyName("points")] + public required double Points { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/NumberComparatorScorecardMetricConditionComparator.cs b/src/Vapi.Net/Types/NumberComparatorScorecardMetricConditionComparator.cs new file mode 100644 index 00000000..ebf7e350 --- /dev/null +++ b/src/Vapi.Net/Types/NumberComparatorScorecardMetricConditionComparator.cs @@ -0,0 +1,104 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(NumberComparatorScorecardMetricConditionComparatorSerializer))] +public enum NumberComparatorScorecardMetricConditionComparator +{ + [EnumMember(Value = "=")] + EqualTo, + + [EnumMember(Value = "!=")] + NotEquals, + + [EnumMember(Value = ">")] + GreaterThan, + + [EnumMember(Value = "<")] + LessThan, + + [EnumMember(Value = ">=")] + GreaterThanOrEqualTo, + + [EnumMember(Value = "<=")] + LessThanOrEqualTo, +} + +internal class NumberComparatorScorecardMetricConditionComparatorSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + NumberComparatorScorecardMetricConditionComparator + > _stringToEnum = new() + { + { "=", NumberComparatorScorecardMetricConditionComparator.EqualTo }, + { "!=", NumberComparatorScorecardMetricConditionComparator.NotEquals }, + { ">", NumberComparatorScorecardMetricConditionComparator.GreaterThan }, + { "<", NumberComparatorScorecardMetricConditionComparator.LessThan }, + { ">=", NumberComparatorScorecardMetricConditionComparator.GreaterThanOrEqualTo }, + { "<=", NumberComparatorScorecardMetricConditionComparator.LessThanOrEqualTo }, + }; + + private static readonly global::System.Collections.Generic.Dictionary< + NumberComparatorScorecardMetricConditionComparator, + string + > _enumToString = new() + { + { NumberComparatorScorecardMetricConditionComparator.EqualTo, "=" }, + { NumberComparatorScorecardMetricConditionComparator.NotEquals, "!=" }, + { NumberComparatorScorecardMetricConditionComparator.GreaterThan, ">" }, + { NumberComparatorScorecardMetricConditionComparator.LessThan, "<" }, + { NumberComparatorScorecardMetricConditionComparator.GreaterThanOrEqualTo, ">=" }, + { NumberComparatorScorecardMetricConditionComparator.LessThanOrEqualTo, "<=" }, + }; + + public override NumberComparatorScorecardMetricConditionComparator Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + NumberComparatorScorecardMetricConditionComparator value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override NumberComparatorScorecardMetricConditionComparator ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + NumberComparatorScorecardMetricConditionComparator value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/NumberComparatorScorecardMetricConditionType.cs b/src/Vapi.Net/Types/NumberComparatorScorecardMetricConditionType.cs new file mode 100644 index 00000000..7555aa01 --- /dev/null +++ b/src/Vapi.Net/Types/NumberComparatorScorecardMetricConditionType.cs @@ -0,0 +1,79 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(NumberComparatorScorecardMetricConditionTypeSerializer))] +public enum NumberComparatorScorecardMetricConditionType +{ + [EnumMember(Value = "comparator")] + Comparator, +} + +internal class NumberComparatorScorecardMetricConditionTypeSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + NumberComparatorScorecardMetricConditionType + > _stringToEnum = new() + { + { "comparator", NumberComparatorScorecardMetricConditionType.Comparator }, + }; + + private static readonly global::System.Collections.Generic.Dictionary< + NumberComparatorScorecardMetricConditionType, + string + > _enumToString = new() + { + { NumberComparatorScorecardMetricConditionType.Comparator, "comparator" }, + }; + + public override NumberComparatorScorecardMetricConditionType Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + NumberComparatorScorecardMetricConditionType value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override NumberComparatorScorecardMetricConditionType ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + NumberComparatorScorecardMetricConditionType value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/OAuth2AuthenticationPlan.cs b/src/Vapi.Net/Types/OAuth2AuthenticationPlan.cs index 265f7465..bca1ee25 100644 --- a/src/Vapi.Net/Types/OAuth2AuthenticationPlan.cs +++ b/src/Vapi.Net/Types/OAuth2AuthenticationPlan.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Client-credentials configuration for obtaining an OAuth 2.0 access token used to authenticate outbound requests. +/// [Serializable] public record OAuth2AuthenticationPlan : IJsonOnDeserialized { @@ -11,6 +14,9 @@ public record OAuth2AuthenticationPlan : IJsonOnDeserialized private readonly IDictionary _extensionData = new Dictionary(); + /// + /// Selects OAuth 2.0 authentication. + /// [JsonPropertyName("type")] public required OAuth2AuthenticationPlanType Type { get; set; } diff --git a/src/Vapi.Net/Types/Oauth2AuthenticationSession.cs b/src/Vapi.Net/Types/Oauth2AuthenticationSession.cs index de88e503..9846ef2a 100644 --- a/src/Vapi.Net/Types/Oauth2AuthenticationSession.cs +++ b/src/Vapi.Net/Types/Oauth2AuthenticationSession.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// OAuth 2.0 session tokens and expiration used to authenticate integration requests. +/// [Serializable] public record Oauth2AuthenticationSession : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/OpenAiFunction.cs b/src/Vapi.Net/Types/OpenAiFunction.cs index 30ce0d39..fd3dde29 100644 --- a/src/Vapi.Net/Types/OpenAiFunction.cs +++ b/src/Vapi.Net/Types/OpenAiFunction.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Function definition exposed to a language model, including its name, purpose, parameter schema, and strict-schema behavior. +/// [Serializable] public record OpenAiFunction : IJsonOnDeserialized { @@ -11,14 +14,6 @@ public record OpenAiFunction : IJsonOnDeserialized private readonly IDictionary _extensionData = new Dictionary(); - /// - /// This is a boolean that controls whether to enable strict schema adherence when generating the function call. If set to true, the model will follow the exact schema defined in the parameters field. Only a subset of JSON Schema is supported when strict is true. Learn more about Structured Outputs in the [OpenAI guide](https://openai.com/index/introducing-structured-outputs-in-the-api/). - /// - /// @default false - /// - [JsonPropertyName("strict")] - public bool? Strict { get; set; } - /// /// This is the the name of the function to be called. /// @@ -27,6 +22,14 @@ public record OpenAiFunction : IJsonOnDeserialized [JsonPropertyName("name")] public required string Name { get; set; } + /// + /// This is a boolean that controls whether to enable strict schema adherence when generating the function call. If set to true, the model will follow the exact schema defined in the parameters field. Only a subset of JSON Schema is supported when strict is true. Learn more about Structured Outputs in the [OpenAI guide](https://openai.com/index/introducing-structured-outputs-in-the-api/). + /// + /// @default false + /// + [JsonPropertyName("strict")] + public bool? Strict { get; set; } + /// /// This is the description of what the function does, used by the AI to choose when and how to call the function. /// diff --git a/src/Vapi.Net/Types/OpenAiFunctionParameters.cs b/src/Vapi.Net/Types/OpenAiFunctionParameters.cs index c9390679..215ec6de 100644 --- a/src/Vapi.Net/Types/OpenAiFunctionParameters.cs +++ b/src/Vapi.Net/Types/OpenAiFunctionParameters.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// JSON object schema defining the properties accepted by a function and which properties are required. +/// [Serializable] public record OpenAiFunctionParameters : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/OpenAiMessage.cs b/src/Vapi.Net/Types/OpenAiMessage.cs index 0e859e4e..87fddc00 100644 --- a/src/Vapi.Net/Types/OpenAiMessage.cs +++ b/src/Vapi.Net/Types/OpenAiMessage.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// A conversation message represented in OpenAI chat format. +/// [Serializable] public record OpenAiMessage : IJsonOnDeserialized { @@ -11,9 +14,15 @@ public record OpenAiMessage : IJsonOnDeserialized private readonly IDictionary _extensionData = new Dictionary(); + /// + /// Content of the conversation message. + /// [JsonPropertyName("content")] public string? Content { get; set; } + /// + /// Role associated with the conversation message. + /// [JsonPropertyName("role")] public required OpenAiMessageRole Role { get; set; } diff --git a/src/Vapi.Net/Types/OpenAiModel.cs b/src/Vapi.Net/Types/OpenAiModel.cs index 47045fd2..1ba6c967 100644 --- a/src/Vapi.Net/Types/OpenAiModel.cs +++ b/src/Vapi.Net/Types/OpenAiModel.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Configuration for generating assistant responses with OpenAI, including model selection, fallback models, prompts, tools, prompt caching, and generation settings. +/// [Serializable] public record OpenAiModel : IJsonOnDeserialized { @@ -33,6 +36,15 @@ public record OpenAiModel : IJsonOnDeserialized [JsonPropertyName("toolIds")] public IEnumerable? ToolIds { get; set; } + /// + /// These are version-pinned references to tools. Each entry pins a specific + /// version of a tool by `(toolId, version)`. When the same `toolId` appears + /// in both `toolIds` and `toolRefs[]`, the `toolRefs` pin wins (the + /// `toolIds` entry is dropped at write time). + /// + [JsonPropertyName("toolRefs")] + public IEnumerable? ToolRefs { get; set; } + /// /// These are the options for the knowledge base. /// @@ -73,7 +85,7 @@ public record OpenAiModel : IJsonOnDeserialized /// - `in_memory`: Default behavior, cache retained in GPU memory only /// - `24h`: Extended caching, keeps cached prefixes active for up to 24 hours by offloading to GPU-local storage /// - /// Only applies to models: gpt-5.4, gpt-5.4-mini, gpt-5.4-nano, gpt-5.2, gpt-5.1, gpt-5.1-codex, gpt-5.1-codex-mini, gpt-5.1-chat-latest, gpt-5, gpt-5-codex, gpt-4.1 + /// Only applies to models: gpt-5.6-sol, gpt-5.6-terra, gpt-5.6-luna, gpt-5.5, chat-latest, gpt-5.4, gpt-5.4-mini, gpt-5.4-nano, gpt-5.2, gpt-5.1, gpt-5.1-codex, gpt-5.1-codex-mini, gpt-5.1-chat-latest, gpt-5, gpt-5-codex, gpt-4.1 /// /// @default undefined (uses API default which is 'in_memory') /// @@ -91,7 +103,16 @@ public record OpenAiModel : IJsonOnDeserialized public string? PromptCacheKey { get; set; } /// - /// This is the temperature that will be used for calls. Default is 0 to leverage caching for lower latency. + /// Reasoning effort for reasoning-capable OpenAI models. + /// For `gpt-realtime-2`: forwarded to V2 stream's session.update as `reasoning.effort`. + /// For non-realtime OpenAI models, model-aware validation limits newly public + /// values while preserving the existing four-value storage contract. + /// + [JsonPropertyName("reasoningEffort")] + public OpenAiModelReasoningEffort? ReasoningEffort { get; set; } + + /// + /// This is the temperature that will be used for calls. Default is 0.5. /// [JsonPropertyName("temperature")] public double? Temperature { get; set; } diff --git a/src/Vapi.Net/Types/OpenAiModelFallbackModelsItem.cs b/src/Vapi.Net/Types/OpenAiModelFallbackModelsItem.cs index 9eb03cdf..02382ada 100644 --- a/src/Vapi.Net/Types/OpenAiModelFallbackModelsItem.cs +++ b/src/Vapi.Net/Types/OpenAiModelFallbackModelsItem.cs @@ -6,6 +6,21 @@ namespace Vapi.Net; [JsonConverter(typeof(OpenAiModelFallbackModelsItemSerializer))] public enum OpenAiModelFallbackModelsItem { + [EnumMember(Value = "gpt-5.6-sol")] + Gpt56Sol, + + [EnumMember(Value = "gpt-5.6-terra")] + Gpt56Terra, + + [EnumMember(Value = "gpt-5.6-luna")] + Gpt56Luna, + + [EnumMember(Value = "gpt-5.5")] + Gpt55, + + [EnumMember(Value = "chat-latest")] + ChatLatest, + [EnumMember(Value = "gpt-5.4")] Gpt54, @@ -90,6 +105,9 @@ public enum OpenAiModelFallbackModelsItem [EnumMember(Value = "gpt-realtime-mini-2025-12-15")] GptRealtimeMini20251215, + [EnumMember(Value = "gpt-realtime-2")] + GptRealtime2, + [EnumMember(Value = "gpt-4o-mini-2024-07-18")] Gpt4OMini20240718, @@ -359,6 +377,15 @@ public enum OpenAiModelFallbackModelsItem [EnumMember(Value = "gpt-3.5-turbo-1106:westus")] Gpt35Turbo1106Westus, + + [EnumMember(Value = "gpt-4.1:australiaeast")] + Gpt41Australiaeast, + + [EnumMember(Value = "gpt-4o:australiaeast")] + Gpt4OAustraliaeast, + + [EnumMember(Value = "gpt-5.4-mini:australiaeast")] + Gpt54MiniAustraliaeast, } internal class OpenAiModelFallbackModelsItemSerializer @@ -369,6 +396,11 @@ internal class OpenAiModelFallbackModelsItemSerializer OpenAiModelFallbackModelsItem > _stringToEnum = new() { + { "gpt-5.6-sol", OpenAiModelFallbackModelsItem.Gpt56Sol }, + { "gpt-5.6-terra", OpenAiModelFallbackModelsItem.Gpt56Terra }, + { "gpt-5.6-luna", OpenAiModelFallbackModelsItem.Gpt56Luna }, + { "gpt-5.5", OpenAiModelFallbackModelsItem.Gpt55 }, + { "chat-latest", OpenAiModelFallbackModelsItem.ChatLatest }, { "gpt-5.4", OpenAiModelFallbackModelsItem.Gpt54 }, { "gpt-5.4-mini", OpenAiModelFallbackModelsItem.Gpt54Mini }, { "gpt-5.4-nano", OpenAiModelFallbackModelsItem.Gpt54Nano }, @@ -406,6 +438,7 @@ internal class OpenAiModelFallbackModelsItemSerializer }, { "gpt-realtime-2025-08-28", OpenAiModelFallbackModelsItem.GptRealtime20250828 }, { "gpt-realtime-mini-2025-12-15", OpenAiModelFallbackModelsItem.GptRealtimeMini20251215 }, + { "gpt-realtime-2", OpenAiModelFallbackModelsItem.GptRealtime2 }, { "gpt-4o-mini-2024-07-18", OpenAiModelFallbackModelsItem.Gpt4OMini20240718 }, { "gpt-4o-mini", OpenAiModelFallbackModelsItem.Gpt4OMini }, { "gpt-4o", OpenAiModelFallbackModelsItem.Gpt4O }, @@ -610,6 +643,9 @@ internal class OpenAiModelFallbackModelsItemSerializer }, { "gpt-3.5-turbo-1106:canadaeast", OpenAiModelFallbackModelsItem.Gpt35Turbo1106Canadaeast }, { "gpt-3.5-turbo-1106:westus", OpenAiModelFallbackModelsItem.Gpt35Turbo1106Westus }, + { "gpt-4.1:australiaeast", OpenAiModelFallbackModelsItem.Gpt41Australiaeast }, + { "gpt-4o:australiaeast", OpenAiModelFallbackModelsItem.Gpt4OAustraliaeast }, + { "gpt-5.4-mini:australiaeast", OpenAiModelFallbackModelsItem.Gpt54MiniAustraliaeast }, }; private static readonly global::System.Collections.Generic.Dictionary< @@ -617,6 +653,11 @@ internal class OpenAiModelFallbackModelsItemSerializer string > _enumToString = new() { + { OpenAiModelFallbackModelsItem.Gpt56Sol, "gpt-5.6-sol" }, + { OpenAiModelFallbackModelsItem.Gpt56Terra, "gpt-5.6-terra" }, + { OpenAiModelFallbackModelsItem.Gpt56Luna, "gpt-5.6-luna" }, + { OpenAiModelFallbackModelsItem.Gpt55, "gpt-5.5" }, + { OpenAiModelFallbackModelsItem.ChatLatest, "chat-latest" }, { OpenAiModelFallbackModelsItem.Gpt54, "gpt-5.4" }, { OpenAiModelFallbackModelsItem.Gpt54Mini, "gpt-5.4-mini" }, { OpenAiModelFallbackModelsItem.Gpt54Nano, "gpt-5.4-nano" }, @@ -654,6 +695,7 @@ internal class OpenAiModelFallbackModelsItemSerializer }, { OpenAiModelFallbackModelsItem.GptRealtime20250828, "gpt-realtime-2025-08-28" }, { OpenAiModelFallbackModelsItem.GptRealtimeMini20251215, "gpt-realtime-mini-2025-12-15" }, + { OpenAiModelFallbackModelsItem.GptRealtime2, "gpt-realtime-2" }, { OpenAiModelFallbackModelsItem.Gpt4OMini20240718, "gpt-4o-mini-2024-07-18" }, { OpenAiModelFallbackModelsItem.Gpt4OMini, "gpt-4o-mini" }, { OpenAiModelFallbackModelsItem.Gpt4O, "gpt-4o" }, @@ -858,6 +900,9 @@ internal class OpenAiModelFallbackModelsItemSerializer }, { OpenAiModelFallbackModelsItem.Gpt35Turbo1106Canadaeast, "gpt-3.5-turbo-1106:canadaeast" }, { OpenAiModelFallbackModelsItem.Gpt35Turbo1106Westus, "gpt-3.5-turbo-1106:westus" }, + { OpenAiModelFallbackModelsItem.Gpt41Australiaeast, "gpt-4.1:australiaeast" }, + { OpenAiModelFallbackModelsItem.Gpt4OAustraliaeast, "gpt-4o:australiaeast" }, + { OpenAiModelFallbackModelsItem.Gpt54MiniAustraliaeast, "gpt-5.4-mini:australiaeast" }, }; public override OpenAiModelFallbackModelsItem Read( diff --git a/src/Vapi.Net/Types/OpenAiModelModel.cs b/src/Vapi.Net/Types/OpenAiModelModel.cs index 08a4d5cb..de47061e 100644 --- a/src/Vapi.Net/Types/OpenAiModelModel.cs +++ b/src/Vapi.Net/Types/OpenAiModelModel.cs @@ -6,6 +6,21 @@ namespace Vapi.Net; [JsonConverter(typeof(OpenAiModelModelSerializer))] public enum OpenAiModelModel { + [EnumMember(Value = "gpt-5.6-sol")] + Gpt56Sol, + + [EnumMember(Value = "gpt-5.6-terra")] + Gpt56Terra, + + [EnumMember(Value = "gpt-5.6-luna")] + Gpt56Luna, + + [EnumMember(Value = "gpt-5.5")] + Gpt55, + + [EnumMember(Value = "chat-latest")] + ChatLatest, + [EnumMember(Value = "gpt-5.4")] Gpt54, @@ -90,6 +105,9 @@ public enum OpenAiModelModel [EnumMember(Value = "gpt-realtime-mini-2025-12-15")] GptRealtimeMini20251215, + [EnumMember(Value = "gpt-realtime-2")] + GptRealtime2, + [EnumMember(Value = "gpt-4o-mini-2024-07-18")] Gpt4OMini20240718, @@ -359,6 +377,15 @@ public enum OpenAiModelModel [EnumMember(Value = "gpt-3.5-turbo-1106:westus")] Gpt35Turbo1106Westus, + + [EnumMember(Value = "gpt-4.1:australiaeast")] + Gpt41Australiaeast, + + [EnumMember(Value = "gpt-4o:australiaeast")] + Gpt4OAustraliaeast, + + [EnumMember(Value = "gpt-5.4-mini:australiaeast")] + Gpt54MiniAustraliaeast, } internal class OpenAiModelModelSerializer @@ -369,6 +396,11 @@ internal class OpenAiModelModelSerializer OpenAiModelModel > _stringToEnum = new() { + { "gpt-5.6-sol", OpenAiModelModel.Gpt56Sol }, + { "gpt-5.6-terra", OpenAiModelModel.Gpt56Terra }, + { "gpt-5.6-luna", OpenAiModelModel.Gpt56Luna }, + { "gpt-5.5", OpenAiModelModel.Gpt55 }, + { "chat-latest", OpenAiModelModel.ChatLatest }, { "gpt-5.4", OpenAiModelModel.Gpt54 }, { "gpt-5.4-mini", OpenAiModelModel.Gpt54Mini }, { "gpt-5.4-nano", OpenAiModelModel.Gpt54Nano }, @@ -400,6 +432,7 @@ internal class OpenAiModelModelSerializer }, { "gpt-realtime-2025-08-28", OpenAiModelModel.GptRealtime20250828 }, { "gpt-realtime-mini-2025-12-15", OpenAiModelModel.GptRealtimeMini20251215 }, + { "gpt-realtime-2", OpenAiModelModel.GptRealtime2 }, { "gpt-4o-mini-2024-07-18", OpenAiModelModel.Gpt4OMini20240718 }, { "gpt-4o-mini", OpenAiModelModel.Gpt4OMini }, { "gpt-4o", OpenAiModelModel.Gpt4O }, @@ -520,6 +553,9 @@ internal class OpenAiModelModelSerializer { "gpt-3.5-turbo-0125:southcentralus", OpenAiModelModel.Gpt35Turbo0125Southcentralus }, { "gpt-3.5-turbo-1106:canadaeast", OpenAiModelModel.Gpt35Turbo1106Canadaeast }, { "gpt-3.5-turbo-1106:westus", OpenAiModelModel.Gpt35Turbo1106Westus }, + { "gpt-4.1:australiaeast", OpenAiModelModel.Gpt41Australiaeast }, + { "gpt-4o:australiaeast", OpenAiModelModel.Gpt4OAustraliaeast }, + { "gpt-5.4-mini:australiaeast", OpenAiModelModel.Gpt54MiniAustraliaeast }, }; private static readonly global::System.Collections.Generic.Dictionary< @@ -527,6 +563,11 @@ internal class OpenAiModelModelSerializer string > _enumToString = new() { + { OpenAiModelModel.Gpt56Sol, "gpt-5.6-sol" }, + { OpenAiModelModel.Gpt56Terra, "gpt-5.6-terra" }, + { OpenAiModelModel.Gpt56Luna, "gpt-5.6-luna" }, + { OpenAiModelModel.Gpt55, "gpt-5.5" }, + { OpenAiModelModel.ChatLatest, "chat-latest" }, { OpenAiModelModel.Gpt54, "gpt-5.4" }, { OpenAiModelModel.Gpt54Mini, "gpt-5.4-mini" }, { OpenAiModelModel.Gpt54Nano, "gpt-5.4-nano" }, @@ -558,6 +599,7 @@ internal class OpenAiModelModelSerializer }, { OpenAiModelModel.GptRealtime20250828, "gpt-realtime-2025-08-28" }, { OpenAiModelModel.GptRealtimeMini20251215, "gpt-realtime-mini-2025-12-15" }, + { OpenAiModelModel.GptRealtime2, "gpt-realtime-2" }, { OpenAiModelModel.Gpt4OMini20240718, "gpt-4o-mini-2024-07-18" }, { OpenAiModelModel.Gpt4OMini, "gpt-4o-mini" }, { OpenAiModelModel.Gpt4O, "gpt-4o" }, @@ -678,6 +720,9 @@ internal class OpenAiModelModelSerializer { OpenAiModelModel.Gpt35Turbo0125Southcentralus, "gpt-3.5-turbo-0125:southcentralus" }, { OpenAiModelModel.Gpt35Turbo1106Canadaeast, "gpt-3.5-turbo-1106:canadaeast" }, { OpenAiModelModel.Gpt35Turbo1106Westus, "gpt-3.5-turbo-1106:westus" }, + { OpenAiModelModel.Gpt41Australiaeast, "gpt-4.1:australiaeast" }, + { OpenAiModelModel.Gpt4OAustraliaeast, "gpt-4o:australiaeast" }, + { OpenAiModelModel.Gpt54MiniAustraliaeast, "gpt-5.4-mini:australiaeast" }, }; public override OpenAiModelModel Read( diff --git a/src/Vapi.Net/Types/OpenAiModelReasoningEffort.cs b/src/Vapi.Net/Types/OpenAiModelReasoningEffort.cs new file mode 100644 index 00000000..31bdfef1 --- /dev/null +++ b/src/Vapi.Net/Types/OpenAiModelReasoningEffort.cs @@ -0,0 +1,104 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(OpenAiModelReasoningEffortSerializer))] +public enum OpenAiModelReasoningEffort +{ + [EnumMember(Value = "minimal")] + Minimal, + + [EnumMember(Value = "none")] + None, + + [EnumMember(Value = "low")] + Low, + + [EnumMember(Value = "medium")] + Medium, + + [EnumMember(Value = "high")] + High, + + [EnumMember(Value = "xhigh")] + Xhigh, +} + +internal class OpenAiModelReasoningEffortSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + OpenAiModelReasoningEffort + > _stringToEnum = new() + { + { "minimal", OpenAiModelReasoningEffort.Minimal }, + { "none", OpenAiModelReasoningEffort.None }, + { "low", OpenAiModelReasoningEffort.Low }, + { "medium", OpenAiModelReasoningEffort.Medium }, + { "high", OpenAiModelReasoningEffort.High }, + { "xhigh", OpenAiModelReasoningEffort.Xhigh }, + }; + + private static readonly global::System.Collections.Generic.Dictionary< + OpenAiModelReasoningEffort, + string + > _enumToString = new() + { + { OpenAiModelReasoningEffort.Minimal, "minimal" }, + { OpenAiModelReasoningEffort.None, "none" }, + { OpenAiModelReasoningEffort.Low, "low" }, + { OpenAiModelReasoningEffort.Medium, "medium" }, + { OpenAiModelReasoningEffort.High, "high" }, + { OpenAiModelReasoningEffort.Xhigh, "xhigh" }, + }; + + public override OpenAiModelReasoningEffort Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + OpenAiModelReasoningEffort value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override OpenAiModelReasoningEffort ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + OpenAiModelReasoningEffort value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/OpenAiTranscriber.cs b/src/Vapi.Net/Types/OpenAiTranscriber.cs index 2fc9fac1..a62dfe2a 100644 --- a/src/Vapi.Net/Types/OpenAiTranscriber.cs +++ b/src/Vapi.Net/Types/OpenAiTranscriber.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Configuration for transcribing speech during assistant conversations with OpenAI, including model, language, and fallback settings. +/// [Serializable] public record OpenAiTranscriber : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/OpenAiVoice.cs b/src/Vapi.Net/Types/OpenAiVoice.cs index e6073977..b0cc61b5 100644 --- a/src/Vapi.Net/Types/OpenAiVoice.cs +++ b/src/Vapi.Net/Types/OpenAiVoice.cs @@ -5,6 +5,9 @@ namespace Vapi.Net; +/// +/// Configuration for synthesizing assistant speech with OpenAI, including voice and model selection, delivery instructions, speed, chunking, caching, and fallback settings. +/// [Serializable] public record OpenAiVoice : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/OpenAiVoicemailDetectionPlan.cs b/src/Vapi.Net/Types/OpenAiVoicemailDetectionPlan.cs index f80ab7b0..df4c16be 100644 --- a/src/Vapi.Net/Types/OpenAiVoicemailDetectionPlan.cs +++ b/src/Vapi.Net/Types/OpenAiVoicemailDetectionPlan.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Configuration for detecting voicemail with OpenAI, including detection type, maximum beep wait, and retry backoff. +/// [Serializable] public record OpenAiVoicemailDetectionPlan : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/OpenRouterModel.cs b/src/Vapi.Net/Types/OpenRouterModel.cs index eeae8046..dcefd75d 100644 --- a/src/Vapi.Net/Types/OpenRouterModel.cs +++ b/src/Vapi.Net/Types/OpenRouterModel.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Configuration for generating assistant responses through OpenRouter, including routed model selection, prompts, tools, knowledge-base access, and generation settings. +/// [Serializable] public record OpenRouterModel : IJsonOnDeserialized { @@ -33,6 +36,15 @@ public record OpenRouterModel : IJsonOnDeserialized [JsonPropertyName("toolIds")] public IEnumerable? ToolIds { get; set; } + /// + /// These are version-pinned references to tools. Each entry pins a specific + /// version of a tool by `(toolId, version)`. When the same `toolId` appears + /// in both `toolIds` and `toolRefs[]`, the `toolRefs` pin wins (the + /// `toolIds` entry is dropped at write time). + /// + [JsonPropertyName("toolRefs")] + public IEnumerable? ToolRefs { get; set; } + /// /// These are the options for the knowledge base. /// @@ -46,7 +58,7 @@ public record OpenRouterModel : IJsonOnDeserialized public required string Model { get; set; } /// - /// This is the temperature that will be used for calls. Default is 0 to leverage caching for lower latency. + /// This is the temperature that will be used for calls. Default is 0.5. /// [JsonPropertyName("temperature")] public double? Temperature { get; set; } diff --git a/src/Vapi.Net/Types/Org.cs b/src/Vapi.Net/Types/Org.cs index ec6f5d0f..fe59545c 100644 --- a/src/Vapi.Net/Types/Org.cs +++ b/src/Vapi.Net/Types/Org.cs @@ -19,6 +19,19 @@ public record Org : IJsonOnDeserialized [JsonPropertyName("hipaaEnabled")] public bool? HipaaEnabled { get; set; } + /// + /// The org was created locally, but WorkOS access is still being repaired. + /// Clients should keep the current session/org and refresh the org list. + /// + [JsonPropertyName("workosRepairPending")] + public bool? WorkosRepairPending { get; set; } + + /// + /// Whether the pending WorkOS repair was accepted by Kafka. + /// + [JsonPropertyName("workosRepairQueued")] + public bool? WorkosRepairQueued { get; set; } + [JsonPropertyName("subscription")] public Subscription? Subscription { get; set; } diff --git a/src/Vapi.Net/Types/OutputTool.cs b/src/Vapi.Net/Types/OutputTool.cs index 08fd7fdd..b860c2a9 100644 --- a/src/Vapi.Net/Types/OutputTool.cs +++ b/src/Vapi.Net/Types/OutputTool.cs @@ -11,10 +11,11 @@ public record OutputTool : IJsonOnDeserialized private readonly IDictionary _extensionData = new Dictionary(); + [JsonPropertyName("latestVersion")] + public string? LatestVersion { 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. + /// Messages spoken while the tool is running. Multiple request-start messages are variants. For request-response-delayed, same timing means variants and different timings mean staged updates. /// [JsonPropertyName("messages")] public IEnumerable? Messages { get; set; } diff --git a/src/Vapi.Net/Types/PaginationMeta.cs b/src/Vapi.Net/Types/PaginationMeta.cs index b6df8623..8b0a960f 100644 --- a/src/Vapi.Net/Types/PaginationMeta.cs +++ b/src/Vapi.Net/Types/PaginationMeta.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Pagination and retention metadata returned with a paginated list of phone numbers. +/// [Serializable] public record PaginationMeta : IJsonOnDeserialized { @@ -11,21 +14,56 @@ public record PaginationMeta : IJsonOnDeserialized private readonly IDictionary _extensionData = new Dictionary(); + /// + /// The number of phone numbers returned per page. + /// [JsonPropertyName("itemsPerPage")] public required double ItemsPerPage { get; set; } + /// + /// The total number of phone numbers matching the request. + /// [JsonPropertyName("totalItems")] public required double TotalItems { get; set; } + /// + /// The current page number. + /// [JsonPropertyName("currentPage")] public required double CurrentPage { get; set; } + [JsonPropertyName("totalPages")] + public double? TotalPages { get; set; } + + [JsonPropertyName("hasNextPage")] + public bool? HasNextPage { get; set; } + + /// + /// Opaque cursor for the next page under keyset pagination (PRO-3163). Pass it + /// back as the `cursor` query param to fetch the next page without an OFFSET + /// scan. Present only when a further page likely exists. + /// + [JsonPropertyName("nextCursor")] + public string? NextCursor { get; set; } + + [JsonPropertyName("sortOrder")] + public PaginationMetaSortOrder? SortOrder { get; set; } + + /// + /// Whether additional matching phone numbers exist beyond the organization's data-retention window. + /// [JsonPropertyName("itemsBeyondRetention")] public bool? ItemsBeyondRetention { get; set; } + /// + /// The inclusive upper creation-time boundary applied to the result set. + /// [JsonPropertyName("createdAtLe")] public DateTime? CreatedAtLe { get; set; } + /// + /// The inclusive lower creation-time boundary applied to the result set. + /// [JsonPropertyName("createdAtGe")] public DateTime? CreatedAtGe { get; set; } diff --git a/src/Vapi.Net/Types/PaginationMetaSortOrder.cs b/src/Vapi.Net/Types/PaginationMetaSortOrder.cs new file mode 100644 index 00000000..4e1f62ff --- /dev/null +++ b/src/Vapi.Net/Types/PaginationMetaSortOrder.cs @@ -0,0 +1,84 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(PaginationMetaSortOrderSerializer))] +public enum PaginationMetaSortOrder +{ + [EnumMember(Value = "ASC")] + Asc, + + [EnumMember(Value = "DESC")] + Desc, +} + +internal class PaginationMetaSortOrderSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + PaginationMetaSortOrder + > _stringToEnum = new() + { + { "ASC", PaginationMetaSortOrder.Asc }, + { "DESC", PaginationMetaSortOrder.Desc }, + }; + + private static readonly global::System.Collections.Generic.Dictionary< + PaginationMetaSortOrder, + string + > _enumToString = new() + { + { PaginationMetaSortOrder.Asc, "ASC" }, + { PaginationMetaSortOrder.Desc, "DESC" }, + }; + + public override PaginationMetaSortOrder Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + PaginationMetaSortOrder value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override PaginationMetaSortOrder ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + PaginationMetaSortOrder value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/PendingInvitationDto.cs b/src/Vapi.Net/Types/PendingInvitationDto.cs new file mode 100644 index 00000000..da02bbd8 --- /dev/null +++ b/src/Vapi.Net/Types/PendingInvitationDto.cs @@ -0,0 +1,31 @@ +using global::System.Text.Json; +using global::System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[Serializable] +public record PendingInvitationDto : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("id")] + public required string Id { get; set; } + + [JsonPropertyName("email")] + public required string Email { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/PendingInvitationsResponseDto.cs b/src/Vapi.Net/Types/PendingInvitationsResponseDto.cs new file mode 100644 index 00000000..0f7da544 --- /dev/null +++ b/src/Vapi.Net/Types/PendingInvitationsResponseDto.cs @@ -0,0 +1,29 @@ +using global::System.Text.Json; +using global::System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[Serializable] +public record PendingInvitationsResponseDto : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("invitations")] + public IEnumerable Invitations { get; set; } = + new List(); + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/PerformanceMetrics.cs b/src/Vapi.Net/Types/PerformanceMetrics.cs index beb62064..5f1924d1 100644 --- a/src/Vapi.Net/Types/PerformanceMetrics.cs +++ b/src/Vapi.Net/Types/PerformanceMetrics.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Call performance measurements, including per-turn and average provider, endpointing, transport, and interruption metrics. +/// [Serializable] public record PerformanceMetrics : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/PerplexityAiModel.cs b/src/Vapi.Net/Types/PerplexityAiModel.cs index 255b7fb9..35049637 100644 --- a/src/Vapi.Net/Types/PerplexityAiModel.cs +++ b/src/Vapi.Net/Types/PerplexityAiModel.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Configuration for generating assistant responses with Perplexity AI, including model, prompts, tools, knowledge-base access, and generation settings. +/// [Serializable] public record PerplexityAiModel : IJsonOnDeserialized { @@ -33,6 +36,15 @@ public record PerplexityAiModel : IJsonOnDeserialized [JsonPropertyName("toolIds")] public IEnumerable? ToolIds { get; set; } + /// + /// These are version-pinned references to tools. Each entry pins a specific + /// version of a tool by `(toolId, version)`. When the same `toolId` appears + /// in both `toolIds` and `toolRefs[]`, the `toolRefs` pin wins (the + /// `toolIds` entry is dropped at write time). + /// + [JsonPropertyName("toolRefs")] + public IEnumerable? ToolRefs { get; set; } + /// /// These are the options for the knowledge base. /// @@ -46,7 +58,7 @@ public record PerplexityAiModel : IJsonOnDeserialized public required string Model { get; set; } /// - /// This is the temperature that will be used for calls. Default is 0 to leverage caching for lower latency. + /// This is the temperature that will be used for calls. Default is 0.5. /// [JsonPropertyName("temperature")] public double? Temperature { get; set; } diff --git a/src/Vapi.Net/Types/PhoneNumberCallEndingHookFilter.cs b/src/Vapi.Net/Types/PhoneNumberCallEndingHookFilter.cs index eff0343e..3fd6d468 100644 --- a/src/Vapi.Net/Types/PhoneNumberCallEndingHookFilter.cs +++ b/src/Vapi.Net/Types/PhoneNumberCallEndingHookFilter.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Matches the call's ended reason against configured assistant-request failure reasons before an ending hook runs. +/// [Serializable] public record PhoneNumberCallEndingHookFilter : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/PhoneNumberCallRingingHookFilter.cs b/src/Vapi.Net/Types/PhoneNumberCallRingingHookFilter.cs index 27ed5298..c55b4430 100644 --- a/src/Vapi.Net/Types/PhoneNumberCallRingingHookFilter.cs +++ b/src/Vapi.Net/Types/PhoneNumberCallRingingHookFilter.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Matches an incoming caller's phone number against one or more prefixes before a ringing hook runs. +/// [Serializable] public record PhoneNumberCallRingingHookFilter : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/PhoneNumberHookCallEnding.cs b/src/Vapi.Net/Types/PhoneNumberHookCallEnding.cs index a691d4ef..a937fec5 100644 --- a/src/Vapi.Net/Types/PhoneNumberHookCallEnding.cs +++ b/src/Vapi.Net/Types/PhoneNumberHookCallEnding.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Runs configured transfer or message actions when a call ends with a matching assistant-request failure reason. +/// [Serializable] public record PhoneNumberHookCallEnding : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/PhoneNumberHookCallRinging.cs b/src/Vapi.Net/Types/PhoneNumberHookCallRinging.cs index bf0c2d5d..54f7b7a4 100644 --- a/src/Vapi.Net/Types/PhoneNumberHookCallRinging.cs +++ b/src/Vapi.Net/Types/PhoneNumberHookCallRinging.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Runs configured transfer or message actions when an incoming call rings and its caller-number prefix filters match. +/// [Serializable] public record PhoneNumberHookCallRinging : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/PhoneNumberPaginatedResponse.cs b/src/Vapi.Net/Types/PhoneNumberPaginatedResponse.cs index d0f81948..42c9462a 100644 --- a/src/Vapi.Net/Types/PhoneNumberPaginatedResponse.cs +++ b/src/Vapi.Net/Types/PhoneNumberPaginatedResponse.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// A paginated collection of phone numbers and metadata describing the result set. +/// [Serializable] public record PhoneNumberPaginatedResponse : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/PieInsight.cs b/src/Vapi.Net/Types/PieInsight.cs index d5e5147d..42586779 100644 --- a/src/Vapi.Net/Types/PieInsight.cs +++ b/src/Vapi.Net/Types/PieInsight.cs @@ -5,6 +5,9 @@ namespace Vapi.Net; +/// +/// A saved pie-chart insight containing its call-data queries, formulas, grouping, time range, and lifecycle information. +/// [Serializable] public record PieInsight : IJsonOnDeserialized { @@ -38,6 +41,9 @@ public record PieInsight : IJsonOnDeserialized [JsonPropertyName("formulas")] public IEnumerable? Formulas { get; set; } + /// + /// The time range used to query the pie-chart data. + /// [JsonPropertyName("timeRange")] public InsightTimeRange? TimeRange { get; set; } @@ -92,6 +98,12 @@ public IEnumerable< [JsonPropertyName("updatedAt")] public required DateTime UpdatedAt { get; set; } + /// + /// Stable server-owned identifier for system-created insights. + /// + [JsonPropertyName("systemKey")] + public string? SystemKey { get; set; } + [JsonIgnore] public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); diff --git a/src/Vapi.Net/Types/PlayHtVoice.cs b/src/Vapi.Net/Types/PlayHtVoice.cs index fef2c758..d9f0728f 100644 --- a/src/Vapi.Net/Types/PlayHtVoice.cs +++ b/src/Vapi.Net/Types/PlayHtVoice.cs @@ -5,6 +5,9 @@ namespace Vapi.Net; +/// +/// Configuration for synthesizing assistant speech with PlayHT, including voice and model selection, language, emotion and style guidance, chunking, caching, and fallback settings. +/// [Serializable] public record PlayHtVoice : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/PromptInjectionSecurityFilter.cs b/src/Vapi.Net/Types/PromptInjectionSecurityFilter.cs index 7cd7d822..292a171a 100644 --- a/src/Vapi.Net/Types/PromptInjectionSecurityFilter.cs +++ b/src/Vapi.Net/Types/PromptInjectionSecurityFilter.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Filters potential prompt-injection patterns from transcripts. +/// [Serializable] public record PromptInjectionSecurityFilter : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/ProviderResource.cs b/src/Vapi.Net/Types/ProviderResource.cs index e1cdc7c0..a226c379 100644 --- a/src/Vapi.Net/Types/ProviderResource.cs +++ b/src/Vapi.Net/Types/ProviderResource.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// A provider-managed pronunciation-dictionary resource mirrored in Vapi, including its provider identifiers, resource data, and lifecycle information. +/// [Serializable] public record ProviderResource : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/ProviderResourcePaginatedResponse.cs b/src/Vapi.Net/Types/ProviderResourcePaginatedResponse.cs index efcf1a60..950a06fb 100644 --- a/src/Vapi.Net/Types/ProviderResourcePaginatedResponse.cs +++ b/src/Vapi.Net/Types/ProviderResourcePaginatedResponse.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// A paginated collection of provider resources and metadata describing the result set. +/// [Serializable] public record ProviderResourcePaginatedResponse : IJsonOnDeserialized { @@ -11,9 +14,15 @@ public record ProviderResourcePaginatedResponse : IJsonOnDeserialized private readonly IDictionary _extensionData = new Dictionary(); + /// + /// The provider resources returned for the current page. + /// [JsonPropertyName("results")] public IEnumerable Results { get; set; } = new List(); + /// + /// Pagination metadata for the provider-resource result set. + /// [JsonPropertyName("metadata")] public required PaginationMeta Metadata { get; set; } diff --git a/src/Vapi.Net/Types/PublicKeyEncryptionPlan.cs b/src/Vapi.Net/Types/PublicKeyEncryptionPlan.cs index fd14d14a..590bff8b 100644 --- a/src/Vapi.Net/Types/PublicKeyEncryptionPlan.cs +++ b/src/Vapi.Net/Types/PublicKeyEncryptionPlan.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Configuration for encrypting sensitive outbound request data with a public key. +/// [Serializable] public record PublicKeyEncryptionPlan : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/QueryTool.cs b/src/Vapi.Net/Types/QueryTool.cs index cc788f83..9b59e2d1 100644 --- a/src/Vapi.Net/Types/QueryTool.cs +++ b/src/Vapi.Net/Types/QueryTool.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// A reusable tool that searches configured knowledge bases and returns relevant content to the assistant. +/// [Serializable] public record QueryTool : IJsonOnDeserialized { @@ -11,10 +14,11 @@ public record QueryTool : IJsonOnDeserialized private readonly IDictionary _extensionData = new Dictionary(); + [JsonPropertyName("latestVersion")] + public string? LatestVersion { 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. + /// Messages spoken while the tool is running. Multiple request-start messages are variants. For request-response-delayed, same timing means variants and different timings mean staged updates. /// [JsonPropertyName("messages")] public IEnumerable? Messages { get; set; } diff --git a/src/Vapi.Net/Types/RceSecurityFilter.cs b/src/Vapi.Net/Types/RceSecurityFilter.cs index ad001db0..6647d1fa 100644 --- a/src/Vapi.Net/Types/RceSecurityFilter.cs +++ b/src/Vapi.Net/Types/RceSecurityFilter.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Filters potential remote code execution (RCE) patterns from transcripts. +/// [Serializable] public record RceSecurityFilter : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/Recording.cs b/src/Vapi.Net/Types/Recording.cs index 62a7889f..7c7fd5ba 100644 --- a/src/Vapi.Net/Types/Recording.cs +++ b/src/Vapi.Net/Types/Recording.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Call recording locations, including stereo, video, and separated mono recording URLs. +/// [Serializable] public record Recording : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/RecordingConsent.cs b/src/Vapi.Net/Types/RecordingConsent.cs index ab5fb755..10d0f5cc 100644 --- a/src/Vapi.Net/Types/RecordingConsent.cs +++ b/src/Vapi.Net/Types/RecordingConsent.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Result of the recording-consent flow, including consent type and the time consent was granted. +/// [Serializable] public record RecordingConsent : IJsonOnDeserialized { @@ -15,7 +18,7 @@ public record RecordingConsent : IJsonOnDeserialized /// This is the type of recording consent. /// [JsonPropertyName("type")] - public object Type { get; set; } = new Dictionary(); + public required RecordingConsentType Type { get; set; } /// /// This is the date and time the recording consent was granted. diff --git a/src/Vapi.Net/Types/RecordingConsentPlanStayOnLine.cs b/src/Vapi.Net/Types/RecordingConsentPlanStayOnLine.cs index 1cacaf4b..8f4f834a 100644 --- a/src/Vapi.Net/Types/RecordingConsentPlanStayOnLine.cs +++ b/src/Vapi.Net/Types/RecordingConsentPlanStayOnLine.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Configuration for requesting recording consent by treating continued presence on the call as consent, including the announcement voice and wait time. +/// [Serializable] public record RecordingConsentPlanStayOnLine : IJsonOnDeserialized { @@ -26,6 +29,22 @@ public record RecordingConsentPlanStayOnLine : IJsonOnDeserialized [JsonPropertyName("voice")] public object? Voice { get; set; } + /// + /// This controls whether the consent assistant speaks first or waits for the caller to speak first. + /// + /// Use: + /// - `assistant-speaks-first` (default) to have the consent assistant play the consent message as soon as the call is answered. + /// - `assistant-waits-for-user` to have the consent assistant wait for the caller to speak before playing the consent message. + /// + /// We strongly recommend `assistant-waits-for-user` for outbound calls. Some telephony providers signal "answered" while the line is still ringing, which can cause the consent message to play into a ringing line and be missed by the caller. Waiting for the caller to speak first guarantees they hear the full consent message. + /// + /// Note: when combined with `type: 'stay-on-line'`, silence only counts toward consent after the caller has spoken at least once. + /// + /// @default 'assistant-speaks-first' + /// + [JsonPropertyName("firstMessageMode")] + public RecordingConsentPlanStayOnLineFirstMessageMode? FirstMessageMode { get; set; } + /// /// Number of seconds to wait before transferring to the assistant if user stays on the call /// diff --git a/src/Vapi.Net/Types/RecordingConsentPlanStayOnLineFirstMessageMode.cs b/src/Vapi.Net/Types/RecordingConsentPlanStayOnLineFirstMessageMode.cs new file mode 100644 index 00000000..e75ad56b --- /dev/null +++ b/src/Vapi.Net/Types/RecordingConsentPlanStayOnLineFirstMessageMode.cs @@ -0,0 +1,96 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(RecordingConsentPlanStayOnLineFirstMessageModeSerializer))] +public enum RecordingConsentPlanStayOnLineFirstMessageMode +{ + [EnumMember(Value = "assistant-speaks-first")] + AssistantSpeaksFirst, + + [EnumMember(Value = "assistant-waits-for-user")] + AssistantWaitsForUser, +} + +internal class RecordingConsentPlanStayOnLineFirstMessageModeSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + RecordingConsentPlanStayOnLineFirstMessageMode + > _stringToEnum = new() + { + { + "assistant-speaks-first", + RecordingConsentPlanStayOnLineFirstMessageMode.AssistantSpeaksFirst + }, + { + "assistant-waits-for-user", + RecordingConsentPlanStayOnLineFirstMessageMode.AssistantWaitsForUser + }, + }; + + private static readonly global::System.Collections.Generic.Dictionary< + RecordingConsentPlanStayOnLineFirstMessageMode, + string + > _enumToString = new() + { + { + RecordingConsentPlanStayOnLineFirstMessageMode.AssistantSpeaksFirst, + "assistant-speaks-first" + }, + { + RecordingConsentPlanStayOnLineFirstMessageMode.AssistantWaitsForUser, + "assistant-waits-for-user" + }, + }; + + public override RecordingConsentPlanStayOnLineFirstMessageMode Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + RecordingConsentPlanStayOnLineFirstMessageMode value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override RecordingConsentPlanStayOnLineFirstMessageMode ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + RecordingConsentPlanStayOnLineFirstMessageMode value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/RecordingConsentPlanVerbal.cs b/src/Vapi.Net/Types/RecordingConsentPlanVerbal.cs index 24217b3f..d3dd4008 100644 --- a/src/Vapi.Net/Types/RecordingConsentPlanVerbal.cs +++ b/src/Vapi.Net/Types/RecordingConsentPlanVerbal.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Configuration for requesting explicit verbal recording consent, including the announcement voice and action to take when the customer declines. +/// [Serializable] public record RecordingConsentPlanVerbal : IJsonOnDeserialized { @@ -26,6 +29,22 @@ public record RecordingConsentPlanVerbal : IJsonOnDeserialized [JsonPropertyName("voice")] public object? Voice { get; set; } + /// + /// This controls whether the consent assistant speaks first or waits for the caller to speak first. + /// + /// Use: + /// - `assistant-speaks-first` (default) to have the consent assistant play the consent message as soon as the call is answered. + /// - `assistant-waits-for-user` to have the consent assistant wait for the caller to speak before playing the consent message. + /// + /// We strongly recommend `assistant-waits-for-user` for outbound calls. Some telephony providers signal "answered" while the line is still ringing, which can cause the consent message to play into a ringing line and be missed by the caller. Waiting for the caller to speak first guarantees they hear the full consent message. + /// + /// Note: when combined with `type: 'stay-on-line'`, silence only counts toward consent after the caller has spoken at least once. + /// + /// @default 'assistant-speaks-first' + /// + [JsonPropertyName("firstMessageMode")] + public RecordingConsentPlanVerbalFirstMessageMode? FirstMessageMode { get; set; } + /// /// Tool to execute if user verbally declines recording consent /// diff --git a/src/Vapi.Net/Types/RecordingConsentPlanVerbalFirstMessageMode.cs b/src/Vapi.Net/Types/RecordingConsentPlanVerbalFirstMessageMode.cs new file mode 100644 index 00000000..fe1ac8f6 --- /dev/null +++ b/src/Vapi.Net/Types/RecordingConsentPlanVerbalFirstMessageMode.cs @@ -0,0 +1,96 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(RecordingConsentPlanVerbalFirstMessageModeSerializer))] +public enum RecordingConsentPlanVerbalFirstMessageMode +{ + [EnumMember(Value = "assistant-speaks-first")] + AssistantSpeaksFirst, + + [EnumMember(Value = "assistant-waits-for-user")] + AssistantWaitsForUser, +} + +internal class RecordingConsentPlanVerbalFirstMessageModeSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + RecordingConsentPlanVerbalFirstMessageMode + > _stringToEnum = new() + { + { + "assistant-speaks-first", + RecordingConsentPlanVerbalFirstMessageMode.AssistantSpeaksFirst + }, + { + "assistant-waits-for-user", + RecordingConsentPlanVerbalFirstMessageMode.AssistantWaitsForUser + }, + }; + + private static readonly global::System.Collections.Generic.Dictionary< + RecordingConsentPlanVerbalFirstMessageMode, + string + > _enumToString = new() + { + { + RecordingConsentPlanVerbalFirstMessageMode.AssistantSpeaksFirst, + "assistant-speaks-first" + }, + { + RecordingConsentPlanVerbalFirstMessageMode.AssistantWaitsForUser, + "assistant-waits-for-user" + }, + }; + + public override RecordingConsentPlanVerbalFirstMessageMode Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + RecordingConsentPlanVerbalFirstMessageMode value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override RecordingConsentPlanVerbalFirstMessageMode ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + RecordingConsentPlanVerbalFirstMessageMode value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/RecordingConsentType.cs b/src/Vapi.Net/Types/RecordingConsentType.cs new file mode 100644 index 00000000..948dffec --- /dev/null +++ b/src/Vapi.Net/Types/RecordingConsentType.cs @@ -0,0 +1,84 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(RecordingConsentTypeSerializer))] +public enum RecordingConsentType +{ + [EnumMember(Value = "stay-on-line")] + StayOnLine, + + [EnumMember(Value = "verbal")] + Verbal, +} + +internal class RecordingConsentTypeSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + RecordingConsentType + > _stringToEnum = new() + { + { "stay-on-line", RecordingConsentType.StayOnLine }, + { "verbal", RecordingConsentType.Verbal }, + }; + + private static readonly global::System.Collections.Generic.Dictionary< + RecordingConsentType, + string + > _enumToString = new() + { + { RecordingConsentType.StayOnLine, "stay-on-line" }, + { RecordingConsentType.Verbal, "verbal" }, + }; + + public override RecordingConsentType Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + RecordingConsentType value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override RecordingConsentType ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + RecordingConsentType value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/RegexCondition.cs b/src/Vapi.Net/Types/RegexCondition.cs index 00c7230b..a4c508b5 100644 --- a/src/Vapi.Net/Types/RegexCondition.cs +++ b/src/Vapi.Net/Types/RegexCondition.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Evaluates whether targeted conversation-message content matches a regular expression. +/// [Serializable] public record RegexCondition : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/RegexOption.cs b/src/Vapi.Net/Types/RegexOption.cs index be02bcdc..cd3b58c4 100644 --- a/src/Vapi.Net/Types/RegexOption.cs +++ b/src/Vapi.Net/Types/RegexOption.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Enables or disables one regular-expression matching option for a text replacement. +/// [Serializable] public record RegexOption : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/RegexReplacement.cs b/src/Vapi.Net/Types/RegexReplacement.cs index 8ffcfb05..32b1e18a 100644 --- a/src/Vapi.Net/Types/RegexReplacement.cs +++ b/src/Vapi.Net/Types/RegexReplacement.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Replaces text matching a regular expression before it is sent to a voice provider. +/// [Serializable] public record RegexReplacement : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/RegexSecurityFilter.cs b/src/Vapi.Net/Types/RegexSecurityFilter.cs index 32b04003..21afca14 100644 --- a/src/Vapi.Net/Types/RegexSecurityFilter.cs +++ b/src/Vapi.Net/Types/RegexSecurityFilter.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Filters transcript content that matches a custom regular expression. +/// [Serializable] public record RegexSecurityFilter : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/RevokeInvitationResponseDto.cs b/src/Vapi.Net/Types/RevokeInvitationResponseDto.cs new file mode 100644 index 00000000..ad77cdc8 --- /dev/null +++ b/src/Vapi.Net/Types/RevokeInvitationResponseDto.cs @@ -0,0 +1,28 @@ +using global::System.Text.Json; +using global::System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[Serializable] +public record RevokeInvitationResponseDto : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("success")] + public required bool Success { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + 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 bd75489b..ab6dff37 100644 --- a/src/Vapi.Net/Types/RimeAiVoice.cs +++ b/src/Vapi.Net/Types/RimeAiVoice.cs @@ -5,6 +5,9 @@ namespace Vapi.Net; +/// +/// Configuration for synthesizing assistant speech with Rime AI, including voice and model selection, language, speed, pauses, phonemization, latency, chunking, caching, and fallback settings. +/// [Serializable] public record RimeAiVoice : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/S3CompatibleBucketPlan.cs b/src/Vapi.Net/Types/S3CompatibleBucketPlan.cs new file mode 100644 index 00000000..c78f6a92 --- /dev/null +++ b/src/Vapi.Net/Types/S3CompatibleBucketPlan.cs @@ -0,0 +1,62 @@ +using global::System.Text.Json; +using global::System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[Serializable] +public record S3CompatibleBucketPlan : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + /// + /// S3-compatible endpoint URL, such as https://s3.us-west-004.backblazeb2.com. Must be public HTTPS. + /// + [JsonPropertyName("url")] + public required string Url { get; set; } + + /// + /// SigV4 signing region expected by the object store. Most stores accept us-east-1. + /// + [JsonPropertyName("region")] + public required string Region { get; set; } + + /// + /// S3 access key ID. + /// + [JsonPropertyName("accessKeyId")] + public required string AccessKeyId { get; set; } + + /// + /// S3 secret access key. This is not returned in the API. + /// + [JsonAccess(JsonAccessType.WriteOnly)] + [JsonPropertyName("secretAccessKey")] + public required string SecretAccessKey { get; set; } + + /// + /// Bucket name. + /// + [JsonPropertyName("name")] + public required string Name { get; set; } + + /// + /// Optional key prefix inside the bucket, such as recordings/. + /// + [JsonPropertyName("path")] + public string? Path { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/S3CompatibleStorageCredential.cs b/src/Vapi.Net/Types/S3CompatibleStorageCredential.cs new file mode 100644 index 00000000..8f1fba92 --- /dev/null +++ b/src/Vapi.Net/Types/S3CompatibleStorageCredential.cs @@ -0,0 +1,70 @@ +using global::System.Text.Json; +using global::System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[Serializable] +public record S3CompatibleStorageCredential : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + /// + /// This is for S3-compatible storage such as MinIO, Garage, Ceph, or Backblaze B2. + /// + [JsonPropertyName("provider")] + public required S3CompatibleStorageCredentialProvider Provider { get; set; } + + [JsonPropertyName("bucketPlan")] + public required S3CompatibleBucketPlan BucketPlan { get; set; } + + /// + /// This is the order in which this storage provider is tried during upload retries. Lower numbers are tried first in increasing order. + /// + [JsonPropertyName("fallbackIndex")] + public double? FallbackIndex { 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; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/S3CompatibleStorageCredentialProvider.cs b/src/Vapi.Net/Types/S3CompatibleStorageCredentialProvider.cs new file mode 100644 index 00000000..a1bd5173 --- /dev/null +++ b/src/Vapi.Net/Types/S3CompatibleStorageCredentialProvider.cs @@ -0,0 +1,79 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(S3CompatibleStorageCredentialProviderSerializer))] +public enum S3CompatibleStorageCredentialProvider +{ + [EnumMember(Value = "s3-compatible")] + S3Compatible, +} + +internal class S3CompatibleStorageCredentialProviderSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + S3CompatibleStorageCredentialProvider + > _stringToEnum = new() + { + { "s3-compatible", S3CompatibleStorageCredentialProvider.S3Compatible }, + }; + + private static readonly global::System.Collections.Generic.Dictionary< + S3CompatibleStorageCredentialProvider, + string + > _enumToString = new() + { + { S3CompatibleStorageCredentialProvider.S3Compatible, "s3-compatible" }, + }; + + public override S3CompatibleStorageCredentialProvider Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + S3CompatibleStorageCredentialProvider value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override S3CompatibleStorageCredentialProvider ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + S3CompatibleStorageCredentialProvider value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/SayHookAction.cs b/src/Vapi.Net/Types/SayHookAction.cs index 23e67776..65243043 100644 --- a/src/Vapi.Net/Types/SayHookAction.cs +++ b/src/Vapi.Net/Types/SayHookAction.cs @@ -5,6 +5,9 @@ namespace Vapi.Net; +/// +/// A hook action that makes the assistant speak exact text or generate a response from a prompt. +/// [Serializable] public record SayHookAction : IJsonOnDeserialized { @@ -12,6 +15,12 @@ public record SayHookAction : IJsonOnDeserialized private readonly IDictionary _extensionData = new Dictionary(); + /// + /// This is the exact message to say. When a string array is provided, one is randomly selected. + /// + [JsonPropertyName("exact")] + public OneOf>? Exact { get; set; } + /// /// This is the prompt for the assistant to generate a response based on existing conversation. /// Can be a string or an array of chat messages. @@ -24,12 +33,6 @@ public OneOf< > >? Prompt { get; set; } - /// - /// This is the message to say - /// - [JsonPropertyName("exact")] - public object? Exact { get; set; } - [JsonIgnore] public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); diff --git a/src/Vapi.Net/Types/SayPhoneNumberHookAction.cs b/src/Vapi.Net/Types/SayPhoneNumberHookAction.cs index 0255bf52..67221c6c 100644 --- a/src/Vapi.Net/Types/SayPhoneNumberHookAction.cs +++ b/src/Vapi.Net/Types/SayPhoneNumberHookAction.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// A phone-number hook action that speaks an exact message to the caller. +/// [Serializable] public record SayPhoneNumberHookAction : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/SchedulePlan.cs b/src/Vapi.Net/Types/SchedulePlan.cs index 85ff13c3..b8b50620 100644 --- a/src/Vapi.Net/Types/SchedulePlan.cs +++ b/src/Vapi.Net/Types/SchedulePlan.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Time window that controls the earliest and latest time a call may begin. +/// [Serializable] public record SchedulePlan : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/Scorecard.cs b/src/Vapi.Net/Types/Scorecard.cs index 66c666dd..222f8129 100644 --- a/src/Vapi.Net/Types/Scorecard.cs +++ b/src/Vapi.Net/Types/Scorecard.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// A saved scorecard containing its evaluation metrics, scoring conditions, assistant associations, descriptive metadata, and lifecycle information. +/// [Serializable] public record Scorecard : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/ScorecardMetric.cs b/src/Vapi.Net/Types/ScorecardMetric.cs index 32422054..67d75593 100644 --- a/src/Vapi.Net/Types/ScorecardMetric.cs +++ b/src/Vapi.Net/Types/ScorecardMetric.cs @@ -1,9 +1,13 @@ using global::System.Text.Json; using global::System.Text.Json.Serialization; +using OneOf; using Vapi.Net.Core; namespace Vapi.Net; +/// +/// A scorecard metric that awards points when a structured output meets its configured conditions. +/// [Serializable] public record ScorecardMetric : IJsonOnDeserialized { @@ -11,13 +15,6 @@ public record ScorecardMetric : IJsonOnDeserialized private readonly IDictionary _extensionData = new Dictionary(); - /// - /// This is the unique identifier for the structured output that will be used to evaluate the scorecard. - /// The structured output must be of type number or boolean only for now. - /// - [JsonPropertyName("structuredOutputId")] - public required string StructuredOutputId { get; set; } - /// /// These are the conditions that will be used to evaluate the scorecard. /// Each condition will have a comparator, value, and points that will be used to calculate the final score. @@ -25,7 +22,22 @@ public record ScorecardMetric : IJsonOnDeserialized /// The overall score will be normalized to a 100 point scale to ensure uniformity across different scorecards. /// [JsonPropertyName("conditions")] - public IEnumerable Conditions { get; set; } = new List(); + public IEnumerable< + OneOf + > Conditions { get; set; } = + new List< + OneOf< + NumberComparatorScorecardMetricCondition, + BooleanComparatorScorecardMetricCondition + > + >(); + + /// + /// This is the unique identifier for the structured output that will be used to evaluate the scorecard. + /// The structured output must be of type number or boolean only for now. + /// + [JsonPropertyName("structuredOutputId")] + public required string StructuredOutputId { get; set; } [JsonIgnore] public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); diff --git a/src/Vapi.Net/Types/ScorecardPaginatedResponse.cs b/src/Vapi.Net/Types/ScorecardPaginatedResponse.cs index 5003eb3f..ab9cfc21 100644 --- a/src/Vapi.Net/Types/ScorecardPaginatedResponse.cs +++ b/src/Vapi.Net/Types/ScorecardPaginatedResponse.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// A paginated collection of scorecards and metadata describing the result set. +/// [Serializable] public record ScorecardPaginatedResponse : IJsonOnDeserialized { @@ -11,9 +14,15 @@ public record ScorecardPaginatedResponse : IJsonOnDeserialized private readonly IDictionary _extensionData = new Dictionary(); + /// + /// The scorecards returned for the current page. + /// [JsonPropertyName("results")] public IEnumerable Results { get; set; } = new List(); + /// + /// Pagination metadata for the scorecard result set. + /// [JsonPropertyName("metadata")] public required PaginationMeta Metadata { get; set; } diff --git a/src/Vapi.Net/Types/SecurityFilterBase.cs b/src/Vapi.Net/Types/SecurityFilterBase.cs index 9fd32760..a2c89d5f 100644 --- a/src/Vapi.Net/Types/SecurityFilterBase.cs +++ b/src/Vapi.Net/Types/SecurityFilterBase.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Base configuration for a security filter applied to transcripts before model processing. +/// [Serializable] public record SecurityFilterBase : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/SecurityFilterPlan.cs b/src/Vapi.Net/Types/SecurityFilterPlan.cs index 47a999bb..f38d911c 100644 --- a/src/Vapi.Net/Types/SecurityFilterPlan.cs +++ b/src/Vapi.Net/Types/SecurityFilterPlan.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Controls filtering of transcripts for security threats before content is sent to the assistant's language model, including filter selection, handling mode, and replacement text. +/// [Serializable] public record SecurityFilterPlan : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/Server.cs b/src/Vapi.Net/Types/Server.cs index aa9a8876..73c3e6d9 100644 --- a/src/Vapi.Net/Types/Server.cs +++ b/src/Vapi.Net/Types/Server.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Configuration for requests Vapi sends to a customer server, including URL, authentication, headers, timeout, encryption, static IP addresses, and retry behavior. +/// [Serializable] public record Server : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/ServerMessage.cs b/src/Vapi.Net/Types/ServerMessage.cs index 90b9e48d..2795e535 100644 --- a/src/Vapi.Net/Types/ServerMessage.cs +++ b/src/Vapi.Net/Types/ServerMessage.cs @@ -50,7 +50,8 @@ public required OneOf< ServerMessageSessionUpdated, ServerMessageSessionDeleted, ServerMessageCallDeleted, - ServerMessageCallDeleteFailed + ServerMessageCallDeleteFailed, + ServerMessageCampaignPredial > Message { get; set; } [JsonIgnore] diff --git a/src/Vapi.Net/Types/ServerMessageAssistantRequest.cs b/src/Vapi.Net/Types/ServerMessageAssistantRequest.cs index bc627f38..3a74b1db 100644 --- a/src/Vapi.Net/Types/ServerMessageAssistantRequest.cs +++ b/src/Vapi.Net/Types/ServerMessageAssistantRequest.cs @@ -17,6 +17,15 @@ public record ServerMessageAssistantRequest : IJsonOnDeserialized [JsonPropertyName("phoneNumber")] public object? PhoneNumber { get; set; } + /// + /// This is the version label (e.g. `v3`) of the assistant the call was + /// configured with. `null` for inline assistants, squad/workflow calls, + /// pre-resolution assistant-request messages, and orgs not on + /// assistant versioning. + /// + [JsonPropertyName("assistantVersion")] + public string? AssistantVersion { get; set; } + /// /// This is the type of the message. "assistant-request" is sent to fetch assistant configuration for an incoming call. /// diff --git a/src/Vapi.Net/Types/ServerMessageAssistantSpeech.cs b/src/Vapi.Net/Types/ServerMessageAssistantSpeech.cs index b0796c6f..210a61b8 100644 --- a/src/Vapi.Net/Types/ServerMessageAssistantSpeech.cs +++ b/src/Vapi.Net/Types/ServerMessageAssistantSpeech.cs @@ -17,6 +17,15 @@ public record ServerMessageAssistantSpeech : IJsonOnDeserialized [JsonPropertyName("phoneNumber")] public object? PhoneNumber { get; set; } + /// + /// This is the version label (e.g. `v3`) of the assistant the call was + /// configured with. `null` for inline assistants, squad/workflow calls, + /// pre-resolution assistant-request messages, and orgs not on + /// assistant versioning. + /// + [JsonPropertyName("assistantVersion")] + public string? AssistantVersion { get; set; } + /// /// This is the type of the message. "assistant-speech" is sent as assistant audio is being played. /// diff --git a/src/Vapi.Net/Types/ServerMessageCallDeleteFailed.cs b/src/Vapi.Net/Types/ServerMessageCallDeleteFailed.cs index afeba273..b0d3b86b 100644 --- a/src/Vapi.Net/Types/ServerMessageCallDeleteFailed.cs +++ b/src/Vapi.Net/Types/ServerMessageCallDeleteFailed.cs @@ -17,6 +17,15 @@ public record ServerMessageCallDeleteFailed : IJsonOnDeserialized [JsonPropertyName("phoneNumber")] public object? PhoneNumber { get; set; } + /// + /// This is the version label (e.g. `v3`) of the assistant the call was + /// configured with. `null` for inline assistants, squad/workflow calls, + /// pre-resolution assistant-request messages, and orgs not on + /// assistant versioning. + /// + [JsonPropertyName("assistantVersion")] + public string? AssistantVersion { get; set; } + /// /// This is the type of the message. "call.deleted" is sent when a call is deleted. /// diff --git a/src/Vapi.Net/Types/ServerMessageCallDeleted.cs b/src/Vapi.Net/Types/ServerMessageCallDeleted.cs index 8fe4499e..400dfd32 100644 --- a/src/Vapi.Net/Types/ServerMessageCallDeleted.cs +++ b/src/Vapi.Net/Types/ServerMessageCallDeleted.cs @@ -17,6 +17,15 @@ public record ServerMessageCallDeleted : IJsonOnDeserialized [JsonPropertyName("phoneNumber")] public object? PhoneNumber { get; set; } + /// + /// This is the version label (e.g. `v3`) of the assistant the call was + /// configured with. `null` for inline assistants, squad/workflow calls, + /// pre-resolution assistant-request messages, and orgs not on + /// assistant versioning. + /// + [JsonPropertyName("assistantVersion")] + public string? AssistantVersion { get; set; } + /// /// This is the type of the message. "call.deleted" is sent when a call is deleted. /// diff --git a/src/Vapi.Net/Types/ServerMessageCallEndpointingRequest.cs b/src/Vapi.Net/Types/ServerMessageCallEndpointingRequest.cs index cb188b04..8bb447d2 100644 --- a/src/Vapi.Net/Types/ServerMessageCallEndpointingRequest.cs +++ b/src/Vapi.Net/Types/ServerMessageCallEndpointingRequest.cs @@ -18,6 +18,15 @@ public record ServerMessageCallEndpointingRequest : IJsonOnDeserialized [JsonPropertyName("phoneNumber")] public object? PhoneNumber { get; set; } + /// + /// This is the version label (e.g. `v3`) of the assistant the call was + /// configured with. `null` for inline assistants, squad/workflow calls, + /// pre-resolution assistant-request messages, and orgs not on + /// assistant versioning. + /// + [JsonPropertyName("assistantVersion")] + public string? AssistantVersion { get; set; } + /// /// This is the type of the message. "call.endpointing.request" is sent when using `assistant.startSpeakingPlan.smartEndpointingPlan={ "provider": "custom-endpointing-model" }`. /// @@ -54,7 +63,7 @@ public record ServerMessageCallEndpointingRequest : IJsonOnDeserialized /// [JsonPropertyName("messages")] public IEnumerable< - OneOf + OneOf >? Messages { get; set; } /// diff --git a/src/Vapi.Net/Types/ServerMessageCampaignPredial.cs b/src/Vapi.Net/Types/ServerMessageCampaignPredial.cs new file mode 100644 index 00000000..ef97ce26 --- /dev/null +++ b/src/Vapi.Net/Types/ServerMessageCampaignPredial.cs @@ -0,0 +1,96 @@ +using global::System.Text.Json; +using global::System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[Serializable] +public record ServerMessageCampaignPredial : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + /// + /// This is the phone number that the message is associated with. + /// + [JsonPropertyName("phoneNumber")] + public object? PhoneNumber { get; set; } + + /// + /// This is the version label (e.g. `v3`) of the assistant the call was + /// configured with. `null` for inline assistants, squad/workflow calls, + /// pre-resolution assistant-request messages, and orgs not on + /// assistant versioning. + /// + [JsonPropertyName("assistantVersion")] + public string? AssistantVersion { get; set; } + + /// + /// This is the type of the message. "campaign.predial" is sent to the campaign's server before each contact is dialed, so the server can decide whether the contact is eligible to be called. It is only sent when the campaign's `predialPlan` is set (and not disabled). + /// + [JsonPropertyName("type")] + public required ServerMessageCampaignPredialType Type { get; set; } + + /// + /// This is the ID of the campaign the contact belongs to. + /// + [JsonPropertyName("campaignId")] + public required string CampaignId { get; set; } + + /// + /// This is the contact that is about to be dialed. + /// + [JsonPropertyName("contact")] + public required CampaignContact Contact { get; set; } + + /// + /// This is the timestamp of the message. + /// + [JsonPropertyName("timestamp")] + public double? Timestamp { get; set; } + + /// + /// This is a live version of the `call.artifact`. + /// + /// This matches what is stored on `call.artifact` after the call. + /// + [JsonPropertyName("artifact")] + public Artifact? Artifact { get; set; } + + /// + /// This is the assistant that the message is associated with. + /// + [JsonPropertyName("assistant")] + public CreateAssistantDto? Assistant { get; set; } + + /// + /// This is the customer that the message is associated with. + /// + [JsonPropertyName("customer")] + public CreateCustomerDto? Customer { get; set; } + + /// + /// This is the call that the message is associated with. + /// + [JsonPropertyName("call")] + public Call? Call { get; set; } + + /// + /// This is the chat object. + /// + [JsonPropertyName("chat")] + public Chat? Chat { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/ServerMessageCampaignPredialType.cs b/src/Vapi.Net/Types/ServerMessageCampaignPredialType.cs new file mode 100644 index 00000000..498c4072 --- /dev/null +++ b/src/Vapi.Net/Types/ServerMessageCampaignPredialType.cs @@ -0,0 +1,79 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(ServerMessageCampaignPredialTypeSerializer))] +public enum ServerMessageCampaignPredialType +{ + [EnumMember(Value = "campaign.predial")] + CampaignPredial, +} + +internal class ServerMessageCampaignPredialTypeSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + ServerMessageCampaignPredialType + > _stringToEnum = new() + { + { "campaign.predial", ServerMessageCampaignPredialType.CampaignPredial }, + }; + + private static readonly global::System.Collections.Generic.Dictionary< + ServerMessageCampaignPredialType, + string + > _enumToString = new() + { + { ServerMessageCampaignPredialType.CampaignPredial, "campaign.predial" }, + }; + + public override ServerMessageCampaignPredialType Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + ServerMessageCampaignPredialType value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override ServerMessageCampaignPredialType ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + ServerMessageCampaignPredialType value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/ServerMessageChatCreated.cs b/src/Vapi.Net/Types/ServerMessageChatCreated.cs index 64cbeb8e..f225e9a0 100644 --- a/src/Vapi.Net/Types/ServerMessageChatCreated.cs +++ b/src/Vapi.Net/Types/ServerMessageChatCreated.cs @@ -17,6 +17,15 @@ public record ServerMessageChatCreated : IJsonOnDeserialized [JsonPropertyName("phoneNumber")] public object? PhoneNumber { get; set; } + /// + /// This is the version label (e.g. `v3`) of the assistant the call was + /// configured with. `null` for inline assistants, squad/workflow calls, + /// pre-resolution assistant-request messages, and orgs not on + /// assistant versioning. + /// + [JsonPropertyName("assistantVersion")] + public string? AssistantVersion { get; set; } + /// /// This is the type of the message. "chat.created" is sent when a new chat is created. /// diff --git a/src/Vapi.Net/Types/ServerMessageChatDeleted.cs b/src/Vapi.Net/Types/ServerMessageChatDeleted.cs index eac53ae1..a7f943cd 100644 --- a/src/Vapi.Net/Types/ServerMessageChatDeleted.cs +++ b/src/Vapi.Net/Types/ServerMessageChatDeleted.cs @@ -17,6 +17,15 @@ public record ServerMessageChatDeleted : IJsonOnDeserialized [JsonPropertyName("phoneNumber")] public object? PhoneNumber { get; set; } + /// + /// This is the version label (e.g. `v3`) of the assistant the call was + /// configured with. `null` for inline assistants, squad/workflow calls, + /// pre-resolution assistant-request messages, and orgs not on + /// assistant versioning. + /// + [JsonPropertyName("assistantVersion")] + public string? AssistantVersion { get; set; } + /// /// This is the type of the message. "chat.deleted" is sent when a chat is deleted. /// diff --git a/src/Vapi.Net/Types/ServerMessageConversationUpdate.cs b/src/Vapi.Net/Types/ServerMessageConversationUpdate.cs index a6ebf96d..a6d4e1ed 100644 --- a/src/Vapi.Net/Types/ServerMessageConversationUpdate.cs +++ b/src/Vapi.Net/Types/ServerMessageConversationUpdate.cs @@ -18,6 +18,15 @@ public record ServerMessageConversationUpdate : IJsonOnDeserialized [JsonPropertyName("phoneNumber")] public object? PhoneNumber { get; set; } + /// + /// This is the version label (e.g. `v3`) of the assistant the call was + /// configured with. `null` for inline assistants, squad/workflow calls, + /// pre-resolution assistant-request messages, and orgs not on + /// assistant versioning. + /// + [JsonPropertyName("assistantVersion")] + public string? AssistantVersion { get; set; } + /// /// This is the type of the message. "conversation-update" is sent when an update is committed to the conversation history. /// @@ -29,7 +38,7 @@ public record ServerMessageConversationUpdate : IJsonOnDeserialized /// [JsonPropertyName("messages")] public IEnumerable< - OneOf + OneOf >? Messages { get; set; } /// diff --git a/src/Vapi.Net/Types/ServerMessageEndOfCallReport.cs b/src/Vapi.Net/Types/ServerMessageEndOfCallReport.cs index 33c5a575..6df70523 100644 --- a/src/Vapi.Net/Types/ServerMessageEndOfCallReport.cs +++ b/src/Vapi.Net/Types/ServerMessageEndOfCallReport.cs @@ -17,6 +17,15 @@ public record ServerMessageEndOfCallReport : IJsonOnDeserialized [JsonPropertyName("phoneNumber")] public object? PhoneNumber { get; set; } + /// + /// This is the version label (e.g. `v3`) of the assistant the call was + /// configured with. `null` for inline assistants, squad/workflow calls, + /// pre-resolution assistant-request messages, and orgs not on + /// assistant versioning. + /// + [JsonPropertyName("assistantVersion")] + public string? AssistantVersion { get; set; } + /// /// This is the type of the message. "end-of-call-report" is sent when the call ends and post-processing is complete. /// diff --git a/src/Vapi.Net/Types/ServerMessageEndOfCallReportEndedReason.cs b/src/Vapi.Net/Types/ServerMessageEndOfCallReportEndedReason.cs index f593e604..5d257bf9 100644 --- a/src/Vapi.Net/Types/ServerMessageEndOfCallReportEndedReason.cs +++ b/src/Vapi.Net/Types/ServerMessageEndOfCallReportEndedReason.cs @@ -78,6 +78,9 @@ public enum ServerMessageEndOfCallReportEndedReason [EnumMember(Value = "call.start.error-enterprise-feature-not-available-recording-consent")] CallStartErrorEnterpriseFeatureNotAvailableRecordingConsent, + [EnumMember(Value = "call.start.assistant-version-error-validation")] + CallStartAssistantVersionErrorValidation, + [EnumMember(Value = "assistant-not-valid")] AssistantNotValid, @@ -135,6 +138,15 @@ public enum ServerMessageEndOfCallReportEndedReason [EnumMember(Value = "pipeline-error-wellsaid-voice-failed")] PipelineErrorWellsaidVoiceFailed, + [EnumMember(Value = "pipeline-error-xai-voice-failed")] + PipelineErrorXaiVoiceFailed, + + [EnumMember(Value = "pipeline-error-microsoft-voice-failed")] + PipelineErrorMicrosoftVoiceFailed, + + [EnumMember(Value = "pipeline-error-microsoft-voice-request-canceled")] + PipelineErrorMicrosoftVoiceRequestCanceled, + [EnumMember(Value = "pipeline-error-tavus-video-failed")] PipelineErrorTavusVideoFailed, @@ -186,6 +198,12 @@ public enum ServerMessageEndOfCallReportEndedReason [EnumMember(Value = "call.in-progress.error-vapifault-wellsaid-voice-failed")] CallInProgressErrorVapifaultWellsaidVoiceFailed, + [EnumMember(Value = "call.in-progress.error-vapifault-xai-voice-failed")] + CallInProgressErrorVapifaultXaiVoiceFailed, + + [EnumMember(Value = "call.in-progress.error-vapifault-microsoft-voice-failed")] + CallInProgressErrorVapifaultMicrosoftVoiceFailed, + [EnumMember(Value = "call.in-progress.error-vapifault-tavus-video-failed")] CallInProgressErrorVapifaultTavusVideoFailed, @@ -213,6 +231,9 @@ public enum ServerMessageEndOfCallReportEndedReason [EnumMember(Value = "call.in-progress.error-providerfault-vapi-llm-failed")] CallInProgressErrorProviderfaultVapiLlmFailed, + [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, @@ -231,6 +252,18 @@ public enum ServerMessageEndOfCallReportEndedReason [EnumMember(Value = "call.in-progress.error-providerfault-vapi-503-server-overloaded-error")] CallInProgressErrorProviderfaultVapi503ServerOverloadedError, + [EnumMember(Value = "pipeline-error-vapi-transcriber-failed")] + PipelineErrorVapiTranscriberFailed, + + [EnumMember(Value = "call.in-progress.error-vapifault-vapi-transcriber-failed")] + CallInProgressErrorVapifaultVapiTranscriberFailed, + + [EnumMember(Value = "call.in-progress.error-providerfault-vapi-transcriber-failed")] + CallInProgressErrorProviderfaultVapiTranscriberFailed, + + [EnumMember(Value = "call.in-progress.error-providerfault-vapi-voice-failed")] + CallInProgressErrorProviderfaultVapiVoiceFailed, + [EnumMember(Value = "pipeline-error-deepgram-transcriber-failed")] PipelineErrorDeepgramTranscriberFailed, @@ -358,6 +391,42 @@ public enum ServerMessageEndOfCallReportEndedReason [EnumMember(Value = "call.in-progress.error-vapifault-soniox-transcriber-failed")] CallInProgressErrorVapifaultSonioxTranscriberFailed, + [EnumMember(Value = "pipeline-error-xai-transcriber-auth-failed")] + PipelineErrorXaiTranscriberAuthFailed, + + [EnumMember(Value = "pipeline-error-xai-transcriber-rate-limited")] + PipelineErrorXaiTranscriberRateLimited, + + [EnumMember(Value = "pipeline-error-xai-transcriber-invalid-config")] + PipelineErrorXaiTranscriberInvalidConfig, + + [EnumMember(Value = "pipeline-error-xai-transcriber-server-error")] + PipelineErrorXaiTranscriberServerError, + + [EnumMember(Value = "pipeline-error-xai-transcriber-failed")] + PipelineErrorXaiTranscriberFailed, + + [EnumMember(Value = "call.in-progress.error-vapifault-xai-transcriber-auth-failed")] + CallInProgressErrorVapifaultXaiTranscriberAuthFailed, + + [EnumMember(Value = "call.in-progress.error-vapifault-xai-transcriber-rate-limited")] + CallInProgressErrorVapifaultXaiTranscriberRateLimited, + + [EnumMember(Value = "call.in-progress.error-vapifault-xai-transcriber-invalid-config")] + CallInProgressErrorVapifaultXaiTranscriberInvalidConfig, + + [EnumMember(Value = "call.in-progress.error-vapifault-xai-transcriber-server-error")] + CallInProgressErrorVapifaultXaiTranscriberServerError, + + [EnumMember(Value = "call.in-progress.error-vapifault-xai-transcriber-failed")] + CallInProgressErrorVapifaultXaiTranscriberFailed, + + [EnumMember(Value = "pipeline-error-cartesia-transcriber-failed")] + PipelineErrorCartesiaTranscriberFailed, + + [EnumMember(Value = "call.in-progress.error-vapifault-cartesia-transcriber-failed")] + CallInProgressErrorVapifaultCartesiaTranscriberFailed, + [EnumMember(Value = "call.in-progress.error-pipeline-no-available-llm-model")] CallInProgressErrorPipelineNoAvailableLlmModel, @@ -1806,6 +1875,9 @@ public enum ServerMessageEndOfCallReportEndedReason [EnumMember(Value = "call.forwarding.operator-busy")] CallForwardingOperatorBusy, + [EnumMember(Value = "call.forwarding.no-answer")] + CallForwardingNoAnswer, + [EnumMember(Value = "silence-timed-out")] SilenceTimedOut, @@ -1957,6 +2029,10 @@ internal class ServerMessageEndOfCallReportEndedReasonSerializer "call.start.error-enterprise-feature-not-available-recording-consent", ServerMessageEndOfCallReportEndedReason.CallStartErrorEnterpriseFeatureNotAvailableRecordingConsent }, + { + "call.start.assistant-version-error-validation", + ServerMessageEndOfCallReportEndedReason.CallStartAssistantVersionErrorValidation + }, { "assistant-not-valid", ServerMessageEndOfCallReportEndedReason.AssistantNotValid }, { "call.start.error-vapifault-database-error", @@ -2027,6 +2103,18 @@ internal class ServerMessageEndOfCallReportEndedReasonSerializer "pipeline-error-wellsaid-voice-failed", ServerMessageEndOfCallReportEndedReason.PipelineErrorWellsaidVoiceFailed }, + { + "pipeline-error-xai-voice-failed", + ServerMessageEndOfCallReportEndedReason.PipelineErrorXaiVoiceFailed + }, + { + "pipeline-error-microsoft-voice-failed", + ServerMessageEndOfCallReportEndedReason.PipelineErrorMicrosoftVoiceFailed + }, + { + "pipeline-error-microsoft-voice-request-canceled", + ServerMessageEndOfCallReportEndedReason.PipelineErrorMicrosoftVoiceRequestCanceled + }, { "pipeline-error-tavus-video-failed", ServerMessageEndOfCallReportEndedReason.PipelineErrorTavusVideoFailed @@ -2095,6 +2183,14 @@ internal class ServerMessageEndOfCallReportEndedReasonSerializer "call.in-progress.error-vapifault-wellsaid-voice-failed", ServerMessageEndOfCallReportEndedReason.CallInProgressErrorVapifaultWellsaidVoiceFailed }, + { + "call.in-progress.error-vapifault-xai-voice-failed", + ServerMessageEndOfCallReportEndedReason.CallInProgressErrorVapifaultXaiVoiceFailed + }, + { + "call.in-progress.error-vapifault-microsoft-voice-failed", + ServerMessageEndOfCallReportEndedReason.CallInProgressErrorVapifaultMicrosoftVoiceFailed + }, { "call.in-progress.error-vapifault-tavus-video-failed", ServerMessageEndOfCallReportEndedReason.CallInProgressErrorVapifaultTavusVideoFailed @@ -2131,6 +2227,10 @@ internal class ServerMessageEndOfCallReportEndedReasonSerializer "call.in-progress.error-providerfault-vapi-llm-failed", ServerMessageEndOfCallReportEndedReason.CallInProgressErrorProviderfaultVapiLlmFailed }, + { + "call.in-progress.error-vapifault-vapi-llm-failed", + ServerMessageEndOfCallReportEndedReason.CallInProgressErrorVapifaultVapiLlmFailed + }, { "call.in-progress.error-vapifault-vapi-400-bad-request-validation-failed", ServerMessageEndOfCallReportEndedReason.CallInProgressErrorVapifaultVapi400BadRequestValidationFailed @@ -2155,6 +2255,22 @@ internal class ServerMessageEndOfCallReportEndedReasonSerializer "call.in-progress.error-providerfault-vapi-503-server-overloaded-error", ServerMessageEndOfCallReportEndedReason.CallInProgressErrorProviderfaultVapi503ServerOverloadedError }, + { + "pipeline-error-vapi-transcriber-failed", + ServerMessageEndOfCallReportEndedReason.PipelineErrorVapiTranscriberFailed + }, + { + "call.in-progress.error-vapifault-vapi-transcriber-failed", + ServerMessageEndOfCallReportEndedReason.CallInProgressErrorVapifaultVapiTranscriberFailed + }, + { + "call.in-progress.error-providerfault-vapi-transcriber-failed", + ServerMessageEndOfCallReportEndedReason.CallInProgressErrorProviderfaultVapiTranscriberFailed + }, + { + "call.in-progress.error-providerfault-vapi-voice-failed", + ServerMessageEndOfCallReportEndedReason.CallInProgressErrorProviderfaultVapiVoiceFailed + }, { "pipeline-error-deepgram-transcriber-failed", ServerMessageEndOfCallReportEndedReason.PipelineErrorDeepgramTranscriberFailed @@ -2311,6 +2427,54 @@ internal class ServerMessageEndOfCallReportEndedReasonSerializer "call.in-progress.error-vapifault-soniox-transcriber-failed", ServerMessageEndOfCallReportEndedReason.CallInProgressErrorVapifaultSonioxTranscriberFailed }, + { + "pipeline-error-xai-transcriber-auth-failed", + ServerMessageEndOfCallReportEndedReason.PipelineErrorXaiTranscriberAuthFailed + }, + { + "pipeline-error-xai-transcriber-rate-limited", + ServerMessageEndOfCallReportEndedReason.PipelineErrorXaiTranscriberRateLimited + }, + { + "pipeline-error-xai-transcriber-invalid-config", + ServerMessageEndOfCallReportEndedReason.PipelineErrorXaiTranscriberInvalidConfig + }, + { + "pipeline-error-xai-transcriber-server-error", + ServerMessageEndOfCallReportEndedReason.PipelineErrorXaiTranscriberServerError + }, + { + "pipeline-error-xai-transcriber-failed", + ServerMessageEndOfCallReportEndedReason.PipelineErrorXaiTranscriberFailed + }, + { + "call.in-progress.error-vapifault-xai-transcriber-auth-failed", + ServerMessageEndOfCallReportEndedReason.CallInProgressErrorVapifaultXaiTranscriberAuthFailed + }, + { + "call.in-progress.error-vapifault-xai-transcriber-rate-limited", + ServerMessageEndOfCallReportEndedReason.CallInProgressErrorVapifaultXaiTranscriberRateLimited + }, + { + "call.in-progress.error-vapifault-xai-transcriber-invalid-config", + ServerMessageEndOfCallReportEndedReason.CallInProgressErrorVapifaultXaiTranscriberInvalidConfig + }, + { + "call.in-progress.error-vapifault-xai-transcriber-server-error", + ServerMessageEndOfCallReportEndedReason.CallInProgressErrorVapifaultXaiTranscriberServerError + }, + { + "call.in-progress.error-vapifault-xai-transcriber-failed", + ServerMessageEndOfCallReportEndedReason.CallInProgressErrorVapifaultXaiTranscriberFailed + }, + { + "pipeline-error-cartesia-transcriber-failed", + ServerMessageEndOfCallReportEndedReason.PipelineErrorCartesiaTranscriberFailed + }, + { + "call.in-progress.error-vapifault-cartesia-transcriber-failed", + ServerMessageEndOfCallReportEndedReason.CallInProgressErrorVapifaultCartesiaTranscriberFailed + }, { "call.in-progress.error-pipeline-no-available-llm-model", ServerMessageEndOfCallReportEndedReason.CallInProgressErrorPipelineNoAvailableLlmModel @@ -4052,6 +4216,10 @@ internal class ServerMessageEndOfCallReportEndedReasonSerializer "call.forwarding.operator-busy", ServerMessageEndOfCallReportEndedReason.CallForwardingOperatorBusy }, + { + "call.forwarding.no-answer", + ServerMessageEndOfCallReportEndedReason.CallForwardingNoAnswer + }, { "silence-timed-out", ServerMessageEndOfCallReportEndedReason.SilenceTimedOut }, { "call.in-progress.error-providerfault-outbound-sip-403-forbidden", @@ -4200,6 +4368,10 @@ internal class ServerMessageEndOfCallReportEndedReasonSerializer ServerMessageEndOfCallReportEndedReason.CallStartErrorEnterpriseFeatureNotAvailableRecordingConsent, "call.start.error-enterprise-feature-not-available-recording-consent" }, + { + ServerMessageEndOfCallReportEndedReason.CallStartAssistantVersionErrorValidation, + "call.start.assistant-version-error-validation" + }, { ServerMessageEndOfCallReportEndedReason.AssistantNotValid, "assistant-not-valid" }, { ServerMessageEndOfCallReportEndedReason.CallStartErrorVapifaultDatabaseError, @@ -4270,6 +4442,18 @@ internal class ServerMessageEndOfCallReportEndedReasonSerializer ServerMessageEndOfCallReportEndedReason.PipelineErrorWellsaidVoiceFailed, "pipeline-error-wellsaid-voice-failed" }, + { + ServerMessageEndOfCallReportEndedReason.PipelineErrorXaiVoiceFailed, + "pipeline-error-xai-voice-failed" + }, + { + ServerMessageEndOfCallReportEndedReason.PipelineErrorMicrosoftVoiceFailed, + "pipeline-error-microsoft-voice-failed" + }, + { + ServerMessageEndOfCallReportEndedReason.PipelineErrorMicrosoftVoiceRequestCanceled, + "pipeline-error-microsoft-voice-request-canceled" + }, { ServerMessageEndOfCallReportEndedReason.PipelineErrorTavusVideoFailed, "pipeline-error-tavus-video-failed" @@ -4338,6 +4522,14 @@ internal class ServerMessageEndOfCallReportEndedReasonSerializer ServerMessageEndOfCallReportEndedReason.CallInProgressErrorVapifaultWellsaidVoiceFailed, "call.in-progress.error-vapifault-wellsaid-voice-failed" }, + { + ServerMessageEndOfCallReportEndedReason.CallInProgressErrorVapifaultXaiVoiceFailed, + "call.in-progress.error-vapifault-xai-voice-failed" + }, + { + ServerMessageEndOfCallReportEndedReason.CallInProgressErrorVapifaultMicrosoftVoiceFailed, + "call.in-progress.error-vapifault-microsoft-voice-failed" + }, { ServerMessageEndOfCallReportEndedReason.CallInProgressErrorVapifaultTavusVideoFailed, "call.in-progress.error-vapifault-tavus-video-failed" @@ -4374,6 +4566,10 @@ internal class ServerMessageEndOfCallReportEndedReasonSerializer ServerMessageEndOfCallReportEndedReason.CallInProgressErrorProviderfaultVapiLlmFailed, "call.in-progress.error-providerfault-vapi-llm-failed" }, + { + ServerMessageEndOfCallReportEndedReason.CallInProgressErrorVapifaultVapiLlmFailed, + "call.in-progress.error-vapifault-vapi-llm-failed" + }, { ServerMessageEndOfCallReportEndedReason.CallInProgressErrorVapifaultVapi400BadRequestValidationFailed, "call.in-progress.error-vapifault-vapi-400-bad-request-validation-failed" @@ -4398,6 +4594,22 @@ internal class ServerMessageEndOfCallReportEndedReasonSerializer ServerMessageEndOfCallReportEndedReason.CallInProgressErrorProviderfaultVapi503ServerOverloadedError, "call.in-progress.error-providerfault-vapi-503-server-overloaded-error" }, + { + ServerMessageEndOfCallReportEndedReason.PipelineErrorVapiTranscriberFailed, + "pipeline-error-vapi-transcriber-failed" + }, + { + ServerMessageEndOfCallReportEndedReason.CallInProgressErrorVapifaultVapiTranscriberFailed, + "call.in-progress.error-vapifault-vapi-transcriber-failed" + }, + { + ServerMessageEndOfCallReportEndedReason.CallInProgressErrorProviderfaultVapiTranscriberFailed, + "call.in-progress.error-providerfault-vapi-transcriber-failed" + }, + { + ServerMessageEndOfCallReportEndedReason.CallInProgressErrorProviderfaultVapiVoiceFailed, + "call.in-progress.error-providerfault-vapi-voice-failed" + }, { ServerMessageEndOfCallReportEndedReason.PipelineErrorDeepgramTranscriberFailed, "pipeline-error-deepgram-transcriber-failed" @@ -4554,6 +4766,54 @@ internal class ServerMessageEndOfCallReportEndedReasonSerializer ServerMessageEndOfCallReportEndedReason.CallInProgressErrorVapifaultSonioxTranscriberFailed, "call.in-progress.error-vapifault-soniox-transcriber-failed" }, + { + ServerMessageEndOfCallReportEndedReason.PipelineErrorXaiTranscriberAuthFailed, + "pipeline-error-xai-transcriber-auth-failed" + }, + { + ServerMessageEndOfCallReportEndedReason.PipelineErrorXaiTranscriberRateLimited, + "pipeline-error-xai-transcriber-rate-limited" + }, + { + ServerMessageEndOfCallReportEndedReason.PipelineErrorXaiTranscriberInvalidConfig, + "pipeline-error-xai-transcriber-invalid-config" + }, + { + ServerMessageEndOfCallReportEndedReason.PipelineErrorXaiTranscriberServerError, + "pipeline-error-xai-transcriber-server-error" + }, + { + ServerMessageEndOfCallReportEndedReason.PipelineErrorXaiTranscriberFailed, + "pipeline-error-xai-transcriber-failed" + }, + { + ServerMessageEndOfCallReportEndedReason.CallInProgressErrorVapifaultXaiTranscriberAuthFailed, + "call.in-progress.error-vapifault-xai-transcriber-auth-failed" + }, + { + ServerMessageEndOfCallReportEndedReason.CallInProgressErrorVapifaultXaiTranscriberRateLimited, + "call.in-progress.error-vapifault-xai-transcriber-rate-limited" + }, + { + ServerMessageEndOfCallReportEndedReason.CallInProgressErrorVapifaultXaiTranscriberInvalidConfig, + "call.in-progress.error-vapifault-xai-transcriber-invalid-config" + }, + { + ServerMessageEndOfCallReportEndedReason.CallInProgressErrorVapifaultXaiTranscriberServerError, + "call.in-progress.error-vapifault-xai-transcriber-server-error" + }, + { + ServerMessageEndOfCallReportEndedReason.CallInProgressErrorVapifaultXaiTranscriberFailed, + "call.in-progress.error-vapifault-xai-transcriber-failed" + }, + { + ServerMessageEndOfCallReportEndedReason.PipelineErrorCartesiaTranscriberFailed, + "pipeline-error-cartesia-transcriber-failed" + }, + { + ServerMessageEndOfCallReportEndedReason.CallInProgressErrorVapifaultCartesiaTranscriberFailed, + "call.in-progress.error-vapifault-cartesia-transcriber-failed" + }, { ServerMessageEndOfCallReportEndedReason.CallInProgressErrorPipelineNoAvailableLlmModel, "call.in-progress.error-pipeline-no-available-llm-model" @@ -6295,6 +6555,10 @@ internal class ServerMessageEndOfCallReportEndedReasonSerializer ServerMessageEndOfCallReportEndedReason.CallForwardingOperatorBusy, "call.forwarding.operator-busy" }, + { + ServerMessageEndOfCallReportEndedReason.CallForwardingNoAnswer, + "call.forwarding.no-answer" + }, { ServerMessageEndOfCallReportEndedReason.SilenceTimedOut, "silence-timed-out" }, { ServerMessageEndOfCallReportEndedReason.CallInProgressErrorProviderfaultOutboundSip403Forbidden, diff --git a/src/Vapi.Net/Types/ServerMessageHandoffDestinationRequest.cs b/src/Vapi.Net/Types/ServerMessageHandoffDestinationRequest.cs index 132af537..c3d475cc 100644 --- a/src/Vapi.Net/Types/ServerMessageHandoffDestinationRequest.cs +++ b/src/Vapi.Net/Types/ServerMessageHandoffDestinationRequest.cs @@ -17,6 +17,15 @@ public record ServerMessageHandoffDestinationRequest : IJsonOnDeserialized [JsonPropertyName("phoneNumber")] public object? PhoneNumber { get; set; } + /// + /// This is the version label (e.g. `v3`) of the assistant the call was + /// configured with. `null` for inline assistants, squad/workflow calls, + /// pre-resolution assistant-request messages, and orgs not on + /// assistant versioning. + /// + [JsonPropertyName("assistantVersion")] + public string? AssistantVersion { get; set; } + /// /// This is the type of the message. "handoff-destination-request" is sent when the model is requesting handoff but destination is unknown. /// diff --git a/src/Vapi.Net/Types/ServerMessageHang.cs b/src/Vapi.Net/Types/ServerMessageHang.cs index 15140c0d..bb01f9e0 100644 --- a/src/Vapi.Net/Types/ServerMessageHang.cs +++ b/src/Vapi.Net/Types/ServerMessageHang.cs @@ -17,6 +17,15 @@ public record ServerMessageHang : IJsonOnDeserialized [JsonPropertyName("phoneNumber")] public object? PhoneNumber { get; set; } + /// + /// This is the version label (e.g. `v3`) of the assistant the call was + /// configured with. `null` for inline assistants, squad/workflow calls, + /// pre-resolution assistant-request messages, and orgs not on + /// assistant versioning. + /// + [JsonPropertyName("assistantVersion")] + public string? AssistantVersion { 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 diff --git a/src/Vapi.Net/Types/ServerMessageKnowledgeBaseRequest.cs b/src/Vapi.Net/Types/ServerMessageKnowledgeBaseRequest.cs index ab14837a..a787e334 100644 --- a/src/Vapi.Net/Types/ServerMessageKnowledgeBaseRequest.cs +++ b/src/Vapi.Net/Types/ServerMessageKnowledgeBaseRequest.cs @@ -18,6 +18,15 @@ public record ServerMessageKnowledgeBaseRequest : IJsonOnDeserialized [JsonPropertyName("phoneNumber")] public object? PhoneNumber { get; set; } + /// + /// This is the version label (e.g. `v3`) of the assistant the call was + /// configured with. `null` for inline assistants, squad/workflow calls, + /// pre-resolution assistant-request messages, and orgs not on + /// assistant versioning. + /// + [JsonPropertyName("assistantVersion")] + public string? AssistantVersion { 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`. /// @@ -29,7 +38,7 @@ public record ServerMessageKnowledgeBaseRequest : IJsonOnDeserialized /// [JsonPropertyName("messages")] public IEnumerable< - OneOf + OneOf >? Messages { get; set; } /// diff --git a/src/Vapi.Net/Types/ServerMessageLanguageChangeDetected.cs b/src/Vapi.Net/Types/ServerMessageLanguageChangeDetected.cs index 2ca25957..10f84a6f 100644 --- a/src/Vapi.Net/Types/ServerMessageLanguageChangeDetected.cs +++ b/src/Vapi.Net/Types/ServerMessageLanguageChangeDetected.cs @@ -17,6 +17,15 @@ public record ServerMessageLanguageChangeDetected : IJsonOnDeserialized [JsonPropertyName("phoneNumber")] public object? PhoneNumber { get; set; } + /// + /// This is the version label (e.g. `v3`) of the assistant the call was + /// configured with. `null` for inline assistants, squad/workflow calls, + /// pre-resolution assistant-request messages, and orgs not on + /// assistant versioning. + /// + [JsonPropertyName("assistantVersion")] + public string? AssistantVersion { 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. /// diff --git a/src/Vapi.Net/Types/ServerMessageModelOutput.cs b/src/Vapi.Net/Types/ServerMessageModelOutput.cs index c2850a75..78be73a7 100644 --- a/src/Vapi.Net/Types/ServerMessageModelOutput.cs +++ b/src/Vapi.Net/Types/ServerMessageModelOutput.cs @@ -17,6 +17,15 @@ public record ServerMessageModelOutput : IJsonOnDeserialized [JsonPropertyName("phoneNumber")] public object? PhoneNumber { get; set; } + /// + /// This is the version label (e.g. `v3`) of the assistant the call was + /// configured with. `null` for inline assistants, squad/workflow calls, + /// pre-resolution assistant-request messages, and orgs not on + /// assistant versioning. + /// + [JsonPropertyName("assistantVersion")] + public string? AssistantVersion { get; set; } + /// /// This is the type of the message. "model-output" is sent as the model outputs tokens. /// diff --git a/src/Vapi.Net/Types/ServerMessagePhoneCallControl.cs b/src/Vapi.Net/Types/ServerMessagePhoneCallControl.cs index a3eb2721..7941ce56 100644 --- a/src/Vapi.Net/Types/ServerMessagePhoneCallControl.cs +++ b/src/Vapi.Net/Types/ServerMessagePhoneCallControl.cs @@ -17,6 +17,15 @@ public record ServerMessagePhoneCallControl : IJsonOnDeserialized [JsonPropertyName("phoneNumber")] public object? PhoneNumber { get; set; } + /// + /// This is the version label (e.g. `v3`) of the assistant the call was + /// configured with. `null` for inline assistants, squad/workflow calls, + /// pre-resolution assistant-request messages, and orgs not on + /// assistant versioning. + /// + [JsonPropertyName("assistantVersion")] + public string? AssistantVersion { get; set; } + /// /// This is the type of the message. "phone-call-control" is an advanced type of message. /// diff --git a/src/Vapi.Net/Types/ServerMessageResponse.cs b/src/Vapi.Net/Types/ServerMessageResponse.cs index 63fd708f..01a679c0 100644 --- a/src/Vapi.Net/Types/ServerMessageResponse.cs +++ b/src/Vapi.Net/Types/ServerMessageResponse.cs @@ -25,7 +25,8 @@ public required OneOf< ServerMessageResponseToolCalls, ServerMessageResponseTransferDestinationRequest, ServerMessageResponseVoiceRequest, - ServerMessageResponseCallEndpointingRequest + ServerMessageResponseCallEndpointingRequest, + ServerMessageResponseCampaignPredial > MessageResponse { get; set; } [JsonIgnore] diff --git a/src/Vapi.Net/Types/ServerMessageResponseCampaignPredial.cs b/src/Vapi.Net/Types/ServerMessageResponseCampaignPredial.cs new file mode 100644 index 00000000..e642961d --- /dev/null +++ b/src/Vapi.Net/Types/ServerMessageResponseCampaignPredial.cs @@ -0,0 +1,31 @@ +using global::System.Text.Json; +using global::System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[Serializable] +public record ServerMessageResponseCampaignPredial : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + /// + /// This is whether the contact is eligible to be dialed. `true` places the call; `false` skips the contact. Any other response — a missing or non-boolean `eligible`, an unreachable server, an error, or a timeout — records a pre-dial failure for the contact and the call is not placed. + /// + [JsonPropertyName("eligible")] + public required bool Eligible { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/ServerMessageSessionCreated.cs b/src/Vapi.Net/Types/ServerMessageSessionCreated.cs index 63630aaa..abb6ae44 100644 --- a/src/Vapi.Net/Types/ServerMessageSessionCreated.cs +++ b/src/Vapi.Net/Types/ServerMessageSessionCreated.cs @@ -17,6 +17,15 @@ public record ServerMessageSessionCreated : IJsonOnDeserialized [JsonPropertyName("phoneNumber")] public object? PhoneNumber { get; set; } + /// + /// This is the version label (e.g. `v3`) of the assistant the call was + /// configured with. `null` for inline assistants, squad/workflow calls, + /// pre-resolution assistant-request messages, and orgs not on + /// assistant versioning. + /// + [JsonPropertyName("assistantVersion")] + public string? AssistantVersion { get; set; } + /// /// This is the type of the message. "session.created" is sent when a new session is created. /// diff --git a/src/Vapi.Net/Types/ServerMessageSessionDeleted.cs b/src/Vapi.Net/Types/ServerMessageSessionDeleted.cs index 244bc617..9a79c1fe 100644 --- a/src/Vapi.Net/Types/ServerMessageSessionDeleted.cs +++ b/src/Vapi.Net/Types/ServerMessageSessionDeleted.cs @@ -17,6 +17,15 @@ public record ServerMessageSessionDeleted : IJsonOnDeserialized [JsonPropertyName("phoneNumber")] public object? PhoneNumber { get; set; } + /// + /// This is the version label (e.g. `v3`) of the assistant the call was + /// configured with. `null` for inline assistants, squad/workflow calls, + /// pre-resolution assistant-request messages, and orgs not on + /// assistant versioning. + /// + [JsonPropertyName("assistantVersion")] + public string? AssistantVersion { get; set; } + /// /// This is the type of the message. "session.deleted" is sent when a session is deleted. /// diff --git a/src/Vapi.Net/Types/ServerMessageSessionUpdated.cs b/src/Vapi.Net/Types/ServerMessageSessionUpdated.cs index 299a1211..57483fdf 100644 --- a/src/Vapi.Net/Types/ServerMessageSessionUpdated.cs +++ b/src/Vapi.Net/Types/ServerMessageSessionUpdated.cs @@ -17,6 +17,15 @@ public record ServerMessageSessionUpdated : IJsonOnDeserialized [JsonPropertyName("phoneNumber")] public object? PhoneNumber { get; set; } + /// + /// This is the version label (e.g. `v3`) of the assistant the call was + /// configured with. `null` for inline assistants, squad/workflow calls, + /// pre-resolution assistant-request messages, and orgs not on + /// assistant versioning. + /// + [JsonPropertyName("assistantVersion")] + public string? AssistantVersion { get; set; } + /// /// This is the type of the message. "session.updated" is sent when a session is updated. /// diff --git a/src/Vapi.Net/Types/ServerMessageSpeechUpdate.cs b/src/Vapi.Net/Types/ServerMessageSpeechUpdate.cs index b63c6497..8f5974c2 100644 --- a/src/Vapi.Net/Types/ServerMessageSpeechUpdate.cs +++ b/src/Vapi.Net/Types/ServerMessageSpeechUpdate.cs @@ -17,6 +17,15 @@ public record ServerMessageSpeechUpdate : IJsonOnDeserialized [JsonPropertyName("phoneNumber")] public object? PhoneNumber { get; set; } + /// + /// This is the version label (e.g. `v3`) of the assistant the call was + /// configured with. `null` for inline assistants, squad/workflow calls, + /// pre-resolution assistant-request messages, and orgs not on + /// assistant versioning. + /// + [JsonPropertyName("assistantVersion")] + public string? AssistantVersion { get; set; } + /// /// This is the type of the message. "speech-update" is sent whenever assistant or user start or stop speaking. /// diff --git a/src/Vapi.Net/Types/ServerMessageStatusUpdate.cs b/src/Vapi.Net/Types/ServerMessageStatusUpdate.cs index 9c78b997..26101fb5 100644 --- a/src/Vapi.Net/Types/ServerMessageStatusUpdate.cs +++ b/src/Vapi.Net/Types/ServerMessageStatusUpdate.cs @@ -18,6 +18,15 @@ public record ServerMessageStatusUpdate : IJsonOnDeserialized [JsonPropertyName("phoneNumber")] public object? PhoneNumber { get; set; } + /// + /// This is the version label (e.g. `v3`) of the assistant the call was + /// configured with. `null` for inline assistants, squad/workflow calls, + /// pre-resolution assistant-request messages, and orgs not on + /// assistant versioning. + /// + [JsonPropertyName("assistantVersion")] + public string? AssistantVersion { get; set; } + /// /// This is the type of the message. "status-update" is sent whenever the `call.status` changes. /// @@ -41,7 +50,7 @@ public record ServerMessageStatusUpdate : IJsonOnDeserialized /// [JsonPropertyName("messages")] public IEnumerable< - OneOf + OneOf >? Messages { get; set; } /// diff --git a/src/Vapi.Net/Types/ServerMessageStatusUpdateEndedReason.cs b/src/Vapi.Net/Types/ServerMessageStatusUpdateEndedReason.cs index 6c18f614..521d3684 100644 --- a/src/Vapi.Net/Types/ServerMessageStatusUpdateEndedReason.cs +++ b/src/Vapi.Net/Types/ServerMessageStatusUpdateEndedReason.cs @@ -78,6 +78,9 @@ public enum ServerMessageStatusUpdateEndedReason [EnumMember(Value = "call.start.error-enterprise-feature-not-available-recording-consent")] CallStartErrorEnterpriseFeatureNotAvailableRecordingConsent, + [EnumMember(Value = "call.start.assistant-version-error-validation")] + CallStartAssistantVersionErrorValidation, + [EnumMember(Value = "assistant-not-valid")] AssistantNotValid, @@ -135,6 +138,15 @@ public enum ServerMessageStatusUpdateEndedReason [EnumMember(Value = "pipeline-error-wellsaid-voice-failed")] PipelineErrorWellsaidVoiceFailed, + [EnumMember(Value = "pipeline-error-xai-voice-failed")] + PipelineErrorXaiVoiceFailed, + + [EnumMember(Value = "pipeline-error-microsoft-voice-failed")] + PipelineErrorMicrosoftVoiceFailed, + + [EnumMember(Value = "pipeline-error-microsoft-voice-request-canceled")] + PipelineErrorMicrosoftVoiceRequestCanceled, + [EnumMember(Value = "pipeline-error-tavus-video-failed")] PipelineErrorTavusVideoFailed, @@ -186,6 +198,12 @@ public enum ServerMessageStatusUpdateEndedReason [EnumMember(Value = "call.in-progress.error-vapifault-wellsaid-voice-failed")] CallInProgressErrorVapifaultWellsaidVoiceFailed, + [EnumMember(Value = "call.in-progress.error-vapifault-xai-voice-failed")] + CallInProgressErrorVapifaultXaiVoiceFailed, + + [EnumMember(Value = "call.in-progress.error-vapifault-microsoft-voice-failed")] + CallInProgressErrorVapifaultMicrosoftVoiceFailed, + [EnumMember(Value = "call.in-progress.error-vapifault-tavus-video-failed")] CallInProgressErrorVapifaultTavusVideoFailed, @@ -213,6 +231,9 @@ public enum ServerMessageStatusUpdateEndedReason [EnumMember(Value = "call.in-progress.error-providerfault-vapi-llm-failed")] CallInProgressErrorProviderfaultVapiLlmFailed, + [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, @@ -231,6 +252,18 @@ public enum ServerMessageStatusUpdateEndedReason [EnumMember(Value = "call.in-progress.error-providerfault-vapi-503-server-overloaded-error")] CallInProgressErrorProviderfaultVapi503ServerOverloadedError, + [EnumMember(Value = "pipeline-error-vapi-transcriber-failed")] + PipelineErrorVapiTranscriberFailed, + + [EnumMember(Value = "call.in-progress.error-vapifault-vapi-transcriber-failed")] + CallInProgressErrorVapifaultVapiTranscriberFailed, + + [EnumMember(Value = "call.in-progress.error-providerfault-vapi-transcriber-failed")] + CallInProgressErrorProviderfaultVapiTranscriberFailed, + + [EnumMember(Value = "call.in-progress.error-providerfault-vapi-voice-failed")] + CallInProgressErrorProviderfaultVapiVoiceFailed, + [EnumMember(Value = "pipeline-error-deepgram-transcriber-failed")] PipelineErrorDeepgramTranscriberFailed, @@ -358,6 +391,42 @@ public enum ServerMessageStatusUpdateEndedReason [EnumMember(Value = "call.in-progress.error-vapifault-soniox-transcriber-failed")] CallInProgressErrorVapifaultSonioxTranscriberFailed, + [EnumMember(Value = "pipeline-error-xai-transcriber-auth-failed")] + PipelineErrorXaiTranscriberAuthFailed, + + [EnumMember(Value = "pipeline-error-xai-transcriber-rate-limited")] + PipelineErrorXaiTranscriberRateLimited, + + [EnumMember(Value = "pipeline-error-xai-transcriber-invalid-config")] + PipelineErrorXaiTranscriberInvalidConfig, + + [EnumMember(Value = "pipeline-error-xai-transcriber-server-error")] + PipelineErrorXaiTranscriberServerError, + + [EnumMember(Value = "pipeline-error-xai-transcriber-failed")] + PipelineErrorXaiTranscriberFailed, + + [EnumMember(Value = "call.in-progress.error-vapifault-xai-transcriber-auth-failed")] + CallInProgressErrorVapifaultXaiTranscriberAuthFailed, + + [EnumMember(Value = "call.in-progress.error-vapifault-xai-transcriber-rate-limited")] + CallInProgressErrorVapifaultXaiTranscriberRateLimited, + + [EnumMember(Value = "call.in-progress.error-vapifault-xai-transcriber-invalid-config")] + CallInProgressErrorVapifaultXaiTranscriberInvalidConfig, + + [EnumMember(Value = "call.in-progress.error-vapifault-xai-transcriber-server-error")] + CallInProgressErrorVapifaultXaiTranscriberServerError, + + [EnumMember(Value = "call.in-progress.error-vapifault-xai-transcriber-failed")] + CallInProgressErrorVapifaultXaiTranscriberFailed, + + [EnumMember(Value = "pipeline-error-cartesia-transcriber-failed")] + PipelineErrorCartesiaTranscriberFailed, + + [EnumMember(Value = "call.in-progress.error-vapifault-cartesia-transcriber-failed")] + CallInProgressErrorVapifaultCartesiaTranscriberFailed, + [EnumMember(Value = "call.in-progress.error-pipeline-no-available-llm-model")] CallInProgressErrorPipelineNoAvailableLlmModel, @@ -1806,6 +1875,9 @@ public enum ServerMessageStatusUpdateEndedReason [EnumMember(Value = "call.forwarding.operator-busy")] CallForwardingOperatorBusy, + [EnumMember(Value = "call.forwarding.no-answer")] + CallForwardingNoAnswer, + [EnumMember(Value = "silence-timed-out")] SilenceTimedOut, @@ -1954,6 +2026,10 @@ internal class ServerMessageStatusUpdateEndedReasonSerializer "call.start.error-enterprise-feature-not-available-recording-consent", ServerMessageStatusUpdateEndedReason.CallStartErrorEnterpriseFeatureNotAvailableRecordingConsent }, + { + "call.start.assistant-version-error-validation", + ServerMessageStatusUpdateEndedReason.CallStartAssistantVersionErrorValidation + }, { "assistant-not-valid", ServerMessageStatusUpdateEndedReason.AssistantNotValid }, { "call.start.error-vapifault-database-error", @@ -2024,6 +2100,18 @@ internal class ServerMessageStatusUpdateEndedReasonSerializer "pipeline-error-wellsaid-voice-failed", ServerMessageStatusUpdateEndedReason.PipelineErrorWellsaidVoiceFailed }, + { + "pipeline-error-xai-voice-failed", + ServerMessageStatusUpdateEndedReason.PipelineErrorXaiVoiceFailed + }, + { + "pipeline-error-microsoft-voice-failed", + ServerMessageStatusUpdateEndedReason.PipelineErrorMicrosoftVoiceFailed + }, + { + "pipeline-error-microsoft-voice-request-canceled", + ServerMessageStatusUpdateEndedReason.PipelineErrorMicrosoftVoiceRequestCanceled + }, { "pipeline-error-tavus-video-failed", ServerMessageStatusUpdateEndedReason.PipelineErrorTavusVideoFailed @@ -2092,6 +2180,14 @@ internal class ServerMessageStatusUpdateEndedReasonSerializer "call.in-progress.error-vapifault-wellsaid-voice-failed", ServerMessageStatusUpdateEndedReason.CallInProgressErrorVapifaultWellsaidVoiceFailed }, + { + "call.in-progress.error-vapifault-xai-voice-failed", + ServerMessageStatusUpdateEndedReason.CallInProgressErrorVapifaultXaiVoiceFailed + }, + { + "call.in-progress.error-vapifault-microsoft-voice-failed", + ServerMessageStatusUpdateEndedReason.CallInProgressErrorVapifaultMicrosoftVoiceFailed + }, { "call.in-progress.error-vapifault-tavus-video-failed", ServerMessageStatusUpdateEndedReason.CallInProgressErrorVapifaultTavusVideoFailed @@ -2128,6 +2224,10 @@ internal class ServerMessageStatusUpdateEndedReasonSerializer "call.in-progress.error-providerfault-vapi-llm-failed", ServerMessageStatusUpdateEndedReason.CallInProgressErrorProviderfaultVapiLlmFailed }, + { + "call.in-progress.error-vapifault-vapi-llm-failed", + ServerMessageStatusUpdateEndedReason.CallInProgressErrorVapifaultVapiLlmFailed + }, { "call.in-progress.error-vapifault-vapi-400-bad-request-validation-failed", ServerMessageStatusUpdateEndedReason.CallInProgressErrorVapifaultVapi400BadRequestValidationFailed @@ -2152,6 +2252,22 @@ internal class ServerMessageStatusUpdateEndedReasonSerializer "call.in-progress.error-providerfault-vapi-503-server-overloaded-error", ServerMessageStatusUpdateEndedReason.CallInProgressErrorProviderfaultVapi503ServerOverloadedError }, + { + "pipeline-error-vapi-transcriber-failed", + ServerMessageStatusUpdateEndedReason.PipelineErrorVapiTranscriberFailed + }, + { + "call.in-progress.error-vapifault-vapi-transcriber-failed", + ServerMessageStatusUpdateEndedReason.CallInProgressErrorVapifaultVapiTranscriberFailed + }, + { + "call.in-progress.error-providerfault-vapi-transcriber-failed", + ServerMessageStatusUpdateEndedReason.CallInProgressErrorProviderfaultVapiTranscriberFailed + }, + { + "call.in-progress.error-providerfault-vapi-voice-failed", + ServerMessageStatusUpdateEndedReason.CallInProgressErrorProviderfaultVapiVoiceFailed + }, { "pipeline-error-deepgram-transcriber-failed", ServerMessageStatusUpdateEndedReason.PipelineErrorDeepgramTranscriberFailed @@ -2308,6 +2424,54 @@ internal class ServerMessageStatusUpdateEndedReasonSerializer "call.in-progress.error-vapifault-soniox-transcriber-failed", ServerMessageStatusUpdateEndedReason.CallInProgressErrorVapifaultSonioxTranscriberFailed }, + { + "pipeline-error-xai-transcriber-auth-failed", + ServerMessageStatusUpdateEndedReason.PipelineErrorXaiTranscriberAuthFailed + }, + { + "pipeline-error-xai-transcriber-rate-limited", + ServerMessageStatusUpdateEndedReason.PipelineErrorXaiTranscriberRateLimited + }, + { + "pipeline-error-xai-transcriber-invalid-config", + ServerMessageStatusUpdateEndedReason.PipelineErrorXaiTranscriberInvalidConfig + }, + { + "pipeline-error-xai-transcriber-server-error", + ServerMessageStatusUpdateEndedReason.PipelineErrorXaiTranscriberServerError + }, + { + "pipeline-error-xai-transcriber-failed", + ServerMessageStatusUpdateEndedReason.PipelineErrorXaiTranscriberFailed + }, + { + "call.in-progress.error-vapifault-xai-transcriber-auth-failed", + ServerMessageStatusUpdateEndedReason.CallInProgressErrorVapifaultXaiTranscriberAuthFailed + }, + { + "call.in-progress.error-vapifault-xai-transcriber-rate-limited", + ServerMessageStatusUpdateEndedReason.CallInProgressErrorVapifaultXaiTranscriberRateLimited + }, + { + "call.in-progress.error-vapifault-xai-transcriber-invalid-config", + ServerMessageStatusUpdateEndedReason.CallInProgressErrorVapifaultXaiTranscriberInvalidConfig + }, + { + "call.in-progress.error-vapifault-xai-transcriber-server-error", + ServerMessageStatusUpdateEndedReason.CallInProgressErrorVapifaultXaiTranscriberServerError + }, + { + "call.in-progress.error-vapifault-xai-transcriber-failed", + ServerMessageStatusUpdateEndedReason.CallInProgressErrorVapifaultXaiTranscriberFailed + }, + { + "pipeline-error-cartesia-transcriber-failed", + ServerMessageStatusUpdateEndedReason.PipelineErrorCartesiaTranscriberFailed + }, + { + "call.in-progress.error-vapifault-cartesia-transcriber-failed", + ServerMessageStatusUpdateEndedReason.CallInProgressErrorVapifaultCartesiaTranscriberFailed + }, { "call.in-progress.error-pipeline-no-available-llm-model", ServerMessageStatusUpdateEndedReason.CallInProgressErrorPipelineNoAvailableLlmModel @@ -4043,6 +4207,10 @@ internal class ServerMessageStatusUpdateEndedReasonSerializer "call.forwarding.operator-busy", ServerMessageStatusUpdateEndedReason.CallForwardingOperatorBusy }, + { + "call.forwarding.no-answer", + ServerMessageStatusUpdateEndedReason.CallForwardingNoAnswer + }, { "silence-timed-out", ServerMessageStatusUpdateEndedReason.SilenceTimedOut }, { "call.in-progress.error-providerfault-outbound-sip-403-forbidden", @@ -4188,6 +4356,10 @@ internal class ServerMessageStatusUpdateEndedReasonSerializer ServerMessageStatusUpdateEndedReason.CallStartErrorEnterpriseFeatureNotAvailableRecordingConsent, "call.start.error-enterprise-feature-not-available-recording-consent" }, + { + ServerMessageStatusUpdateEndedReason.CallStartAssistantVersionErrorValidation, + "call.start.assistant-version-error-validation" + }, { ServerMessageStatusUpdateEndedReason.AssistantNotValid, "assistant-not-valid" }, { ServerMessageStatusUpdateEndedReason.CallStartErrorVapifaultDatabaseError, @@ -4258,6 +4430,18 @@ internal class ServerMessageStatusUpdateEndedReasonSerializer ServerMessageStatusUpdateEndedReason.PipelineErrorWellsaidVoiceFailed, "pipeline-error-wellsaid-voice-failed" }, + { + ServerMessageStatusUpdateEndedReason.PipelineErrorXaiVoiceFailed, + "pipeline-error-xai-voice-failed" + }, + { + ServerMessageStatusUpdateEndedReason.PipelineErrorMicrosoftVoiceFailed, + "pipeline-error-microsoft-voice-failed" + }, + { + ServerMessageStatusUpdateEndedReason.PipelineErrorMicrosoftVoiceRequestCanceled, + "pipeline-error-microsoft-voice-request-canceled" + }, { ServerMessageStatusUpdateEndedReason.PipelineErrorTavusVideoFailed, "pipeline-error-tavus-video-failed" @@ -4326,6 +4510,14 @@ internal class ServerMessageStatusUpdateEndedReasonSerializer ServerMessageStatusUpdateEndedReason.CallInProgressErrorVapifaultWellsaidVoiceFailed, "call.in-progress.error-vapifault-wellsaid-voice-failed" }, + { + ServerMessageStatusUpdateEndedReason.CallInProgressErrorVapifaultXaiVoiceFailed, + "call.in-progress.error-vapifault-xai-voice-failed" + }, + { + ServerMessageStatusUpdateEndedReason.CallInProgressErrorVapifaultMicrosoftVoiceFailed, + "call.in-progress.error-vapifault-microsoft-voice-failed" + }, { ServerMessageStatusUpdateEndedReason.CallInProgressErrorVapifaultTavusVideoFailed, "call.in-progress.error-vapifault-tavus-video-failed" @@ -4362,6 +4554,10 @@ internal class ServerMessageStatusUpdateEndedReasonSerializer ServerMessageStatusUpdateEndedReason.CallInProgressErrorProviderfaultVapiLlmFailed, "call.in-progress.error-providerfault-vapi-llm-failed" }, + { + ServerMessageStatusUpdateEndedReason.CallInProgressErrorVapifaultVapiLlmFailed, + "call.in-progress.error-vapifault-vapi-llm-failed" + }, { ServerMessageStatusUpdateEndedReason.CallInProgressErrorVapifaultVapi400BadRequestValidationFailed, "call.in-progress.error-vapifault-vapi-400-bad-request-validation-failed" @@ -4386,6 +4582,22 @@ internal class ServerMessageStatusUpdateEndedReasonSerializer ServerMessageStatusUpdateEndedReason.CallInProgressErrorProviderfaultVapi503ServerOverloadedError, "call.in-progress.error-providerfault-vapi-503-server-overloaded-error" }, + { + ServerMessageStatusUpdateEndedReason.PipelineErrorVapiTranscriberFailed, + "pipeline-error-vapi-transcriber-failed" + }, + { + ServerMessageStatusUpdateEndedReason.CallInProgressErrorVapifaultVapiTranscriberFailed, + "call.in-progress.error-vapifault-vapi-transcriber-failed" + }, + { + ServerMessageStatusUpdateEndedReason.CallInProgressErrorProviderfaultVapiTranscriberFailed, + "call.in-progress.error-providerfault-vapi-transcriber-failed" + }, + { + ServerMessageStatusUpdateEndedReason.CallInProgressErrorProviderfaultVapiVoiceFailed, + "call.in-progress.error-providerfault-vapi-voice-failed" + }, { ServerMessageStatusUpdateEndedReason.PipelineErrorDeepgramTranscriberFailed, "pipeline-error-deepgram-transcriber-failed" @@ -4542,6 +4754,54 @@ internal class ServerMessageStatusUpdateEndedReasonSerializer ServerMessageStatusUpdateEndedReason.CallInProgressErrorVapifaultSonioxTranscriberFailed, "call.in-progress.error-vapifault-soniox-transcriber-failed" }, + { + ServerMessageStatusUpdateEndedReason.PipelineErrorXaiTranscriberAuthFailed, + "pipeline-error-xai-transcriber-auth-failed" + }, + { + ServerMessageStatusUpdateEndedReason.PipelineErrorXaiTranscriberRateLimited, + "pipeline-error-xai-transcriber-rate-limited" + }, + { + ServerMessageStatusUpdateEndedReason.PipelineErrorXaiTranscriberInvalidConfig, + "pipeline-error-xai-transcriber-invalid-config" + }, + { + ServerMessageStatusUpdateEndedReason.PipelineErrorXaiTranscriberServerError, + "pipeline-error-xai-transcriber-server-error" + }, + { + ServerMessageStatusUpdateEndedReason.PipelineErrorXaiTranscriberFailed, + "pipeline-error-xai-transcriber-failed" + }, + { + ServerMessageStatusUpdateEndedReason.CallInProgressErrorVapifaultXaiTranscriberAuthFailed, + "call.in-progress.error-vapifault-xai-transcriber-auth-failed" + }, + { + ServerMessageStatusUpdateEndedReason.CallInProgressErrorVapifaultXaiTranscriberRateLimited, + "call.in-progress.error-vapifault-xai-transcriber-rate-limited" + }, + { + ServerMessageStatusUpdateEndedReason.CallInProgressErrorVapifaultXaiTranscriberInvalidConfig, + "call.in-progress.error-vapifault-xai-transcriber-invalid-config" + }, + { + ServerMessageStatusUpdateEndedReason.CallInProgressErrorVapifaultXaiTranscriberServerError, + "call.in-progress.error-vapifault-xai-transcriber-server-error" + }, + { + ServerMessageStatusUpdateEndedReason.CallInProgressErrorVapifaultXaiTranscriberFailed, + "call.in-progress.error-vapifault-xai-transcriber-failed" + }, + { + ServerMessageStatusUpdateEndedReason.PipelineErrorCartesiaTranscriberFailed, + "pipeline-error-cartesia-transcriber-failed" + }, + { + ServerMessageStatusUpdateEndedReason.CallInProgressErrorVapifaultCartesiaTranscriberFailed, + "call.in-progress.error-vapifault-cartesia-transcriber-failed" + }, { ServerMessageStatusUpdateEndedReason.CallInProgressErrorPipelineNoAvailableLlmModel, "call.in-progress.error-pipeline-no-available-llm-model" @@ -6277,6 +6537,10 @@ internal class ServerMessageStatusUpdateEndedReasonSerializer ServerMessageStatusUpdateEndedReason.CallForwardingOperatorBusy, "call.forwarding.operator-busy" }, + { + ServerMessageStatusUpdateEndedReason.CallForwardingNoAnswer, + "call.forwarding.no-answer" + }, { ServerMessageStatusUpdateEndedReason.SilenceTimedOut, "silence-timed-out" }, { ServerMessageStatusUpdateEndedReason.CallInProgressErrorProviderfaultOutboundSip403Forbidden, diff --git a/src/Vapi.Net/Types/ServerMessageToolCalls.cs b/src/Vapi.Net/Types/ServerMessageToolCalls.cs index 63a28eea..fe3c4a29 100644 --- a/src/Vapi.Net/Types/ServerMessageToolCalls.cs +++ b/src/Vapi.Net/Types/ServerMessageToolCalls.cs @@ -17,6 +17,15 @@ public record ServerMessageToolCalls : IJsonOnDeserialized [JsonPropertyName("phoneNumber")] public object? PhoneNumber { get; set; } + /// + /// This is the version label (e.g. `v3`) of the assistant the call was + /// configured with. `null` for inline assistants, squad/workflow calls, + /// pre-resolution assistant-request messages, and orgs not on + /// assistant versioning. + /// + [JsonPropertyName("assistantVersion")] + public string? AssistantVersion { get; set; } + /// /// This is the type of the message. "tool-calls" is sent to call a tool. /// diff --git a/src/Vapi.Net/Types/ServerMessageTranscript.cs b/src/Vapi.Net/Types/ServerMessageTranscript.cs index f23575f4..999d27c9 100644 --- a/src/Vapi.Net/Types/ServerMessageTranscript.cs +++ b/src/Vapi.Net/Types/ServerMessageTranscript.cs @@ -17,6 +17,15 @@ public record ServerMessageTranscript : IJsonOnDeserialized [JsonPropertyName("phoneNumber")] public object? PhoneNumber { get; set; } + /// + /// This is the version label (e.g. `v3`) of the assistant the call was + /// configured with. `null` for inline assistants, squad/workflow calls, + /// pre-resolution assistant-request messages, and orgs not on + /// assistant versioning. + /// + [JsonPropertyName("assistantVersion")] + public string? AssistantVersion { get; set; } + /// /// This is the type of the message. "transcript" is sent as transcriber outputs partial or final transcript. /// diff --git a/src/Vapi.Net/Types/ServerMessageTransferDestinationRequest.cs b/src/Vapi.Net/Types/ServerMessageTransferDestinationRequest.cs index 25598e3d..b5c559cb 100644 --- a/src/Vapi.Net/Types/ServerMessageTransferDestinationRequest.cs +++ b/src/Vapi.Net/Types/ServerMessageTransferDestinationRequest.cs @@ -17,6 +17,15 @@ public record ServerMessageTransferDestinationRequest : IJsonOnDeserialized [JsonPropertyName("phoneNumber")] public object? PhoneNumber { get; set; } + /// + /// This is the version label (e.g. `v3`) of the assistant the call was + /// configured with. `null` for inline assistants, squad/workflow calls, + /// pre-resolution assistant-request messages, and orgs not on + /// assistant versioning. + /// + [JsonPropertyName("assistantVersion")] + public string? AssistantVersion { get; set; } + /// /// This is the type of the message. "transfer-destination-request" is sent when the model is requesting transfer but destination is unknown. /// diff --git a/src/Vapi.Net/Types/ServerMessageTransferUpdate.cs b/src/Vapi.Net/Types/ServerMessageTransferUpdate.cs index 9eeee043..9a4a9dbc 100644 --- a/src/Vapi.Net/Types/ServerMessageTransferUpdate.cs +++ b/src/Vapi.Net/Types/ServerMessageTransferUpdate.cs @@ -17,6 +17,15 @@ public record ServerMessageTransferUpdate : IJsonOnDeserialized [JsonPropertyName("phoneNumber")] public object? PhoneNumber { get; set; } + /// + /// This is the version label (e.g. `v3`) of the assistant the call was + /// configured with. `null` for inline assistants, squad/workflow calls, + /// pre-resolution assistant-request messages, and orgs not on + /// assistant versioning. + /// + [JsonPropertyName("assistantVersion")] + public string? AssistantVersion { get; set; } + /// /// This is the type of the message. "transfer-update" is sent whenever a transfer happens. /// diff --git a/src/Vapi.Net/Types/ServerMessageUserInterrupted.cs b/src/Vapi.Net/Types/ServerMessageUserInterrupted.cs index 8058a48b..9ef95709 100644 --- a/src/Vapi.Net/Types/ServerMessageUserInterrupted.cs +++ b/src/Vapi.Net/Types/ServerMessageUserInterrupted.cs @@ -17,6 +17,15 @@ public record ServerMessageUserInterrupted : IJsonOnDeserialized [JsonPropertyName("phoneNumber")] public object? PhoneNumber { get; set; } + /// + /// This is the version label (e.g. `v3`) of the assistant the call was + /// configured with. `null` for inline assistants, squad/workflow calls, + /// pre-resolution assistant-request messages, and orgs not on + /// assistant versioning. + /// + [JsonPropertyName("assistantVersion")] + public string? AssistantVersion { get; set; } + /// /// This is the type of the message. "user-interrupted" is sent when the user interrupts the assistant. /// diff --git a/src/Vapi.Net/Types/ServerMessageVoiceInput.cs b/src/Vapi.Net/Types/ServerMessageVoiceInput.cs index dfd422dc..44612682 100644 --- a/src/Vapi.Net/Types/ServerMessageVoiceInput.cs +++ b/src/Vapi.Net/Types/ServerMessageVoiceInput.cs @@ -17,6 +17,15 @@ public record ServerMessageVoiceInput : IJsonOnDeserialized [JsonPropertyName("phoneNumber")] public object? PhoneNumber { get; set; } + /// + /// This is the version label (e.g. `v3`) of the assistant the call was + /// configured with. `null` for inline assistants, squad/workflow calls, + /// pre-resolution assistant-request messages, and orgs not on + /// assistant versioning. + /// + [JsonPropertyName("assistantVersion")] + public string? AssistantVersion { get; set; } + /// /// This is the type of the message. "voice-input" is sent when a generation is requested from voice provider. /// diff --git a/src/Vapi.Net/Types/ServerMessageVoiceRequest.cs b/src/Vapi.Net/Types/ServerMessageVoiceRequest.cs index 2715ee8a..d302e1ad 100644 --- a/src/Vapi.Net/Types/ServerMessageVoiceRequest.cs +++ b/src/Vapi.Net/Types/ServerMessageVoiceRequest.cs @@ -17,6 +17,15 @@ public record ServerMessageVoiceRequest : IJsonOnDeserialized [JsonPropertyName("phoneNumber")] public object? PhoneNumber { get; set; } + /// + /// This is the version label (e.g. `v3`) of the assistant the call was + /// configured with. `null` for inline assistants, squad/workflow calls, + /// pre-resolution assistant-request messages, and orgs not on + /// assistant versioning. + /// + [JsonPropertyName("assistantVersion")] + public string? AssistantVersion { get; set; } + /// /// This is the type of the message. "voice-request" is sent when using `assistant.voice={ "type": "custom-voice" }`. /// diff --git a/src/Vapi.Net/Types/SesameVoice.cs b/src/Vapi.Net/Types/SesameVoice.cs index 3df8c1f6..844046c6 100644 --- a/src/Vapi.Net/Types/SesameVoice.cs +++ b/src/Vapi.Net/Types/SesameVoice.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Configuration for synthesizing assistant speech with Sesame, including voice and model selection, chunking, caching, and fallback settings. +/// [Serializable] public record SesameVoice : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/SimulationSuite.cs b/src/Vapi.Net/Types/SimulationSuite.cs index 4a724d92..6878ca1d 100644 --- a/src/Vapi.Net/Types/SimulationSuite.cs +++ b/src/Vapi.Net/Types/SimulationSuite.cs @@ -61,6 +61,13 @@ public record SimulationSuite : IJsonOnDeserialized [JsonPropertyName("simulationIds")] public IEnumerable SimulationIds { get; set; } = new List(); + /// + /// This is the ordered list of assistant or squad assignments for the suite. + /// + [JsonPropertyName("targetAssignments")] + public IEnumerable TargetAssignments { get; set; } = + new List(); + [JsonIgnore] public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); diff --git a/src/Vapi.Net/Types/SimulationSuiteTargetAssignment.cs b/src/Vapi.Net/Types/SimulationSuiteTargetAssignment.cs new file mode 100644 index 00000000..15e8d4d5 --- /dev/null +++ b/src/Vapi.Net/Types/SimulationSuiteTargetAssignment.cs @@ -0,0 +1,37 @@ +using global::System.Text.Json; +using global::System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[Serializable] +public record SimulationSuiteTargetAssignment : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + /// + /// This is the type of target assigned to the simulation suite. + /// + [JsonPropertyName("targetType")] + public required SimulationSuiteTargetAssignmentTargetType TargetType { get; set; } + + /// + /// This is the unique identifier of the assigned assistant or squad. + /// + [JsonPropertyName("targetId")] + public required string TargetId { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/SimulationSuiteTargetAssignmentTargetType.cs b/src/Vapi.Net/Types/SimulationSuiteTargetAssignmentTargetType.cs new file mode 100644 index 00000000..bdfcccc9 --- /dev/null +++ b/src/Vapi.Net/Types/SimulationSuiteTargetAssignmentTargetType.cs @@ -0,0 +1,84 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(SimulationSuiteTargetAssignmentTargetTypeSerializer))] +public enum SimulationSuiteTargetAssignmentTargetType +{ + [EnumMember(Value = "assistant")] + Assistant, + + [EnumMember(Value = "squad")] + Squad, +} + +internal class SimulationSuiteTargetAssignmentTargetTypeSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + SimulationSuiteTargetAssignmentTargetType + > _stringToEnum = new() + { + { "assistant", SimulationSuiteTargetAssignmentTargetType.Assistant }, + { "squad", SimulationSuiteTargetAssignmentTargetType.Squad }, + }; + + private static readonly global::System.Collections.Generic.Dictionary< + SimulationSuiteTargetAssignmentTargetType, + string + > _enumToString = new() + { + { SimulationSuiteTargetAssignmentTargetType.Assistant, "assistant" }, + { SimulationSuiteTargetAssignmentTargetType.Squad, "squad" }, + }; + + public override SimulationSuiteTargetAssignmentTargetType Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + SimulationSuiteTargetAssignmentTargetType value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override SimulationSuiteTargetAssignmentTargetType ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + SimulationSuiteTargetAssignmentTargetType value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/SipAuthentication.cs b/src/Vapi.Net/Types/SipAuthentication.cs index 11e3e043..4eb5b63b 100644 --- a/src/Vapi.Net/Types/SipAuthentication.cs +++ b/src/Vapi.Net/Types/SipAuthentication.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Realm, username, and password used to authenticate SIP requests. +/// [Serializable] public record SipAuthentication : IJsonOnDeserialized { @@ -12,7 +15,7 @@ public record SipAuthentication : IJsonOnDeserialized new Dictionary(); /// - /// This will be expected in the `realm` field of the `authorization` header of the SIP INVITE. Defaults to sip.vapi.ai. + /// This will be expected in the `realm` field of the `authorization` header of the SIP INVITE. Defaults to the SIP realm of the Vapi region serving the request (e.g. `sip.vapi.ai` for US, `sip.eu.vapi.ai` for EU). /// [JsonPropertyName("realm")] public string? Realm { get; set; } diff --git a/src/Vapi.Net/Types/SipRequestTool.cs b/src/Vapi.Net/Types/SipRequestTool.cs index 765762fc..f7e7500b 100644 --- a/src/Vapi.Net/Types/SipRequestTool.cs +++ b/src/Vapi.Net/Types/SipRequestTool.cs @@ -5,6 +5,9 @@ namespace Vapi.Net; +/// +/// A reusable tool that sends SIP `INFO`, `MESSAGE`, or `NOTIFY` requests with configured headers and body. +/// [Serializable] public record SipRequestTool : IJsonOnDeserialized { @@ -12,10 +15,11 @@ public record SipRequestTool : IJsonOnDeserialized private readonly IDictionary _extensionData = new Dictionary(); + [JsonPropertyName("latestVersion")] + public string? LatestVersion { 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. + /// Messages spoken while the tool is running. Multiple request-start messages are variants. For request-response-delayed, same timing means variants and different timings mean staged updates. /// [JsonPropertyName("messages")] public IEnumerable? Messages { get; set; } diff --git a/src/Vapi.Net/Types/SipTrunkGateway.cs b/src/Vapi.Net/Types/SipTrunkGateway.cs index 60ce40fa..b64c048e 100644 --- a/src/Vapi.Net/Types/SipTrunkGateway.cs +++ b/src/Vapi.Net/Types/SipTrunkGateway.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Network and routing settings for a SIP trunk gateway, including address, port, netmask, inbound and outbound use, signaling protocol, and OPTIONS health checks. +/// [Serializable] public record SipTrunkGateway : IJsonOnDeserialized { @@ -12,7 +15,7 @@ public record SipTrunkGateway : IJsonOnDeserialized new Dictionary(); /// - /// This is the address of the gateway. It can be an IPv4 address like 1.1.1.1 or a fully qualified domain name like my-sip-trunk.pstn.twilio.com. + /// This is the address of the gateway. Inbound gateways require an IPv4 address like 1.1.1.1. Outbound-only gateways can also use a fully qualified domain name like my-sip-trunk.pstn.twilio.com. /// [JsonPropertyName("ip")] public required string Ip { get; set; } diff --git a/src/Vapi.Net/Types/SipTrunkOutboundAuthenticationPlan.cs b/src/Vapi.Net/Types/SipTrunkOutboundAuthenticationPlan.cs index 271d054a..89eb87a2 100644 --- a/src/Vapi.Net/Types/SipTrunkOutboundAuthenticationPlan.cs +++ b/src/Vapi.Net/Types/SipTrunkOutboundAuthenticationPlan.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Credentials and optional SIP REGISTER settings used to authenticate outbound calls with a SIP trunk. +/// [Serializable] public record SipTrunkOutboundAuthenticationPlan : IJsonOnDeserialized { @@ -17,6 +20,9 @@ public record SipTrunkOutboundAuthenticationPlan : IJsonOnDeserialized [JsonPropertyName("authPassword")] public string? AuthPassword { get; set; } + /// + /// Username used to authenticate outbound SIP requests. + /// [JsonPropertyName("authUsername")] public string? AuthUsername { get; set; } diff --git a/src/Vapi.Net/Types/SipTrunkOutboundSipRegisterPlan.cs b/src/Vapi.Net/Types/SipTrunkOutboundSipRegisterPlan.cs index 05314404..87cc39b1 100644 --- a/src/Vapi.Net/Types/SipTrunkOutboundSipRegisterPlan.cs +++ b/src/Vapi.Net/Types/SipTrunkOutboundSipRegisterPlan.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Registration settings used when the SIP trunk requires SIP REGISTER. +/// [Serializable] public record SipTrunkOutboundSipRegisterPlan : IJsonOnDeserialized { @@ -11,12 +14,21 @@ public record SipTrunkOutboundSipRegisterPlan : IJsonOnDeserialized private readonly IDictionary _extensionData = new Dictionary(); + /// + /// SIP registrar domain used for registration. + /// [JsonPropertyName("domain")] public string? Domain { get; set; } + /// + /// Username sent with the SIP REGISTER request. + /// [JsonPropertyName("username")] public string? Username { get; set; } + /// + /// Authentication realm used for SIP registration. + /// [JsonPropertyName("realm")] public string? Realm { get; set; } diff --git a/src/Vapi.Net/Types/SkippedStructuredOutput.cs b/src/Vapi.Net/Types/SkippedStructuredOutput.cs new file mode 100644 index 00000000..3add1d53 --- /dev/null +++ b/src/Vapi.Net/Types/SkippedStructuredOutput.cs @@ -0,0 +1,38 @@ +using global::System.Text.Json; +using global::System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[Serializable] +public record SkippedStructuredOutput : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + /// + /// This is the name of the structured output that was skipped. + /// + [JsonPropertyName("name")] + public required string Name { get; set; } + + /// + /// This is the first condition that was not met. Conditions use AND semantics, so + /// evaluation stops as soon as one condition does not pass. + /// + [JsonPropertyName("unmetCondition")] + public required object UnmetCondition { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/SlackSendMessageTool.cs b/src/Vapi.Net/Types/SlackSendMessageTool.cs index d0af8f3d..9d0d4154 100644 --- a/src/Vapi.Net/Types/SlackSendMessageTool.cs +++ b/src/Vapi.Net/Types/SlackSendMessageTool.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// A reusable tool that lets an assistant send a message to Slack. +/// [Serializable] public record SlackSendMessageTool : IJsonOnDeserialized { @@ -11,10 +14,11 @@ public record SlackSendMessageTool : IJsonOnDeserialized private readonly IDictionary _extensionData = new Dictionary(); + [JsonPropertyName("latestVersion")] + public string? LatestVersion { 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. + /// Messages spoken while the tool is running. Multiple request-start messages are variants. For request-response-delayed, same timing means variants and different timings mean staged updates. /// [JsonPropertyName("messages")] public IEnumerable? Messages { get; set; } diff --git a/src/Vapi.Net/Types/SmallestAiVoice.cs b/src/Vapi.Net/Types/SmallestAiVoice.cs index 61badf72..66de1e21 100644 --- a/src/Vapi.Net/Types/SmallestAiVoice.cs +++ b/src/Vapi.Net/Types/SmallestAiVoice.cs @@ -5,6 +5,9 @@ namespace Vapi.Net; +/// +/// Configuration for synthesizing assistant speech with Smallest AI, including voice and model selection, speed, chunking, caching, and fallback settings. +/// [Serializable] public record SmallestAiVoice : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/SmartDenoisingPlan.cs b/src/Vapi.Net/Types/SmartDenoisingPlan.cs index e79020de..26a8e953 100644 --- a/src/Vapi.Net/Types/SmartDenoisingPlan.cs +++ b/src/Vapi.Net/Types/SmartDenoisingPlan.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Controls whether Krisp smart denoising filters background speech and noise. +/// [Serializable] public record SmartDenoisingPlan : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/SmsTool.cs b/src/Vapi.Net/Types/SmsTool.cs index d822cfce..5a12a2ae 100644 --- a/src/Vapi.Net/Types/SmsTool.cs +++ b/src/Vapi.Net/Types/SmsTool.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// A reusable tool that lets an assistant send an SMS message during a call. +/// [Serializable] public record SmsTool : IJsonOnDeserialized { @@ -11,10 +14,11 @@ public record SmsTool : IJsonOnDeserialized private readonly IDictionary _extensionData = new Dictionary(); + [JsonPropertyName("latestVersion")] + public string? LatestVersion { 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. + /// Messages spoken while the tool is running. Multiple request-start messages are variants. For request-response-delayed, same timing means variants and different timings mean staged updates. /// [JsonPropertyName("messages")] public IEnumerable? Messages { get; set; } diff --git a/src/Vapi.Net/Types/SonioxContextGeneralItem.cs b/src/Vapi.Net/Types/SonioxContextGeneralItem.cs new file mode 100644 index 00000000..24d4458f --- /dev/null +++ b/src/Vapi.Net/Types/SonioxContextGeneralItem.cs @@ -0,0 +1,37 @@ +using global::System.Text.Json; +using global::System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[Serializable] +public record SonioxContextGeneralItem : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + /// + /// The key describing the type of context (e.g., "domain", "topic", "doctor", "organization"). + /// + [JsonPropertyName("key")] + public required string Key { get; set; } + + /// + /// The value for the context key (e.g., "Healthcare", "Diabetes management consultation"). + /// + [JsonPropertyName("value")] + public required string Value { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/SonioxCredential.cs b/src/Vapi.Net/Types/SonioxCredential.cs index 72e41f9a..ec1571cf 100644 --- a/src/Vapi.Net/Types/SonioxCredential.cs +++ b/src/Vapi.Net/Types/SonioxCredential.cs @@ -20,6 +20,12 @@ public record SonioxCredential : IJsonOnDeserialized [JsonPropertyName("apiKey")] public required string ApiKey { get; set; } + /// + /// Custom Soniox WebSocket endpoint (e.g. EU server wss://stt-rt.eu.soniox.com/transcribe-websocket). Defaults to the region-appropriate endpoint when omitted. + /// + [JsonPropertyName("apiUrl")] + public string? ApiUrl { get; set; } + /// /// This is the unique identifier for the credential. /// diff --git a/src/Vapi.Net/Types/SonioxTranscriber.cs b/src/Vapi.Net/Types/SonioxTranscriber.cs index 8a73479e..2026384b 100644 --- a/src/Vapi.Net/Types/SonioxTranscriber.cs +++ b/src/Vapi.Net/Types/SonioxTranscriber.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Configuration for transcribing speech during assistant conversations with Soniox, including model, language detection, endpointing, vocabulary, and fallback settings. +/// [Serializable] public record SonioxTranscriber : IJsonOnDeserialized { @@ -18,13 +21,19 @@ public record SonioxTranscriber : IJsonOnDeserialized public SonioxTranscriberModel? Model { get; set; } /// - /// The language for transcription. Uses ISO 639-1 codes. Soniox supports 60+ languages with a single universal model. + /// Single language for transcription as an ISO 639-1 code (e.g., `en`, `es`). For multi-language hints or to enable Soniox auto-detect, use `languages` instead — when `languages` is set (including to an empty array), this field is ignored when building the Soniox request. Defaults to `en` if neither this nor `languages` is set. /// [JsonPropertyName("language")] public SonioxTranscriberLanguage? Language { get; set; } /// - /// When enabled, restricts transcription to the language specified in the language field. When disabled, the model can detect and transcribe any of 60+ supported languages. Defaults to true. + /// Language hints sent to Soniox as `language_hints`. Provide `[lang1, lang2, ...]` (ISO 639-1 codes) to bias recognition toward specific languages, or provide an explicit empty array `[]` to enable Soniox auto-detect across all 60+ supported languages. When set (including the empty array), this field takes precedence over the singular `language` field. When omitted, falls back to the singular `language` (which defaults to `en` if also unset). Best accuracy is achieved with a single language. + /// + [JsonPropertyName("languages")] + public IEnumerable? Languages { get; set; } + + /// + /// When `true`, Soniox strictly restricts transcription to the languages in `languages` (or the singular `language` if `languages` is unset). When `false`, Soniox biases toward those languages but still allows transcription in other languages. Has no effect when no language hints are sent (e.g., `languages: []` for auto-detect). Defaults to `true` (strict mode). /// [JsonPropertyName("languageHintsStrict")] public bool? LanguageHintsStrict { get; set; } @@ -41,6 +50,12 @@ public record SonioxTranscriber : IJsonOnDeserialized [JsonPropertyName("customVocabulary")] public IEnumerable? CustomVocabulary { get; set; } + /// + /// General context key-value pairs that guide the AI model during transcription. Helps adapt vocabulary to the correct domain, improving accuracy. Recommended: 10 or fewer pairs. Maps to Soniox context.general. + /// + [JsonPropertyName("contextGeneral")] + public IEnumerable? ContextGeneral { get; set; } + /// /// This is the plan for transcriber provider fallbacks in the event that the primary transcriber provider fails. /// diff --git a/src/Vapi.Net/Types/SonioxTranscriberLanguagesItem.cs b/src/Vapi.Net/Types/SonioxTranscriberLanguagesItem.cs new file mode 100644 index 00000000..086c33b8 --- /dev/null +++ b/src/Vapi.Net/Types/SonioxTranscriberLanguagesItem.cs @@ -0,0 +1,999 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(SonioxTranscriberLanguagesItemSerializer))] +public enum SonioxTranscriberLanguagesItem +{ + [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, +} + +internal class SonioxTranscriberLanguagesItemSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + SonioxTranscriberLanguagesItem + > _stringToEnum = new() + { + { "aa", SonioxTranscriberLanguagesItem.Aa }, + { "ab", SonioxTranscriberLanguagesItem.Ab }, + { "ae", SonioxTranscriberLanguagesItem.Ae }, + { "af", SonioxTranscriberLanguagesItem.Af }, + { "ak", SonioxTranscriberLanguagesItem.Ak }, + { "am", SonioxTranscriberLanguagesItem.Am }, + { "an", SonioxTranscriberLanguagesItem.An }, + { "ar", SonioxTranscriberLanguagesItem.Ar }, + { "as", SonioxTranscriberLanguagesItem.As }, + { "av", SonioxTranscriberLanguagesItem.Av }, + { "ay", SonioxTranscriberLanguagesItem.Ay }, + { "az", SonioxTranscriberLanguagesItem.Az }, + { "ba", SonioxTranscriberLanguagesItem.Ba }, + { "be", SonioxTranscriberLanguagesItem.Be }, + { "bg", SonioxTranscriberLanguagesItem.Bg }, + { "bh", SonioxTranscriberLanguagesItem.Bh }, + { "bi", SonioxTranscriberLanguagesItem.Bi }, + { "bm", SonioxTranscriberLanguagesItem.Bm }, + { "bn", SonioxTranscriberLanguagesItem.Bn }, + { "bo", SonioxTranscriberLanguagesItem.Bo }, + { "br", SonioxTranscriberLanguagesItem.Br }, + { "bs", SonioxTranscriberLanguagesItem.Bs }, + { "ca", SonioxTranscriberLanguagesItem.Ca }, + { "ce", SonioxTranscriberLanguagesItem.Ce }, + { "ch", SonioxTranscriberLanguagesItem.Ch }, + { "co", SonioxTranscriberLanguagesItem.Co }, + { "cr", SonioxTranscriberLanguagesItem.Cr }, + { "cs", SonioxTranscriberLanguagesItem.Cs }, + { "cu", SonioxTranscriberLanguagesItem.Cu }, + { "cv", SonioxTranscriberLanguagesItem.Cv }, + { "cy", SonioxTranscriberLanguagesItem.Cy }, + { "da", SonioxTranscriberLanguagesItem.Da }, + { "de", SonioxTranscriberLanguagesItem.De }, + { "dv", SonioxTranscriberLanguagesItem.Dv }, + { "dz", SonioxTranscriberLanguagesItem.Dz }, + { "ee", SonioxTranscriberLanguagesItem.Ee }, + { "el", SonioxTranscriberLanguagesItem.El }, + { "en", SonioxTranscriberLanguagesItem.En }, + { "eo", SonioxTranscriberLanguagesItem.Eo }, + { "es", SonioxTranscriberLanguagesItem.Es }, + { "et", SonioxTranscriberLanguagesItem.Et }, + { "eu", SonioxTranscriberLanguagesItem.Eu }, + { "fa", SonioxTranscriberLanguagesItem.Fa }, + { "ff", SonioxTranscriberLanguagesItem.Ff }, + { "fi", SonioxTranscriberLanguagesItem.Fi }, + { "fj", SonioxTranscriberLanguagesItem.Fj }, + { "fo", SonioxTranscriberLanguagesItem.Fo }, + { "fr", SonioxTranscriberLanguagesItem.Fr }, + { "fy", SonioxTranscriberLanguagesItem.Fy }, + { "ga", SonioxTranscriberLanguagesItem.Ga }, + { "gd", SonioxTranscriberLanguagesItem.Gd }, + { "gl", SonioxTranscriberLanguagesItem.Gl }, + { "gn", SonioxTranscriberLanguagesItem.Gn }, + { "gu", SonioxTranscriberLanguagesItem.Gu }, + { "gv", SonioxTranscriberLanguagesItem.Gv }, + { "ha", SonioxTranscriberLanguagesItem.Ha }, + { "he", SonioxTranscriberLanguagesItem.He }, + { "hi", SonioxTranscriberLanguagesItem.Hi }, + { "ho", SonioxTranscriberLanguagesItem.Ho }, + { "hr", SonioxTranscriberLanguagesItem.Hr }, + { "ht", SonioxTranscriberLanguagesItem.Ht }, + { "hu", SonioxTranscriberLanguagesItem.Hu }, + { "hy", SonioxTranscriberLanguagesItem.Hy }, + { "hz", SonioxTranscriberLanguagesItem.Hz }, + { "ia", SonioxTranscriberLanguagesItem.Ia }, + { "id", SonioxTranscriberLanguagesItem.Id }, + { "ie", SonioxTranscriberLanguagesItem.Ie }, + { "ig", SonioxTranscriberLanguagesItem.Ig }, + { "ii", SonioxTranscriberLanguagesItem.Ii }, + { "ik", SonioxTranscriberLanguagesItem.Ik }, + { "io", SonioxTranscriberLanguagesItem.Io }, + { "is", SonioxTranscriberLanguagesItem.Is }, + { "it", SonioxTranscriberLanguagesItem.It }, + { "iu", SonioxTranscriberLanguagesItem.Iu }, + { "ja", SonioxTranscriberLanguagesItem.Ja }, + { "jv", SonioxTranscriberLanguagesItem.Jv }, + { "ka", SonioxTranscriberLanguagesItem.Ka }, + { "kg", SonioxTranscriberLanguagesItem.Kg }, + { "ki", SonioxTranscriberLanguagesItem.Ki }, + { "kj", SonioxTranscriberLanguagesItem.Kj }, + { "kk", SonioxTranscriberLanguagesItem.Kk }, + { "kl", SonioxTranscriberLanguagesItem.Kl }, + { "km", SonioxTranscriberLanguagesItem.Km }, + { "kn", SonioxTranscriberLanguagesItem.Kn }, + { "ko", SonioxTranscriberLanguagesItem.Ko }, + { "kr", SonioxTranscriberLanguagesItem.Kr }, + { "ks", SonioxTranscriberLanguagesItem.Ks }, + { "ku", SonioxTranscriberLanguagesItem.Ku }, + { "kv", SonioxTranscriberLanguagesItem.Kv }, + { "kw", SonioxTranscriberLanguagesItem.Kw }, + { "ky", SonioxTranscriberLanguagesItem.Ky }, + { "la", SonioxTranscriberLanguagesItem.La }, + { "lb", SonioxTranscriberLanguagesItem.Lb }, + { "lg", SonioxTranscriberLanguagesItem.Lg }, + { "li", SonioxTranscriberLanguagesItem.Li }, + { "ln", SonioxTranscriberLanguagesItem.Ln }, + { "lo", SonioxTranscriberLanguagesItem.Lo }, + { "lt", SonioxTranscriberLanguagesItem.Lt }, + { "lu", SonioxTranscriberLanguagesItem.Lu }, + { "lv", SonioxTranscriberLanguagesItem.Lv }, + { "mg", SonioxTranscriberLanguagesItem.Mg }, + { "mh", SonioxTranscriberLanguagesItem.Mh }, + { "mi", SonioxTranscriberLanguagesItem.Mi }, + { "mk", SonioxTranscriberLanguagesItem.Mk }, + { "ml", SonioxTranscriberLanguagesItem.Ml }, + { "mn", SonioxTranscriberLanguagesItem.Mn }, + { "mr", SonioxTranscriberLanguagesItem.Mr }, + { "ms", SonioxTranscriberLanguagesItem.Ms }, + { "mt", SonioxTranscriberLanguagesItem.Mt }, + { "my", SonioxTranscriberLanguagesItem.My }, + { "na", SonioxTranscriberLanguagesItem.Na }, + { "nb", SonioxTranscriberLanguagesItem.Nb }, + { "nd", SonioxTranscriberLanguagesItem.Nd }, + { "ne", SonioxTranscriberLanguagesItem.Ne }, + { "ng", SonioxTranscriberLanguagesItem.Ng }, + { "nl", SonioxTranscriberLanguagesItem.Nl }, + { "nn", SonioxTranscriberLanguagesItem.Nn }, + { "no", SonioxTranscriberLanguagesItem.No }, + { "nr", SonioxTranscriberLanguagesItem.Nr }, + { "nv", SonioxTranscriberLanguagesItem.Nv }, + { "ny", SonioxTranscriberLanguagesItem.Ny }, + { "oc", SonioxTranscriberLanguagesItem.Oc }, + { "oj", SonioxTranscriberLanguagesItem.Oj }, + { "om", SonioxTranscriberLanguagesItem.Om }, + { "or", SonioxTranscriberLanguagesItem.Or }, + { "os", SonioxTranscriberLanguagesItem.Os }, + { "pa", SonioxTranscriberLanguagesItem.Pa }, + { "pi", SonioxTranscriberLanguagesItem.Pi }, + { "pl", SonioxTranscriberLanguagesItem.Pl }, + { "ps", SonioxTranscriberLanguagesItem.Ps }, + { "pt", SonioxTranscriberLanguagesItem.Pt }, + { "qu", SonioxTranscriberLanguagesItem.Qu }, + { "rm", SonioxTranscriberLanguagesItem.Rm }, + { "rn", SonioxTranscriberLanguagesItem.Rn }, + { "ro", SonioxTranscriberLanguagesItem.Ro }, + { "ru", SonioxTranscriberLanguagesItem.Ru }, + { "rw", SonioxTranscriberLanguagesItem.Rw }, + { "sa", SonioxTranscriberLanguagesItem.Sa }, + { "sc", SonioxTranscriberLanguagesItem.Sc }, + { "sd", SonioxTranscriberLanguagesItem.Sd }, + { "se", SonioxTranscriberLanguagesItem.Se }, + { "sg", SonioxTranscriberLanguagesItem.Sg }, + { "si", SonioxTranscriberLanguagesItem.Si }, + { "sk", SonioxTranscriberLanguagesItem.Sk }, + { "sl", SonioxTranscriberLanguagesItem.Sl }, + { "sm", SonioxTranscriberLanguagesItem.Sm }, + { "sn", SonioxTranscriberLanguagesItem.Sn }, + { "so", SonioxTranscriberLanguagesItem.So }, + { "sq", SonioxTranscriberLanguagesItem.Sq }, + { "sr", SonioxTranscriberLanguagesItem.Sr }, + { "ss", SonioxTranscriberLanguagesItem.Ss }, + { "st", SonioxTranscriberLanguagesItem.St }, + { "su", SonioxTranscriberLanguagesItem.Su }, + { "sv", SonioxTranscriberLanguagesItem.Sv }, + { "sw", SonioxTranscriberLanguagesItem.Sw }, + { "ta", SonioxTranscriberLanguagesItem.Ta }, + { "te", SonioxTranscriberLanguagesItem.Te }, + { "tg", SonioxTranscriberLanguagesItem.Tg }, + { "th", SonioxTranscriberLanguagesItem.Th }, + { "ti", SonioxTranscriberLanguagesItem.Ti }, + { "tk", SonioxTranscriberLanguagesItem.Tk }, + { "tl", SonioxTranscriberLanguagesItem.Tl }, + { "tn", SonioxTranscriberLanguagesItem.Tn }, + { "to", SonioxTranscriberLanguagesItem.To }, + { "tr", SonioxTranscriberLanguagesItem.Tr }, + { "ts", SonioxTranscriberLanguagesItem.Ts }, + { "tt", SonioxTranscriberLanguagesItem.Tt }, + { "tw", SonioxTranscriberLanguagesItem.Tw }, + { "ty", SonioxTranscriberLanguagesItem.Ty }, + { "ug", SonioxTranscriberLanguagesItem.Ug }, + { "uk", SonioxTranscriberLanguagesItem.Uk }, + { "ur", SonioxTranscriberLanguagesItem.Ur }, + { "uz", SonioxTranscriberLanguagesItem.Uz }, + { "ve", SonioxTranscriberLanguagesItem.Ve }, + { "vi", SonioxTranscriberLanguagesItem.Vi }, + { "vo", SonioxTranscriberLanguagesItem.Vo }, + { "wa", SonioxTranscriberLanguagesItem.Wa }, + { "wo", SonioxTranscriberLanguagesItem.Wo }, + { "xh", SonioxTranscriberLanguagesItem.Xh }, + { "yi", SonioxTranscriberLanguagesItem.Yi }, + { "yue", SonioxTranscriberLanguagesItem.Yue }, + { "yo", SonioxTranscriberLanguagesItem.Yo }, + { "za", SonioxTranscriberLanguagesItem.Za }, + { "zh", SonioxTranscriberLanguagesItem.Zh }, + { "zu", SonioxTranscriberLanguagesItem.Zu }, + }; + + private static readonly global::System.Collections.Generic.Dictionary< + SonioxTranscriberLanguagesItem, + string + > _enumToString = new() + { + { SonioxTranscriberLanguagesItem.Aa, "aa" }, + { SonioxTranscriberLanguagesItem.Ab, "ab" }, + { SonioxTranscriberLanguagesItem.Ae, "ae" }, + { SonioxTranscriberLanguagesItem.Af, "af" }, + { SonioxTranscriberLanguagesItem.Ak, "ak" }, + { SonioxTranscriberLanguagesItem.Am, "am" }, + { SonioxTranscriberLanguagesItem.An, "an" }, + { SonioxTranscriberLanguagesItem.Ar, "ar" }, + { SonioxTranscriberLanguagesItem.As, "as" }, + { SonioxTranscriberLanguagesItem.Av, "av" }, + { SonioxTranscriberLanguagesItem.Ay, "ay" }, + { SonioxTranscriberLanguagesItem.Az, "az" }, + { SonioxTranscriberLanguagesItem.Ba, "ba" }, + { SonioxTranscriberLanguagesItem.Be, "be" }, + { SonioxTranscriberLanguagesItem.Bg, "bg" }, + { SonioxTranscriberLanguagesItem.Bh, "bh" }, + { SonioxTranscriberLanguagesItem.Bi, "bi" }, + { SonioxTranscriberLanguagesItem.Bm, "bm" }, + { SonioxTranscriberLanguagesItem.Bn, "bn" }, + { SonioxTranscriberLanguagesItem.Bo, "bo" }, + { SonioxTranscriberLanguagesItem.Br, "br" }, + { SonioxTranscriberLanguagesItem.Bs, "bs" }, + { SonioxTranscriberLanguagesItem.Ca, "ca" }, + { SonioxTranscriberLanguagesItem.Ce, "ce" }, + { SonioxTranscriberLanguagesItem.Ch, "ch" }, + { SonioxTranscriberLanguagesItem.Co, "co" }, + { SonioxTranscriberLanguagesItem.Cr, "cr" }, + { SonioxTranscriberLanguagesItem.Cs, "cs" }, + { SonioxTranscriberLanguagesItem.Cu, "cu" }, + { SonioxTranscriberLanguagesItem.Cv, "cv" }, + { SonioxTranscriberLanguagesItem.Cy, "cy" }, + { SonioxTranscriberLanguagesItem.Da, "da" }, + { SonioxTranscriberLanguagesItem.De, "de" }, + { SonioxTranscriberLanguagesItem.Dv, "dv" }, + { SonioxTranscriberLanguagesItem.Dz, "dz" }, + { SonioxTranscriberLanguagesItem.Ee, "ee" }, + { SonioxTranscriberLanguagesItem.El, "el" }, + { SonioxTranscriberLanguagesItem.En, "en" }, + { SonioxTranscriberLanguagesItem.Eo, "eo" }, + { SonioxTranscriberLanguagesItem.Es, "es" }, + { SonioxTranscriberLanguagesItem.Et, "et" }, + { SonioxTranscriberLanguagesItem.Eu, "eu" }, + { SonioxTranscriberLanguagesItem.Fa, "fa" }, + { SonioxTranscriberLanguagesItem.Ff, "ff" }, + { SonioxTranscriberLanguagesItem.Fi, "fi" }, + { SonioxTranscriberLanguagesItem.Fj, "fj" }, + { SonioxTranscriberLanguagesItem.Fo, "fo" }, + { SonioxTranscriberLanguagesItem.Fr, "fr" }, + { SonioxTranscriberLanguagesItem.Fy, "fy" }, + { SonioxTranscriberLanguagesItem.Ga, "ga" }, + { SonioxTranscriberLanguagesItem.Gd, "gd" }, + { SonioxTranscriberLanguagesItem.Gl, "gl" }, + { SonioxTranscriberLanguagesItem.Gn, "gn" }, + { SonioxTranscriberLanguagesItem.Gu, "gu" }, + { SonioxTranscriberLanguagesItem.Gv, "gv" }, + { SonioxTranscriberLanguagesItem.Ha, "ha" }, + { SonioxTranscriberLanguagesItem.He, "he" }, + { SonioxTranscriberLanguagesItem.Hi, "hi" }, + { SonioxTranscriberLanguagesItem.Ho, "ho" }, + { SonioxTranscriberLanguagesItem.Hr, "hr" }, + { SonioxTranscriberLanguagesItem.Ht, "ht" }, + { SonioxTranscriberLanguagesItem.Hu, "hu" }, + { SonioxTranscriberLanguagesItem.Hy, "hy" }, + { SonioxTranscriberLanguagesItem.Hz, "hz" }, + { SonioxTranscriberLanguagesItem.Ia, "ia" }, + { SonioxTranscriberLanguagesItem.Id, "id" }, + { SonioxTranscriberLanguagesItem.Ie, "ie" }, + { SonioxTranscriberLanguagesItem.Ig, "ig" }, + { SonioxTranscriberLanguagesItem.Ii, "ii" }, + { SonioxTranscriberLanguagesItem.Ik, "ik" }, + { SonioxTranscriberLanguagesItem.Io, "io" }, + { SonioxTranscriberLanguagesItem.Is, "is" }, + { SonioxTranscriberLanguagesItem.It, "it" }, + { SonioxTranscriberLanguagesItem.Iu, "iu" }, + { SonioxTranscriberLanguagesItem.Ja, "ja" }, + { SonioxTranscriberLanguagesItem.Jv, "jv" }, + { SonioxTranscriberLanguagesItem.Ka, "ka" }, + { SonioxTranscriberLanguagesItem.Kg, "kg" }, + { SonioxTranscriberLanguagesItem.Ki, "ki" }, + { SonioxTranscriberLanguagesItem.Kj, "kj" }, + { SonioxTranscriberLanguagesItem.Kk, "kk" }, + { SonioxTranscriberLanguagesItem.Kl, "kl" }, + { SonioxTranscriberLanguagesItem.Km, "km" }, + { SonioxTranscriberLanguagesItem.Kn, "kn" }, + { SonioxTranscriberLanguagesItem.Ko, "ko" }, + { SonioxTranscriberLanguagesItem.Kr, "kr" }, + { SonioxTranscriberLanguagesItem.Ks, "ks" }, + { SonioxTranscriberLanguagesItem.Ku, "ku" }, + { SonioxTranscriberLanguagesItem.Kv, "kv" }, + { SonioxTranscriberLanguagesItem.Kw, "kw" }, + { SonioxTranscriberLanguagesItem.Ky, "ky" }, + { SonioxTranscriberLanguagesItem.La, "la" }, + { SonioxTranscriberLanguagesItem.Lb, "lb" }, + { SonioxTranscriberLanguagesItem.Lg, "lg" }, + { SonioxTranscriberLanguagesItem.Li, "li" }, + { SonioxTranscriberLanguagesItem.Ln, "ln" }, + { SonioxTranscriberLanguagesItem.Lo, "lo" }, + { SonioxTranscriberLanguagesItem.Lt, "lt" }, + { SonioxTranscriberLanguagesItem.Lu, "lu" }, + { SonioxTranscriberLanguagesItem.Lv, "lv" }, + { SonioxTranscriberLanguagesItem.Mg, "mg" }, + { SonioxTranscriberLanguagesItem.Mh, "mh" }, + { SonioxTranscriberLanguagesItem.Mi, "mi" }, + { SonioxTranscriberLanguagesItem.Mk, "mk" }, + { SonioxTranscriberLanguagesItem.Ml, "ml" }, + { SonioxTranscriberLanguagesItem.Mn, "mn" }, + { SonioxTranscriberLanguagesItem.Mr, "mr" }, + { SonioxTranscriberLanguagesItem.Ms, "ms" }, + { SonioxTranscriberLanguagesItem.Mt, "mt" }, + { SonioxTranscriberLanguagesItem.My, "my" }, + { SonioxTranscriberLanguagesItem.Na, "na" }, + { SonioxTranscriberLanguagesItem.Nb, "nb" }, + { SonioxTranscriberLanguagesItem.Nd, "nd" }, + { SonioxTranscriberLanguagesItem.Ne, "ne" }, + { SonioxTranscriberLanguagesItem.Ng, "ng" }, + { SonioxTranscriberLanguagesItem.Nl, "nl" }, + { SonioxTranscriberLanguagesItem.Nn, "nn" }, + { SonioxTranscriberLanguagesItem.No, "no" }, + { SonioxTranscriberLanguagesItem.Nr, "nr" }, + { SonioxTranscriberLanguagesItem.Nv, "nv" }, + { SonioxTranscriberLanguagesItem.Ny, "ny" }, + { SonioxTranscriberLanguagesItem.Oc, "oc" }, + { SonioxTranscriberLanguagesItem.Oj, "oj" }, + { SonioxTranscriberLanguagesItem.Om, "om" }, + { SonioxTranscriberLanguagesItem.Or, "or" }, + { SonioxTranscriberLanguagesItem.Os, "os" }, + { SonioxTranscriberLanguagesItem.Pa, "pa" }, + { SonioxTranscriberLanguagesItem.Pi, "pi" }, + { SonioxTranscriberLanguagesItem.Pl, "pl" }, + { SonioxTranscriberLanguagesItem.Ps, "ps" }, + { SonioxTranscriberLanguagesItem.Pt, "pt" }, + { SonioxTranscriberLanguagesItem.Qu, "qu" }, + { SonioxTranscriberLanguagesItem.Rm, "rm" }, + { SonioxTranscriberLanguagesItem.Rn, "rn" }, + { SonioxTranscriberLanguagesItem.Ro, "ro" }, + { SonioxTranscriberLanguagesItem.Ru, "ru" }, + { SonioxTranscriberLanguagesItem.Rw, "rw" }, + { SonioxTranscriberLanguagesItem.Sa, "sa" }, + { SonioxTranscriberLanguagesItem.Sc, "sc" }, + { SonioxTranscriberLanguagesItem.Sd, "sd" }, + { SonioxTranscriberLanguagesItem.Se, "se" }, + { SonioxTranscriberLanguagesItem.Sg, "sg" }, + { SonioxTranscriberLanguagesItem.Si, "si" }, + { SonioxTranscriberLanguagesItem.Sk, "sk" }, + { SonioxTranscriberLanguagesItem.Sl, "sl" }, + { SonioxTranscriberLanguagesItem.Sm, "sm" }, + { SonioxTranscriberLanguagesItem.Sn, "sn" }, + { SonioxTranscriberLanguagesItem.So, "so" }, + { SonioxTranscriberLanguagesItem.Sq, "sq" }, + { SonioxTranscriberLanguagesItem.Sr, "sr" }, + { SonioxTranscriberLanguagesItem.Ss, "ss" }, + { SonioxTranscriberLanguagesItem.St, "st" }, + { SonioxTranscriberLanguagesItem.Su, "su" }, + { SonioxTranscriberLanguagesItem.Sv, "sv" }, + { SonioxTranscriberLanguagesItem.Sw, "sw" }, + { SonioxTranscriberLanguagesItem.Ta, "ta" }, + { SonioxTranscriberLanguagesItem.Te, "te" }, + { SonioxTranscriberLanguagesItem.Tg, "tg" }, + { SonioxTranscriberLanguagesItem.Th, "th" }, + { SonioxTranscriberLanguagesItem.Ti, "ti" }, + { SonioxTranscriberLanguagesItem.Tk, "tk" }, + { SonioxTranscriberLanguagesItem.Tl, "tl" }, + { SonioxTranscriberLanguagesItem.Tn, "tn" }, + { SonioxTranscriberLanguagesItem.To, "to" }, + { SonioxTranscriberLanguagesItem.Tr, "tr" }, + { SonioxTranscriberLanguagesItem.Ts, "ts" }, + { SonioxTranscriberLanguagesItem.Tt, "tt" }, + { SonioxTranscriberLanguagesItem.Tw, "tw" }, + { SonioxTranscriberLanguagesItem.Ty, "ty" }, + { SonioxTranscriberLanguagesItem.Ug, "ug" }, + { SonioxTranscriberLanguagesItem.Uk, "uk" }, + { SonioxTranscriberLanguagesItem.Ur, "ur" }, + { SonioxTranscriberLanguagesItem.Uz, "uz" }, + { SonioxTranscriberLanguagesItem.Ve, "ve" }, + { SonioxTranscriberLanguagesItem.Vi, "vi" }, + { SonioxTranscriberLanguagesItem.Vo, "vo" }, + { SonioxTranscriberLanguagesItem.Wa, "wa" }, + { SonioxTranscriberLanguagesItem.Wo, "wo" }, + { SonioxTranscriberLanguagesItem.Xh, "xh" }, + { SonioxTranscriberLanguagesItem.Yi, "yi" }, + { SonioxTranscriberLanguagesItem.Yue, "yue" }, + { SonioxTranscriberLanguagesItem.Yo, "yo" }, + { SonioxTranscriberLanguagesItem.Za, "za" }, + { SonioxTranscriberLanguagesItem.Zh, "zh" }, + { SonioxTranscriberLanguagesItem.Zu, "zu" }, + }; + + public override SonioxTranscriberLanguagesItem Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + SonioxTranscriberLanguagesItem value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override SonioxTranscriberLanguagesItem ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + SonioxTranscriberLanguagesItem value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/SonioxTranscriberModel.cs b/src/Vapi.Net/Types/SonioxTranscriberModel.cs index 62b08499..6ccad94e 100644 --- a/src/Vapi.Net/Types/SonioxTranscriberModel.cs +++ b/src/Vapi.Net/Types/SonioxTranscriberModel.cs @@ -8,6 +8,9 @@ public enum SonioxTranscriberModel { [EnumMember(Value = "stt-rt-v4")] SttRtV4, + + [EnumMember(Value = "stt-rt-v5")] + SttRtV5, } internal class SonioxTranscriberModelSerializer @@ -16,12 +19,20 @@ internal class SonioxTranscriberModelSerializer private static readonly global::System.Collections.Generic.Dictionary< string, SonioxTranscriberModel - > _stringToEnum = new() { { "stt-rt-v4", SonioxTranscriberModel.SttRtV4 } }; + > _stringToEnum = new() + { + { "stt-rt-v4", SonioxTranscriberModel.SttRtV4 }, + { "stt-rt-v5", SonioxTranscriberModel.SttRtV5 }, + }; private static readonly global::System.Collections.Generic.Dictionary< SonioxTranscriberModel, string - > _enumToString = new() { { SonioxTranscriberModel.SttRtV4, "stt-rt-v4" } }; + > _enumToString = new() + { + { SonioxTranscriberModel.SttRtV4, "stt-rt-v4" }, + { SonioxTranscriberModel.SttRtV5, "stt-rt-v5" }, + }; public override SonioxTranscriberModel Read( ref global::System.Text.Json.Utf8JsonReader reader, diff --git a/src/Vapi.Net/Types/SpeechmaticsCustomVocabularyItem.cs b/src/Vapi.Net/Types/SpeechmaticsCustomVocabularyItem.cs index 821fc21a..e017f172 100644 --- a/src/Vapi.Net/Types/SpeechmaticsCustomVocabularyItem.cs +++ b/src/Vapi.Net/Types/SpeechmaticsCustomVocabularyItem.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// A word or phrase to prioritize during Speechmatics transcription, with optional phonetic alternatives. +/// [Serializable] public record SpeechmaticsCustomVocabularyItem : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/SpeechmaticsTranscriber.cs b/src/Vapi.Net/Types/SpeechmaticsTranscriber.cs index 5ed1e43a..2870e913 100644 --- a/src/Vapi.Net/Types/SpeechmaticsTranscriber.cs +++ b/src/Vapi.Net/Types/SpeechmaticsTranscriber.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Configuration for transcribing speech during assistant conversations with Speechmatics, including language, region, diarization, vocabulary, endpointing, formatting, and fallback settings. +/// [Serializable] public record SpeechmaticsTranscriber : IJsonOnDeserialized { @@ -17,6 +20,9 @@ public record SpeechmaticsTranscriber : IJsonOnDeserialized [JsonPropertyName("model")] public SpeechmaticsTranscriberModel? Model { get; set; } + /// + /// Language used for transcription. Set to `auto` to detect the language automatically. + /// [JsonPropertyName("language")] public SpeechmaticsTranscriberLanguage? Language { get; set; } @@ -52,6 +58,9 @@ public record SpeechmaticsTranscriber : IJsonOnDeserialized [JsonPropertyName("maxDelay")] public double? MaxDelay { get; set; } + /// + /// Words and phrases that Speechmatics should recognize more accurately, with optional phonetic alternatives. + /// [JsonPropertyName("customVocabulary")] public IEnumerable CustomVocabulary { get; set; } = new List(); diff --git a/src/Vapi.Net/Types/SpkiPemPublicKeyConfig.cs b/src/Vapi.Net/Types/SpkiPemPublicKeyConfig.cs index 8afe693f..0bcdeef5 100644 --- a/src/Vapi.Net/Types/SpkiPemPublicKeyConfig.cs +++ b/src/Vapi.Net/Types/SpkiPemPublicKeyConfig.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// An SPKI public key in PEM format used to encrypt sensitive request data. +/// [Serializable] public record SpkiPemPublicKeyConfig : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/SqlInjectionSecurityFilter.cs b/src/Vapi.Net/Types/SqlInjectionSecurityFilter.cs index bf1e1b69..0cb53204 100644 --- a/src/Vapi.Net/Types/SqlInjectionSecurityFilter.cs +++ b/src/Vapi.Net/Types/SqlInjectionSecurityFilter.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Filters potential SQL injection patterns from transcripts. +/// [Serializable] public record SqlInjectionSecurityFilter : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/Squad.cs b/src/Vapi.Net/Types/Squad.cs index d873b1cd..e9da899c 100644 --- a/src/Vapi.Net/Types/Squad.cs +++ b/src/Vapi.Net/Types/Squad.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// A saved squad configuration that coordinates a group of assistants during a conversation. The first member starts the call, and member destinations control transfers between assistants. +/// [Serializable] public record Squad : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/SquadMemberDto.cs b/src/Vapi.Net/Types/SquadMemberDto.cs index 561487ec..b877b2f6 100644 --- a/src/Vapi.Net/Types/SquadMemberDto.cs +++ b/src/Vapi.Net/Types/SquadMemberDto.cs @@ -5,6 +5,9 @@ namespace Vapi.Net; +/// +/// An assistant member of a squad. Reference a saved assistant or provide a transient assistant, then configure member-specific overrides and destinations for transfers. +/// [Serializable] public record SquadMemberDto : IJsonOnDeserialized { @@ -12,6 +15,17 @@ public record SquadMemberDto : IJsonOnDeserialized private readonly IDictionary _extensionData = new Dictionary(); + /// + /// This is the assistant version (e.g. `v3`) to pin for this squad member. When set, the call uses + /// the snapshot from `assistant_version` (by `(assistantId, version)`) instead of the latest. Valid + /// only with `assistantId`; rejected with inline `assistant`. Omit to follow the latest version. + /// + [JsonPropertyName("assistantVersion")] + public string? AssistantVersion { get; set; } + + /// + /// Assistants this squad member can route the conversation to through a transfer or handoff. + /// [JsonPropertyName("assistantDestinations")] public IEnumerable< OneOf diff --git a/src/Vapi.Net/Types/SsrfSecurityFilter.cs b/src/Vapi.Net/Types/SsrfSecurityFilter.cs index 3fab8172..ab6278d0 100644 --- a/src/Vapi.Net/Types/SsrfSecurityFilter.cs +++ b/src/Vapi.Net/Types/SsrfSecurityFilter.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Filters potential server-side request forgery (SSRF) patterns from transcripts. +/// [Serializable] public record SsrfSecurityFilter : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/StartSpeakingPlan.cs b/src/Vapi.Net/Types/StartSpeakingPlan.cs index 551d682c..697df059 100644 --- a/src/Vapi.Net/Types/StartSpeakingPlan.cs +++ b/src/Vapi.Net/Types/StartSpeakingPlan.cs @@ -5,6 +5,9 @@ namespace Vapi.Net; +/// +/// Controls when the assistant begins speaking after customer speech, including the minimum wait, endpointing strategy, and custom endpointing rules. +/// [Serializable] public record StartSpeakingPlan : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/StopSpeakingPlan.cs b/src/Vapi.Net/Types/StopSpeakingPlan.cs index f80984d7..047c486d 100644 --- a/src/Vapi.Net/Types/StopSpeakingPlan.cs +++ b/src/Vapi.Net/Types/StopSpeakingPlan.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Controls when the assistant stops speaking after a customer interruption, including word and voice thresholds, restart delay, and phrase exceptions. +/// [Serializable] public record StopSpeakingPlan : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/StructuredDataMultiPlan.cs b/src/Vapi.Net/Types/StructuredDataMultiPlan.cs index 7d092825..2f18e4cd 100644 --- a/src/Vapi.Net/Types/StructuredDataMultiPlan.cs +++ b/src/Vapi.Net/Types/StructuredDataMultiPlan.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Associates a catalog key with a structured data extraction plan. +/// [Serializable] public record StructuredDataMultiPlan : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/StructuredDataPlan.cs b/src/Vapi.Net/Types/StructuredDataPlan.cs index 931465a4..8ad69f04 100644 --- a/src/Vapi.Net/Types/StructuredDataPlan.cs +++ b/src/Vapi.Net/Types/StructuredDataPlan.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Controls extraction of post-call structured data, including prompt messages, JSON schema, enablement, and request timeout. +/// [Serializable] public record StructuredDataPlan : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/StructuredOutput.cs b/src/Vapi.Net/Types/StructuredOutput.cs index 3b1bfd67..6fc31b94 100644 --- a/src/Vapi.Net/Types/StructuredOutput.cs +++ b/src/Vapi.Net/Types/StructuredOutput.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// A saved structured-output definition containing its extraction schema, execution method, model or regular expression, linked resources, and lifecycle metadata. +/// [Serializable] public record StructuredOutput : IJsonOnDeserialized { @@ -59,6 +62,12 @@ public record StructuredOutput : IJsonOnDeserialized [JsonPropertyName("compliancePlan")] public ComplianceOverride? CompliancePlan { get; set; } + /// + /// These are the conditions that gate the execution of this structured output. Every condition must pass for the structured output to run (AND semantics). When omitted or empty, no user-defined conditions gate this output. Send null to clear a previously saved gate. + /// + [JsonPropertyName("conditions")] + public IEnumerable? Conditions { get; set; } + /// /// This is the unique identifier for the structured output. /// diff --git a/src/Vapi.Net/Types/StructuredOutputEvaluationResult.cs b/src/Vapi.Net/Types/StructuredOutputEvaluationResult.cs index e47ad87a..82c35705 100644 --- a/src/Vapi.Net/Types/StructuredOutputEvaluationResult.cs +++ b/src/Vapi.Net/Types/StructuredOutputEvaluationResult.cs @@ -25,6 +25,24 @@ public record StructuredOutputEvaluationResult : IJsonOnDeserialized [JsonPropertyName("name")] public required string Name { get; set; } + /// + /// This is the optional dot-notation path evaluated within an object structured output. + /// + [JsonPropertyName("path")] + public string? Path { get; set; } + + /// + /// This is the structured output description captured when the evaluation ran. + /// + [JsonPropertyName("description")] + public string? Description { get; set; } + + /// + /// This is the structured output schema captured when the evaluation ran. + /// + [JsonPropertyName("schema")] + public JsonSchema? Schema { get; set; } + /// /// This is the value extracted from the call by the structured output. /// diff --git a/src/Vapi.Net/Types/StructuredOutputPaginatedResponse.cs b/src/Vapi.Net/Types/StructuredOutputPaginatedResponse.cs index bcd93200..792e139d 100644 --- a/src/Vapi.Net/Types/StructuredOutputPaginatedResponse.cs +++ b/src/Vapi.Net/Types/StructuredOutputPaginatedResponse.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// A paginated collection of structured-output definitions and metadata describing the result set. +/// [Serializable] public record StructuredOutputPaginatedResponse : IJsonOnDeserialized { @@ -11,9 +14,15 @@ public record StructuredOutputPaginatedResponse : IJsonOnDeserialized private readonly IDictionary _extensionData = new Dictionary(); + /// + /// The structured-output definitions returned for the current page. + /// [JsonPropertyName("results")] public IEnumerable Results { get; set; } = new List(); + /// + /// Pagination metadata for the structured-output result set. + /// [JsonPropertyName("metadata")] public required PaginationMeta Metadata { get; set; } diff --git a/src/Vapi.Net/Types/StructuredOutputRerunResponse.cs b/src/Vapi.Net/Types/StructuredOutputRerunResponse.cs new file mode 100644 index 00000000..6a0e2347 --- /dev/null +++ b/src/Vapi.Net/Types/StructuredOutputRerunResponse.cs @@ -0,0 +1,34 @@ +using global::System.Text.Json; +using global::System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[Serializable] +public record StructuredOutputRerunResponse : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + /// + /// This is the id of the workflow processing the rerun. + /// + [JsonPropertyName("workflowId")] + public string? WorkflowId { get; set; } + + [JsonPropertyName("message")] + public required string Message { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/StructuredOutputRunPreviewResponse.cs b/src/Vapi.Net/Types/StructuredOutputRunPreviewResponse.cs new file mode 100644 index 00000000..3b2fae8e --- /dev/null +++ b/src/Vapi.Net/Types/StructuredOutputRunPreviewResponse.cs @@ -0,0 +1,33 @@ +using global::System.Text.Json; +using global::System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[Serializable] +public record StructuredOutputRunPreviewResponse : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + /// + /// These are the structured outputs whose conditions gated them, keyed by + /// structured output id. Absent when nothing was skipped. An entry here means + /// no extraction ran and no cost was incurred for that output. + /// + [JsonPropertyName("skipped")] + public Dictionary? Skipped { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/StructuredOutputRunResult.cs b/src/Vapi.Net/Types/StructuredOutputRunResult.cs new file mode 100644 index 00000000..4e24cad6 --- /dev/null +++ b/src/Vapi.Net/Types/StructuredOutputRunResult.cs @@ -0,0 +1,41 @@ +using global::System.Text.Json; +using global::System.Text.Json.Serialization; +using OneOf; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[Serializable] +public record StructuredOutputRunResult : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + /// + /// This is the name of the structured output that produced this value. + /// + [JsonPropertyName("name")] + public required string Name { get; set; } + + /// + /// This is the extracted value, shaped by the structured output's schema. + /// + [JsonPropertyName("result")] + public OneOf>? Result { get; set; } + + [JsonPropertyName("compliancePlan")] + public ComplianceOverride? CompliancePlan { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/SubscriptionLimits.cs b/src/Vapi.Net/Types/SubscriptionLimits.cs index ab4fa7ee..35f02d8f 100644 --- a/src/Vapi.Net/Types/SubscriptionLimits.cs +++ b/src/Vapi.Net/Types/SubscriptionLimits.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Organization concurrency limits and remaining concurrent call capacity. +/// [Serializable] public record SubscriptionLimits : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/SuccessEvaluationPlan.cs b/src/Vapi.Net/Types/SuccessEvaluationPlan.cs index 156854f7..b2c1f56d 100644 --- a/src/Vapi.Net/Types/SuccessEvaluationPlan.cs +++ b/src/Vapi.Net/Types/SuccessEvaluationPlan.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Controls post-call success evaluation, including the rubric, prompt messages, enablement, and request timeout. +/// [Serializable] public record SuccessEvaluationPlan : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/SummaryPlan.cs b/src/Vapi.Net/Types/SummaryPlan.cs index c80387b5..1b2554d7 100644 --- a/src/Vapi.Net/Types/SummaryPlan.cs +++ b/src/Vapi.Net/Types/SummaryPlan.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Controls generation of a post-call summary, including prompt messages, enablement, and request timeout. +/// [Serializable] public record SummaryPlan : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/SupabaseBucketPlan.cs b/src/Vapi.Net/Types/SupabaseBucketPlan.cs index 5824e4b7..7a3e7696 100644 --- a/src/Vapi.Net/Types/SupabaseBucketPlan.cs +++ b/src/Vapi.Net/Types/SupabaseBucketPlan.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Supabase S3-compatible bucket configuration for call artifacts, including region, endpoint, access keys, bucket name, and path. +/// [Serializable] public record SupabaseBucketPlan : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/SyncVoiceLibraryDtoProvidersItem.cs b/src/Vapi.Net/Types/SyncVoiceLibraryDtoProvidersItem.cs index 9899ff8a..dcf5fbab 100644 --- a/src/Vapi.Net/Types/SyncVoiceLibraryDtoProvidersItem.cs +++ b/src/Vapi.Net/Types/SyncVoiceLibraryDtoProvidersItem.cs @@ -62,6 +62,12 @@ public enum SyncVoiceLibraryDtoProvidersItem [EnumMember(Value = "orpheus")] Orpheus, + + [EnumMember(Value = "xai")] + Xai, + + [EnumMember(Value = "microsoft")] + Microsoft, } internal class SyncVoiceLibraryDtoProvidersItemSerializer @@ -91,6 +97,8 @@ internal class SyncVoiceLibraryDtoProvidersItemSerializer { "minimax", SyncVoiceLibraryDtoProvidersItem.Minimax }, { "wellsaid", SyncVoiceLibraryDtoProvidersItem.Wellsaid }, { "orpheus", SyncVoiceLibraryDtoProvidersItem.Orpheus }, + { "xai", SyncVoiceLibraryDtoProvidersItem.Xai }, + { "microsoft", SyncVoiceLibraryDtoProvidersItem.Microsoft }, }; private static readonly global::System.Collections.Generic.Dictionary< @@ -117,6 +125,8 @@ internal class SyncVoiceLibraryDtoProvidersItemSerializer { SyncVoiceLibraryDtoProvidersItem.Minimax, "minimax" }, { SyncVoiceLibraryDtoProvidersItem.Wellsaid, "wellsaid" }, { SyncVoiceLibraryDtoProvidersItem.Orpheus, "orpheus" }, + { SyncVoiceLibraryDtoProvidersItem.Xai, "xai" }, + { SyncVoiceLibraryDtoProvidersItem.Microsoft, "microsoft" }, }; public override SyncVoiceLibraryDtoProvidersItem Read( diff --git a/src/Vapi.Net/Types/SystemMessage.cs b/src/Vapi.Net/Types/SystemMessage.cs index 632486d7..6dcd00de 100644 --- a/src/Vapi.Net/Types/SystemMessage.cs +++ b/src/Vapi.Net/Types/SystemMessage.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// A system-authored entry in the call message history, including its content and timing. +/// [Serializable] public record SystemMessage : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/TalkscriberTranscriber.cs b/src/Vapi.Net/Types/TalkscriberTranscriber.cs index 21263e53..c0ec5061 100644 --- a/src/Vapi.Net/Types/TalkscriberTranscriber.cs +++ b/src/Vapi.Net/Types/TalkscriberTranscriber.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Configuration for transcribing speech during assistant conversations with Talkscriber, including model, language, and fallback settings. +/// [Serializable] public record TalkscriberTranscriber : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/TavusConversationProperties.cs b/src/Vapi.Net/Types/TavusConversationProperties.cs index 8ca6bc91..4d3f325a 100644 --- a/src/Vapi.Net/Types/TavusConversationProperties.cs +++ b/src/Vapi.Net/Types/TavusConversationProperties.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Tavus conversation behavior and media settings, including duration, participant timeouts, recording, transcription, background, language, and recording storage. +/// [Serializable] public record TavusConversationProperties : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/TavusVoice.cs b/src/Vapi.Net/Types/TavusVoice.cs index b07a5c7c..79da9e4a 100644 --- a/src/Vapi.Net/Types/TavusVoice.cs +++ b/src/Vapi.Net/Types/TavusVoice.cs @@ -5,6 +5,9 @@ namespace Vapi.Net; +/// +/// Configuration for using Tavus as the assistant's voice provider, including persona, callback, context, greeting, conversation properties, chunking, caching, and fallback settings. +/// [Serializable] public record TavusVoice : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/TelnyxPhoneNumber.cs b/src/Vapi.Net/Types/TelnyxPhoneNumber.cs index cd5bc8b7..1a82d9d4 100644 --- a/src/Vapi.Net/Types/TelnyxPhoneNumber.cs +++ b/src/Vapi.Net/Types/TelnyxPhoneNumber.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// A Telnyx phone number connected to Vapi, including its credential, routing, hooks, server settings, and lifecycle metadata. +/// [Serializable] public record TelnyxPhoneNumber : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/TelnyxTransport.cs b/src/Vapi.Net/Types/TelnyxTransport.cs new file mode 100644 index 00000000..d392a60a --- /dev/null +++ b/src/Vapi.Net/Types/TelnyxTransport.cs @@ -0,0 +1,49 @@ +using global::System.Text.Json; +using global::System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[Serializable] +public record TelnyxTransport : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + /// + /// This is the conversation type of the call (ie, voice or chat). + /// + [JsonPropertyName("conversationType")] + public TelnyxTransportConversationType? ConversationType { get; set; } + + /// + /// This is the call control ID of the Telnyx call. + /// + [JsonPropertyName("callControlId")] + public string? CallControlId { get; set; } + + /// + /// This is the call leg ID of the Telnyx call. + /// + [JsonPropertyName("callLegId")] + public string? CallLegId { get; set; } + + /// + /// This is the call session ID of the Telnyx call. + /// + [JsonPropertyName("callSessionId")] + public string? CallSessionId { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/TelnyxTransportConversationType.cs b/src/Vapi.Net/Types/TelnyxTransportConversationType.cs new file mode 100644 index 00000000..18d82d4e --- /dev/null +++ b/src/Vapi.Net/Types/TelnyxTransportConversationType.cs @@ -0,0 +1,73 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(TelnyxTransportConversationTypeSerializer))] +public enum TelnyxTransportConversationType +{ + [EnumMember(Value = "voice")] + Voice, +} + +internal class TelnyxTransportConversationTypeSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + TelnyxTransportConversationType + > _stringToEnum = new() { { "voice", TelnyxTransportConversationType.Voice } }; + + private static readonly global::System.Collections.Generic.Dictionary< + TelnyxTransportConversationType, + string + > _enumToString = new() { { TelnyxTransportConversationType.Voice, "voice" } }; + + public override TelnyxTransportConversationType Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + TelnyxTransportConversationType value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override TelnyxTransportConversationType ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + TelnyxTransportConversationType value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/TextContent.cs b/src/Vapi.Net/Types/TextContent.cs index 0df52916..f26a77bd 100644 --- a/src/Vapi.Net/Types/TextContent.cs +++ b/src/Vapi.Net/Types/TextContent.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Localized text content used as a language-specific message variant. +/// [Serializable] public record TextContent : IJsonOnDeserialized { @@ -11,12 +14,21 @@ public record TextContent : IJsonOnDeserialized private readonly IDictionary _extensionData = new Dictionary(); + /// + /// Selects text as the content type. + /// [JsonPropertyName("type")] public required TextContentType Type { get; set; } + /// + /// Text spoken or displayed for this content variant. + /// [JsonPropertyName("text")] public required string Text { get; set; } + /// + /// Language code associated with this text variant. + /// [JsonPropertyName("language")] public required TextContentLanguage Language { get; set; } diff --git a/src/Vapi.Net/Types/TextEditorTool.cs b/src/Vapi.Net/Types/TextEditorTool.cs index 4e7d3989..accc5691 100644 --- a/src/Vapi.Net/Types/TextEditorTool.cs +++ b/src/Vapi.Net/Types/TextEditorTool.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// A reusable tool that reads and edits text files in a configured environment. +/// [Serializable] public record TextEditorTool : IJsonOnDeserialized { @@ -11,10 +14,11 @@ public record TextEditorTool : IJsonOnDeserialized private readonly IDictionary _extensionData = new Dictionary(); + [JsonPropertyName("latestVersion")] + public string? LatestVersion { 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. + /// Messages spoken while the tool is running. Multiple request-start messages are variants. For request-response-delayed, same timing means variants and different timings mean staged updates. /// [JsonPropertyName("messages")] public IEnumerable? Messages { get; set; } diff --git a/src/Vapi.Net/Types/TextEditorToolWithToolCall.cs b/src/Vapi.Net/Types/TextEditorToolWithToolCall.cs index a2fec685..ee924342 100644 --- a/src/Vapi.Net/Types/TextEditorToolWithToolCall.cs +++ b/src/Vapi.Net/Types/TextEditorToolWithToolCall.cs @@ -12,9 +12,7 @@ public record TextEditorToolWithToolCall : IJsonOnDeserialized new Dictionary(); /// - /// 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. + /// Messages spoken while the tool is running. Multiple request-start messages are variants. For request-response-delayed, same timing means variants and different timings mean staged updates. /// [JsonPropertyName("messages")] public IEnumerable? Messages { get; set; } diff --git a/src/Vapi.Net/Types/TextInsight.cs b/src/Vapi.Net/Types/TextInsight.cs index e5566b4e..bdf06490 100644 --- a/src/Vapi.Net/Types/TextInsight.cs +++ b/src/Vapi.Net/Types/TextInsight.cs @@ -5,6 +5,9 @@ namespace Vapi.Net; +/// +/// A saved text-value insight containing its call-data queries, formula, time range, and lifecycle information. +/// [Serializable] public record TextInsight : IJsonOnDeserialized { @@ -38,6 +41,9 @@ public record TextInsight : IJsonOnDeserialized [JsonPropertyName("formula")] public object? Formula { get; set; } + /// + /// The time range used to query the text-value data. + /// [JsonPropertyName("timeRange")] public InsightTimeRange? TimeRange { get; set; } @@ -85,6 +91,12 @@ public IEnumerable< [JsonPropertyName("updatedAt")] public required DateTime UpdatedAt { get; set; } + /// + /// Stable server-owned identifier for system-created insights. + /// + [JsonPropertyName("systemKey")] + public string? SystemKey { get; set; } + [JsonIgnore] public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); diff --git a/src/Vapi.Net/Types/TimeRange.cs b/src/Vapi.Net/Types/TimeRange.cs index c85d7cf4..6c952971 100644 --- a/src/Vapi.Net/Types/TimeRange.cs +++ b/src/Vapi.Net/Types/TimeRange.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Start, end, timezone, and time step used for analytics aggregation. +/// [Serializable] public record TimeRange : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/TogetherAiModel.cs b/src/Vapi.Net/Types/TogetherAiModel.cs index 49406246..d8ebc13c 100644 --- a/src/Vapi.Net/Types/TogetherAiModel.cs +++ b/src/Vapi.Net/Types/TogetherAiModel.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Configuration for generating assistant responses with Together AI, including model, prompts, tools, knowledge-base access, and generation settings. +/// [Serializable] public record TogetherAiModel : IJsonOnDeserialized { @@ -33,6 +36,15 @@ public record TogetherAiModel : IJsonOnDeserialized [JsonPropertyName("toolIds")] public IEnumerable? ToolIds { get; set; } + /// + /// These are version-pinned references to tools. Each entry pins a specific + /// version of a tool by `(toolId, version)`. When the same `toolId` appears + /// in both `toolIds` and `toolRefs[]`, the `toolRefs` pin wins (the + /// `toolIds` entry is dropped at write time). + /// + [JsonPropertyName("toolRefs")] + public IEnumerable? ToolRefs { get; set; } + /// /// These are the options for the knowledge base. /// @@ -46,7 +58,7 @@ public record TogetherAiModel : IJsonOnDeserialized public required string Model { get; set; } /// - /// This is the temperature that will be used for calls. Default is 0 to leverage caching for lower latency. + /// This is the temperature that will be used for calls. Default is 0.5. /// [JsonPropertyName("temperature")] public double? Temperature { get; set; } diff --git a/src/Vapi.Net/Types/ToolCall.cs b/src/Vapi.Net/Types/ToolCall.cs index 2779da93..81c42bdc 100644 --- a/src/Vapi.Net/Types/ToolCall.cs +++ b/src/Vapi.Net/Types/ToolCall.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// A tool invocation requested by the assistant, including its identifier, type, and function details. +/// [Serializable] public record ToolCall : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/ToolCallFunction.cs b/src/Vapi.Net/Types/ToolCallFunction.cs index 5bee7a79..b3fef98c 100644 --- a/src/Vapi.Net/Types/ToolCallFunction.cs +++ b/src/Vapi.Net/Types/ToolCallFunction.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// The function name and serialized arguments associated with a tool call. +/// [Serializable] public record ToolCallFunction : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/ToolCallHookAction.cs b/src/Vapi.Net/Types/ToolCallHookAction.cs index d180a541..2e595951 100644 --- a/src/Vapi.Net/Types/ToolCallHookAction.cs +++ b/src/Vapi.Net/Types/ToolCallHookAction.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// A hook action that invokes an inline tool or an existing tool when the hook triggers. +/// [Serializable] public record ToolCallHookAction : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/ToolCallMessage.cs b/src/Vapi.Net/Types/ToolCallMessage.cs index 9a7416d2..b5ff09e5 100644 --- a/src/Vapi.Net/Types/ToolCallMessage.cs +++ b/src/Vapi.Net/Types/ToolCallMessage.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// An entry in the call message history that records one or more tool calls requested during the conversation. +/// [Serializable] public record ToolCallMessage : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/ToolCallResult.cs b/src/Vapi.Net/Types/ToolCallResult.cs index bf307954..51a5e6f1 100644 --- a/src/Vapi.Net/Types/ToolCallResult.cs +++ b/src/Vapi.Net/Types/ToolCallResult.cs @@ -19,7 +19,7 @@ public record ToolCallResult : IJsonOnDeserialized /// 2. a response generated by the model, if not /// [JsonPropertyName("message")] - public ToolCallResultMessage? Message { get; set; } + public object? Message { get; set; } /// /// This is the name of the function the model called. diff --git a/src/Vapi.Net/Types/ToolCallResultMessage.cs b/src/Vapi.Net/Types/ToolCallResultMessage.cs deleted file mode 100644 index 7e5b37f1..00000000 --- a/src/Vapi.Net/Types/ToolCallResultMessage.cs +++ /dev/null @@ -1,67 +0,0 @@ -using global::System.Text.Json; -using global::System.Text.Json.Serialization; -using Vapi.Net.Core; - -namespace Vapi.Net; - -[Serializable] -public record ToolCallResultMessage : IJsonOnDeserialized -{ - [JsonExtensionData] - private readonly IDictionary _extensionData = - new Dictionary(); - - /// - /// The role of the tool call result in the conversation. - /// - [JsonPropertyName("role")] - public required string Role { get; set; } - - /// - /// The ID of the tool call. - /// - [JsonPropertyName("toolCallId")] - public required string ToolCallId { get; set; } - - /// - /// The name of the tool that returned the result. - /// - [JsonPropertyName("name")] - public required string Name { get; set; } - - /// - /// The result of the tool call in JSON format. - /// - [JsonPropertyName("result")] - public required string Result { get; set; } - - /// - /// The timestamp when the message was sent. - /// - [JsonPropertyName("time")] - public required double Time { get; set; } - - /// - /// The number of seconds from the start of the conversation. - /// - [JsonPropertyName("secondsFromStart")] - public required double SecondsFromStart { get; set; } - - /// - /// The metadata for the tool call result. - /// - [JsonPropertyName("metadata")] - public object? Metadata { get; set; } - - [JsonIgnore] - public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); - - void IJsonOnDeserialized.OnDeserialized() => - AdditionalProperties.CopyFromExtensionData(_extensionData); - - /// - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Vapi.Net/Types/ToolCallResultMessageWarning.cs b/src/Vapi.Net/Types/ToolCallResultMessageWarning.cs new file mode 100644 index 00000000..d35f10d1 --- /dev/null +++ b/src/Vapi.Net/Types/ToolCallResultMessageWarning.cs @@ -0,0 +1,46 @@ +using global::System.Text.Json; +using global::System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[Serializable] +public record ToolCallResultMessageWarning : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + /// + /// The kind of warning. Currently: + /// - `oversized-tool-response`: the tool's serialized response exceeded the + /// recommended size and is likely to bloat the model context, increasing + /// latency and risking truncation of earlier instructions. + /// + [JsonPropertyName("type")] + public required ToolCallResultMessageWarningType Type { get; set; } + + /// + /// The estimated number of tokens in the serialized tool response. + /// + [JsonPropertyName("tokenCount")] + public required double TokenCount { get; set; } + + /// + /// The threshold (in tokens) above which the warning is raised. + /// + [JsonPropertyName("threshold")] + public required double Threshold { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/ToolCallResultMessageWarningType.cs b/src/Vapi.Net/Types/ToolCallResultMessageWarningType.cs new file mode 100644 index 00000000..73b4c49b --- /dev/null +++ b/src/Vapi.Net/Types/ToolCallResultMessageWarningType.cs @@ -0,0 +1,79 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(ToolCallResultMessageWarningTypeSerializer))] +public enum ToolCallResultMessageWarningType +{ + [EnumMember(Value = "oversized-tool-response")] + OversizedToolResponse, +} + +internal class ToolCallResultMessageWarningTypeSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + ToolCallResultMessageWarningType + > _stringToEnum = new() + { + { "oversized-tool-response", ToolCallResultMessageWarningType.OversizedToolResponse }, + }; + + private static readonly global::System.Collections.Generic.Dictionary< + ToolCallResultMessageWarningType, + string + > _enumToString = new() + { + { ToolCallResultMessageWarningType.OversizedToolResponse, "oversized-tool-response" }, + }; + + public override ToolCallResultMessageWarningType Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + ToolCallResultMessageWarningType value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override ToolCallResultMessageWarningType ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + ToolCallResultMessageWarningType value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/ToolDraft.cs b/src/Vapi.Net/Types/ToolDraft.cs new file mode 100644 index 00000000..14865ed6 --- /dev/null +++ b/src/Vapi.Net/Types/ToolDraft.cs @@ -0,0 +1,344 @@ +using global::System.Text.Json; +using global::System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[Serializable] +public record ToolDraft : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + /// + /// Messages spoken while the tool is running. Multiple request-start messages are variants. For request-response-delayed, same timing means variants and different timings mean staged updates. + /// + [JsonPropertyName("messages")] + public IEnumerable? Messages { get; set; } + + /// + /// This is the type of the tool. + /// + [JsonPropertyName("type")] + public ToolDraftType? Type { get; set; } + + /// + /// Key used as `draftId` in URLs. + /// + [JsonPropertyName("id")] + public required string Id { get; set; } + + /// + /// This is the unique identifier for the org that owns this draft. + /// + [JsonPropertyName("orgId")] + public required string OrgId { get; set; } + + /// + /// This is the unique identifier for the tool this draft was forked from. + /// Intentionally NOT a FK — `tool_draft` mirrors `tool_version` / `version_pin`'s + /// no-FK / app-cleanup philosophy, so there is no `ON DELETE CASCADE`. Drafts + /// must be cleaned up explicitly (`toolDraftDelete({ orgId, toolId })`) on a + /// parent tool hard-delete; nothing reaps them automatically. + /// + [JsonPropertyName("toolId")] + public required string ToolId { get; set; } + + /// + /// The published version this draft was forked from. Server defaults to + /// `tool.latestVersion` on POST if omitted. Immutable for the draft's lifetime. + /// + [JsonPropertyName("baseVersion")] + public required string BaseVersion { get; set; } + + /// + /// Email when JWT, null when API or external JWT. Set on POST, never rewritten on PATCH. + /// + [JsonPropertyName("createdBy")] + public string? CreatedBy { get; set; } + + /// + /// This is the ISO 8601 date-time string of when the draft was created. + /// + [JsonPropertyName("createdAt")] + public required DateTime CreatedAt { get; set; } + + /// + /// This is the ISO 8601 date-time string of when the draft was last updated. + /// + [JsonPropertyName("updatedAt")] + public required DateTime UpdatedAt { get; set; } + + /// + /// This is the plan to reject a tool call based on the conversation state. + /// + /// // Example 1: Reject endCall if user didn't say goodbye + /// ```json + /// { + /// conditions: [{ + /// type: 'regex', + /// regex: '(?i)\\b(bye|goodbye|farewell|see you later|take care)\\b', + /// target: { position: -1, role: 'user' }, + /// negate: true // Reject if pattern does NOT match + /// }] + /// } + /// ``` + /// + /// // Example 2: Reject transfer if user is actually asking a question + /// ```json + /// { + /// conditions: [{ + /// type: 'regex', + /// regex: '\\?', + /// target: { position: -1, role: 'user' } + /// }] + /// } + /// ``` + /// + /// // Example 3: Reject transfer if user didn't mention transfer recently + /// ```json + /// { + /// conditions: [{ + /// type: 'liquid', + /// liquid: `{% assign recentMessages = messages | last: 5 %} + /// {% assign userMessages = recentMessages | where: 'role', 'user' %} + /// {% assign mentioned = false %} + /// {% for msg in userMessages %} + /// {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %} + /// {% assign mentioned = true %} + /// {% break %} + /// {% endif %} + /// {% endfor %} + /// {% if mentioned %} + /// false + /// {% else %} + /// true + /// {% endif %}` + /// }] + /// } + /// ``` + /// + /// // Example 4: Reject endCall if the bot is looping and trying to exit + /// ```json + /// { + /// conditions: [{ + /// type: 'liquid', + /// liquid: `{% assign recentMessages = messages | last: 6 %} + /// {% assign userMessages = recentMessages | where: 'role', 'user' | reverse %} + /// {% if userMessages.size < 3 %} + /// false + /// {% else %} + /// {% assign msg1 = userMessages[0].content | downcase %} + /// {% assign msg2 = userMessages[1].content | downcase %} + /// {% assign msg3 = userMessages[2].content | downcase %} + /// {% comment %} Check for repetitive messages {% endcomment %} + /// {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %} + /// true + /// {% comment %} Check for common loop phrases {% endcomment %} + /// {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %} + /// true + /// {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %} + /// true + /// {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %} + /// true + /// {% else %} + /// false + /// {% endif %} + /// {% endif %}` + /// }] + /// } + /// ``` + /// + [JsonPropertyName("rejectionPlan")] + public ToolRejectionPlan? RejectionPlan { get; set; } + + /// + /// This is the function definition of the tool. + /// + [JsonPropertyName("function")] + public OpenAiFunction? Function { get; set; } + + /// + /// Provider-specific metadata. Polymorphic across tool variants with no shared + /// discriminator, so it is validated as a plain object (mirrors how + /// `ToolCallResult.metadata` is typed). + /// + [JsonPropertyName("metadata")] + public object? Metadata { get; set; } + + /// + /// This is the unique identifier for the template this tool was created from. + /// + [JsonPropertyName("templateId")] + public string? TemplateId { get; set; } + + [JsonPropertyName("server")] + public Server? Server { get; set; } + + [JsonPropertyName("async")] + public bool? Async { get; set; } + + /// + /// These are the destinations that the call can be transferred to. + /// + [JsonPropertyName("destinations")] + public IEnumerable? Destinations { 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 sub type of the tool (e.g. for computer, bash and text-editor tools). + /// + [JsonPropertyName("subType")] + public string? SubType { get; set; } + + /// + /// The display width in pixels (computer tool). + /// + [JsonPropertyName("displayWidthPx")] + public double? DisplayWidthPx { get; set; } + + /// + /// The display height in pixels (computer tool). + /// + [JsonPropertyName("displayHeightPx")] + public double? DisplayHeightPx { get; set; } + + /// + /// Optional display number (computer tool). + /// + [JsonPropertyName("displayNumber")] + public double? DisplayNumber { get; set; } + + /// + /// The knowledge bases to query (query tool). + /// + [JsonPropertyName("knowledgeBases")] + public IEnumerable? KnowledgeBases { get; set; } + + /// + /// This is where the request will be sent (api-request tool). + /// + [JsonPropertyName("url")] + public string? Url { get; set; } + + /// + /// This is the HTTP method for the request (api-request tool). + /// + [JsonPropertyName("method")] + public ToolDraftMethod? Method { get; set; } + + /// + /// These are the headers to send with the request (api-request / sip-request tool). + /// + [JsonPropertyName("headers")] + public JsonSchema? Headers { get; set; } + + /// + /// This is the body of the request. Either a JSON schema (api-request) or a + /// literal string / schema (sip-request). + /// + [JsonPropertyName("body")] + public object? Body { get; set; } + + /// + /// This is the backoff plan if the request fails. + /// + [JsonPropertyName("backoffPlan")] + public BackoffPlan? BackoffPlan { get; set; } + + /// + /// This is the timeout in seconds for the request. + /// + [JsonPropertyName("timeoutSeconds")] + public double? TimeoutSeconds { 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 the plan to extract variables from the tool's response. + /// + [JsonPropertyName("variableExtractionPlan")] + public VariableExtractionPlan? VariableExtractionPlan { get; set; } + + /// + /// This is the credential ID that will be used for authorization. + /// + [JsonPropertyName("credentialId")] + public string? CredentialId { get; set; } + + [JsonPropertyName("extendedDelayWhenPrecededByTextEnabled")] + public bool? ExtendedDelayWhenPrecededByTextEnabled { get; set; } + + [JsonPropertyName("beepDetectionEnabled")] + public bool? BeepDetectionEnabled { get; set; } + + /// + /// This is the TypeScript code that will be executed when the tool is called (code tool). + /// + [JsonPropertyName("code")] + public string? Code { get; set; } + + /// + /// These are the environment variables available in the code via the `env` object (code tool). + /// + [JsonPropertyName("environmentVariables")] + public IEnumerable? EnvironmentVariables { get; set; } + + /// + /// These are the static parameters to merge into the tool's request body. + /// + [JsonPropertyName("parameters")] + public IEnumerable? Parameters { get; set; } + + /// + /// This is the paths to encrypt in the request body. + /// + [JsonPropertyName("encryptedPaths")] + public IEnumerable? EncryptedPaths { get; set; } + + /// + /// This enables sending DTMF tones via SIP INFO messages instead of RFC 2833. + /// + [JsonPropertyName("sipInfoDtmfEnabled")] + public bool? SipInfoDtmfEnabled { get; set; } + + /// + /// This is the SIP method to send (sip-request tool). + /// + [JsonPropertyName("verb")] + public ToolDraftVerb? Verb { get; set; } + + /// + /// This is the default local tool result message used when no runtime override is returned (handoff tool). + /// + [JsonPropertyName("defaultResult")] + public string? DefaultResult { get; set; } + + /// + /// Per-tool message overrides for individual tools loaded from the MCP server (mcp tool). + /// + [JsonPropertyName("toolMessages")] + public IEnumerable? ToolMessages { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/ToolDraftConflictResponseDto.cs b/src/Vapi.Net/Types/ToolDraftConflictResponseDto.cs new file mode 100644 index 00000000..76c970cb --- /dev/null +++ b/src/Vapi.Net/Types/ToolDraftConflictResponseDto.cs @@ -0,0 +1,34 @@ +using global::System.Text.Json; +using global::System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[Serializable] +public record ToolDraftConflictResponseDto : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("existingDraftId")] + public string? ExistingDraftId { get; set; } + + [JsonPropertyName("error")] + public required string Error { get; set; } + + [JsonPropertyName("message")] + public required string Message { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/ToolDraftMethod.cs b/src/Vapi.Net/Types/ToolDraftMethod.cs new file mode 100644 index 00000000..a682e8b6 --- /dev/null +++ b/src/Vapi.Net/Types/ToolDraftMethod.cs @@ -0,0 +1,99 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(ToolDraftMethodSerializer))] +public enum ToolDraftMethod +{ + [EnumMember(Value = "POST")] + Post, + + [EnumMember(Value = "GET")] + Get, + + [EnumMember(Value = "PUT")] + Put, + + [EnumMember(Value = "PATCH")] + Patch, + + [EnumMember(Value = "DELETE")] + Delete, +} + +internal class ToolDraftMethodSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + ToolDraftMethod + > _stringToEnum = new() + { + { "POST", ToolDraftMethod.Post }, + { "GET", ToolDraftMethod.Get }, + { "PUT", ToolDraftMethod.Put }, + { "PATCH", ToolDraftMethod.Patch }, + { "DELETE", ToolDraftMethod.Delete }, + }; + + private static readonly global::System.Collections.Generic.Dictionary< + ToolDraftMethod, + string + > _enumToString = new() + { + { ToolDraftMethod.Post, "POST" }, + { ToolDraftMethod.Get, "GET" }, + { ToolDraftMethod.Put, "PUT" }, + { ToolDraftMethod.Patch, "PATCH" }, + { ToolDraftMethod.Delete, "DELETE" }, + }; + + public override ToolDraftMethod Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + ToolDraftMethod value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override ToolDraftMethod ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + ToolDraftMethod value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/ToolDraftPaginatedMetadata.cs b/src/Vapi.Net/Types/ToolDraftPaginatedMetadata.cs new file mode 100644 index 00000000..58fb1965 --- /dev/null +++ b/src/Vapi.Net/Types/ToolDraftPaginatedMetadata.cs @@ -0,0 +1,34 @@ +using global::System.Text.Json; +using global::System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[Serializable] +public record ToolDraftPaginatedMetadata : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("nextCursor")] + public string? NextCursor { get; set; } + + [JsonPropertyName("hasNextPage")] + public required bool HasNextPage { get; set; } + + [JsonPropertyName("limit")] + public required double Limit { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/ToolDraftPaginatedResponse.cs b/src/Vapi.Net/Types/ToolDraftPaginatedResponse.cs new file mode 100644 index 00000000..7a37240a --- /dev/null +++ b/src/Vapi.Net/Types/ToolDraftPaginatedResponse.cs @@ -0,0 +1,31 @@ +using global::System.Text.Json; +using global::System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[Serializable] +public record ToolDraftPaginatedResponse : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("results")] + public IEnumerable Results { get; set; } = new List(); + + [JsonPropertyName("metadata")] + public required ToolDraftPaginatedMetadata Metadata { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/ToolDraftType.cs b/src/Vapi.Net/Types/ToolDraftType.cs new file mode 100644 index 00000000..c9242b87 --- /dev/null +++ b/src/Vapi.Net/Types/ToolDraftType.cs @@ -0,0 +1,220 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(ToolDraftTypeSerializer))] +public enum ToolDraftType +{ + [EnumMember(Value = "dtmf")] + Dtmf, + + [EnumMember(Value = "endCall")] + EndCall, + + [EnumMember(Value = "transferCall")] + TransferCall, + + [EnumMember(Value = "transferCancel")] + TransferCancel, + + [EnumMember(Value = "transferSuccessful")] + TransferSuccessful, + + [EnumMember(Value = "handoff")] + Handoff, + + [EnumMember(Value = "output")] + Output, + + [EnumMember(Value = "voicemail")] + Voicemail, + + [EnumMember(Value = "query")] + Query, + + [EnumMember(Value = "sms")] + Sms, + + [EnumMember(Value = "sipRequest")] + SipRequest, + + [EnumMember(Value = "function")] + Function, + + [EnumMember(Value = "mcp")] + Mcp, + + [EnumMember(Value = "apiRequest")] + ApiRequest, + + [EnumMember(Value = "code")] + Code, + + [EnumMember(Value = "bash")] + Bash, + + [EnumMember(Value = "computer")] + Computer, + + [EnumMember(Value = "textEditor")] + TextEditor, + + [EnumMember(Value = "google.calendar.event.create")] + GoogleCalendarEventCreate, + + [EnumMember(Value = "google.calendar.availability.check")] + GoogleCalendarAvailabilityCheck, + + [EnumMember(Value = "google.sheets.row.append")] + GoogleSheetsRowAppend, + + [EnumMember(Value = "slack.message.send")] + SlackMessageSend, + + [EnumMember(Value = "gohighlevel.calendar.event.create")] + GohighlevelCalendarEventCreate, + + [EnumMember(Value = "gohighlevel.calendar.availability.check")] + GohighlevelCalendarAvailabilityCheck, + + [EnumMember(Value = "gohighlevel.contact.create")] + GohighlevelContactCreate, + + [EnumMember(Value = "gohighlevel.contact.get")] + GohighlevelContactGet, + + [EnumMember(Value = "make")] + Make, + + [EnumMember(Value = "ghl")] + Ghl, +} + +internal class ToolDraftTypeSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + ToolDraftType + > _stringToEnum = new() + { + { "dtmf", ToolDraftType.Dtmf }, + { "endCall", ToolDraftType.EndCall }, + { "transferCall", ToolDraftType.TransferCall }, + { "transferCancel", ToolDraftType.TransferCancel }, + { "transferSuccessful", ToolDraftType.TransferSuccessful }, + { "handoff", ToolDraftType.Handoff }, + { "output", ToolDraftType.Output }, + { "voicemail", ToolDraftType.Voicemail }, + { "query", ToolDraftType.Query }, + { "sms", ToolDraftType.Sms }, + { "sipRequest", ToolDraftType.SipRequest }, + { "function", ToolDraftType.Function }, + { "mcp", ToolDraftType.Mcp }, + { "apiRequest", ToolDraftType.ApiRequest }, + { "code", ToolDraftType.Code }, + { "bash", ToolDraftType.Bash }, + { "computer", ToolDraftType.Computer }, + { "textEditor", ToolDraftType.TextEditor }, + { "google.calendar.event.create", ToolDraftType.GoogleCalendarEventCreate }, + { "google.calendar.availability.check", ToolDraftType.GoogleCalendarAvailabilityCheck }, + { "google.sheets.row.append", ToolDraftType.GoogleSheetsRowAppend }, + { "slack.message.send", ToolDraftType.SlackMessageSend }, + { "gohighlevel.calendar.event.create", ToolDraftType.GohighlevelCalendarEventCreate }, + { + "gohighlevel.calendar.availability.check", + ToolDraftType.GohighlevelCalendarAvailabilityCheck + }, + { "gohighlevel.contact.create", ToolDraftType.GohighlevelContactCreate }, + { "gohighlevel.contact.get", ToolDraftType.GohighlevelContactGet }, + { "make", ToolDraftType.Make }, + { "ghl", ToolDraftType.Ghl }, + }; + + private static readonly global::System.Collections.Generic.Dictionary< + ToolDraftType, + string + > _enumToString = new() + { + { ToolDraftType.Dtmf, "dtmf" }, + { ToolDraftType.EndCall, "endCall" }, + { ToolDraftType.TransferCall, "transferCall" }, + { ToolDraftType.TransferCancel, "transferCancel" }, + { ToolDraftType.TransferSuccessful, "transferSuccessful" }, + { ToolDraftType.Handoff, "handoff" }, + { ToolDraftType.Output, "output" }, + { ToolDraftType.Voicemail, "voicemail" }, + { ToolDraftType.Query, "query" }, + { ToolDraftType.Sms, "sms" }, + { ToolDraftType.SipRequest, "sipRequest" }, + { ToolDraftType.Function, "function" }, + { ToolDraftType.Mcp, "mcp" }, + { ToolDraftType.ApiRequest, "apiRequest" }, + { ToolDraftType.Code, "code" }, + { ToolDraftType.Bash, "bash" }, + { ToolDraftType.Computer, "computer" }, + { ToolDraftType.TextEditor, "textEditor" }, + { ToolDraftType.GoogleCalendarEventCreate, "google.calendar.event.create" }, + { ToolDraftType.GoogleCalendarAvailabilityCheck, "google.calendar.availability.check" }, + { ToolDraftType.GoogleSheetsRowAppend, "google.sheets.row.append" }, + { ToolDraftType.SlackMessageSend, "slack.message.send" }, + { ToolDraftType.GohighlevelCalendarEventCreate, "gohighlevel.calendar.event.create" }, + { + ToolDraftType.GohighlevelCalendarAvailabilityCheck, + "gohighlevel.calendar.availability.check" + }, + { ToolDraftType.GohighlevelContactCreate, "gohighlevel.contact.create" }, + { ToolDraftType.GohighlevelContactGet, "gohighlevel.contact.get" }, + { ToolDraftType.Make, "make" }, + { ToolDraftType.Ghl, "ghl" }, + }; + + public override ToolDraftType Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + ToolDraftType value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override ToolDraftType ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + ToolDraftType value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/ToolDraftVerb.cs b/src/Vapi.Net/Types/ToolDraftVerb.cs new file mode 100644 index 00000000..8809d9a2 --- /dev/null +++ b/src/Vapi.Net/Types/ToolDraftVerb.cs @@ -0,0 +1,89 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(ToolDraftVerbSerializer))] +public enum ToolDraftVerb +{ + [EnumMember(Value = "INFO")] + Info, + + [EnumMember(Value = "MESSAGE")] + Message, + + [EnumMember(Value = "NOTIFY")] + Notify, +} + +internal class ToolDraftVerbSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + ToolDraftVerb + > _stringToEnum = new() + { + { "INFO", ToolDraftVerb.Info }, + { "MESSAGE", ToolDraftVerb.Message }, + { "NOTIFY", ToolDraftVerb.Notify }, + }; + + private static readonly global::System.Collections.Generic.Dictionary< + ToolDraftVerb, + string + > _enumToString = new() + { + { ToolDraftVerb.Info, "INFO" }, + { ToolDraftVerb.Message, "MESSAGE" }, + { ToolDraftVerb.Notify, "NOTIFY" }, + }; + + public override ToolDraftVerb Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + ToolDraftVerb value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override ToolDraftVerb ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + ToolDraftVerb value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/ToolMessage.cs b/src/Vapi.Net/Types/ToolMessage.cs index f8a37bfc..964f8066 100644 --- a/src/Vapi.Net/Types/ToolMessage.cs +++ b/src/Vapi.Net/Types/ToolMessage.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// A tool-result message associated with a specific tool call. +/// [Serializable] public record ToolMessage : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/ToolMessageComplete.cs b/src/Vapi.Net/Types/ToolMessageComplete.cs index 4da2e4bb..53012cc4 100644 --- a/src/Vapi.Net/Types/ToolMessageComplete.cs +++ b/src/Vapi.Net/Types/ToolMessageComplete.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Message spoken when a tool call completes, with optional language variants, argument conditions, role, and end-call behavior. +/// [Serializable] public record ToolMessageComplete : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/ToolMessageDelayed.cs b/src/Vapi.Net/Types/ToolMessageDelayed.cs index 496ec70f..2609d10f 100644 --- a/src/Vapi.Net/Types/ToolMessageDelayed.cs +++ b/src/Vapi.Net/Types/ToolMessageDelayed.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Message spoken when a tool call exceeds a configured response delay, with optional language variants and argument conditions. +/// [Serializable] public record ToolMessageDelayed : IJsonOnDeserialized { @@ -24,7 +27,7 @@ public record ToolMessageDelayed : IJsonOnDeserialized public IEnumerable? Contents { get; set; } /// - /// The number of milliseconds to wait for the server response before saying this message. + /// The number of milliseconds to wait for the server response before saying this delayed message. /// [JsonPropertyName("timingMilliseconds")] public double? TimingMilliseconds { get; set; } diff --git a/src/Vapi.Net/Types/ToolMessageFailed.cs b/src/Vapi.Net/Types/ToolMessageFailed.cs index 2047a649..57949715 100644 --- a/src/Vapi.Net/Types/ToolMessageFailed.cs +++ b/src/Vapi.Net/Types/ToolMessageFailed.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Message spoken when a tool call fails, with optional language variants, argument conditions, and end-call behavior. +/// [Serializable] public record ToolMessageFailed : IJsonOnDeserialized { @@ -23,9 +26,29 @@ public record ToolMessageFailed : IJsonOnDeserialized [JsonPropertyName("contents")] public IEnumerable? Contents { get; set; } + /// + /// This is optional and defaults to "assistant". + /// + /// When role=assistant, `content` is said out loud when the tool call fails. + /// + /// When role=system, `content` is passed to the model as a system message + /// along with the failure result, and the model's generated response is + /// spoken. Example: + /// assistant: tool called + /// tool: error from your server + /// <--- system prompt as hint + /// ---> model generates response which is spoken + /// This is useful when you want the model to generate an error-aware + /// response instead of speaking a fixed failure message. + /// + [JsonPropertyName("role")] + public ToolMessageFailedRole? Role { get; set; } + /// /// This is an optional boolean that if true, the call will end after the message is spoken. Default is false. /// + /// This is ignored if `role` is set to `system`. + /// /// @default false /// [JsonPropertyName("endCallAfterSpokenEnabled")] diff --git a/src/Vapi.Net/Types/ToolMessageFailedRole.cs b/src/Vapi.Net/Types/ToolMessageFailedRole.cs new file mode 100644 index 00000000..3345f31c --- /dev/null +++ b/src/Vapi.Net/Types/ToolMessageFailedRole.cs @@ -0,0 +1,84 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(ToolMessageFailedRoleSerializer))] +public enum ToolMessageFailedRole +{ + [EnumMember(Value = "assistant")] + Assistant, + + [EnumMember(Value = "system")] + System, +} + +internal class ToolMessageFailedRoleSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + ToolMessageFailedRole + > _stringToEnum = new() + { + { "assistant", ToolMessageFailedRole.Assistant }, + { "system", ToolMessageFailedRole.System }, + }; + + private static readonly global::System.Collections.Generic.Dictionary< + ToolMessageFailedRole, + string + > _enumToString = new() + { + { ToolMessageFailedRole.Assistant, "assistant" }, + { ToolMessageFailedRole.System, "system" }, + }; + + public override ToolMessageFailedRole Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + ToolMessageFailedRole value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override ToolMessageFailedRole ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + ToolMessageFailedRole value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/ToolMessageStart.cs b/src/Vapi.Net/Types/ToolMessageStart.cs index 44612e8a..24fe3a3d 100644 --- a/src/Vapi.Net/Types/ToolMessageStart.cs +++ b/src/Vapi.Net/Types/ToolMessageStart.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Message spoken when a tool call starts, with optional language variants, argument conditions, and blocking behavior. +/// [Serializable] public record ToolMessageStart : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/ToolNode.cs b/src/Vapi.Net/Types/ToolNode.cs index 5189f851..e696590f 100644 --- a/src/Vapi.Net/Types/ToolNode.cs +++ b/src/Vapi.Net/Types/ToolNode.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// A workflow node that invokes an inline tool or an existing saved tool. +/// [Serializable] public record ToolNode : IJsonOnDeserialized { @@ -23,6 +26,9 @@ public record ToolNode : IJsonOnDeserialized [JsonPropertyName("toolId")] public string? ToolId { get; set; } + /// + /// Unique name used to identify this workflow node. + /// [JsonPropertyName("name")] public required string Name { get; set; } diff --git a/src/Vapi.Net/Types/ToolParameter.cs b/src/Vapi.Net/Types/ToolParameter.cs index 12ab1152..6ec66629 100644 --- a/src/Vapi.Net/Types/ToolParameter.cs +++ b/src/Vapi.Net/Types/ToolParameter.cs @@ -5,6 +5,9 @@ namespace Vapi.Net; +/// +/// Static key-value parameter added to a tool request, with Liquid template support for string values. +/// [Serializable] public record ToolParameter : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/ToolPinnedConflictResponseDto.cs b/src/Vapi.Net/Types/ToolPinnedConflictResponseDto.cs new file mode 100644 index 00000000..7fa9cc95 --- /dev/null +++ b/src/Vapi.Net/Types/ToolPinnedConflictResponseDto.cs @@ -0,0 +1,34 @@ +using global::System.Text.Json; +using global::System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[Serializable] +public record ToolPinnedConflictResponseDto : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("error")] + public required ToolPinnedConflictResponseDtoError Error { get; set; } + + /// + /// Human-readable reason the parent-tool delete was rejected. + /// + [JsonPropertyName("message")] + public required string Message { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/ToolPinnedConflictResponseDtoError.cs b/src/Vapi.Net/Types/ToolPinnedConflictResponseDtoError.cs new file mode 100644 index 00000000..b325d451 --- /dev/null +++ b/src/Vapi.Net/Types/ToolPinnedConflictResponseDtoError.cs @@ -0,0 +1,73 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(ToolPinnedConflictResponseDtoErrorSerializer))] +public enum ToolPinnedConflictResponseDtoError +{ + [EnumMember(Value = "tool_pinned")] + ToolPinned, +} + +internal class ToolPinnedConflictResponseDtoErrorSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + ToolPinnedConflictResponseDtoError + > _stringToEnum = new() { { "tool_pinned", ToolPinnedConflictResponseDtoError.ToolPinned } }; + + private static readonly global::System.Collections.Generic.Dictionary< + ToolPinnedConflictResponseDtoError, + string + > _enumToString = new() { { ToolPinnedConflictResponseDtoError.ToolPinned, "tool_pinned" } }; + + public override ToolPinnedConflictResponseDtoError Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + ToolPinnedConflictResponseDtoError value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override ToolPinnedConflictResponseDtoError ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + ToolPinnedConflictResponseDtoError value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/TrieveKnowledgeBaseImport.cs b/src/Vapi.Net/Types/ToolRef.cs similarity index 64% rename from src/Vapi.Net/Types/TrieveKnowledgeBaseImport.cs rename to src/Vapi.Net/Types/ToolRef.cs index 42634a1c..8ab9e24b 100644 --- a/src/Vapi.Net/Types/TrieveKnowledgeBaseImport.cs +++ b/src/Vapi.Net/Types/ToolRef.cs @@ -5,23 +5,23 @@ namespace Vapi.Net; [Serializable] -public record TrieveKnowledgeBaseImport : IJsonOnDeserialized +public record ToolRef : IJsonOnDeserialized { [JsonExtensionData] private readonly IDictionary _extensionData = new Dictionary(); /// - /// This is to import an existing dataset from Trieve. + /// This is the unique identifier of the tool whose version is being pinned. /// - [JsonPropertyName("type")] - public required TrieveKnowledgeBaseImportType Type { get; set; } + [JsonPropertyName("toolId")] + public required string ToolId { get; set; } /// - /// This is the `datasetId` of the dataset on your Trieve account. + /// Public version label of the tool, e.g. "v3" /// - [JsonPropertyName("providerId")] - public required string ProviderId { get; set; } + [JsonPropertyName("version")] + public required string Version { get; set; } [JsonIgnore] public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); diff --git a/src/Vapi.Net/Types/ToolRejectionPlan.cs b/src/Vapi.Net/Types/ToolRejectionPlan.cs index 20eac00a..c66036e1 100644 --- a/src/Vapi.Net/Types/ToolRejectionPlan.cs +++ b/src/Vapi.Net/Types/ToolRejectionPlan.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Conditions evaluated to determine whether a requested tool call should be rejected. +/// [Serializable] public record ToolRejectionPlan : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/ToolVersion.cs b/src/Vapi.Net/Types/ToolVersion.cs new file mode 100644 index 00000000..4deb2cd7 --- /dev/null +++ b/src/Vapi.Net/Types/ToolVersion.cs @@ -0,0 +1,194 @@ +using global::System.Text.Json; +using global::System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[Serializable] +public record ToolVersion : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + /// + /// Optional human-readable label for this version. Pass `null` to clear. + /// + [JsonPropertyName("versionName")] + public string? VersionName { get; set; } + + /// + /// Optional description for this version. Pass `null` to clear. + /// + [JsonPropertyName("versionDescription")] + public string? VersionDescription { get; set; } + + [JsonPropertyName("type")] + public object? Type { get; set; } + + [JsonPropertyName("function")] + public object? Function { get; set; } + + [JsonPropertyName("messages")] + public IEnumerable? Messages { get; set; } + + [JsonPropertyName("metadata")] + public object? Metadata { get; set; } + + [JsonPropertyName("templateId")] + public string? TemplateId { get; set; } + + [JsonPropertyName("server")] + public Server? Server { get; set; } + + [JsonPropertyName("async")] + public bool? Async { get; set; } + + [JsonPropertyName("destinations")] + public IEnumerable? Destinations { get; set; } + + [JsonPropertyName("name")] + public string? Name { get; set; } + + [JsonPropertyName("subType")] + public string? SubType { get; set; } + + [JsonPropertyName("displayWidthPx")] + public double? DisplayWidthPx { get; set; } + + [JsonPropertyName("displayHeightPx")] + public double? DisplayHeightPx { get; set; } + + [JsonPropertyName("displayNumber")] + public double? DisplayNumber { get; set; } + + [JsonPropertyName("knowledgeBases")] + public IEnumerable? KnowledgeBases { get; set; } + + [JsonPropertyName("url")] + public string? Url { get; set; } + + [JsonPropertyName("method")] + public string? Method { get; set; } + + [JsonPropertyName("headers")] + public object? Headers { get; set; } + + [JsonPropertyName("body")] + public object? Body { get; set; } + + [JsonPropertyName("backoffPlan")] + public object? BackoffPlan { get; set; } + + [JsonPropertyName("timeoutSeconds")] + public double? TimeoutSeconds { get; set; } + + [JsonPropertyName("description")] + public string? Description { get; set; } + + [JsonPropertyName("variableExtractionPlan")] + public object? VariableExtractionPlan { get; set; } + + [JsonPropertyName("rejectionPlan")] + public object? RejectionPlan { get; set; } + + [JsonPropertyName("credentialId")] + public string? CredentialId { get; set; } + + [JsonPropertyName("extendedDelayWhenPrecededByTextEnabled")] + public bool? ExtendedDelayWhenPrecededByTextEnabled { get; set; } + + [JsonPropertyName("beepDetectionEnabled")] + public bool? BeepDetectionEnabled { get; set; } + + [JsonPropertyName("code")] + public string? Code { get; set; } + + [JsonPropertyName("environmentVariables")] + public IEnumerable? EnvironmentVariables { get; set; } + + [JsonPropertyName("parameters")] + public IEnumerable? Parameters { get; set; } + + [JsonPropertyName("encryptedPaths")] + public IEnumerable? EncryptedPaths { get; set; } + + [JsonPropertyName("sipInfoDtmfEnabled")] + public bool? SipInfoDtmfEnabled { get; set; } + + [JsonPropertyName("verb")] + public string? Verb { get; set; } + + [JsonPropertyName("defaultResult")] + public string? DefaultResult { get; set; } + + [JsonPropertyName("toolMessages")] + public IEnumerable? ToolMessages { get; set; } + + /// + /// This is the unique identifier for the version row. + /// + [JsonPropertyName("id")] + public required string Id { get; set; } + + /// + /// This is the unique identifier for the org that owns this version. + /// + [JsonPropertyName("orgId")] + public required string OrgId { get; set; } + + /// + /// This is the unique identifier for the tool this version was snapshotted from. + /// + [JsonPropertyName("toolId")] + public required string ToolId { get; set; } + + /// + /// This is the public monotonic version label, e.g. "v1". + /// System-owned and incremented per tool; never user-supplied. + /// + [JsonPropertyName("version")] + public required string Version { get; set; } + + /// + /// This is the SHA-256 hex of the snapshotted content used for no-op detection. + /// + [JsonPropertyName("configHash")] + public required string ConfigHash { get; set; } + + /// + /// This is the prior version label (vN-1). Null on v1 or for branch roots. + /// + [JsonPropertyName("parentVersion")] + public string? ParentVersion { get; set; } + + /// + /// This is the actor that wrote this version. Email when created via JWT, null when created via API. + /// + [JsonPropertyName("createdBy")] + public string? CreatedBy { get; set; } + + /// + /// This is the soft-delete timestamp. Null when active. + /// + [JsonPropertyName("deletedAt")] + public DateTime? DeletedAt { get; set; } + + /// + /// This is the ISO 8601 date-time string of when the version was created. + /// + [JsonPropertyName("createdAt")] + public required DateTime CreatedAt { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/ToolVersionPaginatedMetadata.cs b/src/Vapi.Net/Types/ToolVersionPaginatedMetadata.cs new file mode 100644 index 00000000..1c3fe5c5 --- /dev/null +++ b/src/Vapi.Net/Types/ToolVersionPaginatedMetadata.cs @@ -0,0 +1,34 @@ +using global::System.Text.Json; +using global::System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[Serializable] +public record ToolVersionPaginatedMetadata : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("nextCursor")] + public string? NextCursor { get; set; } + + [JsonPropertyName("hasNextPage")] + public required bool HasNextPage { get; set; } + + [JsonPropertyName("limit")] + public required double Limit { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/ToolVersionPaginatedResponse.cs b/src/Vapi.Net/Types/ToolVersionPaginatedResponse.cs new file mode 100644 index 00000000..61038815 --- /dev/null +++ b/src/Vapi.Net/Types/ToolVersionPaginatedResponse.cs @@ -0,0 +1,31 @@ +using global::System.Text.Json; +using global::System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[Serializable] +public record ToolVersionPaginatedResponse : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("results")] + public IEnumerable Results { get; set; } = new List(); + + [JsonPropertyName("metadata")] + public required ToolVersionPaginatedMetadata Metadata { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + 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 d8d0c16d..88b8df5b 100644 --- a/src/Vapi.Net/Types/TranscriberCost.cs +++ b/src/Vapi.Net/Types/TranscriberCost.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Speech-to-text cost for a call, including transcriber, billable minutes, and amount. +/// [Serializable] public record TranscriberCost : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/TranscriptPlan.cs b/src/Vapi.Net/Types/TranscriptPlan.cs index bf826b5d..13838d8e 100644 --- a/src/Vapi.Net/Types/TranscriptPlan.cs +++ b/src/Vapi.Net/Types/TranscriptPlan.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Controls whether the call transcript is stored and the speaker names used in the transcript. +/// [Serializable] public record TranscriptPlan : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/TranscriptionEndpointingPlan.cs b/src/Vapi.Net/Types/TranscriptionEndpointingPlan.cs index c859e743..310e1dfd 100644 --- a/src/Vapi.Net/Types/TranscriptionEndpointingPlan.cs +++ b/src/Vapi.Net/Types/TranscriptionEndpointingPlan.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Controls endpointing delays based on whether customer speech ends with punctuation, without punctuation, or with a number. +/// [Serializable] public record TranscriptionEndpointingPlan : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/TransferArtifact.cs b/src/Vapi.Net/Types/TransferArtifact.cs new file mode 100644 index 00000000..daa6b331 --- /dev/null +++ b/src/Vapi.Net/Types/TransferArtifact.cs @@ -0,0 +1,59 @@ +using global::System.Text.Json; +using global::System.Text.Json.Serialization; +using OneOf; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[Serializable] +public record TransferArtifact : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + /// + /// The transfer destination (phone number or SIP URI). + /// + [JsonPropertyName("destination")] + public required object Destination { get; set; } + + /// + /// The transfer mode (e.g. warm-transfer-experimental, blind-transfer). + /// + [JsonPropertyName("mode")] + public TransferArtifactMode? Mode { get; set; } + + /// + /// Flat-text transcript / announcement preview of the transfer. + /// + [JsonPropertyName("transcript")] + public string? Transcript { get; set; } + + /// + /// The terminal status of the transfer, rendered as the status line. + /// + [JsonPropertyName("status")] + public TransferArtifactStatus? Status { get; set; } + + /// + /// The agent↔operator conversation captured during a + /// warm-transfer-experimental, rendered as bubbles. + /// + [JsonPropertyName("messages")] + public IEnumerable< + OneOf + >? Messages { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/TransferArtifactMode.cs b/src/Vapi.Net/Types/TransferArtifactMode.cs new file mode 100644 index 00000000..3c8e12ad --- /dev/null +++ b/src/Vapi.Net/Types/TransferArtifactMode.cs @@ -0,0 +1,132 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(TransferArtifactModeSerializer))] +public enum TransferArtifactMode +{ + [EnumMember(Value = "blind-transfer")] + BlindTransfer, + + [EnumMember(Value = "blind-transfer-add-summary-to-sip-header")] + BlindTransferAddSummaryToSipHeader, + + [EnumMember(Value = "warm-transfer-say-message")] + WarmTransferSayMessage, + + [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, + + [EnumMember(Value = "warm-transfer-wait-for-operator-to-speak-first-and-then-say-summary")] + WarmTransferWaitForOperatorToSpeakFirstAndThenSaySummary, + + [EnumMember(Value = "warm-transfer-experimental")] + WarmTransferExperimental, +} + +internal class TransferArtifactModeSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + TransferArtifactMode + > _stringToEnum = new() + { + { "blind-transfer", TransferArtifactMode.BlindTransfer }, + { + "blind-transfer-add-summary-to-sip-header", + TransferArtifactMode.BlindTransferAddSummaryToSipHeader + }, + { "warm-transfer-say-message", TransferArtifactMode.WarmTransferSayMessage }, + { "warm-transfer-say-summary", TransferArtifactMode.WarmTransferSaySummary }, + { "warm-transfer-twiml", TransferArtifactMode.WarmTransferTwiml }, + { + "warm-transfer-wait-for-operator-to-speak-first-and-then-say-message", + TransferArtifactMode.WarmTransferWaitForOperatorToSpeakFirstAndThenSayMessage + }, + { + "warm-transfer-wait-for-operator-to-speak-first-and-then-say-summary", + TransferArtifactMode.WarmTransferWaitForOperatorToSpeakFirstAndThenSaySummary + }, + { "warm-transfer-experimental", TransferArtifactMode.WarmTransferExperimental }, + }; + + private static readonly global::System.Collections.Generic.Dictionary< + TransferArtifactMode, + string + > _enumToString = new() + { + { TransferArtifactMode.BlindTransfer, "blind-transfer" }, + { + TransferArtifactMode.BlindTransferAddSummaryToSipHeader, + "blind-transfer-add-summary-to-sip-header" + }, + { TransferArtifactMode.WarmTransferSayMessage, "warm-transfer-say-message" }, + { TransferArtifactMode.WarmTransferSaySummary, "warm-transfer-say-summary" }, + { TransferArtifactMode.WarmTransferTwiml, "warm-transfer-twiml" }, + { + TransferArtifactMode.WarmTransferWaitForOperatorToSpeakFirstAndThenSayMessage, + "warm-transfer-wait-for-operator-to-speak-first-and-then-say-message" + }, + { + TransferArtifactMode.WarmTransferWaitForOperatorToSpeakFirstAndThenSaySummary, + "warm-transfer-wait-for-operator-to-speak-first-and-then-say-summary" + }, + { TransferArtifactMode.WarmTransferExperimental, "warm-transfer-experimental" }, + }; + + public override TransferArtifactMode Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + TransferArtifactMode value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override TransferArtifactMode ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + TransferArtifactMode value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/TransferArtifactStatus.cs b/src/Vapi.Net/Types/TransferArtifactStatus.cs new file mode 100644 index 00000000..3b32ce92 --- /dev/null +++ b/src/Vapi.Net/Types/TransferArtifactStatus.cs @@ -0,0 +1,109 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(TransferArtifactStatusSerializer))] +public enum TransferArtifactStatus +{ + [EnumMember(Value = "connected")] + Connected, + + [EnumMember(Value = "no-answer")] + NoAnswer, + + [EnumMember(Value = "busy")] + Busy, + + [EnumMember(Value = "voicemail")] + Voicemail, + + [EnumMember(Value = "failed")] + Failed, + + [EnumMember(Value = "completed")] + Completed, + + [EnumMember(Value = "cancelled")] + Cancelled, +} + +internal class TransferArtifactStatusSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + TransferArtifactStatus + > _stringToEnum = new() + { + { "connected", TransferArtifactStatus.Connected }, + { "no-answer", TransferArtifactStatus.NoAnswer }, + { "busy", TransferArtifactStatus.Busy }, + { "voicemail", TransferArtifactStatus.Voicemail }, + { "failed", TransferArtifactStatus.Failed }, + { "completed", TransferArtifactStatus.Completed }, + { "cancelled", TransferArtifactStatus.Cancelled }, + }; + + private static readonly global::System.Collections.Generic.Dictionary< + TransferArtifactStatus, + string + > _enumToString = new() + { + { TransferArtifactStatus.Connected, "connected" }, + { TransferArtifactStatus.NoAnswer, "no-answer" }, + { TransferArtifactStatus.Busy, "busy" }, + { TransferArtifactStatus.Voicemail, "voicemail" }, + { TransferArtifactStatus.Failed, "failed" }, + { TransferArtifactStatus.Completed, "completed" }, + { TransferArtifactStatus.Cancelled, "cancelled" }, + }; + + public override TransferArtifactStatus Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + TransferArtifactStatus value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override TransferArtifactStatus ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + TransferArtifactStatus value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/TransferCallTool.cs b/src/Vapi.Net/Types/TransferCallTool.cs index 1d3d2a71..e22f1c58 100644 --- a/src/Vapi.Net/Types/TransferCallTool.cs +++ b/src/Vapi.Net/Types/TransferCallTool.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// A reusable tool that transfers the active call to one of its configured destinations. +/// [Serializable] public record TransferCallTool : IJsonOnDeserialized { @@ -11,10 +14,11 @@ public record TransferCallTool : IJsonOnDeserialized private readonly IDictionary _extensionData = new Dictionary(); + [JsonPropertyName("latestVersion")] + public string? LatestVersion { 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. + /// Messages spoken while the tool is running. Multiple request-start messages are variants. For request-response-delayed, same timing means variants and different timings mean staged updates. /// [JsonPropertyName("messages")] public IEnumerable? Messages { get; set; } diff --git a/src/Vapi.Net/Types/TransferCancelToolUserEditable.cs b/src/Vapi.Net/Types/TransferCancelToolUserEditable.cs index c44947d2..074d54bd 100644 --- a/src/Vapi.Net/Types/TransferCancelToolUserEditable.cs +++ b/src/Vapi.Net/Types/TransferCancelToolUserEditable.cs @@ -12,9 +12,7 @@ public record TransferCancelToolUserEditable : IJsonOnDeserialized new Dictionary(); /// - /// 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. + /// Messages spoken while the tool is running. Multiple request-start messages are variants. For request-response-delayed, same timing means variants and different timings mean staged updates. /// [JsonPropertyName("messages")] public IEnumerable? Messages { get; set; } diff --git a/src/Vapi.Net/Types/TransferDestinationAssistant.cs b/src/Vapi.Net/Types/TransferDestinationAssistant.cs index e7512ba6..020bf727 100644 --- a/src/Vapi.Net/Types/TransferDestinationAssistant.cs +++ b/src/Vapi.Net/Types/TransferDestinationAssistant.cs @@ -5,6 +5,9 @@ namespace Vapi.Net; +/// +/// Transfers a call to another assistant by name, with an optional message and assistant-transfer mode. +/// [Serializable] public record TransferDestinationAssistant : IJsonOnDeserialized { @@ -24,6 +27,9 @@ public record TransferDestinationAssistant : IJsonOnDeserialized [JsonPropertyName("message")] public OneOf? Message { get; set; } + /// + /// Selects another assistant as the transfer destination. + /// [JsonPropertyName("type")] public required TransferDestinationAssistantType Type { get; set; } diff --git a/src/Vapi.Net/Types/TransferDestinationNumber.cs b/src/Vapi.Net/Types/TransferDestinationNumber.cs index f8f76917..f42346d9 100644 --- a/src/Vapi.Net/Types/TransferDestinationNumber.cs +++ b/src/Vapi.Net/Types/TransferDestinationNumber.cs @@ -5,6 +5,9 @@ namespace Vapi.Net; +/// +/// Transfers a call to a phone number, with optional extension, caller ID, message, transfer plan, and number validation. +/// [Serializable] public record TransferDestinationNumber : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/TransferDestinationSip.cs b/src/Vapi.Net/Types/TransferDestinationSip.cs index 1191e6aa..648e57cf 100644 --- a/src/Vapi.Net/Types/TransferDestinationSip.cs +++ b/src/Vapi.Net/Types/TransferDestinationSip.cs @@ -5,6 +5,9 @@ namespace Vapi.Net; +/// +/// Transfers a call to a SIP URI, with optional caller ID, headers, message, and transfer plan. +/// [Serializable] public record TransferDestinationSip : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/TransferFallbackPlan.cs b/src/Vapi.Net/Types/TransferFallbackPlan.cs index 1355e8ec..98f5e5b8 100644 --- a/src/Vapi.Net/Types/TransferFallbackPlan.cs +++ b/src/Vapi.Net/Types/TransferFallbackPlan.cs @@ -5,6 +5,9 @@ namespace Vapi.Net; +/// +/// Controls the message and end-call behavior used when a call transfer fails. +/// [Serializable] public record TransferFallbackPlan : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/TransferPhoneNumberHookAction.cs b/src/Vapi.Net/Types/TransferPhoneNumberHookAction.cs index 7a00f75b..95842251 100644 --- a/src/Vapi.Net/Types/TransferPhoneNumberHookAction.cs +++ b/src/Vapi.Net/Types/TransferPhoneNumberHookAction.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// A phone-number hook action that transfers the call to a phone number or SIP destination. +/// [Serializable] public record TransferPhoneNumberHookAction : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/TransferPlan.cs b/src/Vapi.Net/Types/TransferPlan.cs index 5af0b477..9546b2ae 100644 --- a/src/Vapi.Net/Types/TransferPlan.cs +++ b/src/Vapi.Net/Types/TransferPlan.cs @@ -5,6 +5,9 @@ namespace Vapi.Net; +/// +/// Controls how a call transfer is executed, including blind and warm transfer modes, dialing and SIP behavior, hold audio, context, summary, and failure handling. +/// [Serializable] public record TransferPlan : IJsonOnDeserialized { @@ -144,8 +147,10 @@ public record TransferPlan : IJsonOnDeserialized /// 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. + /// - Used when `mode` is `warm-transfer-experimental`. If not provided, a default message will be used. + /// - Used for SIP cold transfers (`blind-transfer` modes) when transfer outcome detection and fallback + /// are enabled for the organization: on a failed transfer, the assistant speaks `message`, then ends + /// the call or continues with the customer per `endCallEnabled`. /// [JsonPropertyName("fallbackPlan")] public TransferFallbackPlan? FallbackPlan { get; set; } diff --git a/src/Vapi.Net/Types/TransferSuccessfulToolUserEditable.cs b/src/Vapi.Net/Types/TransferSuccessfulToolUserEditable.cs index 47e96f0e..3db0023a 100644 --- a/src/Vapi.Net/Types/TransferSuccessfulToolUserEditable.cs +++ b/src/Vapi.Net/Types/TransferSuccessfulToolUserEditable.cs @@ -12,9 +12,7 @@ public record TransferSuccessfulToolUserEditable : IJsonOnDeserialized new Dictionary(); /// - /// 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. + /// Messages spoken while the tool is running. Multiple request-start messages are variants. For request-response-delayed, same timing means variants and different timings mean staged updates. /// [JsonPropertyName("messages")] public IEnumerable? Messages { get; set; } diff --git a/src/Vapi.Net/Types/TransportConfigurationTwilio.cs b/src/Vapi.Net/Types/TransportConfigurationTwilio.cs index ce699031..70ab10b2 100644 --- a/src/Vapi.Net/Types/TransportConfigurationTwilio.cs +++ b/src/Vapi.Net/Types/TransportConfigurationTwilio.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Configuration passed to Twilio for assistant calls, including ring timeout and Twilio recording behavior. +/// [Serializable] public record TransportConfigurationTwilio : IJsonOnDeserialized { @@ -11,6 +14,9 @@ public record TransportConfigurationTwilio : IJsonOnDeserialized private readonly IDictionary _extensionData = new Dictionary(); + /// + /// Selects Twilio as the call transport provider. + /// [JsonPropertyName("provider")] public required TransportConfigurationTwilioProvider Provider { get; set; } diff --git a/src/Vapi.Net/Types/TransportCost.cs b/src/Vapi.Net/Types/TransportCost.cs index 5e1cff96..6b58776b 100644 --- a/src/Vapi.Net/Types/TransportCost.cs +++ b/src/Vapi.Net/Types/TransportCost.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Telephony transport cost for a call, including provider, billable minutes, and amount. +/// [Serializable] public record TransportCost : IJsonOnDeserialized { @@ -11,6 +14,9 @@ public record TransportCost : IJsonOnDeserialized private readonly IDictionary _extensionData = new Dictionary(); + /// + /// Telephony or transport provider that generated the cost. + /// [JsonPropertyName("provider")] public TransportCostProvider? Provider { get; set; } diff --git a/src/Vapi.Net/Types/TrieveKnowledgeBase.cs b/src/Vapi.Net/Types/TrieveKnowledgeBase.cs deleted file mode 100644 index 60adb7e8..00000000 --- a/src/Vapi.Net/Types/TrieveKnowledgeBase.cs +++ /dev/null @@ -1,67 +0,0 @@ -using global::System.Text.Json; -using global::System.Text.Json.Serialization; -using Vapi.Net.Core; - -namespace Vapi.Net; - -[Serializable] -public record TrieveKnowledgeBase : IJsonOnDeserialized -{ - [JsonExtensionData] - private readonly IDictionary _extensionData = - new Dictionary(); - - /// - /// This knowledge base is provided by Trieve. - /// - /// To learn more about Trieve, visit https://trieve.ai. - /// - [JsonPropertyName("provider")] - public required TrieveKnowledgeBaseProvider Provider { get; set; } - - /// - /// This is the name of the knowledge base. - /// - [JsonPropertyName("name")] - public string? Name { get; set; } - - /// - /// This is the searching plan used when searching for relevant chunks from the vector store. - /// - /// You should configure this if you're running into these issues: - /// - Too much unnecessary context is being fed as knowledge base context. - /// - Not enough relevant context is being fed as knowledge base context. - /// - [JsonPropertyName("searchPlan")] - public TrieveKnowledgeBaseSearchPlan? SearchPlan { get; set; } - - /// - /// This is the plan if you want us to create/import a new vector store using Trieve. - /// - [JsonPropertyName("createPlan")] - public TrieveKnowledgeBaseImport? CreatePlan { get; set; } - - /// - /// This is the id of the knowledge base. - /// - [JsonPropertyName("id")] - public required string Id { get; set; } - - /// - /// This is the org id of the knowledge base. - /// - [JsonPropertyName("orgId")] - public required string OrgId { get; set; } - - [JsonIgnore] - public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); - - void IJsonOnDeserialized.OnDeserialized() => - AdditionalProperties.CopyFromExtensionData(_extensionData); - - /// - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Vapi.Net/Types/TrieveKnowledgeBaseChunkPlan.cs b/src/Vapi.Net/Types/TrieveKnowledgeBaseChunkPlan.cs deleted file mode 100644 index 0ee3570b..00000000 --- a/src/Vapi.Net/Types/TrieveKnowledgeBaseChunkPlan.cs +++ /dev/null @@ -1,55 +0,0 @@ -using global::System.Text.Json; -using global::System.Text.Json.Serialization; -using Vapi.Net.Core; - -namespace Vapi.Net; - -[Serializable] -public record TrieveKnowledgeBaseChunkPlan : IJsonOnDeserialized -{ - [JsonExtensionData] - private readonly IDictionary _extensionData = - new Dictionary(); - - /// - /// These are the file ids that will be used to create the vector store. To upload files, use the `POST /files` endpoint. - /// - [JsonPropertyName("fileIds")] - public IEnumerable? FileIds { get; set; } - - /// - /// These are the websites that will be used to create the vector store. - /// - [JsonPropertyName("websites")] - public IEnumerable? Websites { get; set; } - - /// - /// This is an optional field which allows you to specify the number of splits you want per chunk. If not specified, the default 20 is used. However, you may want to use a different number. - /// - [JsonPropertyName("targetSplitsPerChunk")] - public double? TargetSplitsPerChunk { get; set; } - - /// - /// This is an optional field which allows you to specify the delimiters to use when splitting the file before chunking the text. If not specified, the default [.!?\n] are used to split into sentences. However, you may want to use spaces or other delimiters. - /// - [JsonPropertyName("splitDelimiters")] - public IEnumerable? SplitDelimiters { get; set; } - - /// - /// This is an optional field which allows you to specify whether or not to rebalance the chunks created from the file. If not specified, the default true is used. If true, Trieve will evenly distribute remainder splits across chunks such that 66 splits with a target_splits_per_chunk of 20 will result in 3 chunks with 22 splits each. - /// - [JsonPropertyName("rebalanceChunks")] - public bool? RebalanceChunks { get; set; } - - [JsonIgnore] - public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); - - void IJsonOnDeserialized.OnDeserialized() => - AdditionalProperties.CopyFromExtensionData(_extensionData); - - /// - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Vapi.Net/Types/TrieveKnowledgeBaseSearchPlan.cs b/src/Vapi.Net/Types/TrieveKnowledgeBaseSearchPlan.cs deleted file mode 100644 index 3a560119..00000000 --- a/src/Vapi.Net/Types/TrieveKnowledgeBaseSearchPlan.cs +++ /dev/null @@ -1,49 +0,0 @@ -using global::System.Text.Json; -using global::System.Text.Json.Serialization; -using Vapi.Net.Core; - -namespace Vapi.Net; - -[Serializable] -public record TrieveKnowledgeBaseSearchPlan : IJsonOnDeserialized -{ - [JsonExtensionData] - private readonly IDictionary _extensionData = - new Dictionary(); - - /// - /// 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. - /// - [JsonPropertyName("removeStopWords")] - public bool? RemoveStopWords { get; set; } - - /// - /// This is the score threshold to filter out chunks with a score below the threshold for cosine distance metric. For Manhattan Distance, Euclidean Distance, and Dot Product, it will filter out scores above the threshold distance. This threshold applies before weight and bias modifications. If not specified, this defaults to no threshold. A threshold of 0 will default to no threshold. - /// - [JsonPropertyName("scoreThreshold")] - public double? ScoreThreshold { get; set; } - - /// - /// This is the search method used when searching for relevant chunks from the vector store. - /// - [JsonPropertyName("searchType")] - public required TrieveKnowledgeBaseSearchPlanSearchType SearchType { get; set; } - - [JsonIgnore] - public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); - - void IJsonOnDeserialized.OnDeserialized() => - AdditionalProperties.CopyFromExtensionData(_extensionData); - - /// - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/src/Vapi.Net/Types/TurnLatency.cs b/src/Vapi.Net/Types/TurnLatency.cs index 84ced8e3..1a4fafc1 100644 --- a/src/Vapi.Net/Types/TurnLatency.cs +++ b/src/Vapi.Net/Types/TurnLatency.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Model, voice, transcription, endpointing, and total latency measurements for a conversation turn. +/// [Serializable] public record TurnLatency : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/TwilioPhoneNumber.cs b/src/Vapi.Net/Types/TwilioPhoneNumber.cs index 3a40b8d7..71208740 100644 --- a/src/Vapi.Net/Types/TwilioPhoneNumber.cs +++ b/src/Vapi.Net/Types/TwilioPhoneNumber.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// A Twilio phone number connected to Vapi, including its Twilio account details, SMS configuration, routing, hooks, server settings, and lifecycle metadata. +/// [Serializable] public record TwilioPhoneNumber : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/TwilioTransport.cs b/src/Vapi.Net/Types/TwilioTransport.cs new file mode 100644 index 00000000..b0a92042 --- /dev/null +++ b/src/Vapi.Net/Types/TwilioTransport.cs @@ -0,0 +1,56 @@ +using global::System.Text.Json; +using global::System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[Serializable] +public record TwilioTransport : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + /// + /// This is the conversation type of the call (ie, voice or chat). + /// + [JsonPropertyName("conversationType")] + public TwilioTransportConversationType? ConversationType { get; set; } + + /// + /// This is the account SID of the Twilio account. + /// + [JsonPropertyName("accountSid")] + public string? AccountSid { get; set; } + + /// + /// This is the call SID of the Twilio call. + /// + [JsonPropertyName("callSid")] + public string? CallSid { get; set; } + + /// + /// This is the call token of the Twilio call. + /// + [JsonPropertyName("callToken")] + public string? CallToken { get; set; } + + /// + /// This is the phone number from which the call was forwarded. + /// Undefined if the call was not forwarded. + /// + [JsonPropertyName("forwardedFrom")] + public string? ForwardedFrom { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/TwilioTransportConversationType.cs b/src/Vapi.Net/Types/TwilioTransportConversationType.cs new file mode 100644 index 00000000..f66f62aa --- /dev/null +++ b/src/Vapi.Net/Types/TwilioTransportConversationType.cs @@ -0,0 +1,73 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(TwilioTransportConversationTypeSerializer))] +public enum TwilioTransportConversationType +{ + [EnumMember(Value = "voice")] + Voice, +} + +internal class TwilioTransportConversationTypeSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + TwilioTransportConversationType + > _stringToEnum = new() { { "voice", TwilioTransportConversationType.Voice } }; + + private static readonly global::System.Collections.Generic.Dictionary< + TwilioTransportConversationType, + string + > _enumToString = new() { { TwilioTransportConversationType.Voice, "voice" } }; + + public override TwilioTransportConversationType Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + TwilioTransportConversationType value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override TwilioTransportConversationType ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + TwilioTransportConversationType value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/TwilioVoicemailDetectionPlan.cs b/src/Vapi.Net/Types/TwilioVoicemailDetectionPlan.cs index 748a5b08..597f03b7 100644 --- a/src/Vapi.Net/Types/TwilioVoicemailDetectionPlan.cs +++ b/src/Vapi.Net/Types/TwilioVoicemailDetectionPlan.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Configuration for Twilio answering-machine detection, including recognized outcomes, enablement, timeout, speech thresholds, and silence timeout. +/// [Serializable] public record TwilioVoicemailDetectionPlan : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/UpdateAnthropicBedrockCredentialDto.cs b/src/Vapi.Net/Types/UpdateAnthropicBedrockCredentialDto.cs index 4d61749b..2e600d52 100644 --- a/src/Vapi.Net/Types/UpdateAnthropicBedrockCredentialDto.cs +++ b/src/Vapi.Net/Types/UpdateAnthropicBedrockCredentialDto.cs @@ -11,6 +11,9 @@ public record UpdateAnthropicBedrockCredentialDto : IJsonOnDeserialized private readonly IDictionary _extensionData = new Dictionary(); + [JsonPropertyName("provider")] + public UpdateAnthropicBedrockCredentialDtoProvider? Provider { get; set; } + /// /// AWS region where Bedrock is configured. /// diff --git a/src/Vapi.Net/Types/UpdateAnthropicBedrockCredentialDtoProvider.cs b/src/Vapi.Net/Types/UpdateAnthropicBedrockCredentialDtoProvider.cs new file mode 100644 index 00000000..36142ee2 --- /dev/null +++ b/src/Vapi.Net/Types/UpdateAnthropicBedrockCredentialDtoProvider.cs @@ -0,0 +1,79 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(UpdateAnthropicBedrockCredentialDtoProviderSerializer))] +public enum UpdateAnthropicBedrockCredentialDtoProvider +{ + [EnumMember(Value = "anthropic-bedrock")] + AnthropicBedrock, +} + +internal class UpdateAnthropicBedrockCredentialDtoProviderSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + UpdateAnthropicBedrockCredentialDtoProvider + > _stringToEnum = new() + { + { "anthropic-bedrock", UpdateAnthropicBedrockCredentialDtoProvider.AnthropicBedrock }, + }; + + private static readonly global::System.Collections.Generic.Dictionary< + UpdateAnthropicBedrockCredentialDtoProvider, + string + > _enumToString = new() + { + { UpdateAnthropicBedrockCredentialDtoProvider.AnthropicBedrock, "anthropic-bedrock" }, + }; + + public override UpdateAnthropicBedrockCredentialDtoProvider Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + UpdateAnthropicBedrockCredentialDtoProvider value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override UpdateAnthropicBedrockCredentialDtoProvider ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + UpdateAnthropicBedrockCredentialDtoProvider value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/UpdateAnthropicBedrockCredentialDtoRegion.cs b/src/Vapi.Net/Types/UpdateAnthropicBedrockCredentialDtoRegion.cs index f1bb8fe3..22e68ed8 100644 --- a/src/Vapi.Net/Types/UpdateAnthropicBedrockCredentialDtoRegion.cs +++ b/src/Vapi.Net/Types/UpdateAnthropicBedrockCredentialDtoRegion.cs @@ -12,6 +12,9 @@ public enum UpdateAnthropicBedrockCredentialDtoRegion [EnumMember(Value = "us-west-2")] UsWest2, + [EnumMember(Value = "eu-central-1")] + EuCentral1, + [EnumMember(Value = "eu-west-1")] EuWest1, @@ -35,6 +38,7 @@ internal class UpdateAnthropicBedrockCredentialDtoRegionSerializer { { "us-east-1", UpdateAnthropicBedrockCredentialDtoRegion.UsEast1 }, { "us-west-2", UpdateAnthropicBedrockCredentialDtoRegion.UsWest2 }, + { "eu-central-1", UpdateAnthropicBedrockCredentialDtoRegion.EuCentral1 }, { "eu-west-1", UpdateAnthropicBedrockCredentialDtoRegion.EuWest1 }, { "eu-west-3", UpdateAnthropicBedrockCredentialDtoRegion.EuWest3 }, { "ap-northeast-1", UpdateAnthropicBedrockCredentialDtoRegion.ApNortheast1 }, @@ -48,6 +52,7 @@ internal class UpdateAnthropicBedrockCredentialDtoRegionSerializer { { UpdateAnthropicBedrockCredentialDtoRegion.UsEast1, "us-east-1" }, { UpdateAnthropicBedrockCredentialDtoRegion.UsWest2, "us-west-2" }, + { UpdateAnthropicBedrockCredentialDtoRegion.EuCentral1, "eu-central-1" }, { UpdateAnthropicBedrockCredentialDtoRegion.EuWest1, "eu-west-1" }, { UpdateAnthropicBedrockCredentialDtoRegion.EuWest3, "eu-west-3" }, { UpdateAnthropicBedrockCredentialDtoRegion.ApNortheast1, "ap-northeast-1" }, diff --git a/src/Vapi.Net/Types/UpdateAnthropicCredentialDto.cs b/src/Vapi.Net/Types/UpdateAnthropicCredentialDto.cs index 5fd7a5ce..a4f0a09e 100644 --- a/src/Vapi.Net/Types/UpdateAnthropicCredentialDto.cs +++ b/src/Vapi.Net/Types/UpdateAnthropicCredentialDto.cs @@ -11,6 +11,9 @@ public record UpdateAnthropicCredentialDto : IJsonOnDeserialized private readonly IDictionary _extensionData = new Dictionary(); + [JsonPropertyName("provider")] + public UpdateAnthropicCredentialDtoProvider? Provider { get; set; } + /// /// This is not returned in the API. /// diff --git a/src/Vapi.Net/Types/UpdateAnthropicCredentialDtoProvider.cs b/src/Vapi.Net/Types/UpdateAnthropicCredentialDtoProvider.cs new file mode 100644 index 00000000..ca775c55 --- /dev/null +++ b/src/Vapi.Net/Types/UpdateAnthropicCredentialDtoProvider.cs @@ -0,0 +1,73 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(UpdateAnthropicCredentialDtoProviderSerializer))] +public enum UpdateAnthropicCredentialDtoProvider +{ + [EnumMember(Value = "anthropic")] + Anthropic, +} + +internal class UpdateAnthropicCredentialDtoProviderSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + UpdateAnthropicCredentialDtoProvider + > _stringToEnum = new() { { "anthropic", UpdateAnthropicCredentialDtoProvider.Anthropic } }; + + private static readonly global::System.Collections.Generic.Dictionary< + UpdateAnthropicCredentialDtoProvider, + string + > _enumToString = new() { { UpdateAnthropicCredentialDtoProvider.Anthropic, "anthropic" } }; + + public override UpdateAnthropicCredentialDtoProvider Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + UpdateAnthropicCredentialDtoProvider value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override UpdateAnthropicCredentialDtoProvider ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + UpdateAnthropicCredentialDtoProvider value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/UpdateAnyscaleCredentialDto.cs b/src/Vapi.Net/Types/UpdateAnyscaleCredentialDto.cs index bb742b12..9e5ebdca 100644 --- a/src/Vapi.Net/Types/UpdateAnyscaleCredentialDto.cs +++ b/src/Vapi.Net/Types/UpdateAnyscaleCredentialDto.cs @@ -11,6 +11,9 @@ public record UpdateAnyscaleCredentialDto : IJsonOnDeserialized private readonly IDictionary _extensionData = new Dictionary(); + [JsonPropertyName("provider")] + public UpdateAnyscaleCredentialDtoProvider? Provider { get; set; } + /// /// This is not returned in the API. /// diff --git a/src/Vapi.Net/Types/UpdateAnyscaleCredentialDtoProvider.cs b/src/Vapi.Net/Types/UpdateAnyscaleCredentialDtoProvider.cs new file mode 100644 index 00000000..4e80e2ed --- /dev/null +++ b/src/Vapi.Net/Types/UpdateAnyscaleCredentialDtoProvider.cs @@ -0,0 +1,73 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(UpdateAnyscaleCredentialDtoProviderSerializer))] +public enum UpdateAnyscaleCredentialDtoProvider +{ + [EnumMember(Value = "anyscale")] + Anyscale, +} + +internal class UpdateAnyscaleCredentialDtoProviderSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + UpdateAnyscaleCredentialDtoProvider + > _stringToEnum = new() { { "anyscale", UpdateAnyscaleCredentialDtoProvider.Anyscale } }; + + private static readonly global::System.Collections.Generic.Dictionary< + UpdateAnyscaleCredentialDtoProvider, + string + > _enumToString = new() { { UpdateAnyscaleCredentialDtoProvider.Anyscale, "anyscale" } }; + + public override UpdateAnyscaleCredentialDtoProvider Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + UpdateAnyscaleCredentialDtoProvider value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override UpdateAnyscaleCredentialDtoProvider ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + UpdateAnyscaleCredentialDtoProvider value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/UpdateApiRequestToolDto.cs b/src/Vapi.Net/Types/UpdateApiRequestToolDto.cs index a64a30f2..a334d2a6 100644 --- a/src/Vapi.Net/Types/UpdateApiRequestToolDto.cs +++ b/src/Vapi.Net/Types/UpdateApiRequestToolDto.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Fields used to update an API-request tool, including its URL, HTTP method, authentication, request data, retries, and response handling. +/// [Serializable] public record UpdateApiRequestToolDto : IJsonOnDeserialized { @@ -12,13 +15,22 @@ public record UpdateApiRequestToolDto : IJsonOnDeserialized new Dictionary(); /// - /// 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. + /// Messages spoken while the tool is running. Multiple request-start messages are variants. For request-response-delayed, same timing means variants and different timings mean staged updates. /// [JsonPropertyName("messages")] public IEnumerable? Messages { get; set; } + /// + /// This is the name of the tool. This will be passed to the model. + /// + /// Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 40. + /// + [JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// The HTTP method used for the API request. + /// [JsonPropertyName("method")] public UpdateApiRequestToolDtoMethod? Method { get; set; } @@ -131,14 +143,6 @@ public record UpdateApiRequestToolDto : IJsonOnDeserialized [JsonPropertyName("rejectionPlan")] public ToolRejectionPlan? RejectionPlan { get; set; } - /// - /// This is the name of the tool. This will be passed to the model. - /// - /// Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 40. - /// - [JsonPropertyName("name")] - public string? Name { get; set; } - /// /// This is the description of the tool. This will be passed to the model. /// diff --git a/src/Vapi.Net/Types/UpdateAssemblyAiCredentialDto.cs b/src/Vapi.Net/Types/UpdateAssemblyAiCredentialDto.cs index 3ffafcbb..e381a66e 100644 --- a/src/Vapi.Net/Types/UpdateAssemblyAiCredentialDto.cs +++ b/src/Vapi.Net/Types/UpdateAssemblyAiCredentialDto.cs @@ -11,6 +11,9 @@ public record UpdateAssemblyAiCredentialDto : IJsonOnDeserialized private readonly IDictionary _extensionData = new Dictionary(); + [JsonPropertyName("provider")] + public UpdateAssemblyAiCredentialDtoProvider? Provider { get; set; } + /// /// This is not returned in the API. /// diff --git a/src/Vapi.Net/Types/UpdateAssemblyAiCredentialDtoProvider.cs b/src/Vapi.Net/Types/UpdateAssemblyAiCredentialDtoProvider.cs new file mode 100644 index 00000000..42e80bd2 --- /dev/null +++ b/src/Vapi.Net/Types/UpdateAssemblyAiCredentialDtoProvider.cs @@ -0,0 +1,73 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(UpdateAssemblyAiCredentialDtoProviderSerializer))] +public enum UpdateAssemblyAiCredentialDtoProvider +{ + [EnumMember(Value = "assembly-ai")] + AssemblyAi, +} + +internal class UpdateAssemblyAiCredentialDtoProviderSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + UpdateAssemblyAiCredentialDtoProvider + > _stringToEnum = new() { { "assembly-ai", UpdateAssemblyAiCredentialDtoProvider.AssemblyAi } }; + + private static readonly global::System.Collections.Generic.Dictionary< + UpdateAssemblyAiCredentialDtoProvider, + string + > _enumToString = new() { { UpdateAssemblyAiCredentialDtoProvider.AssemblyAi, "assembly-ai" } }; + + public override UpdateAssemblyAiCredentialDtoProvider Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + UpdateAssemblyAiCredentialDtoProvider value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override UpdateAssemblyAiCredentialDtoProvider ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + UpdateAssemblyAiCredentialDtoProvider value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/UpdateAssistantDraftDto.cs b/src/Vapi.Net/Types/UpdateAssistantDraftDto.cs new file mode 100644 index 00000000..f516809e --- /dev/null +++ b/src/Vapi.Net/Types/UpdateAssistantDraftDto.cs @@ -0,0 +1,273 @@ +using global::System.Text.Json; +using global::System.Text.Json.Serialization; +using OneOf; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[Serializable] +public record UpdateAssistantDraftDto : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + /// + /// These are the options for the assistant's transcriber. + /// + [JsonPropertyName("transcriber")] + public object? Transcriber { get; set; } + + /// + /// These are the options for the assistant's LLM. + /// + [JsonPropertyName("model")] + public object? Model { get; set; } + + /// + /// These are the options for the assistant's voice. + /// + [JsonPropertyName("voice")] + public object? Voice { get; set; } + + /// + /// This is the first message that the assistant will say. This can also be a URL to a containerized audio file (mp3, wav, etc.). + /// + /// If unspecified, assistant will wait for user to speak and use the model to respond once they speak. + /// + [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'. + /// + /// Use: + /// - 'assistant-speaks-first' to have the assistant speak first. + /// - 'assistant-waits-for-user' to have the assistant wait for the user to speak first. + /// - 'assistant-speaks-first-with-model-generated-message' to have the assistant speak first with a message generated by the model based on the conversation state. (`assistant.model.messages` at call start, `call.messages` at squad transfer points). + /// + /// @default 'assistant-speaks-first' + /// + [JsonPropertyName("firstMessageMode")] + public UpdateAssistantDraftDtoFirstMessageMode? FirstMessageMode { get; set; } + + /// + /// These are the settings to configure or disable voicemail detection. Alternatively, voicemail detection can be configured using the model.tools=[VoicemailTool]. + /// By default, voicemail detection is disabled. + /// + [JsonPropertyName("voicemailDetection")] + public OneOf< + UpdateAssistantDraftDtoVoicemailDetectionZero, + GoogleVoicemailDetectionPlan, + OpenAiVoicemailDetectionPlan, + TwilioVoicemailDetectionPlan, + VapiVoicemailDetectionPlan + >? 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,assistant.started. You can check the shape of the messages in ClientMessage schema. + /// + [JsonPropertyName("clientMessages")] + public IEnumerable? ClientMessages { get; set; } + + /// + /// These are the messages that will be sent to your Server URL. Default is conversation-update,end-of-call-report,function-call,hang,speech-update,status-update,tool-calls,transfer-destination-request,handoff-destination-request,user-interrupted,assistant.started. You can check the shape of the messages in ServerMessage schema. + /// + [JsonPropertyName("serverMessages")] + public IEnumerable? ServerMessages { get; set; } + + /// + /// This is the maximum number of seconds that the call will last. When the call reaches this duration, it will be ended. + /// + /// @default 600 (10 minutes) + /// + [JsonPropertyName("maxDurationSeconds")] + public double? MaxDurationSeconds { get; set; } + + /// + /// 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 OneOf? BackgroundSound { get; set; } + + /// + /// This determines whether the model's output is used in conversation history rather than the transcription of assistant's speech. + /// + /// @default false + /// + [JsonPropertyName("modelOutputInMessagesEnabled")] + public bool? ModelOutputInMessagesEnabled { get; set; } + + /// + /// These are the configurations to be passed to the transport providers of assistant's calls, like Twilio. You can store multiple configurations for different transport providers. For a call, only the configuration matching the call transport provider is used. + /// + [JsonPropertyName("transportConfigurations")] + public IEnumerable? TransportConfigurations { get; set; } + + /// + /// This is the plan for observability of assistant's calls. + /// + /// Currently, only Langfuse is supported. + /// + [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. + /// + [JsonPropertyName("credentials")] + public IEnumerable? Credentials { get; set; } + + /// + /// This is a set of actions that will be performed on certain events. + /// + [JsonPropertyName("hooks")] + public IEnumerable< + OneOf< + CallHookCallEnding, + CallHookAssistantSpeechInterrupted, + CallHookCustomerSpeechInterrupted, + CallHookCustomerSpeechTimeout, + SessionCreatedHook + > + >? Hooks { get; set; } + + /// + /// This is the name of the assistant. + /// + /// This is required when you want to transfer between assistants in a call. + /// + [JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// This is the message that the assistant will say if the call is forwarded to voicemail. + /// + /// If unspecified, it will hang up. + /// + [JsonPropertyName("voicemailMessage")] + public string? VoicemailMessage { get; set; } + + /// + /// This is the message that the assistant will say if it ends the call. + /// + /// If unspecified, it will hang up without saying anything. + /// + [JsonPropertyName("endCallMessage")] + public string? EndCallMessage { get; set; } + + /// + /// This list contains phrases that, if spoken by the assistant, will trigger the call to be hung up. Case insensitive. + /// + [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. + /// + [JsonPropertyName("metadata")] + public object? Metadata { get; set; } + + /// + /// This enables filtering of noise and background speech while the user is talking. + /// + /// Features: + /// - Smart denoising using Krisp + /// - Fourier denoising + /// + /// Smart denoising can be combined with or used independently of Fourier denoising. + /// + /// Order of precedence: + /// - Smart denoising + /// - Fourier denoising + /// + [JsonPropertyName("backgroundSpeechDenoisingPlan")] + public BackgroundSpeechDenoisingPlan? BackgroundSpeechDenoisingPlan { get; set; } + + /// + /// This is the plan for analysis of assistant's calls. Stored in `call.analysis`. + /// + [JsonPropertyName("analysisPlan")] + public AnalysisPlan? AnalysisPlan { get; set; } + + /// + /// This is the plan for artifacts generated during assistant's calls. Stored in `call.artifact`. + /// + [JsonPropertyName("artifactPlan")] + public ArtifactPlan? ArtifactPlan { get; set; } + + /// + /// This is the plan for when the assistant should start talking. + /// + /// You should configure this if you're running into these issues: + /// - The assistant is too slow to start talking after the customer is done speaking. + /// - The assistant is too fast to start talking after the customer is done speaking. + /// - The assistant is so fast that it's actually interrupting the customer. + /// + [JsonPropertyName("startSpeakingPlan")] + public StartSpeakingPlan? StartSpeakingPlan { get; set; } + + /// + /// This is the plan for when assistant should stop talking on customer interruption. + /// + /// You should configure this if you're running into these issues: + /// - The assistant is too slow to recognize customer's interruption. + /// - The assistant is too fast to recognize customer's interruption. + /// - The assistant is getting interrupted by phrases that are just acknowledgments. + /// - The assistant is getting interrupted by background noises. + /// - The assistant is not properly stopping -- it starts talking right after getting interrupted. + /// + [JsonPropertyName("stopSpeakingPlan")] + public StopSpeakingPlan? StopSpeakingPlan { get; set; } + + /// + /// This is the plan for real-time monitoring of the assistant's calls. + /// + /// Usage: + /// - To enable live listening of the assistant's calls, set `monitorPlan.listenEnabled` to `true`. + /// - To enable live control of the assistant's calls, set `monitorPlan.controlEnabled` to `true`. + /// - To attach monitors to the assistant, set `monitorPlan.monitorIds` to the set of monitor ids. + /// + [JsonPropertyName("monitorPlan")] + public MonitorPlan? MonitorPlan { get; set; } + + /// + /// These are the credentials that will be used for the assistant calls. By default, all the credentials are available for use in the call but you can provide a subset using this. + /// + [JsonPropertyName("credentialIds")] + public IEnumerable? CredentialIds { 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.url + /// 2. phoneNumber.serverUrl + /// 3. org.serverUrl + /// + [JsonPropertyName("server")] + public Server? Server { get; set; } + + [JsonPropertyName("keypadInputPlan")] + public KeypadInputPlan? KeypadInputPlan { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/UpdateAssistantDraftDtoBackgroundSoundZero.cs b/src/Vapi.Net/Types/UpdateAssistantDraftDtoBackgroundSoundZero.cs new file mode 100644 index 00000000..8ffb03c1 --- /dev/null +++ b/src/Vapi.Net/Types/UpdateAssistantDraftDtoBackgroundSoundZero.cs @@ -0,0 +1,84 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(UpdateAssistantDraftDtoBackgroundSoundZeroSerializer))] +public enum UpdateAssistantDraftDtoBackgroundSoundZero +{ + [EnumMember(Value = "off")] + Off, + + [EnumMember(Value = "office")] + Office, +} + +internal class UpdateAssistantDraftDtoBackgroundSoundZeroSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + UpdateAssistantDraftDtoBackgroundSoundZero + > _stringToEnum = new() + { + { "off", UpdateAssistantDraftDtoBackgroundSoundZero.Off }, + { "office", UpdateAssistantDraftDtoBackgroundSoundZero.Office }, + }; + + private static readonly global::System.Collections.Generic.Dictionary< + UpdateAssistantDraftDtoBackgroundSoundZero, + string + > _enumToString = new() + { + { UpdateAssistantDraftDtoBackgroundSoundZero.Off, "off" }, + { UpdateAssistantDraftDtoBackgroundSoundZero.Office, "office" }, + }; + + public override UpdateAssistantDraftDtoBackgroundSoundZero Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + UpdateAssistantDraftDtoBackgroundSoundZero value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override UpdateAssistantDraftDtoBackgroundSoundZero ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + UpdateAssistantDraftDtoBackgroundSoundZero value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/UpdateAssistantDraftDtoClientMessagesItem.cs b/src/Vapi.Net/Types/UpdateAssistantDraftDtoClientMessagesItem.cs new file mode 100644 index 00000000..a724a9d7 --- /dev/null +++ b/src/Vapi.Net/Types/UpdateAssistantDraftDtoClientMessagesItem.cs @@ -0,0 +1,175 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(UpdateAssistantDraftDtoClientMessagesItemSerializer))] +public enum UpdateAssistantDraftDtoClientMessagesItem +{ + [EnumMember(Value = "conversation-update")] + ConversationUpdate, + + [EnumMember(Value = "assistant.speechStarted")] + AssistantSpeechStarted, + + [EnumMember(Value = "function-call")] + FunctionCall, + + [EnumMember(Value = "function-call-result")] + FunctionCallResult, + + [EnumMember(Value = "hang")] + Hang, + + [EnumMember(Value = "language-changed")] + LanguageChanged, + + [EnumMember(Value = "metadata")] + Metadata, + + [EnumMember(Value = "model-output")] + ModelOutput, + + [EnumMember(Value = "speech-update")] + SpeechUpdate, + + [EnumMember(Value = "status-update")] + StatusUpdate, + + [EnumMember(Value = "transcript")] + Transcript, + + [EnumMember(Value = "tool-calls")] + ToolCalls, + + [EnumMember(Value = "tool-calls-result")] + ToolCallsResult, + + [EnumMember(Value = "tool.completed")] + ToolCompleted, + + [EnumMember(Value = "transfer-update")] + TransferUpdate, + + [EnumMember(Value = "user-interrupted")] + UserInterrupted, + + [EnumMember(Value = "voice-input")] + VoiceInput, + + [EnumMember(Value = "workflow.node.started")] + WorkflowNodeStarted, + + [EnumMember(Value = "assistant.started")] + AssistantStarted, +} + +internal class UpdateAssistantDraftDtoClientMessagesItemSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + UpdateAssistantDraftDtoClientMessagesItem + > _stringToEnum = new() + { + { "conversation-update", UpdateAssistantDraftDtoClientMessagesItem.ConversationUpdate }, + { + "assistant.speechStarted", + UpdateAssistantDraftDtoClientMessagesItem.AssistantSpeechStarted + }, + { "function-call", UpdateAssistantDraftDtoClientMessagesItem.FunctionCall }, + { "function-call-result", UpdateAssistantDraftDtoClientMessagesItem.FunctionCallResult }, + { "hang", UpdateAssistantDraftDtoClientMessagesItem.Hang }, + { "language-changed", UpdateAssistantDraftDtoClientMessagesItem.LanguageChanged }, + { "metadata", UpdateAssistantDraftDtoClientMessagesItem.Metadata }, + { "model-output", UpdateAssistantDraftDtoClientMessagesItem.ModelOutput }, + { "speech-update", UpdateAssistantDraftDtoClientMessagesItem.SpeechUpdate }, + { "status-update", UpdateAssistantDraftDtoClientMessagesItem.StatusUpdate }, + { "transcript", UpdateAssistantDraftDtoClientMessagesItem.Transcript }, + { "tool-calls", UpdateAssistantDraftDtoClientMessagesItem.ToolCalls }, + { "tool-calls-result", UpdateAssistantDraftDtoClientMessagesItem.ToolCallsResult }, + { "tool.completed", UpdateAssistantDraftDtoClientMessagesItem.ToolCompleted }, + { "transfer-update", UpdateAssistantDraftDtoClientMessagesItem.TransferUpdate }, + { "user-interrupted", UpdateAssistantDraftDtoClientMessagesItem.UserInterrupted }, + { "voice-input", UpdateAssistantDraftDtoClientMessagesItem.VoiceInput }, + { "workflow.node.started", UpdateAssistantDraftDtoClientMessagesItem.WorkflowNodeStarted }, + { "assistant.started", UpdateAssistantDraftDtoClientMessagesItem.AssistantStarted }, + }; + + private static readonly global::System.Collections.Generic.Dictionary< + UpdateAssistantDraftDtoClientMessagesItem, + string + > _enumToString = new() + { + { UpdateAssistantDraftDtoClientMessagesItem.ConversationUpdate, "conversation-update" }, + { + UpdateAssistantDraftDtoClientMessagesItem.AssistantSpeechStarted, + "assistant.speechStarted" + }, + { UpdateAssistantDraftDtoClientMessagesItem.FunctionCall, "function-call" }, + { UpdateAssistantDraftDtoClientMessagesItem.FunctionCallResult, "function-call-result" }, + { UpdateAssistantDraftDtoClientMessagesItem.Hang, "hang" }, + { UpdateAssistantDraftDtoClientMessagesItem.LanguageChanged, "language-changed" }, + { UpdateAssistantDraftDtoClientMessagesItem.Metadata, "metadata" }, + { UpdateAssistantDraftDtoClientMessagesItem.ModelOutput, "model-output" }, + { UpdateAssistantDraftDtoClientMessagesItem.SpeechUpdate, "speech-update" }, + { UpdateAssistantDraftDtoClientMessagesItem.StatusUpdate, "status-update" }, + { UpdateAssistantDraftDtoClientMessagesItem.Transcript, "transcript" }, + { UpdateAssistantDraftDtoClientMessagesItem.ToolCalls, "tool-calls" }, + { UpdateAssistantDraftDtoClientMessagesItem.ToolCallsResult, "tool-calls-result" }, + { UpdateAssistantDraftDtoClientMessagesItem.ToolCompleted, "tool.completed" }, + { UpdateAssistantDraftDtoClientMessagesItem.TransferUpdate, "transfer-update" }, + { UpdateAssistantDraftDtoClientMessagesItem.UserInterrupted, "user-interrupted" }, + { UpdateAssistantDraftDtoClientMessagesItem.VoiceInput, "voice-input" }, + { UpdateAssistantDraftDtoClientMessagesItem.WorkflowNodeStarted, "workflow.node.started" }, + { UpdateAssistantDraftDtoClientMessagesItem.AssistantStarted, "assistant.started" }, + }; + + public override UpdateAssistantDraftDtoClientMessagesItem Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + UpdateAssistantDraftDtoClientMessagesItem value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override UpdateAssistantDraftDtoClientMessagesItem ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + UpdateAssistantDraftDtoClientMessagesItem value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/UpdateAssistantDraftDtoFirstMessageMode.cs b/src/Vapi.Net/Types/UpdateAssistantDraftDtoFirstMessageMode.cs new file mode 100644 index 00000000..95ed634c --- /dev/null +++ b/src/Vapi.Net/Types/UpdateAssistantDraftDtoFirstMessageMode.cs @@ -0,0 +1,101 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(UpdateAssistantDraftDtoFirstMessageModeSerializer))] +public enum UpdateAssistantDraftDtoFirstMessageMode +{ + [EnumMember(Value = "assistant-speaks-first")] + AssistantSpeaksFirst, + + [EnumMember(Value = "assistant-speaks-first-with-model-generated-message")] + AssistantSpeaksFirstWithModelGeneratedMessage, + + [EnumMember(Value = "assistant-waits-for-user")] + AssistantWaitsForUser, +} + +internal class UpdateAssistantDraftDtoFirstMessageModeSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + UpdateAssistantDraftDtoFirstMessageMode + > _stringToEnum = new() + { + { "assistant-speaks-first", UpdateAssistantDraftDtoFirstMessageMode.AssistantSpeaksFirst }, + { + "assistant-speaks-first-with-model-generated-message", + UpdateAssistantDraftDtoFirstMessageMode.AssistantSpeaksFirstWithModelGeneratedMessage + }, + { + "assistant-waits-for-user", + UpdateAssistantDraftDtoFirstMessageMode.AssistantWaitsForUser + }, + }; + + private static readonly global::System.Collections.Generic.Dictionary< + UpdateAssistantDraftDtoFirstMessageMode, + string + > _enumToString = new() + { + { UpdateAssistantDraftDtoFirstMessageMode.AssistantSpeaksFirst, "assistant-speaks-first" }, + { + UpdateAssistantDraftDtoFirstMessageMode.AssistantSpeaksFirstWithModelGeneratedMessage, + "assistant-speaks-first-with-model-generated-message" + }, + { + UpdateAssistantDraftDtoFirstMessageMode.AssistantWaitsForUser, + "assistant-waits-for-user" + }, + }; + + public override UpdateAssistantDraftDtoFirstMessageMode Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + UpdateAssistantDraftDtoFirstMessageMode value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override UpdateAssistantDraftDtoFirstMessageMode ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + UpdateAssistantDraftDtoFirstMessageMode value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/UpdateAssistantDraftDtoServerMessagesItem.cs b/src/Vapi.Net/Types/UpdateAssistantDraftDtoServerMessagesItem.cs new file mode 100644 index 00000000..b53c88bc --- /dev/null +++ b/src/Vapi.Net/Types/UpdateAssistantDraftDtoServerMessagesItem.cs @@ -0,0 +1,239 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(UpdateAssistantDraftDtoServerMessagesItemSerializer))] +public enum UpdateAssistantDraftDtoServerMessagesItem +{ + [EnumMember(Value = "assistant.started")] + AssistantStarted, + + [EnumMember(Value = "assistant.speechStarted")] + AssistantSpeechStarted, + + [EnumMember(Value = "conversation-update")] + ConversationUpdate, + + [EnumMember(Value = "end-of-call-report")] + EndOfCallReport, + + [EnumMember(Value = "function-call")] + FunctionCall, + + [EnumMember(Value = "hang")] + Hang, + + [EnumMember(Value = "language-changed")] + LanguageChanged, + + [EnumMember(Value = "language-change-detected")] + LanguageChangeDetected, + + [EnumMember(Value = "model-output")] + ModelOutput, + + [EnumMember(Value = "phone-call-control")] + PhoneCallControl, + + [EnumMember(Value = "speech-update")] + SpeechUpdate, + + [EnumMember(Value = "status-update")] + StatusUpdate, + + [EnumMember(Value = "transcript")] + Transcript, + + [EnumMember(Value = "transcript[transcriptType=\"final\"]")] + TranscriptTranscriptTypeFinal, + + [EnumMember(Value = "tool-calls")] + ToolCalls, + + [EnumMember(Value = "transfer-destination-request")] + TransferDestinationRequest, + + [EnumMember(Value = "handoff-destination-request")] + HandoffDestinationRequest, + + [EnumMember(Value = "transfer-update")] + TransferUpdate, + + [EnumMember(Value = "user-interrupted")] + UserInterrupted, + + [EnumMember(Value = "voice-input")] + VoiceInput, + + [EnumMember(Value = "chat.created")] + ChatCreated, + + [EnumMember(Value = "chat.deleted")] + ChatDeleted, + + [EnumMember(Value = "session.created")] + SessionCreated, + + [EnumMember(Value = "session.updated")] + SessionUpdated, + + [EnumMember(Value = "session.deleted")] + SessionDeleted, + + [EnumMember(Value = "call.deleted")] + CallDeleted, + + [EnumMember(Value = "call.delete.failed")] + CallDeleteFailed, +} + +internal class UpdateAssistantDraftDtoServerMessagesItemSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + UpdateAssistantDraftDtoServerMessagesItem + > _stringToEnum = new() + { + { "assistant.started", UpdateAssistantDraftDtoServerMessagesItem.AssistantStarted }, + { + "assistant.speechStarted", + UpdateAssistantDraftDtoServerMessagesItem.AssistantSpeechStarted + }, + { "conversation-update", UpdateAssistantDraftDtoServerMessagesItem.ConversationUpdate }, + { "end-of-call-report", UpdateAssistantDraftDtoServerMessagesItem.EndOfCallReport }, + { "function-call", UpdateAssistantDraftDtoServerMessagesItem.FunctionCall }, + { "hang", UpdateAssistantDraftDtoServerMessagesItem.Hang }, + { "language-changed", UpdateAssistantDraftDtoServerMessagesItem.LanguageChanged }, + { + "language-change-detected", + UpdateAssistantDraftDtoServerMessagesItem.LanguageChangeDetected + }, + { "model-output", UpdateAssistantDraftDtoServerMessagesItem.ModelOutput }, + { "phone-call-control", UpdateAssistantDraftDtoServerMessagesItem.PhoneCallControl }, + { "speech-update", UpdateAssistantDraftDtoServerMessagesItem.SpeechUpdate }, + { "status-update", UpdateAssistantDraftDtoServerMessagesItem.StatusUpdate }, + { "transcript", UpdateAssistantDraftDtoServerMessagesItem.Transcript }, + { + "transcript[transcriptType=\"final\"]", + UpdateAssistantDraftDtoServerMessagesItem.TranscriptTranscriptTypeFinal + }, + { "tool-calls", UpdateAssistantDraftDtoServerMessagesItem.ToolCalls }, + { + "transfer-destination-request", + UpdateAssistantDraftDtoServerMessagesItem.TransferDestinationRequest + }, + { + "handoff-destination-request", + UpdateAssistantDraftDtoServerMessagesItem.HandoffDestinationRequest + }, + { "transfer-update", UpdateAssistantDraftDtoServerMessagesItem.TransferUpdate }, + { "user-interrupted", UpdateAssistantDraftDtoServerMessagesItem.UserInterrupted }, + { "voice-input", UpdateAssistantDraftDtoServerMessagesItem.VoiceInput }, + { "chat.created", UpdateAssistantDraftDtoServerMessagesItem.ChatCreated }, + { "chat.deleted", UpdateAssistantDraftDtoServerMessagesItem.ChatDeleted }, + { "session.created", UpdateAssistantDraftDtoServerMessagesItem.SessionCreated }, + { "session.updated", UpdateAssistantDraftDtoServerMessagesItem.SessionUpdated }, + { "session.deleted", UpdateAssistantDraftDtoServerMessagesItem.SessionDeleted }, + { "call.deleted", UpdateAssistantDraftDtoServerMessagesItem.CallDeleted }, + { "call.delete.failed", UpdateAssistantDraftDtoServerMessagesItem.CallDeleteFailed }, + }; + + private static readonly global::System.Collections.Generic.Dictionary< + UpdateAssistantDraftDtoServerMessagesItem, + string + > _enumToString = new() + { + { UpdateAssistantDraftDtoServerMessagesItem.AssistantStarted, "assistant.started" }, + { + UpdateAssistantDraftDtoServerMessagesItem.AssistantSpeechStarted, + "assistant.speechStarted" + }, + { UpdateAssistantDraftDtoServerMessagesItem.ConversationUpdate, "conversation-update" }, + { UpdateAssistantDraftDtoServerMessagesItem.EndOfCallReport, "end-of-call-report" }, + { UpdateAssistantDraftDtoServerMessagesItem.FunctionCall, "function-call" }, + { UpdateAssistantDraftDtoServerMessagesItem.Hang, "hang" }, + { UpdateAssistantDraftDtoServerMessagesItem.LanguageChanged, "language-changed" }, + { + UpdateAssistantDraftDtoServerMessagesItem.LanguageChangeDetected, + "language-change-detected" + }, + { UpdateAssistantDraftDtoServerMessagesItem.ModelOutput, "model-output" }, + { UpdateAssistantDraftDtoServerMessagesItem.PhoneCallControl, "phone-call-control" }, + { UpdateAssistantDraftDtoServerMessagesItem.SpeechUpdate, "speech-update" }, + { UpdateAssistantDraftDtoServerMessagesItem.StatusUpdate, "status-update" }, + { UpdateAssistantDraftDtoServerMessagesItem.Transcript, "transcript" }, + { + UpdateAssistantDraftDtoServerMessagesItem.TranscriptTranscriptTypeFinal, + "transcript[transcriptType=\"final\"]" + }, + { UpdateAssistantDraftDtoServerMessagesItem.ToolCalls, "tool-calls" }, + { + UpdateAssistantDraftDtoServerMessagesItem.TransferDestinationRequest, + "transfer-destination-request" + }, + { + UpdateAssistantDraftDtoServerMessagesItem.HandoffDestinationRequest, + "handoff-destination-request" + }, + { UpdateAssistantDraftDtoServerMessagesItem.TransferUpdate, "transfer-update" }, + { UpdateAssistantDraftDtoServerMessagesItem.UserInterrupted, "user-interrupted" }, + { UpdateAssistantDraftDtoServerMessagesItem.VoiceInput, "voice-input" }, + { UpdateAssistantDraftDtoServerMessagesItem.ChatCreated, "chat.created" }, + { UpdateAssistantDraftDtoServerMessagesItem.ChatDeleted, "chat.deleted" }, + { UpdateAssistantDraftDtoServerMessagesItem.SessionCreated, "session.created" }, + { UpdateAssistantDraftDtoServerMessagesItem.SessionUpdated, "session.updated" }, + { UpdateAssistantDraftDtoServerMessagesItem.SessionDeleted, "session.deleted" }, + { UpdateAssistantDraftDtoServerMessagesItem.CallDeleted, "call.deleted" }, + { UpdateAssistantDraftDtoServerMessagesItem.CallDeleteFailed, "call.delete.failed" }, + }; + + public override UpdateAssistantDraftDtoServerMessagesItem Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + UpdateAssistantDraftDtoServerMessagesItem value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override UpdateAssistantDraftDtoServerMessagesItem ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + UpdateAssistantDraftDtoServerMessagesItem value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/UpdateAssistantDraftDtoVoicemailDetectionZero.cs b/src/Vapi.Net/Types/UpdateAssistantDraftDtoVoicemailDetectionZero.cs new file mode 100644 index 00000000..93771c3d --- /dev/null +++ b/src/Vapi.Net/Types/UpdateAssistantDraftDtoVoicemailDetectionZero.cs @@ -0,0 +1,73 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(UpdateAssistantDraftDtoVoicemailDetectionZeroSerializer))] +public enum UpdateAssistantDraftDtoVoicemailDetectionZero +{ + [EnumMember(Value = "off")] + Off, +} + +internal class UpdateAssistantDraftDtoVoicemailDetectionZeroSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + UpdateAssistantDraftDtoVoicemailDetectionZero + > _stringToEnum = new() { { "off", UpdateAssistantDraftDtoVoicemailDetectionZero.Off } }; + + private static readonly global::System.Collections.Generic.Dictionary< + UpdateAssistantDraftDtoVoicemailDetectionZero, + string + > _enumToString = new() { { UpdateAssistantDraftDtoVoicemailDetectionZero.Off, "off" } }; + + public override UpdateAssistantDraftDtoVoicemailDetectionZero Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + UpdateAssistantDraftDtoVoicemailDetectionZero value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override UpdateAssistantDraftDtoVoicemailDetectionZero ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + UpdateAssistantDraftDtoVoicemailDetectionZero value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/UpdateAssistantVersionMetadataDto.cs b/src/Vapi.Net/Types/UpdateAssistantVersionMetadataDto.cs new file mode 100644 index 00000000..c2381175 --- /dev/null +++ b/src/Vapi.Net/Types/UpdateAssistantVersionMetadataDto.cs @@ -0,0 +1,37 @@ +using global::System.Text.Json; +using global::System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[Serializable] +public record UpdateAssistantVersionMetadataDto : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + /// + /// Optional human-readable label for this version. Pass `null` to clear. + /// + [JsonPropertyName("versionName")] + public string? VersionName { get; set; } + + /// + /// Optional description for this version. Pass `null` to clear. + /// + [JsonPropertyName("versionDescription")] + public string? VersionDescription { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + 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 15f00fb6..7c102a3e 100644 --- a/src/Vapi.Net/Types/UpdateAzureCredentialDto.cs +++ b/src/Vapi.Net/Types/UpdateAzureCredentialDto.cs @@ -11,6 +11,9 @@ public record UpdateAzureCredentialDto : IJsonOnDeserialized private readonly IDictionary _extensionData = new Dictionary(); + [JsonPropertyName("provider")] + public UpdateAzureCredentialDtoProvider? Provider { get; set; } + /// /// This is the service being used in Azure. /// diff --git a/src/Vapi.Net/Types/UpdateAzureCredentialDtoProvider.cs b/src/Vapi.Net/Types/UpdateAzureCredentialDtoProvider.cs new file mode 100644 index 00000000..c41c4f6f --- /dev/null +++ b/src/Vapi.Net/Types/UpdateAzureCredentialDtoProvider.cs @@ -0,0 +1,73 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(UpdateAzureCredentialDtoProviderSerializer))] +public enum UpdateAzureCredentialDtoProvider +{ + [EnumMember(Value = "azure")] + Azure, +} + +internal class UpdateAzureCredentialDtoProviderSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + UpdateAzureCredentialDtoProvider + > _stringToEnum = new() { { "azure", UpdateAzureCredentialDtoProvider.Azure } }; + + private static readonly global::System.Collections.Generic.Dictionary< + UpdateAzureCredentialDtoProvider, + string + > _enumToString = new() { { UpdateAzureCredentialDtoProvider.Azure, "azure" } }; + + public override UpdateAzureCredentialDtoProvider Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + UpdateAzureCredentialDtoProvider value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override UpdateAzureCredentialDtoProvider ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + UpdateAzureCredentialDtoProvider value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/UpdateAzureCredentialDtoRegion.cs b/src/Vapi.Net/Types/UpdateAzureCredentialDtoRegion.cs index 48659992..84a2ff33 100644 --- a/src/Vapi.Net/Types/UpdateAzureCredentialDtoRegion.cs +++ b/src/Vapi.Net/Types/UpdateAzureCredentialDtoRegion.cs @@ -60,6 +60,12 @@ public enum UpdateAzureCredentialDtoRegion [EnumMember(Value = "switzerland")] Switzerland, + [EnumMember(Value = "switzerlandnorth")] + Switzerlandnorth, + + [EnumMember(Value = "switzerlandwest")] + Switzerlandwest, + [EnumMember(Value = "uaenorth")] Uaenorth, @@ -102,6 +108,8 @@ internal class UpdateAzureCredentialDtoRegionSerializer { "spaincentral", UpdateAzureCredentialDtoRegion.Spaincentral }, { "swedencentral", UpdateAzureCredentialDtoRegion.Swedencentral }, { "switzerland", UpdateAzureCredentialDtoRegion.Switzerland }, + { "switzerlandnorth", UpdateAzureCredentialDtoRegion.Switzerlandnorth }, + { "switzerlandwest", UpdateAzureCredentialDtoRegion.Switzerlandwest }, { "uaenorth", UpdateAzureCredentialDtoRegion.Uaenorth }, { "uk", UpdateAzureCredentialDtoRegion.Uk }, { "westeurope", UpdateAzureCredentialDtoRegion.Westeurope }, @@ -132,6 +140,8 @@ internal class UpdateAzureCredentialDtoRegionSerializer { UpdateAzureCredentialDtoRegion.Spaincentral, "spaincentral" }, { UpdateAzureCredentialDtoRegion.Swedencentral, "swedencentral" }, { UpdateAzureCredentialDtoRegion.Switzerland, "switzerland" }, + { UpdateAzureCredentialDtoRegion.Switzerlandnorth, "switzerlandnorth" }, + { UpdateAzureCredentialDtoRegion.Switzerlandwest, "switzerlandwest" }, { UpdateAzureCredentialDtoRegion.Uaenorth, "uaenorth" }, { UpdateAzureCredentialDtoRegion.Uk, "uk" }, { UpdateAzureCredentialDtoRegion.Westeurope, "westeurope" }, diff --git a/src/Vapi.Net/Types/UpdateAzureOpenAiCredentialDto.cs b/src/Vapi.Net/Types/UpdateAzureOpenAiCredentialDto.cs index 0c9e2986..b7ceca87 100644 --- a/src/Vapi.Net/Types/UpdateAzureOpenAiCredentialDto.cs +++ b/src/Vapi.Net/Types/UpdateAzureOpenAiCredentialDto.cs @@ -11,6 +11,9 @@ public record UpdateAzureOpenAiCredentialDto : IJsonOnDeserialized private readonly IDictionary _extensionData = new Dictionary(); + [JsonPropertyName("provider")] + public UpdateAzureOpenAiCredentialDtoProvider? Provider { get; set; } + [JsonPropertyName("region")] public UpdateAzureOpenAiCredentialDtoRegion? Region { get; set; } diff --git a/src/Vapi.Net/Types/UpdateAzureOpenAiCredentialDtoModelsItem.cs b/src/Vapi.Net/Types/UpdateAzureOpenAiCredentialDtoModelsItem.cs index ced7952c..aed446cb 100644 --- a/src/Vapi.Net/Types/UpdateAzureOpenAiCredentialDtoModelsItem.cs +++ b/src/Vapi.Net/Types/UpdateAzureOpenAiCredentialDtoModelsItem.cs @@ -74,6 +74,15 @@ public enum UpdateAzureOpenAiCredentialDtoModelsItem [EnumMember(Value = "gpt-35-turbo-1106")] Gpt35Turbo1106, + + [EnumMember(Value = "gpt-4o")] + Gpt4O, + + [EnumMember(Value = "gpt-4.1")] + Gpt41, + + [EnumMember(Value = "gpt-5.4-mini-2026-03-17")] + Gpt54Mini20260317, } internal class UpdateAzureOpenAiCredentialDtoModelsItemSerializer @@ -107,6 +116,9 @@ internal class UpdateAzureOpenAiCredentialDtoModelsItemSerializer { "gpt-4-0613", UpdateAzureOpenAiCredentialDtoModelsItem.Gpt40613 }, { "gpt-35-turbo-0125", UpdateAzureOpenAiCredentialDtoModelsItem.Gpt35Turbo0125 }, { "gpt-35-turbo-1106", UpdateAzureOpenAiCredentialDtoModelsItem.Gpt35Turbo1106 }, + { "gpt-4o", UpdateAzureOpenAiCredentialDtoModelsItem.Gpt4O }, + { "gpt-4.1", UpdateAzureOpenAiCredentialDtoModelsItem.Gpt41 }, + { "gpt-5.4-mini-2026-03-17", UpdateAzureOpenAiCredentialDtoModelsItem.Gpt54Mini20260317 }, }; private static readonly global::System.Collections.Generic.Dictionary< @@ -137,6 +149,9 @@ internal class UpdateAzureOpenAiCredentialDtoModelsItemSerializer { UpdateAzureOpenAiCredentialDtoModelsItem.Gpt40613, "gpt-4-0613" }, { UpdateAzureOpenAiCredentialDtoModelsItem.Gpt35Turbo0125, "gpt-35-turbo-0125" }, { UpdateAzureOpenAiCredentialDtoModelsItem.Gpt35Turbo1106, "gpt-35-turbo-1106" }, + { UpdateAzureOpenAiCredentialDtoModelsItem.Gpt4O, "gpt-4o" }, + { UpdateAzureOpenAiCredentialDtoModelsItem.Gpt41, "gpt-4.1" }, + { UpdateAzureOpenAiCredentialDtoModelsItem.Gpt54Mini20260317, "gpt-5.4-mini-2026-03-17" }, }; public override UpdateAzureOpenAiCredentialDtoModelsItem Read( diff --git a/src/Vapi.Net/Types/UpdateAzureOpenAiCredentialDtoProvider.cs b/src/Vapi.Net/Types/UpdateAzureOpenAiCredentialDtoProvider.cs new file mode 100644 index 00000000..478bccb2 --- /dev/null +++ b/src/Vapi.Net/Types/UpdateAzureOpenAiCredentialDtoProvider.cs @@ -0,0 +1,79 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(UpdateAzureOpenAiCredentialDtoProviderSerializer))] +public enum UpdateAzureOpenAiCredentialDtoProvider +{ + [EnumMember(Value = "azure-openai")] + AzureOpenai, +} + +internal class UpdateAzureOpenAiCredentialDtoProviderSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + UpdateAzureOpenAiCredentialDtoProvider + > _stringToEnum = new() + { + { "azure-openai", UpdateAzureOpenAiCredentialDtoProvider.AzureOpenai }, + }; + + private static readonly global::System.Collections.Generic.Dictionary< + UpdateAzureOpenAiCredentialDtoProvider, + string + > _enumToString = new() + { + { UpdateAzureOpenAiCredentialDtoProvider.AzureOpenai, "azure-openai" }, + }; + + public override UpdateAzureOpenAiCredentialDtoProvider Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + UpdateAzureOpenAiCredentialDtoProvider value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override UpdateAzureOpenAiCredentialDtoProvider ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + UpdateAzureOpenAiCredentialDtoProvider value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/UpdateAzureOpenAiCredentialDtoRegion.cs b/src/Vapi.Net/Types/UpdateAzureOpenAiCredentialDtoRegion.cs index f43c64d0..8b42b11a 100644 --- a/src/Vapi.Net/Types/UpdateAzureOpenAiCredentialDtoRegion.cs +++ b/src/Vapi.Net/Types/UpdateAzureOpenAiCredentialDtoRegion.cs @@ -60,6 +60,12 @@ public enum UpdateAzureOpenAiCredentialDtoRegion [EnumMember(Value = "switzerland")] Switzerland, + [EnumMember(Value = "switzerlandnorth")] + Switzerlandnorth, + + [EnumMember(Value = "switzerlandwest")] + Switzerlandwest, + [EnumMember(Value = "uaenorth")] Uaenorth, @@ -102,6 +108,8 @@ internal class UpdateAzureOpenAiCredentialDtoRegionSerializer { "spaincentral", UpdateAzureOpenAiCredentialDtoRegion.Spaincentral }, { "swedencentral", UpdateAzureOpenAiCredentialDtoRegion.Swedencentral }, { "switzerland", UpdateAzureOpenAiCredentialDtoRegion.Switzerland }, + { "switzerlandnorth", UpdateAzureOpenAiCredentialDtoRegion.Switzerlandnorth }, + { "switzerlandwest", UpdateAzureOpenAiCredentialDtoRegion.Switzerlandwest }, { "uaenorth", UpdateAzureOpenAiCredentialDtoRegion.Uaenorth }, { "uk", UpdateAzureOpenAiCredentialDtoRegion.Uk }, { "westeurope", UpdateAzureOpenAiCredentialDtoRegion.Westeurope }, @@ -132,6 +140,8 @@ internal class UpdateAzureOpenAiCredentialDtoRegionSerializer { UpdateAzureOpenAiCredentialDtoRegion.Spaincentral, "spaincentral" }, { UpdateAzureOpenAiCredentialDtoRegion.Swedencentral, "swedencentral" }, { UpdateAzureOpenAiCredentialDtoRegion.Switzerland, "switzerland" }, + { UpdateAzureOpenAiCredentialDtoRegion.Switzerlandnorth, "switzerlandnorth" }, + { UpdateAzureOpenAiCredentialDtoRegion.Switzerlandwest, "switzerlandwest" }, { UpdateAzureOpenAiCredentialDtoRegion.Uaenorth, "uaenorth" }, { UpdateAzureOpenAiCredentialDtoRegion.Uk, "uk" }, { UpdateAzureOpenAiCredentialDtoRegion.Westeurope, "westeurope" }, diff --git a/src/Vapi.Net/Types/UpdateBarInsightFromCallTableDto.cs b/src/Vapi.Net/Types/UpdateBarInsightFromCallTableDto.cs index 4966ad89..2b075335 100644 --- a/src/Vapi.Net/Types/UpdateBarInsightFromCallTableDto.cs +++ b/src/Vapi.Net/Types/UpdateBarInsightFromCallTableDto.cs @@ -5,6 +5,9 @@ namespace Vapi.Net; +/// +/// Fields used to update a bar-chart insight, including its queries, formulas, grouping, time range, metadata, and name. +/// [Serializable] public record UpdateBarInsightFromCallTableDto : IJsonOnDeserialized { @@ -44,6 +47,9 @@ public record UpdateBarInsightFromCallTableDto : IJsonOnDeserialized [JsonPropertyName("metadata")] public BarInsightMetadata? Metadata { get; set; } + /// + /// The time range and interval used to aggregate the bar-chart data. + /// [JsonPropertyName("timeRange")] public InsightTimeRangeWithStep? TimeRange { get; set; } diff --git a/src/Vapi.Net/Types/UpdateBashToolDto.cs b/src/Vapi.Net/Types/UpdateBashToolDto.cs index 2e0b400e..6fa1447c 100644 --- a/src/Vapi.Net/Types/UpdateBashToolDto.cs +++ b/src/Vapi.Net/Types/UpdateBashToolDto.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Fields used to update a Bash tool, including its name, environment subtype, server, messages, and rejection plan. +/// [Serializable] public record UpdateBashToolDto : IJsonOnDeserialized { @@ -12,9 +15,7 @@ public record UpdateBashToolDto : IJsonOnDeserialized new Dictionary(); /// - /// 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. + /// Messages spoken while the tool is running. Multiple request-start messages are variants. For request-response-delayed, same timing means variants and different timings mean staged updates. /// [JsonPropertyName("messages")] public IEnumerable? Messages { get; set; } diff --git a/src/Vapi.Net/Types/UpdateByoPhoneNumberDto.cs b/src/Vapi.Net/Types/UpdateByoPhoneNumberDto.cs index 073af831..a66324ef 100644 --- a/src/Vapi.Net/Types/UpdateByoPhoneNumberDto.cs +++ b/src/Vapi.Net/Types/UpdateByoPhoneNumberDto.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Fields used to update a bring-your-own phone number, including its credential, number, routing, hooks, and server settings. +/// [Serializable] public record UpdateByoPhoneNumberDto : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/UpdateByoSipTrunkCredentialDto.cs b/src/Vapi.Net/Types/UpdateByoSipTrunkCredentialDto.cs index de524c32..fdc7b474 100644 --- a/src/Vapi.Net/Types/UpdateByoSipTrunkCredentialDto.cs +++ b/src/Vapi.Net/Types/UpdateByoSipTrunkCredentialDto.cs @@ -11,6 +11,12 @@ public record UpdateByoSipTrunkCredentialDto : IJsonOnDeserialized private readonly IDictionary _extensionData = new Dictionary(); + /// + /// This can be used to bring your own SIP trunks or to connect to a Carrier. + /// + [JsonPropertyName("provider")] + public UpdateByoSipTrunkCredentialDtoProvider? Provider { get; set; } + /// /// This is the name of credential. This is just for your reference. /// @@ -52,12 +58,6 @@ public record UpdateByoSipTrunkCredentialDto : IJsonOnDeserialized [JsonPropertyName("sipDiversionHeader")] public string? SipDiversionHeader { get; set; } - /// - /// This is an advanced configuration for enterprise deployments. This uses the onprem SBC to trunk into the SIP trunk's `gateways`, rather than the managed SBC provided by Vapi. - /// - [JsonPropertyName("sbcConfiguration")] - public SbcConfiguration? SbcConfiguration { get; set; } - [JsonIgnore] public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); diff --git a/src/Vapi.Net/Types/UpdateByoSipTrunkCredentialDtoProvider.cs b/src/Vapi.Net/Types/UpdateByoSipTrunkCredentialDtoProvider.cs new file mode 100644 index 00000000..31ff811c --- /dev/null +++ b/src/Vapi.Net/Types/UpdateByoSipTrunkCredentialDtoProvider.cs @@ -0,0 +1,79 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(UpdateByoSipTrunkCredentialDtoProviderSerializer))] +public enum UpdateByoSipTrunkCredentialDtoProvider +{ + [EnumMember(Value = "byo-sip-trunk")] + ByoSipTrunk, +} + +internal class UpdateByoSipTrunkCredentialDtoProviderSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + UpdateByoSipTrunkCredentialDtoProvider + > _stringToEnum = new() + { + { "byo-sip-trunk", UpdateByoSipTrunkCredentialDtoProvider.ByoSipTrunk }, + }; + + private static readonly global::System.Collections.Generic.Dictionary< + UpdateByoSipTrunkCredentialDtoProvider, + string + > _enumToString = new() + { + { UpdateByoSipTrunkCredentialDtoProvider.ByoSipTrunk, "byo-sip-trunk" }, + }; + + public override UpdateByoSipTrunkCredentialDtoProvider Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + UpdateByoSipTrunkCredentialDtoProvider value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override UpdateByoSipTrunkCredentialDtoProvider ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + UpdateByoSipTrunkCredentialDtoProvider value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Campaigns/Requests/UpdateCampaignDto.cs b/src/Vapi.Net/Types/UpdateCampaignDto.cs similarity index 74% rename from src/Vapi.Net/Campaigns/Requests/UpdateCampaignDto.cs rename to src/Vapi.Net/Types/UpdateCampaignDto.cs index 0e3543e6..b9f4b8b9 100644 --- a/src/Vapi.Net/Campaigns/Requests/UpdateCampaignDto.cs +++ b/src/Vapi.Net/Types/UpdateCampaignDto.cs @@ -1,11 +1,19 @@ +using global::System.Text.Json; using global::System.Text.Json.Serialization; using Vapi.Net.Core; namespace Vapi.Net; +/// +/// Fields used to update an outbound calling campaign, including its name, status, calling resource, phone-number or dial-plan settings, and schedule. +/// [Serializable] -public record UpdateCampaignDto +public record UpdateCampaignDto : IJsonOnDeserialized { + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + /// /// This is the name of the campaign. This is just for your own reference. /// @@ -55,13 +63,18 @@ public record UpdateCampaignDto public SchedulePlan? SchedulePlan { get; set; } /// - /// This is the status of the campaign. - /// Can only be updated to 'ended' if you want to end the campaign. - /// When set to 'ended', it will delete all scheduled calls. Calls in progress will be allowed to complete. + /// Set to 'cancelled' to stop the campaign ('ended' is a V1 alias). Scheduled + /// calls are deleted; in-progress calls are allowed to finish. /// [JsonPropertyName("status")] public UpdateCampaignDtoStatus? Status { get; set; } + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + /// public override string ToString() { diff --git a/src/Vapi.Net/Campaigns/Types/UpdateCampaignDtoStatus.cs b/src/Vapi.Net/Types/UpdateCampaignDtoStatus.cs similarity index 86% rename from src/Vapi.Net/Campaigns/Types/UpdateCampaignDtoStatus.cs rename to src/Vapi.Net/Types/UpdateCampaignDtoStatus.cs index 7507cb91..64574916 100644 --- a/src/Vapi.Net/Campaigns/Types/UpdateCampaignDtoStatus.cs +++ b/src/Vapi.Net/Types/UpdateCampaignDtoStatus.cs @@ -8,6 +8,9 @@ public enum UpdateCampaignDtoStatus { [EnumMember(Value = "ended")] Ended, + + [EnumMember(Value = "cancelled")] + Cancelled, } internal class UpdateCampaignDtoStatusSerializer @@ -16,12 +19,20 @@ internal class UpdateCampaignDtoStatusSerializer private static readonly global::System.Collections.Generic.Dictionary< string, UpdateCampaignDtoStatus - > _stringToEnum = new() { { "ended", UpdateCampaignDtoStatus.Ended } }; + > _stringToEnum = new() + { + { "ended", UpdateCampaignDtoStatus.Ended }, + { "cancelled", UpdateCampaignDtoStatus.Cancelled }, + }; private static readonly global::System.Collections.Generic.Dictionary< UpdateCampaignDtoStatus, string - > _enumToString = new() { { UpdateCampaignDtoStatus.Ended, "ended" } }; + > _enumToString = new() + { + { UpdateCampaignDtoStatus.Ended, "ended" }, + { UpdateCampaignDtoStatus.Cancelled, "cancelled" }, + }; public override UpdateCampaignDtoStatus Read( ref global::System.Text.Json.Utf8JsonReader reader, diff --git a/src/Vapi.Net/Types/UpdateCartesiaCredentialDto.cs b/src/Vapi.Net/Types/UpdateCartesiaCredentialDto.cs index 07044663..e5a793f7 100644 --- a/src/Vapi.Net/Types/UpdateCartesiaCredentialDto.cs +++ b/src/Vapi.Net/Types/UpdateCartesiaCredentialDto.cs @@ -11,6 +11,9 @@ public record UpdateCartesiaCredentialDto : IJsonOnDeserialized private readonly IDictionary _extensionData = new Dictionary(); + [JsonPropertyName("provider")] + public UpdateCartesiaCredentialDtoProvider? Provider { get; set; } + /// /// This is not returned in the API. /// @@ -23,6 +26,12 @@ public record UpdateCartesiaCredentialDto : IJsonOnDeserialized [JsonPropertyName("name")] public string? Name { get; set; } + /// + /// This can be used to point to an onprem Cartesia instance. Defaults to api.cartesia.ai. + /// + [JsonPropertyName("apiUrl")] + public string? ApiUrl { get; set; } + [JsonIgnore] public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); diff --git a/src/Vapi.Net/Types/UpdateCartesiaCredentialDtoProvider.cs b/src/Vapi.Net/Types/UpdateCartesiaCredentialDtoProvider.cs new file mode 100644 index 00000000..e7ec9d23 --- /dev/null +++ b/src/Vapi.Net/Types/UpdateCartesiaCredentialDtoProvider.cs @@ -0,0 +1,73 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(UpdateCartesiaCredentialDtoProviderSerializer))] +public enum UpdateCartesiaCredentialDtoProvider +{ + [EnumMember(Value = "cartesia")] + Cartesia, +} + +internal class UpdateCartesiaCredentialDtoProviderSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + UpdateCartesiaCredentialDtoProvider + > _stringToEnum = new() { { "cartesia", UpdateCartesiaCredentialDtoProvider.Cartesia } }; + + private static readonly global::System.Collections.Generic.Dictionary< + UpdateCartesiaCredentialDtoProvider, + string + > _enumToString = new() { { UpdateCartesiaCredentialDtoProvider.Cartesia, "cartesia" } }; + + public override UpdateCartesiaCredentialDtoProvider Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + UpdateCartesiaCredentialDtoProvider value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override UpdateCartesiaCredentialDtoProvider ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + UpdateCartesiaCredentialDtoProvider value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/UpdateCerebrasCredentialDto.cs b/src/Vapi.Net/Types/UpdateCerebrasCredentialDto.cs index c68763db..aebb5eac 100644 --- a/src/Vapi.Net/Types/UpdateCerebrasCredentialDto.cs +++ b/src/Vapi.Net/Types/UpdateCerebrasCredentialDto.cs @@ -11,6 +11,9 @@ public record UpdateCerebrasCredentialDto : IJsonOnDeserialized private readonly IDictionary _extensionData = new Dictionary(); + [JsonPropertyName("provider")] + public UpdateCerebrasCredentialDtoProvider? Provider { get; set; } + /// /// This is not returned in the API. /// diff --git a/src/Vapi.Net/Types/UpdateCerebrasCredentialDtoProvider.cs b/src/Vapi.Net/Types/UpdateCerebrasCredentialDtoProvider.cs new file mode 100644 index 00000000..283e07d2 --- /dev/null +++ b/src/Vapi.Net/Types/UpdateCerebrasCredentialDtoProvider.cs @@ -0,0 +1,73 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(UpdateCerebrasCredentialDtoProviderSerializer))] +public enum UpdateCerebrasCredentialDtoProvider +{ + [EnumMember(Value = "cerebras")] + Cerebras, +} + +internal class UpdateCerebrasCredentialDtoProviderSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + UpdateCerebrasCredentialDtoProvider + > _stringToEnum = new() { { "cerebras", UpdateCerebrasCredentialDtoProvider.Cerebras } }; + + private static readonly global::System.Collections.Generic.Dictionary< + UpdateCerebrasCredentialDtoProvider, + string + > _enumToString = new() { { UpdateCerebrasCredentialDtoProvider.Cerebras, "cerebras" } }; + + public override UpdateCerebrasCredentialDtoProvider Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + UpdateCerebrasCredentialDtoProvider value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override UpdateCerebrasCredentialDtoProvider ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + UpdateCerebrasCredentialDtoProvider value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/UpdateCloudflareCredentialDto.cs b/src/Vapi.Net/Types/UpdateCloudflareCredentialDto.cs index 1caba699..740eeb0f 100644 --- a/src/Vapi.Net/Types/UpdateCloudflareCredentialDto.cs +++ b/src/Vapi.Net/Types/UpdateCloudflareCredentialDto.cs @@ -11,6 +11,12 @@ public record UpdateCloudflareCredentialDto : IJsonOnDeserialized private readonly IDictionary _extensionData = new Dictionary(); + /// + /// Credential provider. Only allowed value is cloudflare + /// + [JsonPropertyName("provider")] + public UpdateCloudflareCredentialDtoProvider? Provider { get; set; } + /// /// Cloudflare Account Id. /// diff --git a/src/Vapi.Net/Types/UpdateCloudflareCredentialDtoProvider.cs b/src/Vapi.Net/Types/UpdateCloudflareCredentialDtoProvider.cs new file mode 100644 index 00000000..a767ae08 --- /dev/null +++ b/src/Vapi.Net/Types/UpdateCloudflareCredentialDtoProvider.cs @@ -0,0 +1,73 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(UpdateCloudflareCredentialDtoProviderSerializer))] +public enum UpdateCloudflareCredentialDtoProvider +{ + [EnumMember(Value = "cloudflare")] + Cloudflare, +} + +internal class UpdateCloudflareCredentialDtoProviderSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + UpdateCloudflareCredentialDtoProvider + > _stringToEnum = new() { { "cloudflare", UpdateCloudflareCredentialDtoProvider.Cloudflare } }; + + private static readonly global::System.Collections.Generic.Dictionary< + UpdateCloudflareCredentialDtoProvider, + string + > _enumToString = new() { { UpdateCloudflareCredentialDtoProvider.Cloudflare, "cloudflare" } }; + + public override UpdateCloudflareCredentialDtoProvider Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + UpdateCloudflareCredentialDtoProvider value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override UpdateCloudflareCredentialDtoProvider ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + UpdateCloudflareCredentialDtoProvider value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/UpdateCodeToolDto.cs b/src/Vapi.Net/Types/UpdateCodeToolDto.cs index 087cf004..ec39f30f 100644 --- a/src/Vapi.Net/Types/UpdateCodeToolDto.cs +++ b/src/Vapi.Net/Types/UpdateCodeToolDto.cs @@ -12,13 +12,17 @@ public record UpdateCodeToolDto : IJsonOnDeserialized new Dictionary(); /// - /// 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. + /// Messages spoken while the tool is running. Multiple request-start messages are variants. For request-response-delayed, same timing means variants and different timings mean staged updates. /// [JsonPropertyName("messages")] public IEnumerable? Messages { get; set; } + /// + /// The type of tool. "code" for Code tool. + /// + [JsonPropertyName("type")] + public UpdateCodeToolDtoType? Type { get; set; } + /// /// This determines if the tool is async. /// diff --git a/src/Vapi.Net/Types/TrieveKnowledgeBaseProvider.cs b/src/Vapi.Net/Types/UpdateCodeToolDtoType.cs similarity index 71% rename from src/Vapi.Net/Types/TrieveKnowledgeBaseProvider.cs rename to src/Vapi.Net/Types/UpdateCodeToolDtoType.cs index 49838b77..efc2ae2d 100644 --- a/src/Vapi.Net/Types/TrieveKnowledgeBaseProvider.cs +++ b/src/Vapi.Net/Types/UpdateCodeToolDtoType.cs @@ -3,27 +3,27 @@ namespace Vapi.Net; -[JsonConverter(typeof(TrieveKnowledgeBaseProviderSerializer))] -public enum TrieveKnowledgeBaseProvider +[JsonConverter(typeof(UpdateCodeToolDtoTypeSerializer))] +public enum UpdateCodeToolDtoType { - [EnumMember(Value = "trieve")] - Trieve, + [EnumMember(Value = "code")] + Code, } -internal class TrieveKnowledgeBaseProviderSerializer - : global::System.Text.Json.Serialization.JsonConverter +internal class UpdateCodeToolDtoTypeSerializer + : global::System.Text.Json.Serialization.JsonConverter { private static readonly global::System.Collections.Generic.Dictionary< string, - TrieveKnowledgeBaseProvider - > _stringToEnum = new() { { "trieve", TrieveKnowledgeBaseProvider.Trieve } }; + UpdateCodeToolDtoType + > _stringToEnum = new() { { "code", UpdateCodeToolDtoType.Code } }; private static readonly global::System.Collections.Generic.Dictionary< - TrieveKnowledgeBaseProvider, + UpdateCodeToolDtoType, string - > _enumToString = new() { { TrieveKnowledgeBaseProvider.Trieve, "trieve" } }; + > _enumToString = new() { { UpdateCodeToolDtoType.Code, "code" } }; - public override TrieveKnowledgeBaseProvider Read( + public override UpdateCodeToolDtoType Read( ref global::System.Text.Json.Utf8JsonReader reader, global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options @@ -37,7 +37,7 @@ public override TrieveKnowledgeBaseProvider Read( public override void Write( global::System.Text.Json.Utf8JsonWriter writer, - TrieveKnowledgeBaseProvider value, + UpdateCodeToolDtoType value, global::System.Text.Json.JsonSerializerOptions options ) { @@ -46,7 +46,7 @@ public override void Write( ); } - public override TrieveKnowledgeBaseProvider ReadAsPropertyName( + public override UpdateCodeToolDtoType ReadAsPropertyName( ref global::System.Text.Json.Utf8JsonReader reader, global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options @@ -62,7 +62,7 @@ public override TrieveKnowledgeBaseProvider ReadAsPropertyName( public override void WriteAsPropertyName( global::System.Text.Json.Utf8JsonWriter writer, - TrieveKnowledgeBaseProvider value, + UpdateCodeToolDtoType value, global::System.Text.Json.JsonSerializerOptions options ) { diff --git a/src/Vapi.Net/Types/UpdateComputerToolDto.cs b/src/Vapi.Net/Types/UpdateComputerToolDto.cs index 5e919880..6276a8ae 100644 --- a/src/Vapi.Net/Types/UpdateComputerToolDto.cs +++ b/src/Vapi.Net/Types/UpdateComputerToolDto.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Fields used to update a computer tool, including its display settings, environment subtype, server, messages, and rejection plan. +/// [Serializable] public record UpdateComputerToolDto : IJsonOnDeserialized { @@ -12,9 +15,7 @@ public record UpdateComputerToolDto : IJsonOnDeserialized new Dictionary(); /// - /// 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. + /// Messages spoken while the tool is running. Multiple request-start messages are variants. For request-response-delayed, same timing means variants and different timings mean staged updates. /// [JsonPropertyName("messages")] public IEnumerable? Messages { get; set; } diff --git a/src/Vapi.Net/Types/UpdateCustomCredentialDto.cs b/src/Vapi.Net/Types/UpdateCustomCredentialDto.cs index 7f8abce7..0df0954e 100644 --- a/src/Vapi.Net/Types/UpdateCustomCredentialDto.cs +++ b/src/Vapi.Net/Types/UpdateCustomCredentialDto.cs @@ -11,6 +11,9 @@ public record UpdateCustomCredentialDto : IJsonOnDeserialized private readonly IDictionary _extensionData = new Dictionary(); + [JsonPropertyName("provider")] + public UpdateCustomCredentialDtoProvider? Provider { get; set; } + /// /// This is the authentication plan. Supports OAuth2 RFC 6749, HMAC signing, and Bearer authentication. /// diff --git a/src/Vapi.Net/Types/UpdateCustomCredentialDtoProvider.cs b/src/Vapi.Net/Types/UpdateCustomCredentialDtoProvider.cs new file mode 100644 index 00000000..8e62ba55 --- /dev/null +++ b/src/Vapi.Net/Types/UpdateCustomCredentialDtoProvider.cs @@ -0,0 +1,79 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(UpdateCustomCredentialDtoProviderSerializer))] +public enum UpdateCustomCredentialDtoProvider +{ + [EnumMember(Value = "custom-credential")] + CustomCredential, +} + +internal class UpdateCustomCredentialDtoProviderSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + UpdateCustomCredentialDtoProvider + > _stringToEnum = new() + { + { "custom-credential", UpdateCustomCredentialDtoProvider.CustomCredential }, + }; + + private static readonly global::System.Collections.Generic.Dictionary< + UpdateCustomCredentialDtoProvider, + string + > _enumToString = new() + { + { UpdateCustomCredentialDtoProvider.CustomCredential, "custom-credential" }, + }; + + public override UpdateCustomCredentialDtoProvider Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + UpdateCustomCredentialDtoProvider value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override UpdateCustomCredentialDtoProvider ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + UpdateCustomCredentialDtoProvider value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/UpdateCustomKnowledgeBaseDto.cs b/src/Vapi.Net/Types/UpdateCustomKnowledgeBaseDto.cs index 5c8947ce..0d6a9fb7 100644 --- a/src/Vapi.Net/Types/UpdateCustomKnowledgeBaseDto.cs +++ b/src/Vapi.Net/Types/UpdateCustomKnowledgeBaseDto.cs @@ -11,6 +11,12 @@ public record UpdateCustomKnowledgeBaseDto : IJsonOnDeserialized private readonly IDictionary _extensionData = new Dictionary(); + /// + /// This knowledge base is bring your own knowledge base implementation. + /// + [JsonPropertyName("provider")] + public UpdateCustomKnowledgeBaseDtoProvider? Provider { get; set; } + /// /// This is where the knowledge base request will be sent. /// diff --git a/src/Vapi.Net/Types/UpdateCustomKnowledgeBaseDtoProvider.cs b/src/Vapi.Net/Types/UpdateCustomKnowledgeBaseDtoProvider.cs new file mode 100644 index 00000000..19f969cb --- /dev/null +++ b/src/Vapi.Net/Types/UpdateCustomKnowledgeBaseDtoProvider.cs @@ -0,0 +1,79 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(UpdateCustomKnowledgeBaseDtoProviderSerializer))] +public enum UpdateCustomKnowledgeBaseDtoProvider +{ + [EnumMember(Value = "custom-knowledge-base")] + CustomKnowledgeBase, +} + +internal class UpdateCustomKnowledgeBaseDtoProviderSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + UpdateCustomKnowledgeBaseDtoProvider + > _stringToEnum = new() + { + { "custom-knowledge-base", UpdateCustomKnowledgeBaseDtoProvider.CustomKnowledgeBase }, + }; + + private static readonly global::System.Collections.Generic.Dictionary< + UpdateCustomKnowledgeBaseDtoProvider, + string + > _enumToString = new() + { + { UpdateCustomKnowledgeBaseDtoProvider.CustomKnowledgeBase, "custom-knowledge-base" }, + }; + + public override UpdateCustomKnowledgeBaseDtoProvider Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + UpdateCustomKnowledgeBaseDtoProvider value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override UpdateCustomKnowledgeBaseDtoProvider ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + UpdateCustomKnowledgeBaseDtoProvider value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/UpdateCustomLlmCredentialDto.cs b/src/Vapi.Net/Types/UpdateCustomLlmCredentialDto.cs index c364f17d..49808040 100644 --- a/src/Vapi.Net/Types/UpdateCustomLlmCredentialDto.cs +++ b/src/Vapi.Net/Types/UpdateCustomLlmCredentialDto.cs @@ -11,6 +11,9 @@ public record UpdateCustomLlmCredentialDto : IJsonOnDeserialized private readonly IDictionary _extensionData = new Dictionary(); + [JsonPropertyName("provider")] + public UpdateCustomLlmCredentialDtoProvider? Provider { get; set; } + /// /// This is not returned in the API. /// diff --git a/src/Vapi.Net/Types/UpdateCustomLlmCredentialDtoProvider.cs b/src/Vapi.Net/Types/UpdateCustomLlmCredentialDtoProvider.cs new file mode 100644 index 00000000..42ec5534 --- /dev/null +++ b/src/Vapi.Net/Types/UpdateCustomLlmCredentialDtoProvider.cs @@ -0,0 +1,73 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(UpdateCustomLlmCredentialDtoProviderSerializer))] +public enum UpdateCustomLlmCredentialDtoProvider +{ + [EnumMember(Value = "custom-llm")] + CustomLlm, +} + +internal class UpdateCustomLlmCredentialDtoProviderSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + UpdateCustomLlmCredentialDtoProvider + > _stringToEnum = new() { { "custom-llm", UpdateCustomLlmCredentialDtoProvider.CustomLlm } }; + + private static readonly global::System.Collections.Generic.Dictionary< + UpdateCustomLlmCredentialDtoProvider, + string + > _enumToString = new() { { UpdateCustomLlmCredentialDtoProvider.CustomLlm, "custom-llm" } }; + + public override UpdateCustomLlmCredentialDtoProvider Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + UpdateCustomLlmCredentialDtoProvider value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override UpdateCustomLlmCredentialDtoProvider ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + UpdateCustomLlmCredentialDtoProvider value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/UpdateDeepInfraCredentialDto.cs b/src/Vapi.Net/Types/UpdateDeepInfraCredentialDto.cs index 28d321b2..1465f725 100644 --- a/src/Vapi.Net/Types/UpdateDeepInfraCredentialDto.cs +++ b/src/Vapi.Net/Types/UpdateDeepInfraCredentialDto.cs @@ -11,6 +11,9 @@ public record UpdateDeepInfraCredentialDto : IJsonOnDeserialized private readonly IDictionary _extensionData = new Dictionary(); + [JsonPropertyName("provider")] + public UpdateDeepInfraCredentialDtoProvider? Provider { get; set; } + /// /// This is not returned in the API. /// diff --git a/src/Vapi.Net/Types/UpdateDeepInfraCredentialDtoProvider.cs b/src/Vapi.Net/Types/UpdateDeepInfraCredentialDtoProvider.cs new file mode 100644 index 00000000..07af86ab --- /dev/null +++ b/src/Vapi.Net/Types/UpdateDeepInfraCredentialDtoProvider.cs @@ -0,0 +1,73 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(UpdateDeepInfraCredentialDtoProviderSerializer))] +public enum UpdateDeepInfraCredentialDtoProvider +{ + [EnumMember(Value = "deepinfra")] + Deepinfra, +} + +internal class UpdateDeepInfraCredentialDtoProviderSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + UpdateDeepInfraCredentialDtoProvider + > _stringToEnum = new() { { "deepinfra", UpdateDeepInfraCredentialDtoProvider.Deepinfra } }; + + private static readonly global::System.Collections.Generic.Dictionary< + UpdateDeepInfraCredentialDtoProvider, + string + > _enumToString = new() { { UpdateDeepInfraCredentialDtoProvider.Deepinfra, "deepinfra" } }; + + public override UpdateDeepInfraCredentialDtoProvider Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + UpdateDeepInfraCredentialDtoProvider value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override UpdateDeepInfraCredentialDtoProvider ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + UpdateDeepInfraCredentialDtoProvider value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/UpdateDeepSeekCredentialDto.cs b/src/Vapi.Net/Types/UpdateDeepSeekCredentialDto.cs index 256a34df..7b04b8c3 100644 --- a/src/Vapi.Net/Types/UpdateDeepSeekCredentialDto.cs +++ b/src/Vapi.Net/Types/UpdateDeepSeekCredentialDto.cs @@ -11,6 +11,9 @@ public record UpdateDeepSeekCredentialDto : IJsonOnDeserialized private readonly IDictionary _extensionData = new Dictionary(); + [JsonPropertyName("provider")] + public UpdateDeepSeekCredentialDtoProvider? Provider { get; set; } + /// /// This is not returned in the API. /// diff --git a/src/Vapi.Net/Types/UpdateDeepSeekCredentialDtoProvider.cs b/src/Vapi.Net/Types/UpdateDeepSeekCredentialDtoProvider.cs new file mode 100644 index 00000000..e0bc888a --- /dev/null +++ b/src/Vapi.Net/Types/UpdateDeepSeekCredentialDtoProvider.cs @@ -0,0 +1,73 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(UpdateDeepSeekCredentialDtoProviderSerializer))] +public enum UpdateDeepSeekCredentialDtoProvider +{ + [EnumMember(Value = "deep-seek")] + DeepSeek, +} + +internal class UpdateDeepSeekCredentialDtoProviderSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + UpdateDeepSeekCredentialDtoProvider + > _stringToEnum = new() { { "deep-seek", UpdateDeepSeekCredentialDtoProvider.DeepSeek } }; + + private static readonly global::System.Collections.Generic.Dictionary< + UpdateDeepSeekCredentialDtoProvider, + string + > _enumToString = new() { { UpdateDeepSeekCredentialDtoProvider.DeepSeek, "deep-seek" } }; + + public override UpdateDeepSeekCredentialDtoProvider Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + UpdateDeepSeekCredentialDtoProvider value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override UpdateDeepSeekCredentialDtoProvider ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + UpdateDeepSeekCredentialDtoProvider value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/UpdateDeepgramCredentialDto.cs b/src/Vapi.Net/Types/UpdateDeepgramCredentialDto.cs index fd654e19..38de6f3c 100644 --- a/src/Vapi.Net/Types/UpdateDeepgramCredentialDto.cs +++ b/src/Vapi.Net/Types/UpdateDeepgramCredentialDto.cs @@ -11,6 +11,9 @@ public record UpdateDeepgramCredentialDto : IJsonOnDeserialized private readonly IDictionary _extensionData = new Dictionary(); + [JsonPropertyName("provider")] + public UpdateDeepgramCredentialDtoProvider? Provider { get; set; } + /// /// This is not returned in the API. /// diff --git a/src/Vapi.Net/Types/UpdateDeepgramCredentialDtoProvider.cs b/src/Vapi.Net/Types/UpdateDeepgramCredentialDtoProvider.cs new file mode 100644 index 00000000..add47545 --- /dev/null +++ b/src/Vapi.Net/Types/UpdateDeepgramCredentialDtoProvider.cs @@ -0,0 +1,73 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(UpdateDeepgramCredentialDtoProviderSerializer))] +public enum UpdateDeepgramCredentialDtoProvider +{ + [EnumMember(Value = "deepgram")] + Deepgram, +} + +internal class UpdateDeepgramCredentialDtoProviderSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + UpdateDeepgramCredentialDtoProvider + > _stringToEnum = new() { { "deepgram", UpdateDeepgramCredentialDtoProvider.Deepgram } }; + + private static readonly global::System.Collections.Generic.Dictionary< + UpdateDeepgramCredentialDtoProvider, + string + > _enumToString = new() { { UpdateDeepgramCredentialDtoProvider.Deepgram, "deepgram" } }; + + public override UpdateDeepgramCredentialDtoProvider Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + UpdateDeepgramCredentialDtoProvider value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override UpdateDeepgramCredentialDtoProvider ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + UpdateDeepgramCredentialDtoProvider value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/UpdateDtmfToolDto.cs b/src/Vapi.Net/Types/UpdateDtmfToolDto.cs index b0108aeb..5c71d074 100644 --- a/src/Vapi.Net/Types/UpdateDtmfToolDto.cs +++ b/src/Vapi.Net/Types/UpdateDtmfToolDto.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Fields used to update a DTMF tool, including its spoken messages, rejection plan, and SIP INFO behavior. +/// [Serializable] public record UpdateDtmfToolDto : IJsonOnDeserialized { @@ -12,9 +15,7 @@ public record UpdateDtmfToolDto : IJsonOnDeserialized new Dictionary(); /// - /// 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. + /// Messages spoken while the tool is running. Multiple request-start messages are variants. For request-response-delayed, same timing means variants and different timings mean staged updates. /// [JsonPropertyName("messages")] public IEnumerable? Messages { get; set; } diff --git a/src/Vapi.Net/Types/UpdateElevenLabsCredentialDto.cs b/src/Vapi.Net/Types/UpdateElevenLabsCredentialDto.cs index fb854985..fd1fd0b3 100644 --- a/src/Vapi.Net/Types/UpdateElevenLabsCredentialDto.cs +++ b/src/Vapi.Net/Types/UpdateElevenLabsCredentialDto.cs @@ -11,21 +11,27 @@ public record UpdateElevenLabsCredentialDto : IJsonOnDeserialized private readonly IDictionary _extensionData = new Dictionary(); + [JsonPropertyName("provider")] + public string? Provider { get; set; } + /// /// This is not returned in the API. /// [JsonPropertyName("apiKey")] public string? ApiKey { get; set; } + /// + /// ElevenLabs-only API environment for this key: the global endpoint or the EU data residency endpoint. In EU deployments, new credentials must explicitly use the EU data residency endpoint; existing credentials may omit this field on update to retain their saved endpoint. Outside EU deployments, Vapi detects an omitted endpoint automatically and null on update clears and re-detects the endpoint. + /// + [JsonPropertyName("apiUrl")] + public UpdateElevenLabsCredentialDtoApiUrl? ApiUrl { get; set; } + /// /// This is the name of credential. This is just for your reference. /// [JsonPropertyName("name")] public string? Name { get; set; } - [JsonPropertyName("provider")] - public string? Provider { get; set; } - [JsonIgnore] public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); diff --git a/src/Vapi.Net/Types/UpdateElevenLabsCredentialDtoApiUrl.cs b/src/Vapi.Net/Types/UpdateElevenLabsCredentialDtoApiUrl.cs new file mode 100644 index 00000000..dac5855f --- /dev/null +++ b/src/Vapi.Net/Types/UpdateElevenLabsCredentialDtoApiUrl.cs @@ -0,0 +1,90 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(UpdateElevenLabsCredentialDtoApiUrlSerializer))] +public enum UpdateElevenLabsCredentialDtoApiUrl +{ + [EnumMember(Value = "https://api.elevenlabs.io")] + HttpsApiElevenlabsIo, + + [EnumMember(Value = "https://api.eu.residency.elevenlabs.io")] + HttpsApiEuResidencyElevenlabsIo, +} + +internal class UpdateElevenLabsCredentialDtoApiUrlSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + UpdateElevenLabsCredentialDtoApiUrl + > _stringToEnum = new() + { + { "https://api.elevenlabs.io", UpdateElevenLabsCredentialDtoApiUrl.HttpsApiElevenlabsIo }, + { + "https://api.eu.residency.elevenlabs.io", + UpdateElevenLabsCredentialDtoApiUrl.HttpsApiEuResidencyElevenlabsIo + }, + }; + + private static readonly global::System.Collections.Generic.Dictionary< + UpdateElevenLabsCredentialDtoApiUrl, + string + > _enumToString = new() + { + { UpdateElevenLabsCredentialDtoApiUrl.HttpsApiElevenlabsIo, "https://api.elevenlabs.io" }, + { + UpdateElevenLabsCredentialDtoApiUrl.HttpsApiEuResidencyElevenlabsIo, + "https://api.eu.residency.elevenlabs.io" + }, + }; + + public override UpdateElevenLabsCredentialDtoApiUrl Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + UpdateElevenLabsCredentialDtoApiUrl value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override UpdateElevenLabsCredentialDtoApiUrl ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + UpdateElevenLabsCredentialDtoApiUrl value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/UpdateEmailCredentialDto.cs b/src/Vapi.Net/Types/UpdateEmailCredentialDto.cs index d14dde5c..d6c7d3e5 100644 --- a/src/Vapi.Net/Types/UpdateEmailCredentialDto.cs +++ b/src/Vapi.Net/Types/UpdateEmailCredentialDto.cs @@ -11,6 +11,9 @@ public record UpdateEmailCredentialDto : IJsonOnDeserialized private readonly IDictionary _extensionData = new Dictionary(); + [JsonPropertyName("provider")] + public UpdateEmailCredentialDtoProvider? Provider { get; set; } + /// /// The recipient email address for alerts /// diff --git a/src/Vapi.Net/Types/UpdateEmailCredentialDtoProvider.cs b/src/Vapi.Net/Types/UpdateEmailCredentialDtoProvider.cs new file mode 100644 index 00000000..0508658e --- /dev/null +++ b/src/Vapi.Net/Types/UpdateEmailCredentialDtoProvider.cs @@ -0,0 +1,73 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(UpdateEmailCredentialDtoProviderSerializer))] +public enum UpdateEmailCredentialDtoProvider +{ + [EnumMember(Value = "email")] + Email, +} + +internal class UpdateEmailCredentialDtoProviderSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + UpdateEmailCredentialDtoProvider + > _stringToEnum = new() { { "email", UpdateEmailCredentialDtoProvider.Email } }; + + private static readonly global::System.Collections.Generic.Dictionary< + UpdateEmailCredentialDtoProvider, + string + > _enumToString = new() { { UpdateEmailCredentialDtoProvider.Email, "email" } }; + + public override UpdateEmailCredentialDtoProvider Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + UpdateEmailCredentialDtoProvider value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override UpdateEmailCredentialDtoProvider ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + UpdateEmailCredentialDtoProvider value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/UpdateEndCallToolDto.cs b/src/Vapi.Net/Types/UpdateEndCallToolDto.cs index 16ca62af..6d2d4966 100644 --- a/src/Vapi.Net/Types/UpdateEndCallToolDto.cs +++ b/src/Vapi.Net/Types/UpdateEndCallToolDto.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Fields used to update an end-call tool, including its spoken messages and rejection plan. +/// [Serializable] public record UpdateEndCallToolDto : IJsonOnDeserialized { @@ -12,9 +15,7 @@ public record UpdateEndCallToolDto : IJsonOnDeserialized new Dictionary(); /// - /// 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. + /// Messages spoken while the tool is running. Multiple request-start messages are variants. For request-response-delayed, same timing means variants and different timings mean staged updates. /// [JsonPropertyName("messages")] public IEnumerable? Messages { get; set; } diff --git a/src/Vapi.Net/Types/UpdateFunctionToolDto.cs b/src/Vapi.Net/Types/UpdateFunctionToolDto.cs index facb0d81..9f3e18f5 100644 --- a/src/Vapi.Net/Types/UpdateFunctionToolDto.cs +++ b/src/Vapi.Net/Types/UpdateFunctionToolDto.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Fields used to update a custom function tool, including its function definition, server, parameters, messages, and execution behavior. +/// [Serializable] public record UpdateFunctionToolDto : IJsonOnDeserialized { @@ -12,9 +15,7 @@ public record UpdateFunctionToolDto : IJsonOnDeserialized new Dictionary(); /// - /// 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. + /// Messages spoken while the tool is running. Multiple request-start messages are variants. For request-response-delayed, same timing means variants and different timings mean staged updates. /// [JsonPropertyName("messages")] public IEnumerable? Messages { get; set; } diff --git a/src/Vapi.Net/Types/UpdateGcpCredentialDto.cs b/src/Vapi.Net/Types/UpdateGcpCredentialDto.cs index d23a9657..2ac107f3 100644 --- a/src/Vapi.Net/Types/UpdateGcpCredentialDto.cs +++ b/src/Vapi.Net/Types/UpdateGcpCredentialDto.cs @@ -11,6 +11,9 @@ public record UpdateGcpCredentialDto : IJsonOnDeserialized private readonly IDictionary _extensionData = new Dictionary(); + [JsonPropertyName("provider")] + public UpdateGcpCredentialDtoProvider? Provider { get; set; } + /// /// This is the order in which this storage provider is tried during upload retries. Lower numbers are tried first in increasing order. /// diff --git a/src/Vapi.Net/Types/UpdateGcpCredentialDtoProvider.cs b/src/Vapi.Net/Types/UpdateGcpCredentialDtoProvider.cs new file mode 100644 index 00000000..b210fe4d --- /dev/null +++ b/src/Vapi.Net/Types/UpdateGcpCredentialDtoProvider.cs @@ -0,0 +1,73 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(UpdateGcpCredentialDtoProviderSerializer))] +public enum UpdateGcpCredentialDtoProvider +{ + [EnumMember(Value = "gcp")] + Gcp, +} + +internal class UpdateGcpCredentialDtoProviderSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + UpdateGcpCredentialDtoProvider + > _stringToEnum = new() { { "gcp", UpdateGcpCredentialDtoProvider.Gcp } }; + + private static readonly global::System.Collections.Generic.Dictionary< + UpdateGcpCredentialDtoProvider, + string + > _enumToString = new() { { UpdateGcpCredentialDtoProvider.Gcp, "gcp" } }; + + public override UpdateGcpCredentialDtoProvider Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + UpdateGcpCredentialDtoProvider value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override UpdateGcpCredentialDtoProvider ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + UpdateGcpCredentialDtoProvider value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/UpdateGhlToolDto.cs b/src/Vapi.Net/Types/UpdateGhlToolDto.cs index 9c9a2614..b7f1876c 100644 --- a/src/Vapi.Net/Types/UpdateGhlToolDto.cs +++ b/src/Vapi.Net/Types/UpdateGhlToolDto.cs @@ -12,13 +12,17 @@ public record UpdateGhlToolDto : IJsonOnDeserialized new Dictionary(); /// - /// 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. + /// Messages spoken while the tool is running. Multiple request-start messages are variants. For request-response-delayed, same timing means variants and different timings mean staged updates. /// [JsonPropertyName("messages")] public IEnumerable? Messages { get; set; } + /// + /// The type of tool. "ghl" for GHL tool. + /// + [JsonPropertyName("type")] + public UpdateGhlToolDtoType? Type { get; set; } + /// /// This is the plan to reject a tool call based on the conversation state. /// diff --git a/src/Vapi.Net/Types/UpdateGhlToolDtoType.cs b/src/Vapi.Net/Types/UpdateGhlToolDtoType.cs new file mode 100644 index 00000000..a86031ba --- /dev/null +++ b/src/Vapi.Net/Types/UpdateGhlToolDtoType.cs @@ -0,0 +1,73 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(UpdateGhlToolDtoTypeSerializer))] +public enum UpdateGhlToolDtoType +{ + [EnumMember(Value = "ghl")] + Ghl, +} + +internal class UpdateGhlToolDtoTypeSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + UpdateGhlToolDtoType + > _stringToEnum = new() { { "ghl", UpdateGhlToolDtoType.Ghl } }; + + private static readonly global::System.Collections.Generic.Dictionary< + UpdateGhlToolDtoType, + string + > _enumToString = new() { { UpdateGhlToolDtoType.Ghl, "ghl" } }; + + public override UpdateGhlToolDtoType Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + UpdateGhlToolDtoType value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override UpdateGhlToolDtoType ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + UpdateGhlToolDtoType value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/UpdateGladiaCredentialDto.cs b/src/Vapi.Net/Types/UpdateGladiaCredentialDto.cs index 067f72e2..3d2ad04f 100644 --- a/src/Vapi.Net/Types/UpdateGladiaCredentialDto.cs +++ b/src/Vapi.Net/Types/UpdateGladiaCredentialDto.cs @@ -11,6 +11,9 @@ public record UpdateGladiaCredentialDto : IJsonOnDeserialized private readonly IDictionary _extensionData = new Dictionary(); + [JsonPropertyName("provider")] + public UpdateGladiaCredentialDtoProvider? Provider { get; set; } + /// /// This is not returned in the API. /// diff --git a/src/Vapi.Net/Types/UpdateGladiaCredentialDtoProvider.cs b/src/Vapi.Net/Types/UpdateGladiaCredentialDtoProvider.cs new file mode 100644 index 00000000..b2d9f39b --- /dev/null +++ b/src/Vapi.Net/Types/UpdateGladiaCredentialDtoProvider.cs @@ -0,0 +1,73 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(UpdateGladiaCredentialDtoProviderSerializer))] +public enum UpdateGladiaCredentialDtoProvider +{ + [EnumMember(Value = "gladia")] + Gladia, +} + +internal class UpdateGladiaCredentialDtoProviderSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + UpdateGladiaCredentialDtoProvider + > _stringToEnum = new() { { "gladia", UpdateGladiaCredentialDtoProvider.Gladia } }; + + private static readonly global::System.Collections.Generic.Dictionary< + UpdateGladiaCredentialDtoProvider, + string + > _enumToString = new() { { UpdateGladiaCredentialDtoProvider.Gladia, "gladia" } }; + + public override UpdateGladiaCredentialDtoProvider Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + UpdateGladiaCredentialDtoProvider value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override UpdateGladiaCredentialDtoProvider ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + UpdateGladiaCredentialDtoProvider value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/UpdateGoHighLevelCalendarAvailabilityToolDto.cs b/src/Vapi.Net/Types/UpdateGoHighLevelCalendarAvailabilityToolDto.cs index 8478b53f..b48bd3cc 100644 --- a/src/Vapi.Net/Types/UpdateGoHighLevelCalendarAvailabilityToolDto.cs +++ b/src/Vapi.Net/Types/UpdateGoHighLevelCalendarAvailabilityToolDto.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Fields used to update a GoHighLevel calendar-availability tool, including its spoken messages and rejection plan. +/// [Serializable] public record UpdateGoHighLevelCalendarAvailabilityToolDto : IJsonOnDeserialized { @@ -12,9 +15,7 @@ public record UpdateGoHighLevelCalendarAvailabilityToolDto : IJsonOnDeserialized new Dictionary(); /// - /// 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. + /// Messages spoken while the tool is running. Multiple request-start messages are variants. For request-response-delayed, same timing means variants and different timings mean staged updates. /// [JsonPropertyName("messages")] public IEnumerable? Messages { get; set; } diff --git a/src/Vapi.Net/Types/UpdateGoHighLevelCalendarEventCreateToolDto.cs b/src/Vapi.Net/Types/UpdateGoHighLevelCalendarEventCreateToolDto.cs index e6764b80..3722fea0 100644 --- a/src/Vapi.Net/Types/UpdateGoHighLevelCalendarEventCreateToolDto.cs +++ b/src/Vapi.Net/Types/UpdateGoHighLevelCalendarEventCreateToolDto.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Fields used to update a GoHighLevel calendar-event tool, including its spoken messages and rejection plan. +/// [Serializable] public record UpdateGoHighLevelCalendarEventCreateToolDto : IJsonOnDeserialized { @@ -12,9 +15,7 @@ public record UpdateGoHighLevelCalendarEventCreateToolDto : IJsonOnDeserialized new Dictionary(); /// - /// 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. + /// Messages spoken while the tool is running. Multiple request-start messages are variants. For request-response-delayed, same timing means variants and different timings mean staged updates. /// [JsonPropertyName("messages")] public IEnumerable? Messages { get; set; } diff --git a/src/Vapi.Net/Types/UpdateGoHighLevelContactCreateToolDto.cs b/src/Vapi.Net/Types/UpdateGoHighLevelContactCreateToolDto.cs index 2a2df946..68c762b4 100644 --- a/src/Vapi.Net/Types/UpdateGoHighLevelContactCreateToolDto.cs +++ b/src/Vapi.Net/Types/UpdateGoHighLevelContactCreateToolDto.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Fields used to update a GoHighLevel contact-creation tool, including its spoken messages and rejection plan. +/// [Serializable] public record UpdateGoHighLevelContactCreateToolDto : IJsonOnDeserialized { @@ -12,9 +15,7 @@ public record UpdateGoHighLevelContactCreateToolDto : IJsonOnDeserialized new Dictionary(); /// - /// 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. + /// Messages spoken while the tool is running. Multiple request-start messages are variants. For request-response-delayed, same timing means variants and different timings mean staged updates. /// [JsonPropertyName("messages")] public IEnumerable? Messages { get; set; } diff --git a/src/Vapi.Net/Types/UpdateGoHighLevelContactGetToolDto.cs b/src/Vapi.Net/Types/UpdateGoHighLevelContactGetToolDto.cs index 1749a1b2..2edb0191 100644 --- a/src/Vapi.Net/Types/UpdateGoHighLevelContactGetToolDto.cs +++ b/src/Vapi.Net/Types/UpdateGoHighLevelContactGetToolDto.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Fields used to update a GoHighLevel contact-retrieval tool, including its spoken messages and rejection plan. +/// [Serializable] public record UpdateGoHighLevelContactGetToolDto : IJsonOnDeserialized { @@ -12,9 +15,7 @@ public record UpdateGoHighLevelContactGetToolDto : IJsonOnDeserialized new Dictionary(); /// - /// 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. + /// Messages spoken while the tool is running. Multiple request-start messages are variants. For request-response-delayed, same timing means variants and different timings mean staged updates. /// [JsonPropertyName("messages")] public IEnumerable? Messages { get; set; } diff --git a/src/Vapi.Net/Types/UpdateGoHighLevelCredentialDto.cs b/src/Vapi.Net/Types/UpdateGoHighLevelCredentialDto.cs index 4c923bf5..04432846 100644 --- a/src/Vapi.Net/Types/UpdateGoHighLevelCredentialDto.cs +++ b/src/Vapi.Net/Types/UpdateGoHighLevelCredentialDto.cs @@ -11,6 +11,9 @@ public record UpdateGoHighLevelCredentialDto : IJsonOnDeserialized private readonly IDictionary _extensionData = new Dictionary(); + [JsonPropertyName("provider")] + public UpdateGoHighLevelCredentialDtoProvider? Provider { get; set; } + /// /// This is not returned in the API. /// diff --git a/src/Vapi.Net/Types/UpdateGoHighLevelCredentialDtoProvider.cs b/src/Vapi.Net/Types/UpdateGoHighLevelCredentialDtoProvider.cs new file mode 100644 index 00000000..c9a83bf9 --- /dev/null +++ b/src/Vapi.Net/Types/UpdateGoHighLevelCredentialDtoProvider.cs @@ -0,0 +1,79 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(UpdateGoHighLevelCredentialDtoProviderSerializer))] +public enum UpdateGoHighLevelCredentialDtoProvider +{ + [EnumMember(Value = "gohighlevel")] + Gohighlevel, +} + +internal class UpdateGoHighLevelCredentialDtoProviderSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + UpdateGoHighLevelCredentialDtoProvider + > _stringToEnum = new() + { + { "gohighlevel", UpdateGoHighLevelCredentialDtoProvider.Gohighlevel }, + }; + + private static readonly global::System.Collections.Generic.Dictionary< + UpdateGoHighLevelCredentialDtoProvider, + string + > _enumToString = new() + { + { UpdateGoHighLevelCredentialDtoProvider.Gohighlevel, "gohighlevel" }, + }; + + public override UpdateGoHighLevelCredentialDtoProvider Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + UpdateGoHighLevelCredentialDtoProvider value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override UpdateGoHighLevelCredentialDtoProvider ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + UpdateGoHighLevelCredentialDtoProvider value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/UpdateGoHighLevelMcpCredentialDto.cs b/src/Vapi.Net/Types/UpdateGoHighLevelMcpCredentialDto.cs index af7d3f7d..fa73d12e 100644 --- a/src/Vapi.Net/Types/UpdateGoHighLevelMcpCredentialDto.cs +++ b/src/Vapi.Net/Types/UpdateGoHighLevelMcpCredentialDto.cs @@ -11,6 +11,9 @@ public record UpdateGoHighLevelMcpCredentialDto : IJsonOnDeserialized private readonly IDictionary _extensionData = new Dictionary(); + [JsonPropertyName("provider")] + public UpdateGoHighLevelMcpCredentialDtoProvider? Provider { get; set; } + /// /// This is the authentication session for the credential. /// diff --git a/src/Vapi.Net/Types/UpdateGoHighLevelMcpCredentialDtoProvider.cs b/src/Vapi.Net/Types/UpdateGoHighLevelMcpCredentialDtoProvider.cs new file mode 100644 index 00000000..0058ec0a --- /dev/null +++ b/src/Vapi.Net/Types/UpdateGoHighLevelMcpCredentialDtoProvider.cs @@ -0,0 +1,85 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(UpdateGoHighLevelMcpCredentialDtoProviderSerializer))] +public enum UpdateGoHighLevelMcpCredentialDtoProvider +{ + [EnumMember(Value = "ghl.oauth2-authorization")] + GhlOauth2Authorization, +} + +internal class UpdateGoHighLevelMcpCredentialDtoProviderSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + UpdateGoHighLevelMcpCredentialDtoProvider + > _stringToEnum = new() + { + { + "ghl.oauth2-authorization", + UpdateGoHighLevelMcpCredentialDtoProvider.GhlOauth2Authorization + }, + }; + + private static readonly global::System.Collections.Generic.Dictionary< + UpdateGoHighLevelMcpCredentialDtoProvider, + string + > _enumToString = new() + { + { + UpdateGoHighLevelMcpCredentialDtoProvider.GhlOauth2Authorization, + "ghl.oauth2-authorization" + }, + }; + + public override UpdateGoHighLevelMcpCredentialDtoProvider Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + UpdateGoHighLevelMcpCredentialDtoProvider value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override UpdateGoHighLevelMcpCredentialDtoProvider ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + UpdateGoHighLevelMcpCredentialDtoProvider value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/UpdateGoogleCalendarCheckAvailabilityToolDto.cs b/src/Vapi.Net/Types/UpdateGoogleCalendarCheckAvailabilityToolDto.cs index 0a5599e3..d4c22b15 100644 --- a/src/Vapi.Net/Types/UpdateGoogleCalendarCheckAvailabilityToolDto.cs +++ b/src/Vapi.Net/Types/UpdateGoogleCalendarCheckAvailabilityToolDto.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Fields used to update a Google Calendar availability tool, including its spoken messages and rejection plan. +/// [Serializable] public record UpdateGoogleCalendarCheckAvailabilityToolDto : IJsonOnDeserialized { @@ -12,9 +15,7 @@ public record UpdateGoogleCalendarCheckAvailabilityToolDto : IJsonOnDeserialized new Dictionary(); /// - /// 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. + /// Messages spoken while the tool is running. Multiple request-start messages are variants. For request-response-delayed, same timing means variants and different timings mean staged updates. /// [JsonPropertyName("messages")] public IEnumerable? Messages { get; set; } diff --git a/src/Vapi.Net/Types/UpdateGoogleCalendarCreateEventToolDto.cs b/src/Vapi.Net/Types/UpdateGoogleCalendarCreateEventToolDto.cs index e43c6e03..1e386083 100644 --- a/src/Vapi.Net/Types/UpdateGoogleCalendarCreateEventToolDto.cs +++ b/src/Vapi.Net/Types/UpdateGoogleCalendarCreateEventToolDto.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Fields used to update a Google Calendar event-creation tool, including its spoken messages and rejection plan. +/// [Serializable] public record UpdateGoogleCalendarCreateEventToolDto : IJsonOnDeserialized { @@ -12,9 +15,7 @@ public record UpdateGoogleCalendarCreateEventToolDto : IJsonOnDeserialized new Dictionary(); /// - /// 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. + /// Messages spoken while the tool is running. Multiple request-start messages are variants. For request-response-delayed, same timing means variants and different timings mean staged updates. /// [JsonPropertyName("messages")] public IEnumerable? Messages { get; set; } diff --git a/src/Vapi.Net/Types/UpdateGoogleCalendarOAuth2AuthorizationCredentialDto.cs b/src/Vapi.Net/Types/UpdateGoogleCalendarOAuth2AuthorizationCredentialDto.cs index 67cbab82..6aeb1da2 100644 --- a/src/Vapi.Net/Types/UpdateGoogleCalendarOAuth2AuthorizationCredentialDto.cs +++ b/src/Vapi.Net/Types/UpdateGoogleCalendarOAuth2AuthorizationCredentialDto.cs @@ -11,6 +11,9 @@ public record UpdateGoogleCalendarOAuth2AuthorizationCredentialDto : IJsonOnDese private readonly IDictionary _extensionData = new Dictionary(); + [JsonPropertyName("provider")] + public UpdateGoogleCalendarOAuth2AuthorizationCredentialDtoProvider? Provider { get; set; } + /// /// The authorization ID for the OAuth2 authorization /// diff --git a/src/Vapi.Net/Types/UpdateGoogleCalendarOAuth2AuthorizationCredentialDtoProvider.cs b/src/Vapi.Net/Types/UpdateGoogleCalendarOAuth2AuthorizationCredentialDtoProvider.cs new file mode 100644 index 00000000..4797d0f4 --- /dev/null +++ b/src/Vapi.Net/Types/UpdateGoogleCalendarOAuth2AuthorizationCredentialDtoProvider.cs @@ -0,0 +1,85 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(UpdateGoogleCalendarOAuth2AuthorizationCredentialDtoProviderSerializer))] +public enum UpdateGoogleCalendarOAuth2AuthorizationCredentialDtoProvider +{ + [EnumMember(Value = "google.calendar.oauth2-authorization")] + GoogleCalendarOauth2Authorization, +} + +internal class UpdateGoogleCalendarOAuth2AuthorizationCredentialDtoProviderSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + UpdateGoogleCalendarOAuth2AuthorizationCredentialDtoProvider + > _stringToEnum = new() + { + { + "google.calendar.oauth2-authorization", + UpdateGoogleCalendarOAuth2AuthorizationCredentialDtoProvider.GoogleCalendarOauth2Authorization + }, + }; + + private static readonly global::System.Collections.Generic.Dictionary< + UpdateGoogleCalendarOAuth2AuthorizationCredentialDtoProvider, + string + > _enumToString = new() + { + { + UpdateGoogleCalendarOAuth2AuthorizationCredentialDtoProvider.GoogleCalendarOauth2Authorization, + "google.calendar.oauth2-authorization" + }, + }; + + public override UpdateGoogleCalendarOAuth2AuthorizationCredentialDtoProvider Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + UpdateGoogleCalendarOAuth2AuthorizationCredentialDtoProvider value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override UpdateGoogleCalendarOAuth2AuthorizationCredentialDtoProvider ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + UpdateGoogleCalendarOAuth2AuthorizationCredentialDtoProvider value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/UpdateGoogleCalendarOAuth2ClientCredentialDto.cs b/src/Vapi.Net/Types/UpdateGoogleCalendarOAuth2ClientCredentialDto.cs index 959f34e1..3f81d50e 100644 --- a/src/Vapi.Net/Types/UpdateGoogleCalendarOAuth2ClientCredentialDto.cs +++ b/src/Vapi.Net/Types/UpdateGoogleCalendarOAuth2ClientCredentialDto.cs @@ -11,6 +11,9 @@ public record UpdateGoogleCalendarOAuth2ClientCredentialDto : IJsonOnDeserialize private readonly IDictionary _extensionData = new Dictionary(); + [JsonPropertyName("provider")] + public UpdateGoogleCalendarOAuth2ClientCredentialDtoProvider? Provider { get; set; } + /// /// This is the name of credential. This is just for your reference. /// diff --git a/src/Vapi.Net/Types/UpdateGoogleCalendarOAuth2ClientCredentialDtoProvider.cs b/src/Vapi.Net/Types/UpdateGoogleCalendarOAuth2ClientCredentialDtoProvider.cs new file mode 100644 index 00000000..4c63a215 --- /dev/null +++ b/src/Vapi.Net/Types/UpdateGoogleCalendarOAuth2ClientCredentialDtoProvider.cs @@ -0,0 +1,85 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(UpdateGoogleCalendarOAuth2ClientCredentialDtoProviderSerializer))] +public enum UpdateGoogleCalendarOAuth2ClientCredentialDtoProvider +{ + [EnumMember(Value = "google.calendar.oauth2-client")] + GoogleCalendarOauth2Client, +} + +internal class UpdateGoogleCalendarOAuth2ClientCredentialDtoProviderSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + UpdateGoogleCalendarOAuth2ClientCredentialDtoProvider + > _stringToEnum = new() + { + { + "google.calendar.oauth2-client", + UpdateGoogleCalendarOAuth2ClientCredentialDtoProvider.GoogleCalendarOauth2Client + }, + }; + + private static readonly global::System.Collections.Generic.Dictionary< + UpdateGoogleCalendarOAuth2ClientCredentialDtoProvider, + string + > _enumToString = new() + { + { + UpdateGoogleCalendarOAuth2ClientCredentialDtoProvider.GoogleCalendarOauth2Client, + "google.calendar.oauth2-client" + }, + }; + + public override UpdateGoogleCalendarOAuth2ClientCredentialDtoProvider Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + UpdateGoogleCalendarOAuth2ClientCredentialDtoProvider value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override UpdateGoogleCalendarOAuth2ClientCredentialDtoProvider ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + UpdateGoogleCalendarOAuth2ClientCredentialDtoProvider value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/UpdateGoogleCredentialDto.cs b/src/Vapi.Net/Types/UpdateGoogleCredentialDto.cs index 3e7bb9a3..9806f22c 100644 --- a/src/Vapi.Net/Types/UpdateGoogleCredentialDto.cs +++ b/src/Vapi.Net/Types/UpdateGoogleCredentialDto.cs @@ -11,6 +11,12 @@ public record UpdateGoogleCredentialDto : IJsonOnDeserialized private readonly IDictionary _extensionData = new Dictionary(); + /// + /// This is the key for Gemini in Google AI Studio. Get it from here: https://aistudio.google.com/app/apikey + /// + [JsonPropertyName("provider")] + public UpdateGoogleCredentialDtoProvider? Provider { get; set; } + /// /// This is not returned in the API. /// diff --git a/src/Vapi.Net/Types/UpdateGoogleCredentialDtoProvider.cs b/src/Vapi.Net/Types/UpdateGoogleCredentialDtoProvider.cs new file mode 100644 index 00000000..7a7fcea8 --- /dev/null +++ b/src/Vapi.Net/Types/UpdateGoogleCredentialDtoProvider.cs @@ -0,0 +1,73 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(UpdateGoogleCredentialDtoProviderSerializer))] +public enum UpdateGoogleCredentialDtoProvider +{ + [EnumMember(Value = "google")] + Google, +} + +internal class UpdateGoogleCredentialDtoProviderSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + UpdateGoogleCredentialDtoProvider + > _stringToEnum = new() { { "google", UpdateGoogleCredentialDtoProvider.Google } }; + + private static readonly global::System.Collections.Generic.Dictionary< + UpdateGoogleCredentialDtoProvider, + string + > _enumToString = new() { { UpdateGoogleCredentialDtoProvider.Google, "google" } }; + + public override UpdateGoogleCredentialDtoProvider Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + UpdateGoogleCredentialDtoProvider value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override UpdateGoogleCredentialDtoProvider ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + UpdateGoogleCredentialDtoProvider value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/UpdateGoogleSheetsOAuth2AuthorizationCredentialDto.cs b/src/Vapi.Net/Types/UpdateGoogleSheetsOAuth2AuthorizationCredentialDto.cs index 45602577..613b5c44 100644 --- a/src/Vapi.Net/Types/UpdateGoogleSheetsOAuth2AuthorizationCredentialDto.cs +++ b/src/Vapi.Net/Types/UpdateGoogleSheetsOAuth2AuthorizationCredentialDto.cs @@ -11,6 +11,9 @@ public record UpdateGoogleSheetsOAuth2AuthorizationCredentialDto : IJsonOnDeseri private readonly IDictionary _extensionData = new Dictionary(); + [JsonPropertyName("provider")] + public UpdateGoogleSheetsOAuth2AuthorizationCredentialDtoProvider? Provider { get; set; } + /// /// The authorization ID for the OAuth2 authorization /// diff --git a/src/Vapi.Net/Types/UpdateGoogleSheetsOAuth2AuthorizationCredentialDtoProvider.cs b/src/Vapi.Net/Types/UpdateGoogleSheetsOAuth2AuthorizationCredentialDtoProvider.cs new file mode 100644 index 00000000..8180024b --- /dev/null +++ b/src/Vapi.Net/Types/UpdateGoogleSheetsOAuth2AuthorizationCredentialDtoProvider.cs @@ -0,0 +1,85 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(UpdateGoogleSheetsOAuth2AuthorizationCredentialDtoProviderSerializer))] +public enum UpdateGoogleSheetsOAuth2AuthorizationCredentialDtoProvider +{ + [EnumMember(Value = "google.sheets.oauth2-authorization")] + GoogleSheetsOauth2Authorization, +} + +internal class UpdateGoogleSheetsOAuth2AuthorizationCredentialDtoProviderSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + UpdateGoogleSheetsOAuth2AuthorizationCredentialDtoProvider + > _stringToEnum = new() + { + { + "google.sheets.oauth2-authorization", + UpdateGoogleSheetsOAuth2AuthorizationCredentialDtoProvider.GoogleSheetsOauth2Authorization + }, + }; + + private static readonly global::System.Collections.Generic.Dictionary< + UpdateGoogleSheetsOAuth2AuthorizationCredentialDtoProvider, + string + > _enumToString = new() + { + { + UpdateGoogleSheetsOAuth2AuthorizationCredentialDtoProvider.GoogleSheetsOauth2Authorization, + "google.sheets.oauth2-authorization" + }, + }; + + public override UpdateGoogleSheetsOAuth2AuthorizationCredentialDtoProvider Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + UpdateGoogleSheetsOAuth2AuthorizationCredentialDtoProvider value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override UpdateGoogleSheetsOAuth2AuthorizationCredentialDtoProvider ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + UpdateGoogleSheetsOAuth2AuthorizationCredentialDtoProvider value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/UpdateGoogleSheetsRowAppendToolDto.cs b/src/Vapi.Net/Types/UpdateGoogleSheetsRowAppendToolDto.cs index 0f198656..24a590fb 100644 --- a/src/Vapi.Net/Types/UpdateGoogleSheetsRowAppendToolDto.cs +++ b/src/Vapi.Net/Types/UpdateGoogleSheetsRowAppendToolDto.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Fields used to update a Google Sheets row-append tool, including its spoken messages and rejection plan. +/// [Serializable] public record UpdateGoogleSheetsRowAppendToolDto : IJsonOnDeserialized { @@ -12,9 +15,7 @@ public record UpdateGoogleSheetsRowAppendToolDto : IJsonOnDeserialized new Dictionary(); /// - /// 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. + /// Messages spoken while the tool is running. Multiple request-start messages are variants. For request-response-delayed, same timing means variants and different timings mean staged updates. /// [JsonPropertyName("messages")] public IEnumerable? Messages { get; set; } diff --git a/src/Vapi.Net/Types/UpdateGroqCredentialDto.cs b/src/Vapi.Net/Types/UpdateGroqCredentialDto.cs index 9de10585..24a2cc8a 100644 --- a/src/Vapi.Net/Types/UpdateGroqCredentialDto.cs +++ b/src/Vapi.Net/Types/UpdateGroqCredentialDto.cs @@ -11,6 +11,9 @@ public record UpdateGroqCredentialDto : IJsonOnDeserialized private readonly IDictionary _extensionData = new Dictionary(); + [JsonPropertyName("provider")] + public UpdateGroqCredentialDtoProvider? Provider { get; set; } + /// /// This is not returned in the API. /// diff --git a/src/Vapi.Net/Types/UpdateGroqCredentialDtoProvider.cs b/src/Vapi.Net/Types/UpdateGroqCredentialDtoProvider.cs new file mode 100644 index 00000000..bc3531dc --- /dev/null +++ b/src/Vapi.Net/Types/UpdateGroqCredentialDtoProvider.cs @@ -0,0 +1,73 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(UpdateGroqCredentialDtoProviderSerializer))] +public enum UpdateGroqCredentialDtoProvider +{ + [EnumMember(Value = "groq")] + Groq, +} + +internal class UpdateGroqCredentialDtoProviderSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + UpdateGroqCredentialDtoProvider + > _stringToEnum = new() { { "groq", UpdateGroqCredentialDtoProvider.Groq } }; + + private static readonly global::System.Collections.Generic.Dictionary< + UpdateGroqCredentialDtoProvider, + string + > _enumToString = new() { { UpdateGroqCredentialDtoProvider.Groq, "groq" } }; + + public override UpdateGroqCredentialDtoProvider Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + UpdateGroqCredentialDtoProvider value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override UpdateGroqCredentialDtoProvider ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + UpdateGroqCredentialDtoProvider value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/UpdateHandoffToolDto.cs b/src/Vapi.Net/Types/UpdateHandoffToolDto.cs index ae29f55c..66e46613 100644 --- a/src/Vapi.Net/Types/UpdateHandoffToolDto.cs +++ b/src/Vapi.Net/Types/UpdateHandoffToolDto.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Fields used to update a handoff tool, including its destinations, function definition, default result, messages, and rejection plan. +/// [Serializable] public record UpdateHandoffToolDto : IJsonOnDeserialized { @@ -12,9 +15,7 @@ public record UpdateHandoffToolDto : IJsonOnDeserialized new Dictionary(); /// - /// 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. + /// Messages spoken while the tool is running. Multiple request-start messages are variants. For request-response-delayed, same timing means variants and different timings mean staged updates. /// [JsonPropertyName("messages")] public IEnumerable? Messages { get; set; } diff --git a/src/Vapi.Net/Types/UpdateHumeCredentialDto.cs b/src/Vapi.Net/Types/UpdateHumeCredentialDto.cs index 7b5f296f..71924246 100644 --- a/src/Vapi.Net/Types/UpdateHumeCredentialDto.cs +++ b/src/Vapi.Net/Types/UpdateHumeCredentialDto.cs @@ -11,6 +11,9 @@ public record UpdateHumeCredentialDto : IJsonOnDeserialized private readonly IDictionary _extensionData = new Dictionary(); + [JsonPropertyName("provider")] + public UpdateHumeCredentialDtoProvider? Provider { get; set; } + /// /// This is not returned in the API. /// diff --git a/src/Vapi.Net/Types/UpdateHumeCredentialDtoProvider.cs b/src/Vapi.Net/Types/UpdateHumeCredentialDtoProvider.cs new file mode 100644 index 00000000..7f626a1b --- /dev/null +++ b/src/Vapi.Net/Types/UpdateHumeCredentialDtoProvider.cs @@ -0,0 +1,73 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(UpdateHumeCredentialDtoProviderSerializer))] +public enum UpdateHumeCredentialDtoProvider +{ + [EnumMember(Value = "hume")] + Hume, +} + +internal class UpdateHumeCredentialDtoProviderSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + UpdateHumeCredentialDtoProvider + > _stringToEnum = new() { { "hume", UpdateHumeCredentialDtoProvider.Hume } }; + + private static readonly global::System.Collections.Generic.Dictionary< + UpdateHumeCredentialDtoProvider, + string + > _enumToString = new() { { UpdateHumeCredentialDtoProvider.Hume, "hume" } }; + + public override UpdateHumeCredentialDtoProvider Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + UpdateHumeCredentialDtoProvider value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override UpdateHumeCredentialDtoProvider ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + UpdateHumeCredentialDtoProvider value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/UpdateInflectionAiCredentialDto.cs b/src/Vapi.Net/Types/UpdateInflectionAiCredentialDto.cs index 955bb804..394c50c5 100644 --- a/src/Vapi.Net/Types/UpdateInflectionAiCredentialDto.cs +++ b/src/Vapi.Net/Types/UpdateInflectionAiCredentialDto.cs @@ -11,6 +11,12 @@ public record UpdateInflectionAiCredentialDto : IJsonOnDeserialized private readonly IDictionary _extensionData = new Dictionary(); + /// + /// 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 UpdateInflectionAiCredentialDtoProvider? Provider { get; set; } + /// /// This is not returned in the API. /// diff --git a/src/Vapi.Net/Types/UpdateInflectionAiCredentialDtoProvider.cs b/src/Vapi.Net/Types/UpdateInflectionAiCredentialDtoProvider.cs new file mode 100644 index 00000000..2f2bf065 --- /dev/null +++ b/src/Vapi.Net/Types/UpdateInflectionAiCredentialDtoProvider.cs @@ -0,0 +1,79 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(UpdateInflectionAiCredentialDtoProviderSerializer))] +public enum UpdateInflectionAiCredentialDtoProvider +{ + [EnumMember(Value = "inflection-ai")] + InflectionAi, +} + +internal class UpdateInflectionAiCredentialDtoProviderSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + UpdateInflectionAiCredentialDtoProvider + > _stringToEnum = new() + { + { "inflection-ai", UpdateInflectionAiCredentialDtoProvider.InflectionAi }, + }; + + private static readonly global::System.Collections.Generic.Dictionary< + UpdateInflectionAiCredentialDtoProvider, + string + > _enumToString = new() + { + { UpdateInflectionAiCredentialDtoProvider.InflectionAi, "inflection-ai" }, + }; + + public override UpdateInflectionAiCredentialDtoProvider Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + UpdateInflectionAiCredentialDtoProvider value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override UpdateInflectionAiCredentialDtoProvider ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + UpdateInflectionAiCredentialDtoProvider value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/UpdateInworldCredentialDto.cs b/src/Vapi.Net/Types/UpdateInworldCredentialDto.cs index c4027b40..6a7252d9 100644 --- a/src/Vapi.Net/Types/UpdateInworldCredentialDto.cs +++ b/src/Vapi.Net/Types/UpdateInworldCredentialDto.cs @@ -11,6 +11,9 @@ public record UpdateInworldCredentialDto : IJsonOnDeserialized private readonly IDictionary _extensionData = new Dictionary(); + [JsonPropertyName("provider")] + public UpdateInworldCredentialDtoProvider? Provider { get; set; } + /// /// This is the Inworld Basic (Base64) authentication token. This is not returned in the API. /// diff --git a/src/Vapi.Net/Types/UpdateInworldCredentialDtoProvider.cs b/src/Vapi.Net/Types/UpdateInworldCredentialDtoProvider.cs new file mode 100644 index 00000000..ba09998e --- /dev/null +++ b/src/Vapi.Net/Types/UpdateInworldCredentialDtoProvider.cs @@ -0,0 +1,73 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(UpdateInworldCredentialDtoProviderSerializer))] +public enum UpdateInworldCredentialDtoProvider +{ + [EnumMember(Value = "inworld")] + Inworld, +} + +internal class UpdateInworldCredentialDtoProviderSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + UpdateInworldCredentialDtoProvider + > _stringToEnum = new() { { "inworld", UpdateInworldCredentialDtoProvider.Inworld } }; + + private static readonly global::System.Collections.Generic.Dictionary< + UpdateInworldCredentialDtoProvider, + string + > _enumToString = new() { { UpdateInworldCredentialDtoProvider.Inworld, "inworld" } }; + + public override UpdateInworldCredentialDtoProvider Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + UpdateInworldCredentialDtoProvider value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override UpdateInworldCredentialDtoProvider ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + UpdateInworldCredentialDtoProvider value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/UpdateLangfuseCredentialDto.cs b/src/Vapi.Net/Types/UpdateLangfuseCredentialDto.cs index 56db2e41..77389475 100644 --- a/src/Vapi.Net/Types/UpdateLangfuseCredentialDto.cs +++ b/src/Vapi.Net/Types/UpdateLangfuseCredentialDto.cs @@ -11,6 +11,9 @@ public record UpdateLangfuseCredentialDto : IJsonOnDeserialized private readonly IDictionary _extensionData = new Dictionary(); + [JsonPropertyName("provider")] + public UpdateLangfuseCredentialDtoProvider? Provider { get; set; } + /// /// The public key for Langfuse project. Eg: pk-lf-... /// diff --git a/src/Vapi.Net/Types/UpdateLangfuseCredentialDtoProvider.cs b/src/Vapi.Net/Types/UpdateLangfuseCredentialDtoProvider.cs new file mode 100644 index 00000000..5ec56e1a --- /dev/null +++ b/src/Vapi.Net/Types/UpdateLangfuseCredentialDtoProvider.cs @@ -0,0 +1,73 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(UpdateLangfuseCredentialDtoProviderSerializer))] +public enum UpdateLangfuseCredentialDtoProvider +{ + [EnumMember(Value = "langfuse")] + Langfuse, +} + +internal class UpdateLangfuseCredentialDtoProviderSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + UpdateLangfuseCredentialDtoProvider + > _stringToEnum = new() { { "langfuse", UpdateLangfuseCredentialDtoProvider.Langfuse } }; + + private static readonly global::System.Collections.Generic.Dictionary< + UpdateLangfuseCredentialDtoProvider, + string + > _enumToString = new() { { UpdateLangfuseCredentialDtoProvider.Langfuse, "langfuse" } }; + + public override UpdateLangfuseCredentialDtoProvider Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + UpdateLangfuseCredentialDtoProvider value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override UpdateLangfuseCredentialDtoProvider ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + UpdateLangfuseCredentialDtoProvider value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/UpdateLineInsightFromCallTableDto.cs b/src/Vapi.Net/Types/UpdateLineInsightFromCallTableDto.cs index 8876bef7..7c322c66 100644 --- a/src/Vapi.Net/Types/UpdateLineInsightFromCallTableDto.cs +++ b/src/Vapi.Net/Types/UpdateLineInsightFromCallTableDto.cs @@ -5,6 +5,9 @@ namespace Vapi.Net; +/// +/// Fields used to update a line-chart insight, including its queries, formulas, grouping, time range, metadata, and name. +/// [Serializable] public record UpdateLineInsightFromCallTableDto : IJsonOnDeserialized { @@ -44,6 +47,9 @@ public record UpdateLineInsightFromCallTableDto : IJsonOnDeserialized [JsonPropertyName("metadata")] public LineInsightMetadata? Metadata { get; set; } + /// + /// The time range and interval used to aggregate the line-chart data. + /// [JsonPropertyName("timeRange")] public InsightTimeRangeWithStep? TimeRange { get; set; } diff --git a/src/Vapi.Net/Types/UpdateLmntCredentialDto.cs b/src/Vapi.Net/Types/UpdateLmntCredentialDto.cs index 2d7b3ffd..ac6ad8d4 100644 --- a/src/Vapi.Net/Types/UpdateLmntCredentialDto.cs +++ b/src/Vapi.Net/Types/UpdateLmntCredentialDto.cs @@ -11,6 +11,9 @@ public record UpdateLmntCredentialDto : IJsonOnDeserialized private readonly IDictionary _extensionData = new Dictionary(); + [JsonPropertyName("provider")] + public UpdateLmntCredentialDtoProvider? Provider { get; set; } + /// /// This is not returned in the API. /// diff --git a/src/Vapi.Net/Types/UpdateLmntCredentialDtoProvider.cs b/src/Vapi.Net/Types/UpdateLmntCredentialDtoProvider.cs new file mode 100644 index 00000000..e01a06d0 --- /dev/null +++ b/src/Vapi.Net/Types/UpdateLmntCredentialDtoProvider.cs @@ -0,0 +1,73 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(UpdateLmntCredentialDtoProviderSerializer))] +public enum UpdateLmntCredentialDtoProvider +{ + [EnumMember(Value = "lmnt")] + Lmnt, +} + +internal class UpdateLmntCredentialDtoProviderSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + UpdateLmntCredentialDtoProvider + > _stringToEnum = new() { { "lmnt", UpdateLmntCredentialDtoProvider.Lmnt } }; + + private static readonly global::System.Collections.Generic.Dictionary< + UpdateLmntCredentialDtoProvider, + string + > _enumToString = new() { { UpdateLmntCredentialDtoProvider.Lmnt, "lmnt" } }; + + public override UpdateLmntCredentialDtoProvider Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + UpdateLmntCredentialDtoProvider value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override UpdateLmntCredentialDtoProvider ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + UpdateLmntCredentialDtoProvider value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/UpdateMakeCredentialDto.cs b/src/Vapi.Net/Types/UpdateMakeCredentialDto.cs index 8482990f..187b55d1 100644 --- a/src/Vapi.Net/Types/UpdateMakeCredentialDto.cs +++ b/src/Vapi.Net/Types/UpdateMakeCredentialDto.cs @@ -11,6 +11,9 @@ public record UpdateMakeCredentialDto : IJsonOnDeserialized private readonly IDictionary _extensionData = new Dictionary(); + [JsonPropertyName("provider")] + public UpdateMakeCredentialDtoProvider? Provider { get; set; } + /// /// Team ID /// diff --git a/src/Vapi.Net/Types/UpdateMakeCredentialDtoProvider.cs b/src/Vapi.Net/Types/UpdateMakeCredentialDtoProvider.cs new file mode 100644 index 00000000..7c8e4248 --- /dev/null +++ b/src/Vapi.Net/Types/UpdateMakeCredentialDtoProvider.cs @@ -0,0 +1,73 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(UpdateMakeCredentialDtoProviderSerializer))] +public enum UpdateMakeCredentialDtoProvider +{ + [EnumMember(Value = "make")] + Make, +} + +internal class UpdateMakeCredentialDtoProviderSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + UpdateMakeCredentialDtoProvider + > _stringToEnum = new() { { "make", UpdateMakeCredentialDtoProvider.Make } }; + + private static readonly global::System.Collections.Generic.Dictionary< + UpdateMakeCredentialDtoProvider, + string + > _enumToString = new() { { UpdateMakeCredentialDtoProvider.Make, "make" } }; + + public override UpdateMakeCredentialDtoProvider Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + UpdateMakeCredentialDtoProvider value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override UpdateMakeCredentialDtoProvider ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + UpdateMakeCredentialDtoProvider value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/UpdateMakeToolDto.cs b/src/Vapi.Net/Types/UpdateMakeToolDto.cs index 5b947e34..e677d6f4 100644 --- a/src/Vapi.Net/Types/UpdateMakeToolDto.cs +++ b/src/Vapi.Net/Types/UpdateMakeToolDto.cs @@ -12,13 +12,17 @@ public record UpdateMakeToolDto : IJsonOnDeserialized new Dictionary(); /// - /// 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. + /// Messages spoken while the tool is running. Multiple request-start messages are variants. For request-response-delayed, same timing means variants and different timings mean staged updates. /// [JsonPropertyName("messages")] public IEnumerable? Messages { get; set; } + /// + /// The type of tool. "make" for Make tool. + /// + [JsonPropertyName("type")] + public UpdateMakeToolDtoType? Type { get; set; } + /// /// This is the plan to reject a tool call based on the conversation state. /// diff --git a/src/Vapi.Net/Types/UpdateMakeToolDtoType.cs b/src/Vapi.Net/Types/UpdateMakeToolDtoType.cs new file mode 100644 index 00000000..b0d19cdc --- /dev/null +++ b/src/Vapi.Net/Types/UpdateMakeToolDtoType.cs @@ -0,0 +1,73 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(UpdateMakeToolDtoTypeSerializer))] +public enum UpdateMakeToolDtoType +{ + [EnumMember(Value = "make")] + Make, +} + +internal class UpdateMakeToolDtoTypeSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + UpdateMakeToolDtoType + > _stringToEnum = new() { { "make", UpdateMakeToolDtoType.Make } }; + + private static readonly global::System.Collections.Generic.Dictionary< + UpdateMakeToolDtoType, + string + > _enumToString = new() { { UpdateMakeToolDtoType.Make, "make" } }; + + public override UpdateMakeToolDtoType Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + UpdateMakeToolDtoType value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override UpdateMakeToolDtoType ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + UpdateMakeToolDtoType value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/UpdateMcpToolDto.cs b/src/Vapi.Net/Types/UpdateMcpToolDto.cs index 7597bc2d..22fe624b 100644 --- a/src/Vapi.Net/Types/UpdateMcpToolDto.cs +++ b/src/Vapi.Net/Types/UpdateMcpToolDto.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Fields used to update an MCP tool, including its server, connection metadata, exposed tool messages, and rejection plan. +/// [Serializable] public record UpdateMcpToolDto : IJsonOnDeserialized { @@ -12,9 +15,7 @@ public record UpdateMcpToolDto : IJsonOnDeserialized new Dictionary(); /// - /// 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. + /// Messages spoken while the tool is running. Multiple request-start messages are variants. For request-response-delayed, same timing means variants and different timings mean staged updates. /// [JsonPropertyName("messages")] public IEnumerable? Messages { get; set; } @@ -121,6 +122,9 @@ public record UpdateMcpToolDto : IJsonOnDeserialized [JsonPropertyName("rejectionPlan")] public ToolRejectionPlan? RejectionPlan { get; set; } + /// + /// Connection metadata for the MCP server, including its communication protocol. + /// [JsonPropertyName("metadata")] public McpToolMetadata? Metadata { get; set; } diff --git a/src/Vapi.Net/Types/UpdateTrieveKnowledgeBaseDto.cs b/src/Vapi.Net/Types/UpdateMicrosoftCredentialDto.cs similarity index 52% rename from src/Vapi.Net/Types/UpdateTrieveKnowledgeBaseDto.cs rename to src/Vapi.Net/Types/UpdateMicrosoftCredentialDto.cs index 10c3f975..8aa273ce 100644 --- a/src/Vapi.Net/Types/UpdateTrieveKnowledgeBaseDto.cs +++ b/src/Vapi.Net/Types/UpdateMicrosoftCredentialDto.cs @@ -5,33 +5,32 @@ namespace Vapi.Net; [Serializable] -public record UpdateTrieveKnowledgeBaseDto : IJsonOnDeserialized +public record UpdateMicrosoftCredentialDto : IJsonOnDeserialized { [JsonExtensionData] private readonly IDictionary _extensionData = new Dictionary(); + [JsonPropertyName("provider")] + public UpdateMicrosoftCredentialDtoProvider? Provider { get; set; } + /// - /// This is the name of the knowledge base. + /// This is not returned in the API. /// - [JsonPropertyName("name")] - public string? Name { get; set; } + [JsonPropertyName("apiKey")] + public string? ApiKey { get; set; } /// - /// This is the searching plan used when searching for relevant chunks from the vector store. - /// - /// You should configure this if you're running into these issues: - /// - Too much unnecessary context is being fed as knowledge base context. - /// - Not enough relevant context is being fed as knowledge base context. + /// Azure region for the Speech resource. Defaults to `eastus` when omitted. MAI-Voice-2 is preview and region-limited. /// - [JsonPropertyName("searchPlan")] - public TrieveKnowledgeBaseSearchPlan? SearchPlan { get; set; } + [JsonPropertyName("region")] + public string? Region { get; set; } /// - /// This is the plan if you want us to create/import a new vector store using Trieve. + /// This is the name of credential. This is just for your reference. /// - [JsonPropertyName("createPlan")] - public TrieveKnowledgeBaseImport? CreatePlan { get; set; } + [JsonPropertyName("name")] + public string? Name { get; set; } [JsonIgnore] public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); diff --git a/src/Vapi.Net/Types/UpdateMicrosoftCredentialDtoProvider.cs b/src/Vapi.Net/Types/UpdateMicrosoftCredentialDtoProvider.cs new file mode 100644 index 00000000..f5a51681 --- /dev/null +++ b/src/Vapi.Net/Types/UpdateMicrosoftCredentialDtoProvider.cs @@ -0,0 +1,73 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(UpdateMicrosoftCredentialDtoProviderSerializer))] +public enum UpdateMicrosoftCredentialDtoProvider +{ + [EnumMember(Value = "microsoft")] + Microsoft, +} + +internal class UpdateMicrosoftCredentialDtoProviderSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + UpdateMicrosoftCredentialDtoProvider + > _stringToEnum = new() { { "microsoft", UpdateMicrosoftCredentialDtoProvider.Microsoft } }; + + private static readonly global::System.Collections.Generic.Dictionary< + UpdateMicrosoftCredentialDtoProvider, + string + > _enumToString = new() { { UpdateMicrosoftCredentialDtoProvider.Microsoft, "microsoft" } }; + + public override UpdateMicrosoftCredentialDtoProvider Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + UpdateMicrosoftCredentialDtoProvider value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override UpdateMicrosoftCredentialDtoProvider ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + UpdateMicrosoftCredentialDtoProvider value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/UpdateMistralCredentialDto.cs b/src/Vapi.Net/Types/UpdateMistralCredentialDto.cs index b2e9d122..873f2ad8 100644 --- a/src/Vapi.Net/Types/UpdateMistralCredentialDto.cs +++ b/src/Vapi.Net/Types/UpdateMistralCredentialDto.cs @@ -11,6 +11,9 @@ public record UpdateMistralCredentialDto : IJsonOnDeserialized private readonly IDictionary _extensionData = new Dictionary(); + [JsonPropertyName("provider")] + public UpdateMistralCredentialDtoProvider? Provider { get; set; } + /// /// This is not returned in the API. /// diff --git a/src/Vapi.Net/Types/UpdateMistralCredentialDtoProvider.cs b/src/Vapi.Net/Types/UpdateMistralCredentialDtoProvider.cs new file mode 100644 index 00000000..d2808e34 --- /dev/null +++ b/src/Vapi.Net/Types/UpdateMistralCredentialDtoProvider.cs @@ -0,0 +1,73 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(UpdateMistralCredentialDtoProviderSerializer))] +public enum UpdateMistralCredentialDtoProvider +{ + [EnumMember(Value = "mistral")] + Mistral, +} + +internal class UpdateMistralCredentialDtoProviderSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + UpdateMistralCredentialDtoProvider + > _stringToEnum = new() { { "mistral", UpdateMistralCredentialDtoProvider.Mistral } }; + + private static readonly global::System.Collections.Generic.Dictionary< + UpdateMistralCredentialDtoProvider, + string + > _enumToString = new() { { UpdateMistralCredentialDtoProvider.Mistral, "mistral" } }; + + public override UpdateMistralCredentialDtoProvider Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + UpdateMistralCredentialDtoProvider value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override UpdateMistralCredentialDtoProvider ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + UpdateMistralCredentialDtoProvider value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/UpdateNeuphonicCredentialDto.cs b/src/Vapi.Net/Types/UpdateNeuphonicCredentialDto.cs index ec8c0f5b..582ad98e 100644 --- a/src/Vapi.Net/Types/UpdateNeuphonicCredentialDto.cs +++ b/src/Vapi.Net/Types/UpdateNeuphonicCredentialDto.cs @@ -11,6 +11,9 @@ public record UpdateNeuphonicCredentialDto : IJsonOnDeserialized private readonly IDictionary _extensionData = new Dictionary(); + [JsonPropertyName("provider")] + public UpdateNeuphonicCredentialDtoProvider? Provider { get; set; } + /// /// This is not returned in the API. /// diff --git a/src/Vapi.Net/Types/UpdateNeuphonicCredentialDtoProvider.cs b/src/Vapi.Net/Types/UpdateNeuphonicCredentialDtoProvider.cs new file mode 100644 index 00000000..2950f921 --- /dev/null +++ b/src/Vapi.Net/Types/UpdateNeuphonicCredentialDtoProvider.cs @@ -0,0 +1,73 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(UpdateNeuphonicCredentialDtoProviderSerializer))] +public enum UpdateNeuphonicCredentialDtoProvider +{ + [EnumMember(Value = "neuphonic")] + Neuphonic, +} + +internal class UpdateNeuphonicCredentialDtoProviderSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + UpdateNeuphonicCredentialDtoProvider + > _stringToEnum = new() { { "neuphonic", UpdateNeuphonicCredentialDtoProvider.Neuphonic } }; + + private static readonly global::System.Collections.Generic.Dictionary< + UpdateNeuphonicCredentialDtoProvider, + string + > _enumToString = new() { { UpdateNeuphonicCredentialDtoProvider.Neuphonic, "neuphonic" } }; + + public override UpdateNeuphonicCredentialDtoProvider Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + UpdateNeuphonicCredentialDtoProvider value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override UpdateNeuphonicCredentialDtoProvider ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + UpdateNeuphonicCredentialDtoProvider value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/UpdateOpenAiCredentialDto.cs b/src/Vapi.Net/Types/UpdateOpenAiCredentialDto.cs index eaa01379..e091366a 100644 --- a/src/Vapi.Net/Types/UpdateOpenAiCredentialDto.cs +++ b/src/Vapi.Net/Types/UpdateOpenAiCredentialDto.cs @@ -11,6 +11,9 @@ public record UpdateOpenAiCredentialDto : IJsonOnDeserialized private readonly IDictionary _extensionData = new Dictionary(); + [JsonPropertyName("provider")] + public UpdateOpenAiCredentialDtoProvider? Provider { get; set; } + /// /// This is not returned in the API. /// diff --git a/src/Vapi.Net/Types/UpdateOpenAiCredentialDtoProvider.cs b/src/Vapi.Net/Types/UpdateOpenAiCredentialDtoProvider.cs new file mode 100644 index 00000000..90785ac0 --- /dev/null +++ b/src/Vapi.Net/Types/UpdateOpenAiCredentialDtoProvider.cs @@ -0,0 +1,73 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(UpdateOpenAiCredentialDtoProviderSerializer))] +public enum UpdateOpenAiCredentialDtoProvider +{ + [EnumMember(Value = "openai")] + Openai, +} + +internal class UpdateOpenAiCredentialDtoProviderSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + UpdateOpenAiCredentialDtoProvider + > _stringToEnum = new() { { "openai", UpdateOpenAiCredentialDtoProvider.Openai } }; + + private static readonly global::System.Collections.Generic.Dictionary< + UpdateOpenAiCredentialDtoProvider, + string + > _enumToString = new() { { UpdateOpenAiCredentialDtoProvider.Openai, "openai" } }; + + public override UpdateOpenAiCredentialDtoProvider Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + UpdateOpenAiCredentialDtoProvider value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override UpdateOpenAiCredentialDtoProvider ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + UpdateOpenAiCredentialDtoProvider value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/UpdateOpenRouterCredentialDto.cs b/src/Vapi.Net/Types/UpdateOpenRouterCredentialDto.cs index e67c854b..87cda7ee 100644 --- a/src/Vapi.Net/Types/UpdateOpenRouterCredentialDto.cs +++ b/src/Vapi.Net/Types/UpdateOpenRouterCredentialDto.cs @@ -11,6 +11,9 @@ public record UpdateOpenRouterCredentialDto : IJsonOnDeserialized private readonly IDictionary _extensionData = new Dictionary(); + [JsonPropertyName("provider")] + public UpdateOpenRouterCredentialDtoProvider? Provider { get; set; } + /// /// This is not returned in the API. /// diff --git a/src/Vapi.Net/Types/UpdateOpenRouterCredentialDtoProvider.cs b/src/Vapi.Net/Types/UpdateOpenRouterCredentialDtoProvider.cs new file mode 100644 index 00000000..c1443818 --- /dev/null +++ b/src/Vapi.Net/Types/UpdateOpenRouterCredentialDtoProvider.cs @@ -0,0 +1,73 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(UpdateOpenRouterCredentialDtoProviderSerializer))] +public enum UpdateOpenRouterCredentialDtoProvider +{ + [EnumMember(Value = "openrouter")] + Openrouter, +} + +internal class UpdateOpenRouterCredentialDtoProviderSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + UpdateOpenRouterCredentialDtoProvider + > _stringToEnum = new() { { "openrouter", UpdateOpenRouterCredentialDtoProvider.Openrouter } }; + + private static readonly global::System.Collections.Generic.Dictionary< + UpdateOpenRouterCredentialDtoProvider, + string + > _enumToString = new() { { UpdateOpenRouterCredentialDtoProvider.Openrouter, "openrouter" } }; + + public override UpdateOpenRouterCredentialDtoProvider Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + UpdateOpenRouterCredentialDtoProvider value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override UpdateOpenRouterCredentialDtoProvider ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + UpdateOpenRouterCredentialDtoProvider value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/UpdateOutputToolDto.cs b/src/Vapi.Net/Types/UpdateOutputToolDto.cs index b3198cb4..e2ab178e 100644 --- a/src/Vapi.Net/Types/UpdateOutputToolDto.cs +++ b/src/Vapi.Net/Types/UpdateOutputToolDto.cs @@ -12,13 +12,17 @@ public record UpdateOutputToolDto : IJsonOnDeserialized new Dictionary(); /// - /// 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. + /// Messages spoken while the tool is running. Multiple request-start messages are variants. For request-response-delayed, same timing means variants and different timings mean staged updates. /// [JsonPropertyName("messages")] public IEnumerable? Messages { get; set; } + /// + /// The type of tool. "output" for Output tool. + /// + [JsonPropertyName("type")] + public UpdateOutputToolDtoType? Type { get; set; } + /// /// This is the plan to reject a tool call based on the conversation state. /// diff --git a/src/Vapi.Net/Types/UpdateOutputToolDtoType.cs b/src/Vapi.Net/Types/UpdateOutputToolDtoType.cs new file mode 100644 index 00000000..af26df01 --- /dev/null +++ b/src/Vapi.Net/Types/UpdateOutputToolDtoType.cs @@ -0,0 +1,73 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(UpdateOutputToolDtoTypeSerializer))] +public enum UpdateOutputToolDtoType +{ + [EnumMember(Value = "output")] + Output, +} + +internal class UpdateOutputToolDtoTypeSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + UpdateOutputToolDtoType + > _stringToEnum = new() { { "output", UpdateOutputToolDtoType.Output } }; + + private static readonly global::System.Collections.Generic.Dictionary< + UpdateOutputToolDtoType, + string + > _enumToString = new() { { UpdateOutputToolDtoType.Output, "output" } }; + + public override UpdateOutputToolDtoType Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + UpdateOutputToolDtoType value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override UpdateOutputToolDtoType ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + UpdateOutputToolDtoType value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/UpdatePerplexityAiCredentialDto.cs b/src/Vapi.Net/Types/UpdatePerplexityAiCredentialDto.cs index 72d70f7c..c2f2b79a 100644 --- a/src/Vapi.Net/Types/UpdatePerplexityAiCredentialDto.cs +++ b/src/Vapi.Net/Types/UpdatePerplexityAiCredentialDto.cs @@ -11,6 +11,9 @@ public record UpdatePerplexityAiCredentialDto : IJsonOnDeserialized private readonly IDictionary _extensionData = new Dictionary(); + [JsonPropertyName("provider")] + public UpdatePerplexityAiCredentialDtoProvider? Provider { get; set; } + /// /// This is not returned in the API. /// diff --git a/src/Vapi.Net/Types/UpdatePerplexityAiCredentialDtoProvider.cs b/src/Vapi.Net/Types/UpdatePerplexityAiCredentialDtoProvider.cs new file mode 100644 index 00000000..a82257ce --- /dev/null +++ b/src/Vapi.Net/Types/UpdatePerplexityAiCredentialDtoProvider.cs @@ -0,0 +1,79 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(UpdatePerplexityAiCredentialDtoProviderSerializer))] +public enum UpdatePerplexityAiCredentialDtoProvider +{ + [EnumMember(Value = "perplexity-ai")] + PerplexityAi, +} + +internal class UpdatePerplexityAiCredentialDtoProviderSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + UpdatePerplexityAiCredentialDtoProvider + > _stringToEnum = new() + { + { "perplexity-ai", UpdatePerplexityAiCredentialDtoProvider.PerplexityAi }, + }; + + private static readonly global::System.Collections.Generic.Dictionary< + UpdatePerplexityAiCredentialDtoProvider, + string + > _enumToString = new() + { + { UpdatePerplexityAiCredentialDtoProvider.PerplexityAi, "perplexity-ai" }, + }; + + public override UpdatePerplexityAiCredentialDtoProvider Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + UpdatePerplexityAiCredentialDtoProvider value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override UpdatePerplexityAiCredentialDtoProvider ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + UpdatePerplexityAiCredentialDtoProvider value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/UpdatePieInsightFromCallTableDto.cs b/src/Vapi.Net/Types/UpdatePieInsightFromCallTableDto.cs index 4633c901..c22ec893 100644 --- a/src/Vapi.Net/Types/UpdatePieInsightFromCallTableDto.cs +++ b/src/Vapi.Net/Types/UpdatePieInsightFromCallTableDto.cs @@ -5,6 +5,9 @@ namespace Vapi.Net; +/// +/// Fields used to update a pie-chart insight, including its queries, formulas, grouping, time range, and name. +/// [Serializable] public record UpdatePieInsightFromCallTableDto : IJsonOnDeserialized { @@ -38,6 +41,9 @@ public record UpdatePieInsightFromCallTableDto : IJsonOnDeserialized [JsonPropertyName("formulas")] public IEnumerable? Formulas { get; set; } + /// + /// The time range used to query the pie-chart data. + /// [JsonPropertyName("timeRange")] public InsightTimeRange? TimeRange { get; set; } diff --git a/src/Vapi.Net/Types/UpdatePlayHtCredentialDto.cs b/src/Vapi.Net/Types/UpdatePlayHtCredentialDto.cs index bad06d8f..fb678ed0 100644 --- a/src/Vapi.Net/Types/UpdatePlayHtCredentialDto.cs +++ b/src/Vapi.Net/Types/UpdatePlayHtCredentialDto.cs @@ -11,6 +11,9 @@ public record UpdatePlayHtCredentialDto : IJsonOnDeserialized private readonly IDictionary _extensionData = new Dictionary(); + [JsonPropertyName("provider")] + public UpdatePlayHtCredentialDtoProvider? Provider { get; set; } + /// /// This is not returned in the API. /// diff --git a/src/Vapi.Net/Types/UpdatePlayHtCredentialDtoProvider.cs b/src/Vapi.Net/Types/UpdatePlayHtCredentialDtoProvider.cs new file mode 100644 index 00000000..a194c450 --- /dev/null +++ b/src/Vapi.Net/Types/UpdatePlayHtCredentialDtoProvider.cs @@ -0,0 +1,73 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(UpdatePlayHtCredentialDtoProviderSerializer))] +public enum UpdatePlayHtCredentialDtoProvider +{ + [EnumMember(Value = "playht")] + Playht, +} + +internal class UpdatePlayHtCredentialDtoProviderSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + UpdatePlayHtCredentialDtoProvider + > _stringToEnum = new() { { "playht", UpdatePlayHtCredentialDtoProvider.Playht } }; + + private static readonly global::System.Collections.Generic.Dictionary< + UpdatePlayHtCredentialDtoProvider, + string + > _enumToString = new() { { UpdatePlayHtCredentialDtoProvider.Playht, "playht" } }; + + public override UpdatePlayHtCredentialDtoProvider Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + UpdatePlayHtCredentialDtoProvider value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override UpdatePlayHtCredentialDtoProvider ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + UpdatePlayHtCredentialDtoProvider value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/UpdateQueryToolDto.cs b/src/Vapi.Net/Types/UpdateQueryToolDto.cs index fe4c324d..530427d0 100644 --- a/src/Vapi.Net/Types/UpdateQueryToolDto.cs +++ b/src/Vapi.Net/Types/UpdateQueryToolDto.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Fields used to update a query tool, including its knowledge bases, spoken messages, and rejection plan. +/// [Serializable] public record UpdateQueryToolDto : IJsonOnDeserialized { @@ -12,9 +15,7 @@ public record UpdateQueryToolDto : IJsonOnDeserialized new Dictionary(); /// - /// 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. + /// Messages spoken while the tool is running. Multiple request-start messages are variants. For request-response-delayed, same timing means variants and different timings mean staged updates. /// [JsonPropertyName("messages")] public IEnumerable? Messages { get; set; } diff --git a/src/Vapi.Net/Types/UpdateRimeAiCredentialDto.cs b/src/Vapi.Net/Types/UpdateRimeAiCredentialDto.cs index 48a6f1ac..1349ecf3 100644 --- a/src/Vapi.Net/Types/UpdateRimeAiCredentialDto.cs +++ b/src/Vapi.Net/Types/UpdateRimeAiCredentialDto.cs @@ -11,6 +11,9 @@ public record UpdateRimeAiCredentialDto : IJsonOnDeserialized private readonly IDictionary _extensionData = new Dictionary(); + [JsonPropertyName("provider")] + public UpdateRimeAiCredentialDtoProvider? Provider { get; set; } + /// /// This is not returned in the API. /// diff --git a/src/Vapi.Net/Types/UpdateRimeAiCredentialDtoProvider.cs b/src/Vapi.Net/Types/UpdateRimeAiCredentialDtoProvider.cs new file mode 100644 index 00000000..94a0144e --- /dev/null +++ b/src/Vapi.Net/Types/UpdateRimeAiCredentialDtoProvider.cs @@ -0,0 +1,73 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(UpdateRimeAiCredentialDtoProviderSerializer))] +public enum UpdateRimeAiCredentialDtoProvider +{ + [EnumMember(Value = "rime-ai")] + RimeAi, +} + +internal class UpdateRimeAiCredentialDtoProviderSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + UpdateRimeAiCredentialDtoProvider + > _stringToEnum = new() { { "rime-ai", UpdateRimeAiCredentialDtoProvider.RimeAi } }; + + private static readonly global::System.Collections.Generic.Dictionary< + UpdateRimeAiCredentialDtoProvider, + string + > _enumToString = new() { { UpdateRimeAiCredentialDtoProvider.RimeAi, "rime-ai" } }; + + public override UpdateRimeAiCredentialDtoProvider Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + UpdateRimeAiCredentialDtoProvider value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override UpdateRimeAiCredentialDtoProvider ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + UpdateRimeAiCredentialDtoProvider value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/UpdateRunpodCredentialDto.cs b/src/Vapi.Net/Types/UpdateRunpodCredentialDto.cs index a2c8f9e9..8d6afc7b 100644 --- a/src/Vapi.Net/Types/UpdateRunpodCredentialDto.cs +++ b/src/Vapi.Net/Types/UpdateRunpodCredentialDto.cs @@ -11,6 +11,9 @@ public record UpdateRunpodCredentialDto : IJsonOnDeserialized private readonly IDictionary _extensionData = new Dictionary(); + [JsonPropertyName("provider")] + public UpdateRunpodCredentialDtoProvider? Provider { get; set; } + /// /// This is not returned in the API. /// diff --git a/src/Vapi.Net/Types/UpdateRunpodCredentialDtoProvider.cs b/src/Vapi.Net/Types/UpdateRunpodCredentialDtoProvider.cs new file mode 100644 index 00000000..a7ea9df5 --- /dev/null +++ b/src/Vapi.Net/Types/UpdateRunpodCredentialDtoProvider.cs @@ -0,0 +1,73 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(UpdateRunpodCredentialDtoProviderSerializer))] +public enum UpdateRunpodCredentialDtoProvider +{ + [EnumMember(Value = "runpod")] + Runpod, +} + +internal class UpdateRunpodCredentialDtoProviderSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + UpdateRunpodCredentialDtoProvider + > _stringToEnum = new() { { "runpod", UpdateRunpodCredentialDtoProvider.Runpod } }; + + private static readonly global::System.Collections.Generic.Dictionary< + UpdateRunpodCredentialDtoProvider, + string + > _enumToString = new() { { UpdateRunpodCredentialDtoProvider.Runpod, "runpod" } }; + + public override UpdateRunpodCredentialDtoProvider Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + UpdateRunpodCredentialDtoProvider value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override UpdateRunpodCredentialDtoProvider ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + UpdateRunpodCredentialDtoProvider value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/UpdateS3CompatibleBucketPlanDto.cs b/src/Vapi.Net/Types/UpdateS3CompatibleBucketPlanDto.cs new file mode 100644 index 00000000..8b76c7d0 --- /dev/null +++ b/src/Vapi.Net/Types/UpdateS3CompatibleBucketPlanDto.cs @@ -0,0 +1,62 @@ +using global::System.Text.Json; +using global::System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[Serializable] +public record UpdateS3CompatibleBucketPlanDto : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + /// + /// S3-compatible endpoint URL, such as https://s3.us-west-004.backblazeb2.com. Must be public HTTPS. + /// + [JsonPropertyName("url")] + public string? Url { get; set; } + + /// + /// SigV4 signing region expected by the object store. Most stores accept us-east-1. + /// + [JsonPropertyName("region")] + public string? Region { get; set; } + + /// + /// S3 access key ID. + /// + [JsonPropertyName("accessKeyId")] + public string? AccessKeyId { get; set; } + + /// + /// S3 secret access key. This is not returned in the API. + /// + [JsonAccess(JsonAccessType.WriteOnly)] + [JsonPropertyName("secretAccessKey")] + public string? SecretAccessKey { get; set; } + + /// + /// Bucket name. + /// + [JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// Optional key prefix inside the bucket, such as recordings/. + /// + [JsonPropertyName("path")] + public string? Path { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/UpdateS3CompatibleCredentialDto.cs b/src/Vapi.Net/Types/UpdateS3CompatibleCredentialDto.cs new file mode 100644 index 00000000..c7a77601 --- /dev/null +++ b/src/Vapi.Net/Types/UpdateS3CompatibleCredentialDto.cs @@ -0,0 +1,46 @@ +using global::System.Text.Json; +using global::System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[Serializable] +public record UpdateS3CompatibleCredentialDto : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + /// + /// This is for S3-compatible storage such as MinIO, Garage, Ceph, or Backblaze B2. + /// + [JsonPropertyName("provider")] + public UpdateS3CompatibleCredentialDtoProvider? Provider { get; set; } + + /// + /// This is the order in which this storage provider is tried during upload retries. Lower numbers are tried first in increasing order. + /// + [JsonPropertyName("fallbackIndex")] + public double? FallbackIndex { get; set; } + + [JsonPropertyName("bucketPlan")] + public UpdateS3CompatibleBucketPlanDto? BucketPlan { get; set; } + + /// + /// This is the name of credential. This is just for your reference. + /// + [JsonPropertyName("name")] + public string? Name { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/UpdateS3CompatibleCredentialDtoProvider.cs b/src/Vapi.Net/Types/UpdateS3CompatibleCredentialDtoProvider.cs new file mode 100644 index 00000000..eba02cd3 --- /dev/null +++ b/src/Vapi.Net/Types/UpdateS3CompatibleCredentialDtoProvider.cs @@ -0,0 +1,79 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(UpdateS3CompatibleCredentialDtoProviderSerializer))] +public enum UpdateS3CompatibleCredentialDtoProvider +{ + [EnumMember(Value = "s3-compatible")] + S3Compatible, +} + +internal class UpdateS3CompatibleCredentialDtoProviderSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + UpdateS3CompatibleCredentialDtoProvider + > _stringToEnum = new() + { + { "s3-compatible", UpdateS3CompatibleCredentialDtoProvider.S3Compatible }, + }; + + private static readonly global::System.Collections.Generic.Dictionary< + UpdateS3CompatibleCredentialDtoProvider, + string + > _enumToString = new() + { + { UpdateS3CompatibleCredentialDtoProvider.S3Compatible, "s3-compatible" }, + }; + + public override UpdateS3CompatibleCredentialDtoProvider Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + UpdateS3CompatibleCredentialDtoProvider value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override UpdateS3CompatibleCredentialDtoProvider ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + UpdateS3CompatibleCredentialDtoProvider value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/UpdateS3CredentialDto.cs b/src/Vapi.Net/Types/UpdateS3CredentialDto.cs index fea5163f..d7c789a2 100644 --- a/src/Vapi.Net/Types/UpdateS3CredentialDto.cs +++ b/src/Vapi.Net/Types/UpdateS3CredentialDto.cs @@ -11,6 +11,12 @@ public record UpdateS3CredentialDto : IJsonOnDeserialized private readonly IDictionary _extensionData = new Dictionary(); + /// + /// Credential provider. Only allowed value is s3 + /// + [JsonPropertyName("provider")] + public UpdateS3CredentialDtoProvider? Provider { get; set; } + /// /// AWS access key ID. /// diff --git a/src/Vapi.Net/Types/TrieveKnowledgeBaseCreateType.cs b/src/Vapi.Net/Types/UpdateS3CredentialDtoProvider.cs similarity index 71% rename from src/Vapi.Net/Types/TrieveKnowledgeBaseCreateType.cs rename to src/Vapi.Net/Types/UpdateS3CredentialDtoProvider.cs index 7c9c3926..1277e46a 100644 --- a/src/Vapi.Net/Types/TrieveKnowledgeBaseCreateType.cs +++ b/src/Vapi.Net/Types/UpdateS3CredentialDtoProvider.cs @@ -3,27 +3,27 @@ namespace Vapi.Net; -[JsonConverter(typeof(TrieveKnowledgeBaseCreateTypeSerializer))] -public enum TrieveKnowledgeBaseCreateType +[JsonConverter(typeof(UpdateS3CredentialDtoProviderSerializer))] +public enum UpdateS3CredentialDtoProvider { - [EnumMember(Value = "create")] - Create, + [EnumMember(Value = "s3")] + S3, } -internal class TrieveKnowledgeBaseCreateTypeSerializer - : global::System.Text.Json.Serialization.JsonConverter +internal class UpdateS3CredentialDtoProviderSerializer + : global::System.Text.Json.Serialization.JsonConverter { private static readonly global::System.Collections.Generic.Dictionary< string, - TrieveKnowledgeBaseCreateType - > _stringToEnum = new() { { "create", TrieveKnowledgeBaseCreateType.Create } }; + UpdateS3CredentialDtoProvider + > _stringToEnum = new() { { "s3", UpdateS3CredentialDtoProvider.S3 } }; private static readonly global::System.Collections.Generic.Dictionary< - TrieveKnowledgeBaseCreateType, + UpdateS3CredentialDtoProvider, string - > _enumToString = new() { { TrieveKnowledgeBaseCreateType.Create, "create" } }; + > _enumToString = new() { { UpdateS3CredentialDtoProvider.S3, "s3" } }; - public override TrieveKnowledgeBaseCreateType Read( + public override UpdateS3CredentialDtoProvider Read( ref global::System.Text.Json.Utf8JsonReader reader, global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options @@ -37,7 +37,7 @@ public override TrieveKnowledgeBaseCreateType Read( public override void Write( global::System.Text.Json.Utf8JsonWriter writer, - TrieveKnowledgeBaseCreateType value, + UpdateS3CredentialDtoProvider value, global::System.Text.Json.JsonSerializerOptions options ) { @@ -46,7 +46,7 @@ public override void Write( ); } - public override TrieveKnowledgeBaseCreateType ReadAsPropertyName( + public override UpdateS3CredentialDtoProvider ReadAsPropertyName( ref global::System.Text.Json.Utf8JsonReader reader, global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options @@ -62,7 +62,7 @@ public override TrieveKnowledgeBaseCreateType ReadAsPropertyName( public override void WriteAsPropertyName( global::System.Text.Json.Utf8JsonWriter writer, - TrieveKnowledgeBaseCreateType value, + UpdateS3CredentialDtoProvider value, global::System.Text.Json.JsonSerializerOptions options ) { diff --git a/src/Vapi.Net/Types/UpdateSimulationSuiteDto.cs b/src/Vapi.Net/Types/UpdateSimulationSuiteDto.cs index 04a4825f..26373401 100644 --- a/src/Vapi.Net/Types/UpdateSimulationSuiteDto.cs +++ b/src/Vapi.Net/Types/UpdateSimulationSuiteDto.cs @@ -29,6 +29,12 @@ public record UpdateSimulationSuiteDto : IJsonOnDeserialized [JsonPropertyName("simulationIds")] public IEnumerable? SimulationIds { get; set; } + /// + /// Optional assistant or squad assignments (replaces existing). + /// + [JsonPropertyName("targetAssignments")] + public IEnumerable? TargetAssignments { get; set; } + /// /// Optional folder path for organizing simulation suites. /// Supports up to 3 levels (e.g., "dept/feature/variant"). diff --git a/src/Vapi.Net/Types/UpdateSipRequestToolDto.cs b/src/Vapi.Net/Types/UpdateSipRequestToolDto.cs index 76233935..2aaf3c69 100644 --- a/src/Vapi.Net/Types/UpdateSipRequestToolDto.cs +++ b/src/Vapi.Net/Types/UpdateSipRequestToolDto.cs @@ -5,6 +5,9 @@ namespace Vapi.Net; +/// +/// Fields used to update a SIP-request tool, including its method, headers, body, spoken messages, and rejection plan. +/// [Serializable] public record UpdateSipRequestToolDto : IJsonOnDeserialized { @@ -13,9 +16,7 @@ public record UpdateSipRequestToolDto : IJsonOnDeserialized new Dictionary(); /// - /// 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. + /// Messages spoken while the tool is running. Multiple request-start messages are variants. For request-response-delayed, same timing means variants and different timings mean staged updates. /// [JsonPropertyName("messages")] public IEnumerable? Messages { get; set; } diff --git a/src/Vapi.Net/Types/UpdateSlackOAuth2AuthorizationCredentialDto.cs b/src/Vapi.Net/Types/UpdateSlackOAuth2AuthorizationCredentialDto.cs index 13560da4..0c886cdf 100644 --- a/src/Vapi.Net/Types/UpdateSlackOAuth2AuthorizationCredentialDto.cs +++ b/src/Vapi.Net/Types/UpdateSlackOAuth2AuthorizationCredentialDto.cs @@ -11,6 +11,9 @@ public record UpdateSlackOAuth2AuthorizationCredentialDto : IJsonOnDeserialized private readonly IDictionary _extensionData = new Dictionary(); + [JsonPropertyName("provider")] + public UpdateSlackOAuth2AuthorizationCredentialDtoProvider? Provider { get; set; } + /// /// The authorization ID for the OAuth2 authorization /// diff --git a/src/Vapi.Net/Types/UpdateSlackOAuth2AuthorizationCredentialDtoProvider.cs b/src/Vapi.Net/Types/UpdateSlackOAuth2AuthorizationCredentialDtoProvider.cs new file mode 100644 index 00000000..fbe50628 --- /dev/null +++ b/src/Vapi.Net/Types/UpdateSlackOAuth2AuthorizationCredentialDtoProvider.cs @@ -0,0 +1,85 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(UpdateSlackOAuth2AuthorizationCredentialDtoProviderSerializer))] +public enum UpdateSlackOAuth2AuthorizationCredentialDtoProvider +{ + [EnumMember(Value = "slack.oauth2-authorization")] + SlackOauth2Authorization, +} + +internal class UpdateSlackOAuth2AuthorizationCredentialDtoProviderSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + UpdateSlackOAuth2AuthorizationCredentialDtoProvider + > _stringToEnum = new() + { + { + "slack.oauth2-authorization", + UpdateSlackOAuth2AuthorizationCredentialDtoProvider.SlackOauth2Authorization + }, + }; + + private static readonly global::System.Collections.Generic.Dictionary< + UpdateSlackOAuth2AuthorizationCredentialDtoProvider, + string + > _enumToString = new() + { + { + UpdateSlackOAuth2AuthorizationCredentialDtoProvider.SlackOauth2Authorization, + "slack.oauth2-authorization" + }, + }; + + public override UpdateSlackOAuth2AuthorizationCredentialDtoProvider Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + UpdateSlackOAuth2AuthorizationCredentialDtoProvider value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override UpdateSlackOAuth2AuthorizationCredentialDtoProvider ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + UpdateSlackOAuth2AuthorizationCredentialDtoProvider value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/UpdateSlackSendMessageToolDto.cs b/src/Vapi.Net/Types/UpdateSlackSendMessageToolDto.cs index e61f0de1..dc61321a 100644 --- a/src/Vapi.Net/Types/UpdateSlackSendMessageToolDto.cs +++ b/src/Vapi.Net/Types/UpdateSlackSendMessageToolDto.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Fields used to update a Slack message tool, including its spoken messages and rejection plan. +/// [Serializable] public record UpdateSlackSendMessageToolDto : IJsonOnDeserialized { @@ -12,9 +15,7 @@ public record UpdateSlackSendMessageToolDto : IJsonOnDeserialized new Dictionary(); /// - /// 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. + /// Messages spoken while the tool is running. Multiple request-start messages are variants. For request-response-delayed, same timing means variants and different timings mean staged updates. /// [JsonPropertyName("messages")] public IEnumerable? Messages { get; set; } diff --git a/src/Vapi.Net/Types/UpdateSlackWebhookCredentialDto.cs b/src/Vapi.Net/Types/UpdateSlackWebhookCredentialDto.cs index 7cb21352..da6a2e01 100644 --- a/src/Vapi.Net/Types/UpdateSlackWebhookCredentialDto.cs +++ b/src/Vapi.Net/Types/UpdateSlackWebhookCredentialDto.cs @@ -11,6 +11,9 @@ public record UpdateSlackWebhookCredentialDto : IJsonOnDeserialized private readonly IDictionary _extensionData = new Dictionary(); + [JsonPropertyName("provider")] + public UpdateSlackWebhookCredentialDtoProvider? Provider { get; set; } + /// /// Slack incoming webhook URL. See https://api.slack.com/messaging/webhooks for setup instructions. This is not returned in the API. /// diff --git a/src/Vapi.Net/Types/UpdateSlackWebhookCredentialDtoProvider.cs b/src/Vapi.Net/Types/UpdateSlackWebhookCredentialDtoProvider.cs new file mode 100644 index 00000000..0a200312 --- /dev/null +++ b/src/Vapi.Net/Types/UpdateSlackWebhookCredentialDtoProvider.cs @@ -0,0 +1,79 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(UpdateSlackWebhookCredentialDtoProviderSerializer))] +public enum UpdateSlackWebhookCredentialDtoProvider +{ + [EnumMember(Value = "slack-webhook")] + SlackWebhook, +} + +internal class UpdateSlackWebhookCredentialDtoProviderSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + UpdateSlackWebhookCredentialDtoProvider + > _stringToEnum = new() + { + { "slack-webhook", UpdateSlackWebhookCredentialDtoProvider.SlackWebhook }, + }; + + private static readonly global::System.Collections.Generic.Dictionary< + UpdateSlackWebhookCredentialDtoProvider, + string + > _enumToString = new() + { + { UpdateSlackWebhookCredentialDtoProvider.SlackWebhook, "slack-webhook" }, + }; + + public override UpdateSlackWebhookCredentialDtoProvider Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + UpdateSlackWebhookCredentialDtoProvider value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override UpdateSlackWebhookCredentialDtoProvider ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + UpdateSlackWebhookCredentialDtoProvider value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/UpdateSmsToolDto.cs b/src/Vapi.Net/Types/UpdateSmsToolDto.cs index d7fbf757..345a0a28 100644 --- a/src/Vapi.Net/Types/UpdateSmsToolDto.cs +++ b/src/Vapi.Net/Types/UpdateSmsToolDto.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Fields used to update an SMS tool, including its spoken messages and rejection plan. +/// [Serializable] public record UpdateSmsToolDto : IJsonOnDeserialized { @@ -12,9 +15,7 @@ public record UpdateSmsToolDto : IJsonOnDeserialized new Dictionary(); /// - /// 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. + /// Messages spoken while the tool is running. Multiple request-start messages are variants. For request-response-delayed, same timing means variants and different timings mean staged updates. /// [JsonPropertyName("messages")] public IEnumerable? Messages { get; set; } diff --git a/src/Vapi.Net/Types/UpdateSonioxCredentialDto.cs b/src/Vapi.Net/Types/UpdateSonioxCredentialDto.cs index 81058392..44bc6019 100644 --- a/src/Vapi.Net/Types/UpdateSonioxCredentialDto.cs +++ b/src/Vapi.Net/Types/UpdateSonioxCredentialDto.cs @@ -11,12 +11,21 @@ public record UpdateSonioxCredentialDto : IJsonOnDeserialized private readonly IDictionary _extensionData = new Dictionary(); + [JsonPropertyName("provider")] + public UpdateSonioxCredentialDtoProvider? Provider { get; set; } + /// /// This is not returned in the API. /// [JsonPropertyName("apiKey")] public string? ApiKey { get; set; } + /// + /// Custom Soniox WebSocket endpoint (e.g. EU server wss://stt-rt.eu.soniox.com/transcribe-websocket). Defaults to the region-appropriate endpoint when omitted. + /// + [JsonPropertyName("apiUrl")] + public string? ApiUrl { get; set; } + /// /// This is the name of credential. This is just for your reference. /// diff --git a/src/Vapi.Net/Types/UpdateSonioxCredentialDtoProvider.cs b/src/Vapi.Net/Types/UpdateSonioxCredentialDtoProvider.cs new file mode 100644 index 00000000..98040ac9 --- /dev/null +++ b/src/Vapi.Net/Types/UpdateSonioxCredentialDtoProvider.cs @@ -0,0 +1,73 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(UpdateSonioxCredentialDtoProviderSerializer))] +public enum UpdateSonioxCredentialDtoProvider +{ + [EnumMember(Value = "soniox")] + Soniox, +} + +internal class UpdateSonioxCredentialDtoProviderSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + UpdateSonioxCredentialDtoProvider + > _stringToEnum = new() { { "soniox", UpdateSonioxCredentialDtoProvider.Soniox } }; + + private static readonly global::System.Collections.Generic.Dictionary< + UpdateSonioxCredentialDtoProvider, + string + > _enumToString = new() { { UpdateSonioxCredentialDtoProvider.Soniox, "soniox" } }; + + public override UpdateSonioxCredentialDtoProvider Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + UpdateSonioxCredentialDtoProvider value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override UpdateSonioxCredentialDtoProvider ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + UpdateSonioxCredentialDtoProvider value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/UpdateTelnyxPhoneNumberDto.cs b/src/Vapi.Net/Types/UpdateTelnyxPhoneNumberDto.cs index 96abac7a..9a665299 100644 --- a/src/Vapi.Net/Types/UpdateTelnyxPhoneNumberDto.cs +++ b/src/Vapi.Net/Types/UpdateTelnyxPhoneNumberDto.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Fields used to update a Telnyx phone number, including its credential, number, routing, hooks, and server settings. +/// [Serializable] public record UpdateTelnyxPhoneNumberDto : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/UpdateTextEditorToolDto.cs b/src/Vapi.Net/Types/UpdateTextEditorToolDto.cs index ab3dedc0..a98f0406 100644 --- a/src/Vapi.Net/Types/UpdateTextEditorToolDto.cs +++ b/src/Vapi.Net/Types/UpdateTextEditorToolDto.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Fields used to update a text-editor tool, including its name, environment subtype, server, messages, and rejection plan. +/// [Serializable] public record UpdateTextEditorToolDto : IJsonOnDeserialized { @@ -12,9 +15,7 @@ public record UpdateTextEditorToolDto : IJsonOnDeserialized new Dictionary(); /// - /// 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. + /// Messages spoken while the tool is running. Multiple request-start messages are variants. For request-response-delayed, same timing means variants and different timings mean staged updates. /// [JsonPropertyName("messages")] public IEnumerable? Messages { get; set; } diff --git a/src/Vapi.Net/Types/UpdateTextInsightFromCallTableDto.cs b/src/Vapi.Net/Types/UpdateTextInsightFromCallTableDto.cs index de10f641..c7e750a9 100644 --- a/src/Vapi.Net/Types/UpdateTextInsightFromCallTableDto.cs +++ b/src/Vapi.Net/Types/UpdateTextInsightFromCallTableDto.cs @@ -5,6 +5,9 @@ namespace Vapi.Net; +/// +/// Fields used to update a text-value insight, including its queries, formula, time range, and name. +/// [Serializable] public record UpdateTextInsightFromCallTableDto : IJsonOnDeserialized { @@ -38,6 +41,9 @@ public record UpdateTextInsightFromCallTableDto : IJsonOnDeserialized [JsonPropertyName("formula")] public object? Formula { get; set; } + /// + /// The time range used to query the text-value data. + /// [JsonPropertyName("timeRange")] public InsightTimeRange? TimeRange { get; set; } diff --git a/src/Vapi.Net/Types/UpdateTogetherAiCredentialDto.cs b/src/Vapi.Net/Types/UpdateTogetherAiCredentialDto.cs index 75b8d45a..109758ac 100644 --- a/src/Vapi.Net/Types/UpdateTogetherAiCredentialDto.cs +++ b/src/Vapi.Net/Types/UpdateTogetherAiCredentialDto.cs @@ -11,6 +11,9 @@ public record UpdateTogetherAiCredentialDto : IJsonOnDeserialized private readonly IDictionary _extensionData = new Dictionary(); + [JsonPropertyName("provider")] + public UpdateTogetherAiCredentialDtoProvider? Provider { get; set; } + /// /// This is not returned in the API. /// diff --git a/src/Vapi.Net/Types/UpdateTogetherAiCredentialDtoProvider.cs b/src/Vapi.Net/Types/UpdateTogetherAiCredentialDtoProvider.cs new file mode 100644 index 00000000..5171e32c --- /dev/null +++ b/src/Vapi.Net/Types/UpdateTogetherAiCredentialDtoProvider.cs @@ -0,0 +1,73 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(UpdateTogetherAiCredentialDtoProviderSerializer))] +public enum UpdateTogetherAiCredentialDtoProvider +{ + [EnumMember(Value = "together-ai")] + TogetherAi, +} + +internal class UpdateTogetherAiCredentialDtoProviderSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + UpdateTogetherAiCredentialDtoProvider + > _stringToEnum = new() { { "together-ai", UpdateTogetherAiCredentialDtoProvider.TogetherAi } }; + + private static readonly global::System.Collections.Generic.Dictionary< + UpdateTogetherAiCredentialDtoProvider, + string + > _enumToString = new() { { UpdateTogetherAiCredentialDtoProvider.TogetherAi, "together-ai" } }; + + public override UpdateTogetherAiCredentialDtoProvider Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + UpdateTogetherAiCredentialDtoProvider value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override UpdateTogetherAiCredentialDtoProvider ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + UpdateTogetherAiCredentialDtoProvider value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/UpdateToolDraftDto.cs b/src/Vapi.Net/Types/UpdateToolDraftDto.cs new file mode 100644 index 00000000..d397fef5 --- /dev/null +++ b/src/Vapi.Net/Types/UpdateToolDraftDto.cs @@ -0,0 +1,297 @@ +using global::System.Text.Json; +using global::System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[Serializable] +public record UpdateToolDraftDto : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + /// + /// Messages spoken while the tool is running. Multiple request-start messages are variants. For request-response-delayed, same timing means variants and different timings mean staged updates. + /// + [JsonPropertyName("messages")] + public IEnumerable? Messages { get; set; } + + /// + /// This is the type of the tool. + /// + [JsonPropertyName("type")] + public UpdateToolDraftDtoType? Type { get; set; } + + /// + /// This is the function definition of the tool. + /// + [JsonPropertyName("function")] + public OpenAiFunction? Function { get; set; } + + /// + /// Provider-specific metadata. Polymorphic across tool variants with no shared + /// discriminator, so it is validated as a plain object (mirrors how + /// `ToolCallResult.metadata` is typed). + /// + [JsonPropertyName("metadata")] + public object? Metadata { get; set; } + + /// + /// This is the unique identifier for the template this tool was created from. + /// + [JsonPropertyName("templateId")] + public string? TemplateId { get; set; } + + [JsonPropertyName("server")] + public Server? Server { get; set; } + + [JsonPropertyName("async")] + public bool? Async { get; set; } + + /// + /// These are the destinations that the call can be transferred to. + /// + [JsonPropertyName("destinations")] + public IEnumerable? Destinations { 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 sub type of the tool (e.g. for computer, bash and text-editor tools). + /// + [JsonPropertyName("subType")] + public string? SubType { get; set; } + + /// + /// The display width in pixels (computer tool). + /// + [JsonPropertyName("displayWidthPx")] + public double? DisplayWidthPx { get; set; } + + /// + /// The display height in pixels (computer tool). + /// + [JsonPropertyName("displayHeightPx")] + public double? DisplayHeightPx { get; set; } + + /// + /// Optional display number (computer tool). + /// + [JsonPropertyName("displayNumber")] + public double? DisplayNumber { get; set; } + + /// + /// The knowledge bases to query (query tool). + /// + [JsonPropertyName("knowledgeBases")] + public IEnumerable? KnowledgeBases { get; set; } + + /// + /// This is where the request will be sent (api-request tool). + /// + [JsonPropertyName("url")] + public string? Url { get; set; } + + /// + /// This is the HTTP method for the request (api-request tool). + /// + [JsonPropertyName("method")] + public UpdateToolDraftDtoMethod? Method { get; set; } + + /// + /// These are the headers to send with the request (api-request / sip-request tool). + /// + [JsonPropertyName("headers")] + public JsonSchema? Headers { get; set; } + + /// + /// This is the body of the request. Either a JSON schema (api-request) or a + /// literal string / schema (sip-request). + /// + [JsonPropertyName("body")] + public object? Body { get; set; } + + /// + /// This is the backoff plan if the request fails. + /// + [JsonPropertyName("backoffPlan")] + public BackoffPlan? BackoffPlan { get; set; } + + /// + /// This is the timeout in seconds for the request. + /// + [JsonPropertyName("timeoutSeconds")] + public double? TimeoutSeconds { 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 the plan to extract variables from the tool's response. + /// + [JsonPropertyName("variableExtractionPlan")] + public VariableExtractionPlan? VariableExtractionPlan { get; set; } + + /// + /// This is the credential ID that will be used for authorization. + /// + [JsonPropertyName("credentialId")] + public string? CredentialId { get; set; } + + [JsonPropertyName("extendedDelayWhenPrecededByTextEnabled")] + public bool? ExtendedDelayWhenPrecededByTextEnabled { get; set; } + + [JsonPropertyName("beepDetectionEnabled")] + public bool? BeepDetectionEnabled { get; set; } + + /// + /// This is the TypeScript code that will be executed when the tool is called (code tool). + /// + [JsonPropertyName("code")] + public string? Code { get; set; } + + /// + /// These are the environment variables available in the code via the `env` object (code tool). + /// + [JsonPropertyName("environmentVariables")] + public IEnumerable? EnvironmentVariables { get; set; } + + /// + /// These are the static parameters to merge into the tool's request body. + /// + [JsonPropertyName("parameters")] + public IEnumerable? Parameters { get; set; } + + /// + /// This is the paths to encrypt in the request body. + /// + [JsonPropertyName("encryptedPaths")] + public IEnumerable? EncryptedPaths { get; set; } + + /// + /// This enables sending DTMF tones via SIP INFO messages instead of RFC 2833. + /// + [JsonPropertyName("sipInfoDtmfEnabled")] + public bool? SipInfoDtmfEnabled { get; set; } + + /// + /// This is the SIP method to send (sip-request tool). + /// + [JsonPropertyName("verb")] + public UpdateToolDraftDtoVerb? Verb { get; set; } + + /// + /// This is the default local tool result message used when no runtime override is returned (handoff tool). + /// + [JsonPropertyName("defaultResult")] + public string? DefaultResult { get; set; } + + /// + /// Per-tool message overrides for individual tools loaded from the MCP server (mcp tool). + /// + [JsonPropertyName("toolMessages")] + public IEnumerable? ToolMessages { get; set; } + + /// + /// This is the plan to reject a tool call based on the conversation state. + /// + /// // Example 1: Reject endCall if user didn't say goodbye + /// ```json + /// { + /// conditions: [{ + /// type: 'regex', + /// regex: '(?i)\\b(bye|goodbye|farewell|see you later|take care)\\b', + /// target: { position: -1, role: 'user' }, + /// negate: true // Reject if pattern does NOT match + /// }] + /// } + /// ``` + /// + /// // Example 2: Reject transfer if user is actually asking a question + /// ```json + /// { + /// conditions: [{ + /// type: 'regex', + /// regex: '\\?', + /// target: { position: -1, role: 'user' } + /// }] + /// } + /// ``` + /// + /// // Example 3: Reject transfer if user didn't mention transfer recently + /// ```json + /// { + /// conditions: [{ + /// type: 'liquid', + /// liquid: `{% assign recentMessages = messages | last: 5 %} + /// {% assign userMessages = recentMessages | where: 'role', 'user' %} + /// {% assign mentioned = false %} + /// {% for msg in userMessages %} + /// {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %} + /// {% assign mentioned = true %} + /// {% break %} + /// {% endif %} + /// {% endfor %} + /// {% if mentioned %} + /// false + /// {% else %} + /// true + /// {% endif %}` + /// }] + /// } + /// ``` + /// + /// // Example 4: Reject endCall if the bot is looping and trying to exit + /// ```json + /// { + /// conditions: [{ + /// type: 'liquid', + /// liquid: `{% assign recentMessages = messages | last: 6 %} + /// {% assign userMessages = recentMessages | where: 'role', 'user' | reverse %} + /// {% if userMessages.size < 3 %} + /// false + /// {% else %} + /// {% assign msg1 = userMessages[0].content | downcase %} + /// {% assign msg2 = userMessages[1].content | downcase %} + /// {% assign msg3 = userMessages[2].content | downcase %} + /// {% comment %} Check for repetitive messages {% endcomment %} + /// {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %} + /// true + /// {% comment %} Check for common loop phrases {% endcomment %} + /// {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %} + /// true + /// {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %} + /// true + /// {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %} + /// true + /// {% else %} + /// false + /// {% endif %} + /// {% endif %}` + /// }] + /// } + /// ``` + /// + [JsonPropertyName("rejectionPlan")] + public ToolRejectionPlan? RejectionPlan { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/UpdateToolDraftDtoMethod.cs b/src/Vapi.Net/Types/UpdateToolDraftDtoMethod.cs new file mode 100644 index 00000000..9b8d670b --- /dev/null +++ b/src/Vapi.Net/Types/UpdateToolDraftDtoMethod.cs @@ -0,0 +1,99 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(UpdateToolDraftDtoMethodSerializer))] +public enum UpdateToolDraftDtoMethod +{ + [EnumMember(Value = "POST")] + Post, + + [EnumMember(Value = "GET")] + Get, + + [EnumMember(Value = "PUT")] + Put, + + [EnumMember(Value = "PATCH")] + Patch, + + [EnumMember(Value = "DELETE")] + Delete, +} + +internal class UpdateToolDraftDtoMethodSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + UpdateToolDraftDtoMethod + > _stringToEnum = new() + { + { "POST", UpdateToolDraftDtoMethod.Post }, + { "GET", UpdateToolDraftDtoMethod.Get }, + { "PUT", UpdateToolDraftDtoMethod.Put }, + { "PATCH", UpdateToolDraftDtoMethod.Patch }, + { "DELETE", UpdateToolDraftDtoMethod.Delete }, + }; + + private static readonly global::System.Collections.Generic.Dictionary< + UpdateToolDraftDtoMethod, + string + > _enumToString = new() + { + { UpdateToolDraftDtoMethod.Post, "POST" }, + { UpdateToolDraftDtoMethod.Get, "GET" }, + { UpdateToolDraftDtoMethod.Put, "PUT" }, + { UpdateToolDraftDtoMethod.Patch, "PATCH" }, + { UpdateToolDraftDtoMethod.Delete, "DELETE" }, + }; + + public override UpdateToolDraftDtoMethod Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + UpdateToolDraftDtoMethod value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override UpdateToolDraftDtoMethod ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + UpdateToolDraftDtoMethod value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/UpdateToolDraftDtoType.cs b/src/Vapi.Net/Types/UpdateToolDraftDtoType.cs new file mode 100644 index 00000000..8532c814 --- /dev/null +++ b/src/Vapi.Net/Types/UpdateToolDraftDtoType.cs @@ -0,0 +1,232 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(UpdateToolDraftDtoTypeSerializer))] +public enum UpdateToolDraftDtoType +{ + [EnumMember(Value = "dtmf")] + Dtmf, + + [EnumMember(Value = "endCall")] + EndCall, + + [EnumMember(Value = "transferCall")] + TransferCall, + + [EnumMember(Value = "transferCancel")] + TransferCancel, + + [EnumMember(Value = "transferSuccessful")] + TransferSuccessful, + + [EnumMember(Value = "handoff")] + Handoff, + + [EnumMember(Value = "output")] + Output, + + [EnumMember(Value = "voicemail")] + Voicemail, + + [EnumMember(Value = "query")] + Query, + + [EnumMember(Value = "sms")] + Sms, + + [EnumMember(Value = "sipRequest")] + SipRequest, + + [EnumMember(Value = "function")] + Function, + + [EnumMember(Value = "mcp")] + Mcp, + + [EnumMember(Value = "apiRequest")] + ApiRequest, + + [EnumMember(Value = "code")] + Code, + + [EnumMember(Value = "bash")] + Bash, + + [EnumMember(Value = "computer")] + Computer, + + [EnumMember(Value = "textEditor")] + TextEditor, + + [EnumMember(Value = "google.calendar.event.create")] + GoogleCalendarEventCreate, + + [EnumMember(Value = "google.calendar.availability.check")] + GoogleCalendarAvailabilityCheck, + + [EnumMember(Value = "google.sheets.row.append")] + GoogleSheetsRowAppend, + + [EnumMember(Value = "slack.message.send")] + SlackMessageSend, + + [EnumMember(Value = "gohighlevel.calendar.event.create")] + GohighlevelCalendarEventCreate, + + [EnumMember(Value = "gohighlevel.calendar.availability.check")] + GohighlevelCalendarAvailabilityCheck, + + [EnumMember(Value = "gohighlevel.contact.create")] + GohighlevelContactCreate, + + [EnumMember(Value = "gohighlevel.contact.get")] + GohighlevelContactGet, + + [EnumMember(Value = "make")] + Make, + + [EnumMember(Value = "ghl")] + Ghl, +} + +internal class UpdateToolDraftDtoTypeSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + UpdateToolDraftDtoType + > _stringToEnum = new() + { + { "dtmf", UpdateToolDraftDtoType.Dtmf }, + { "endCall", UpdateToolDraftDtoType.EndCall }, + { "transferCall", UpdateToolDraftDtoType.TransferCall }, + { "transferCancel", UpdateToolDraftDtoType.TransferCancel }, + { "transferSuccessful", UpdateToolDraftDtoType.TransferSuccessful }, + { "handoff", UpdateToolDraftDtoType.Handoff }, + { "output", UpdateToolDraftDtoType.Output }, + { "voicemail", UpdateToolDraftDtoType.Voicemail }, + { "query", UpdateToolDraftDtoType.Query }, + { "sms", UpdateToolDraftDtoType.Sms }, + { "sipRequest", UpdateToolDraftDtoType.SipRequest }, + { "function", UpdateToolDraftDtoType.Function }, + { "mcp", UpdateToolDraftDtoType.Mcp }, + { "apiRequest", UpdateToolDraftDtoType.ApiRequest }, + { "code", UpdateToolDraftDtoType.Code }, + { "bash", UpdateToolDraftDtoType.Bash }, + { "computer", UpdateToolDraftDtoType.Computer }, + { "textEditor", UpdateToolDraftDtoType.TextEditor }, + { "google.calendar.event.create", UpdateToolDraftDtoType.GoogleCalendarEventCreate }, + { + "google.calendar.availability.check", + UpdateToolDraftDtoType.GoogleCalendarAvailabilityCheck + }, + { "google.sheets.row.append", UpdateToolDraftDtoType.GoogleSheetsRowAppend }, + { "slack.message.send", UpdateToolDraftDtoType.SlackMessageSend }, + { + "gohighlevel.calendar.event.create", + UpdateToolDraftDtoType.GohighlevelCalendarEventCreate + }, + { + "gohighlevel.calendar.availability.check", + UpdateToolDraftDtoType.GohighlevelCalendarAvailabilityCheck + }, + { "gohighlevel.contact.create", UpdateToolDraftDtoType.GohighlevelContactCreate }, + { "gohighlevel.contact.get", UpdateToolDraftDtoType.GohighlevelContactGet }, + { "make", UpdateToolDraftDtoType.Make }, + { "ghl", UpdateToolDraftDtoType.Ghl }, + }; + + private static readonly global::System.Collections.Generic.Dictionary< + UpdateToolDraftDtoType, + string + > _enumToString = new() + { + { UpdateToolDraftDtoType.Dtmf, "dtmf" }, + { UpdateToolDraftDtoType.EndCall, "endCall" }, + { UpdateToolDraftDtoType.TransferCall, "transferCall" }, + { UpdateToolDraftDtoType.TransferCancel, "transferCancel" }, + { UpdateToolDraftDtoType.TransferSuccessful, "transferSuccessful" }, + { UpdateToolDraftDtoType.Handoff, "handoff" }, + { UpdateToolDraftDtoType.Output, "output" }, + { UpdateToolDraftDtoType.Voicemail, "voicemail" }, + { UpdateToolDraftDtoType.Query, "query" }, + { UpdateToolDraftDtoType.Sms, "sms" }, + { UpdateToolDraftDtoType.SipRequest, "sipRequest" }, + { UpdateToolDraftDtoType.Function, "function" }, + { UpdateToolDraftDtoType.Mcp, "mcp" }, + { UpdateToolDraftDtoType.ApiRequest, "apiRequest" }, + { UpdateToolDraftDtoType.Code, "code" }, + { UpdateToolDraftDtoType.Bash, "bash" }, + { UpdateToolDraftDtoType.Computer, "computer" }, + { UpdateToolDraftDtoType.TextEditor, "textEditor" }, + { UpdateToolDraftDtoType.GoogleCalendarEventCreate, "google.calendar.event.create" }, + { + UpdateToolDraftDtoType.GoogleCalendarAvailabilityCheck, + "google.calendar.availability.check" + }, + { UpdateToolDraftDtoType.GoogleSheetsRowAppend, "google.sheets.row.append" }, + { UpdateToolDraftDtoType.SlackMessageSend, "slack.message.send" }, + { + UpdateToolDraftDtoType.GohighlevelCalendarEventCreate, + "gohighlevel.calendar.event.create" + }, + { + UpdateToolDraftDtoType.GohighlevelCalendarAvailabilityCheck, + "gohighlevel.calendar.availability.check" + }, + { UpdateToolDraftDtoType.GohighlevelContactCreate, "gohighlevel.contact.create" }, + { UpdateToolDraftDtoType.GohighlevelContactGet, "gohighlevel.contact.get" }, + { UpdateToolDraftDtoType.Make, "make" }, + { UpdateToolDraftDtoType.Ghl, "ghl" }, + }; + + public override UpdateToolDraftDtoType Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + UpdateToolDraftDtoType value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override UpdateToolDraftDtoType ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + UpdateToolDraftDtoType value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/UpdateToolDraftDtoVerb.cs b/src/Vapi.Net/Types/UpdateToolDraftDtoVerb.cs new file mode 100644 index 00000000..45c4488a --- /dev/null +++ b/src/Vapi.Net/Types/UpdateToolDraftDtoVerb.cs @@ -0,0 +1,89 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(UpdateToolDraftDtoVerbSerializer))] +public enum UpdateToolDraftDtoVerb +{ + [EnumMember(Value = "INFO")] + Info, + + [EnumMember(Value = "MESSAGE")] + Message, + + [EnumMember(Value = "NOTIFY")] + Notify, +} + +internal class UpdateToolDraftDtoVerbSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + UpdateToolDraftDtoVerb + > _stringToEnum = new() + { + { "INFO", UpdateToolDraftDtoVerb.Info }, + { "MESSAGE", UpdateToolDraftDtoVerb.Message }, + { "NOTIFY", UpdateToolDraftDtoVerb.Notify }, + }; + + private static readonly global::System.Collections.Generic.Dictionary< + UpdateToolDraftDtoVerb, + string + > _enumToString = new() + { + { UpdateToolDraftDtoVerb.Info, "INFO" }, + { UpdateToolDraftDtoVerb.Message, "MESSAGE" }, + { UpdateToolDraftDtoVerb.Notify, "NOTIFY" }, + }; + + public override UpdateToolDraftDtoVerb Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + UpdateToolDraftDtoVerb value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override UpdateToolDraftDtoVerb ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + UpdateToolDraftDtoVerb value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/UpdateToolVersionMetadataDto.cs b/src/Vapi.Net/Types/UpdateToolVersionMetadataDto.cs new file mode 100644 index 00000000..d38ef037 --- /dev/null +++ b/src/Vapi.Net/Types/UpdateToolVersionMetadataDto.cs @@ -0,0 +1,37 @@ +using global::System.Text.Json; +using global::System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[Serializable] +public record UpdateToolVersionMetadataDto : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + /// + /// Optional human-readable label for this version. Pass `null` to clear. + /// + [JsonPropertyName("versionName")] + public string? VersionName { get; set; } + + /// + /// Optional description for this version. Pass `null` to clear. + /// + [JsonPropertyName("versionDescription")] + public string? VersionDescription { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + 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 04db482d..0e854aa7 100644 --- a/src/Vapi.Net/Types/UpdateTransferCallToolDto.cs +++ b/src/Vapi.Net/Types/UpdateTransferCallToolDto.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Fields used to update a call-transfer tool, including its destinations, spoken messages, and rejection plan. +/// [Serializable] public record UpdateTransferCallToolDto : IJsonOnDeserialized { @@ -12,9 +15,7 @@ public record UpdateTransferCallToolDto : IJsonOnDeserialized new Dictionary(); /// - /// 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. + /// Messages spoken while the tool is running. Multiple request-start messages are variants. For request-response-delayed, same timing means variants and different timings mean staged updates. /// [JsonPropertyName("messages")] public IEnumerable? Messages { get; set; } diff --git a/src/Vapi.Net/Types/UpdateTwilioCredentialDto.cs b/src/Vapi.Net/Types/UpdateTwilioCredentialDto.cs index aaa45258..3e0578b2 100644 --- a/src/Vapi.Net/Types/UpdateTwilioCredentialDto.cs +++ b/src/Vapi.Net/Types/UpdateTwilioCredentialDto.cs @@ -11,6 +11,9 @@ public record UpdateTwilioCredentialDto : IJsonOnDeserialized private readonly IDictionary _extensionData = new Dictionary(); + [JsonPropertyName("provider")] + public UpdateTwilioCredentialDtoProvider? Provider { get; set; } + /// /// This is not returned in the API. /// diff --git a/src/Vapi.Net/Types/UpdateTwilioCredentialDtoProvider.cs b/src/Vapi.Net/Types/UpdateTwilioCredentialDtoProvider.cs new file mode 100644 index 00000000..d2f8ea09 --- /dev/null +++ b/src/Vapi.Net/Types/UpdateTwilioCredentialDtoProvider.cs @@ -0,0 +1,73 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(UpdateTwilioCredentialDtoProviderSerializer))] +public enum UpdateTwilioCredentialDtoProvider +{ + [EnumMember(Value = "twilio")] + Twilio, +} + +internal class UpdateTwilioCredentialDtoProviderSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + UpdateTwilioCredentialDtoProvider + > _stringToEnum = new() { { "twilio", UpdateTwilioCredentialDtoProvider.Twilio } }; + + private static readonly global::System.Collections.Generic.Dictionary< + UpdateTwilioCredentialDtoProvider, + string + > _enumToString = new() { { UpdateTwilioCredentialDtoProvider.Twilio, "twilio" } }; + + public override UpdateTwilioCredentialDtoProvider Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + UpdateTwilioCredentialDtoProvider value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override UpdateTwilioCredentialDtoProvider ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + UpdateTwilioCredentialDtoProvider value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/UpdateTwilioPhoneNumberDto.cs b/src/Vapi.Net/Types/UpdateTwilioPhoneNumberDto.cs index 3183bfc7..bb80b0d0 100644 --- a/src/Vapi.Net/Types/UpdateTwilioPhoneNumberDto.cs +++ b/src/Vapi.Net/Types/UpdateTwilioPhoneNumberDto.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Fields used to update a Twilio phone number, including its account credentials, SMS configuration, routing, hooks, and server settings. +/// [Serializable] public record UpdateTwilioPhoneNumberDto : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/UpdateUserRoleDto.cs b/src/Vapi.Net/Types/UpdateUserRoleDto.cs index 55e3c2fe..c3e2fb69 100644 --- a/src/Vapi.Net/Types/UpdateUserRoleDto.cs +++ b/src/Vapi.Net/Types/UpdateUserRoleDto.cs @@ -1,5 +1,6 @@ using global::System.Text.Json; using global::System.Text.Json.Serialization; +using OneOf; using Vapi.Net.Core; namespace Vapi.Net; @@ -15,7 +16,7 @@ public record UpdateUserRoleDto : IJsonOnDeserialized public required string UserId { get; set; } [JsonPropertyName("role")] - public required UpdateUserRoleDtoRole Role { get; set; } + public required OneOf Role { get; set; } [JsonIgnore] public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); diff --git a/src/Vapi.Net/Types/UpdateUserRoleDtoRole.cs b/src/Vapi.Net/Types/UpdateUserRoleDtoRoleZero.cs similarity index 73% rename from src/Vapi.Net/Types/UpdateUserRoleDtoRole.cs rename to src/Vapi.Net/Types/UpdateUserRoleDtoRoleZero.cs index bf6a8c1a..edcf5a09 100644 --- a/src/Vapi.Net/Types/UpdateUserRoleDtoRole.cs +++ b/src/Vapi.Net/Types/UpdateUserRoleDtoRoleZero.cs @@ -3,8 +3,8 @@ namespace Vapi.Net; -[JsonConverter(typeof(UpdateUserRoleDtoRoleSerializer))] -public enum UpdateUserRoleDtoRole +[JsonConverter(typeof(UpdateUserRoleDtoRoleZeroSerializer))] +public enum UpdateUserRoleDtoRoleZero { [EnumMember(Value = "admin")] Admin, @@ -16,30 +16,30 @@ public enum UpdateUserRoleDtoRole Viewer, } -internal class UpdateUserRoleDtoRoleSerializer - : global::System.Text.Json.Serialization.JsonConverter +internal class UpdateUserRoleDtoRoleZeroSerializer + : global::System.Text.Json.Serialization.JsonConverter { private static readonly global::System.Collections.Generic.Dictionary< string, - UpdateUserRoleDtoRole + UpdateUserRoleDtoRoleZero > _stringToEnum = new() { - { "admin", UpdateUserRoleDtoRole.Admin }, - { "editor", UpdateUserRoleDtoRole.Editor }, - { "viewer", UpdateUserRoleDtoRole.Viewer }, + { "admin", UpdateUserRoleDtoRoleZero.Admin }, + { "editor", UpdateUserRoleDtoRoleZero.Editor }, + { "viewer", UpdateUserRoleDtoRoleZero.Viewer }, }; private static readonly global::System.Collections.Generic.Dictionary< - UpdateUserRoleDtoRole, + UpdateUserRoleDtoRoleZero, string > _enumToString = new() { - { UpdateUserRoleDtoRole.Admin, "admin" }, - { UpdateUserRoleDtoRole.Editor, "editor" }, - { UpdateUserRoleDtoRole.Viewer, "viewer" }, + { UpdateUserRoleDtoRoleZero.Admin, "admin" }, + { UpdateUserRoleDtoRoleZero.Editor, "editor" }, + { UpdateUserRoleDtoRoleZero.Viewer, "viewer" }, }; - public override UpdateUserRoleDtoRole Read( + public override UpdateUserRoleDtoRoleZero Read( ref global::System.Text.Json.Utf8JsonReader reader, global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options @@ -53,7 +53,7 @@ public override UpdateUserRoleDtoRole Read( public override void Write( global::System.Text.Json.Utf8JsonWriter writer, - UpdateUserRoleDtoRole value, + UpdateUserRoleDtoRoleZero value, global::System.Text.Json.JsonSerializerOptions options ) { @@ -62,7 +62,7 @@ public override void Write( ); } - public override UpdateUserRoleDtoRole ReadAsPropertyName( + public override UpdateUserRoleDtoRoleZero ReadAsPropertyName( ref global::System.Text.Json.Utf8JsonReader reader, global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options @@ -78,7 +78,7 @@ public override UpdateUserRoleDtoRole ReadAsPropertyName( public override void WriteAsPropertyName( global::System.Text.Json.Utf8JsonWriter writer, - UpdateUserRoleDtoRole value, + UpdateUserRoleDtoRoleZero value, global::System.Text.Json.JsonSerializerOptions options ) { diff --git a/src/Vapi.Net/Types/UpdateVapiPhoneNumberDto.cs b/src/Vapi.Net/Types/UpdateVapiPhoneNumberDto.cs index 41748316..36d31294 100644 --- a/src/Vapi.Net/Types/UpdateVapiPhoneNumberDto.cs +++ b/src/Vapi.Net/Types/UpdateVapiPhoneNumberDto.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Fields used to update a Vapi-managed phone number or SIP URI, including its authentication, routing, hooks, and server settings. +/// [Serializable] public record UpdateVapiPhoneNumberDto : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/UpdateVoicemailToolDto.cs b/src/Vapi.Net/Types/UpdateVoicemailToolDto.cs index 7cb9cc6c..825cdb7f 100644 --- a/src/Vapi.Net/Types/UpdateVoicemailToolDto.cs +++ b/src/Vapi.Net/Types/UpdateVoicemailToolDto.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Fields used to update a voicemail-detection tool, including beep detection, spoken messages, and rejection plan. +/// [Serializable] public record UpdateVoicemailToolDto : IJsonOnDeserialized { @@ -12,9 +15,7 @@ public record UpdateVoicemailToolDto : IJsonOnDeserialized new Dictionary(); /// - /// 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. + /// Messages spoken while the tool is running. Multiple request-start messages are variants. For request-response-delayed, same timing means variants and different timings mean staged updates. /// [JsonPropertyName("messages")] public IEnumerable? Messages { get; set; } diff --git a/src/Vapi.Net/Types/UpdateVonageCredentialDto.cs b/src/Vapi.Net/Types/UpdateVonageCredentialDto.cs index 81d4a1fa..adee237c 100644 --- a/src/Vapi.Net/Types/UpdateVonageCredentialDto.cs +++ b/src/Vapi.Net/Types/UpdateVonageCredentialDto.cs @@ -11,6 +11,9 @@ public record UpdateVonageCredentialDto : IJsonOnDeserialized private readonly IDictionary _extensionData = new Dictionary(); + [JsonPropertyName("provider")] + public UpdateVonageCredentialDtoProvider? Provider { get; set; } + /// /// This is not returned in the API. /// diff --git a/src/Vapi.Net/Types/UpdateVonageCredentialDtoProvider.cs b/src/Vapi.Net/Types/UpdateVonageCredentialDtoProvider.cs new file mode 100644 index 00000000..219403d3 --- /dev/null +++ b/src/Vapi.Net/Types/UpdateVonageCredentialDtoProvider.cs @@ -0,0 +1,73 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(UpdateVonageCredentialDtoProviderSerializer))] +public enum UpdateVonageCredentialDtoProvider +{ + [EnumMember(Value = "vonage")] + Vonage, +} + +internal class UpdateVonageCredentialDtoProviderSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + UpdateVonageCredentialDtoProvider + > _stringToEnum = new() { { "vonage", UpdateVonageCredentialDtoProvider.Vonage } }; + + private static readonly global::System.Collections.Generic.Dictionary< + UpdateVonageCredentialDtoProvider, + string + > _enumToString = new() { { UpdateVonageCredentialDtoProvider.Vonage, "vonage" } }; + + public override UpdateVonageCredentialDtoProvider Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + UpdateVonageCredentialDtoProvider value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override UpdateVonageCredentialDtoProvider ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + UpdateVonageCredentialDtoProvider value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/UpdateVonagePhoneNumberDto.cs b/src/Vapi.Net/Types/UpdateVonagePhoneNumberDto.cs index ed96555f..57486a1f 100644 --- a/src/Vapi.Net/Types/UpdateVonagePhoneNumberDto.cs +++ b/src/Vapi.Net/Types/UpdateVonagePhoneNumberDto.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Fields used to update a Vonage phone number, including its credential, number, routing, hooks, and server settings. +/// [Serializable] public record UpdateVonagePhoneNumberDto : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/UpdateWebhookCredentialDto.cs b/src/Vapi.Net/Types/UpdateWebhookCredentialDto.cs index 99c0c8c3..e91fbbcf 100644 --- a/src/Vapi.Net/Types/UpdateWebhookCredentialDto.cs +++ b/src/Vapi.Net/Types/UpdateWebhookCredentialDto.cs @@ -11,6 +11,9 @@ public record UpdateWebhookCredentialDto : IJsonOnDeserialized private readonly IDictionary _extensionData = new Dictionary(); + [JsonPropertyName("provider")] + public UpdateWebhookCredentialDtoProvider? Provider { get; set; } + /// /// This is the authentication plan. Supports OAuth2 RFC 6749, HMAC signing, and Bearer authentication. /// diff --git a/src/Vapi.Net/Types/UpdateWebhookCredentialDtoProvider.cs b/src/Vapi.Net/Types/UpdateWebhookCredentialDtoProvider.cs new file mode 100644 index 00000000..397eb440 --- /dev/null +++ b/src/Vapi.Net/Types/UpdateWebhookCredentialDtoProvider.cs @@ -0,0 +1,73 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(UpdateWebhookCredentialDtoProviderSerializer))] +public enum UpdateWebhookCredentialDtoProvider +{ + [EnumMember(Value = "webhook")] + Webhook, +} + +internal class UpdateWebhookCredentialDtoProviderSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + UpdateWebhookCredentialDtoProvider + > _stringToEnum = new() { { "webhook", UpdateWebhookCredentialDtoProvider.Webhook } }; + + private static readonly global::System.Collections.Generic.Dictionary< + UpdateWebhookCredentialDtoProvider, + string + > _enumToString = new() { { UpdateWebhookCredentialDtoProvider.Webhook, "webhook" } }; + + public override UpdateWebhookCredentialDtoProvider Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + UpdateWebhookCredentialDtoProvider value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override UpdateWebhookCredentialDtoProvider ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + UpdateWebhookCredentialDtoProvider value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/UpdateWellSaidCredentialDto.cs b/src/Vapi.Net/Types/UpdateWellSaidCredentialDto.cs index 629fbbeb..336eb5da 100644 --- a/src/Vapi.Net/Types/UpdateWellSaidCredentialDto.cs +++ b/src/Vapi.Net/Types/UpdateWellSaidCredentialDto.cs @@ -11,6 +11,9 @@ public record UpdateWellSaidCredentialDto : IJsonOnDeserialized private readonly IDictionary _extensionData = new Dictionary(); + [JsonPropertyName("provider")] + public UpdateWellSaidCredentialDtoProvider? Provider { get; set; } + /// /// This is not returned in the API. /// diff --git a/src/Vapi.Net/Types/UpdateWellSaidCredentialDtoProvider.cs b/src/Vapi.Net/Types/UpdateWellSaidCredentialDtoProvider.cs new file mode 100644 index 00000000..604199ae --- /dev/null +++ b/src/Vapi.Net/Types/UpdateWellSaidCredentialDtoProvider.cs @@ -0,0 +1,73 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(UpdateWellSaidCredentialDtoProviderSerializer))] +public enum UpdateWellSaidCredentialDtoProvider +{ + [EnumMember(Value = "wellsaid")] + Wellsaid, +} + +internal class UpdateWellSaidCredentialDtoProviderSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + UpdateWellSaidCredentialDtoProvider + > _stringToEnum = new() { { "wellsaid", UpdateWellSaidCredentialDtoProvider.Wellsaid } }; + + private static readonly global::System.Collections.Generic.Dictionary< + UpdateWellSaidCredentialDtoProvider, + string + > _enumToString = new() { { UpdateWellSaidCredentialDtoProvider.Wellsaid, "wellsaid" } }; + + public override UpdateWellSaidCredentialDtoProvider Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + UpdateWellSaidCredentialDtoProvider value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override UpdateWellSaidCredentialDtoProvider ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + UpdateWellSaidCredentialDtoProvider value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/UpdateXAiCredentialDto.cs b/src/Vapi.Net/Types/UpdateXAiCredentialDto.cs index a79d416b..b54d8557 100644 --- a/src/Vapi.Net/Types/UpdateXAiCredentialDto.cs +++ b/src/Vapi.Net/Types/UpdateXAiCredentialDto.cs @@ -11,6 +11,12 @@ public record UpdateXAiCredentialDto : IJsonOnDeserialized private readonly IDictionary _extensionData = new Dictionary(); + /// + /// This is the api key for Grok in XAi's console. Get it from here: https://console.x.ai + /// + [JsonPropertyName("provider")] + public UpdateXAiCredentialDtoProvider? Provider { get; set; } + /// /// This is not returned in the API. /// diff --git a/src/Vapi.Net/Types/UpdateXAiCredentialDtoProvider.cs b/src/Vapi.Net/Types/UpdateXAiCredentialDtoProvider.cs new file mode 100644 index 00000000..a2a0b389 --- /dev/null +++ b/src/Vapi.Net/Types/UpdateXAiCredentialDtoProvider.cs @@ -0,0 +1,73 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(UpdateXAiCredentialDtoProviderSerializer))] +public enum UpdateXAiCredentialDtoProvider +{ + [EnumMember(Value = "xai")] + Xai, +} + +internal class UpdateXAiCredentialDtoProviderSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + UpdateXAiCredentialDtoProvider + > _stringToEnum = new() { { "xai", UpdateXAiCredentialDtoProvider.Xai } }; + + private static readonly global::System.Collections.Generic.Dictionary< + UpdateXAiCredentialDtoProvider, + string + > _enumToString = new() { { UpdateXAiCredentialDtoProvider.Xai, "xai" } }; + + public override UpdateXAiCredentialDtoProvider Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + UpdateXAiCredentialDtoProvider value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override UpdateXAiCredentialDtoProvider ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + UpdateXAiCredentialDtoProvider value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/UserMessage.cs b/src/Vapi.Net/Types/UserMessage.cs index 30944e90..2158e0e4 100644 --- a/src/Vapi.Net/Types/UserMessage.cs +++ b/src/Vapi.Net/Types/UserMessage.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// A user-authored entry in the call message history, including content, timing, security-filter results, and optional speaker metadata. +/// [Serializable] public record UserMessage : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/VapiCost.cs b/src/Vapi.Net/Types/VapiCost.cs index 0e3810d2..6b926f1a 100644 --- a/src/Vapi.Net/Types/VapiCost.cs +++ b/src/Vapi.Net/Types/VapiCost.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Vapi platform cost for a call, including cost subtype, billable minutes, and amount. +/// [Serializable] public record VapiCost : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/VapiModel.cs b/src/Vapi.Net/Types/VapiModel.cs index 7936a08a..f4bc28f6 100644 --- a/src/Vapi.Net/Types/VapiModel.cs +++ b/src/Vapi.Net/Types/VapiModel.cs @@ -33,14 +33,40 @@ public record VapiModel : IJsonOnDeserialized [JsonPropertyName("toolIds")] public IEnumerable? ToolIds { get; set; } + /// + /// These are version-pinned references to tools. Each entry pins a specific + /// version of a tool by `(toolId, version)`. When the same `toolId` appears + /// in both `toolIds` and `toolRefs[]`, the `toolRefs` pin wins (the + /// `toolIds` entry is dropped at write time). + /// + [JsonPropertyName("toolRefs")] + public IEnumerable? ToolRefs { get; set; } + /// /// These are the options for the knowledge base. /// [JsonPropertyName("knowledgeBase")] public CreateCustomKnowledgeBaseDto? KnowledgeBase { get; set; } - [JsonPropertyName("provider")] - public required VapiModelProvider Provider { get; set; } + /// + /// White-label Vapi models are selected by `version`, not a model name, so + /// `model` is optional here (the runtime already accepts a version-only Vapi + /// payload). Overriding the required `ModelBase.model`: the declared type stays + /// `string` to match the base (avoids TS2416) and the `= undefined!` initializer + /// satisfies TS2612 for the field override, while `@IsOptional` + + /// `@ApiPropertyOptional` make validation and the generated OpenAPI schema treat + /// it as optional (so `VapiModel.required` is `['provider']`). + /// + [JsonPropertyName("model")] + public string? Model { get; set; } + + /// + /// Vapi-managed model version (update channel). When set, this is a Vapi-managed + /// LLM routed by the registry; when absent, this is the legacy workflow form + /// below (`steps` / `workflow`). + /// + [JsonPropertyName("version")] + public VapiModelVersion? Version { get; set; } /// /// This is the workflow that will be used for the call. To use a transient workflow, use `workflow` instead. @@ -55,23 +81,11 @@ public record VapiModel : IJsonOnDeserialized public WorkflowUserEditable? Workflow { get; set; } /// - /// This is the name of the model. Ex. cognitivecomputations/dolphin-mixtral-8x7b - /// - [JsonPropertyName("model")] - public required string Model { get; set; } - - /// - /// This is the temperature that will be used for calls. Default is 0 to leverage caching for lower latency. + /// This is the temperature that will be used for calls. Default is 0.5. /// [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. /// diff --git a/src/Vapi.Net/Types/TrieveKnowledgeBaseImportType.cs b/src/Vapi.Net/Types/VapiModelVersion.cs similarity index 70% rename from src/Vapi.Net/Types/TrieveKnowledgeBaseImportType.cs rename to src/Vapi.Net/Types/VapiModelVersion.cs index 8bb2a79f..83b946d4 100644 --- a/src/Vapi.Net/Types/TrieveKnowledgeBaseImportType.cs +++ b/src/Vapi.Net/Types/VapiModelVersion.cs @@ -3,27 +3,38 @@ namespace Vapi.Net; -[JsonConverter(typeof(TrieveKnowledgeBaseImportTypeSerializer))] -public enum TrieveKnowledgeBaseImportType +[JsonConverter(typeof(VapiModelVersionSerializer))] +public enum VapiModelVersion { - [EnumMember(Value = "import")] - Import, + [EnumMember(Value = "latest")] + Latest, + + [EnumMember(Value = "1")] + One, } -internal class TrieveKnowledgeBaseImportTypeSerializer - : global::System.Text.Json.Serialization.JsonConverter +internal class VapiModelVersionSerializer + : global::System.Text.Json.Serialization.JsonConverter { private static readonly global::System.Collections.Generic.Dictionary< string, - TrieveKnowledgeBaseImportType - > _stringToEnum = new() { { "import", TrieveKnowledgeBaseImportType.Import } }; + VapiModelVersion + > _stringToEnum = new() + { + { "latest", VapiModelVersion.Latest }, + { "1", VapiModelVersion.One }, + }; private static readonly global::System.Collections.Generic.Dictionary< - TrieveKnowledgeBaseImportType, + VapiModelVersion, string - > _enumToString = new() { { TrieveKnowledgeBaseImportType.Import, "import" } }; + > _enumToString = new() + { + { VapiModelVersion.Latest, "latest" }, + { VapiModelVersion.One, "1" }, + }; - public override TrieveKnowledgeBaseImportType Read( + public override VapiModelVersion Read( ref global::System.Text.Json.Utf8JsonReader reader, global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options @@ -37,7 +48,7 @@ public override TrieveKnowledgeBaseImportType Read( public override void Write( global::System.Text.Json.Utf8JsonWriter writer, - TrieveKnowledgeBaseImportType value, + VapiModelVersion value, global::System.Text.Json.JsonSerializerOptions options ) { @@ -46,7 +57,7 @@ public override void Write( ); } - public override TrieveKnowledgeBaseImportType ReadAsPropertyName( + public override VapiModelVersion ReadAsPropertyName( ref global::System.Text.Json.Utf8JsonReader reader, global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options @@ -62,7 +73,7 @@ public override TrieveKnowledgeBaseImportType ReadAsPropertyName( public override void WriteAsPropertyName( global::System.Text.Json.Utf8JsonWriter writer, - TrieveKnowledgeBaseImportType value, + VapiModelVersion value, global::System.Text.Json.JsonSerializerOptions options ) { diff --git a/src/Vapi.Net/Types/VapiPhoneNumber.cs b/src/Vapi.Net/Types/VapiPhoneNumber.cs index 7d56e777..f49c37ff 100644 --- a/src/Vapi.Net/Types/VapiPhoneNumber.cs +++ b/src/Vapi.Net/Types/VapiPhoneNumber.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// A Vapi-managed phone number or SIP URI, including its authentication, routing, hooks, server settings, and lifecycle metadata. +/// [Serializable] public record VapiPhoneNumber : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/VapiPronunciationDictionaryLocator.cs b/src/Vapi.Net/Types/VapiPronunciationDictionaryLocator.cs index e93c9336..98dfda17 100644 --- a/src/Vapi.Net/Types/VapiPronunciationDictionaryLocator.cs +++ b/src/Vapi.Net/Types/VapiPronunciationDictionaryLocator.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Identifies a pronunciation dictionary and optional version used for voice synthesis. +/// [Serializable] public record VapiPronunciationDictionaryLocator : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/VapiSipTransport.cs b/src/Vapi.Net/Types/VapiSipTransport.cs new file mode 100644 index 00000000..44aa596f --- /dev/null +++ b/src/Vapi.Net/Types/VapiSipTransport.cs @@ -0,0 +1,51 @@ +using global::System.Text.Json; +using global::System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[Serializable] +public record VapiSipTransport : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + /// + /// This is the conversation type of the call (ie, voice or chat). + /// + [JsonPropertyName("conversationType")] + public VapiSipTransportConversationType? ConversationType { get; set; } + + /// + /// This sets the timeout for outbound dial operations in seconds. This is the duration the call will ring before timing out. + /// + /// @default 60 + /// + [JsonPropertyName("dialTimeout")] + public double? DialTimeout { get; set; } + + /// + /// This is the call SID of the Vapi SIP call. + /// + [JsonPropertyName("sbcCallSid")] + public string? SbcCallSid { get; set; } + + /// + /// This is the call ID of the Vapi SIP call. + /// + [JsonPropertyName("callSid")] + public string? CallSid { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/VapiSipTransportConversationType.cs b/src/Vapi.Net/Types/VapiSipTransportConversationType.cs new file mode 100644 index 00000000..2198a3e4 --- /dev/null +++ b/src/Vapi.Net/Types/VapiSipTransportConversationType.cs @@ -0,0 +1,73 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(VapiSipTransportConversationTypeSerializer))] +public enum VapiSipTransportConversationType +{ + [EnumMember(Value = "voice")] + Voice, +} + +internal class VapiSipTransportConversationTypeSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + VapiSipTransportConversationType + > _stringToEnum = new() { { "voice", VapiSipTransportConversationType.Voice } }; + + private static readonly global::System.Collections.Generic.Dictionary< + VapiSipTransportConversationType, + string + > _enumToString = new() { { VapiSipTransportConversationType.Voice, "voice" } }; + + public override VapiSipTransportConversationType Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + VapiSipTransportConversationType value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override VapiSipTransportConversationType ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + VapiSipTransportConversationType value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/VapiSmartEndpointingPlan.cs b/src/Vapi.Net/Types/VapiSmartEndpointingPlan.cs index e05beedf..d6a1cffd 100644 --- a/src/Vapi.Net/Types/VapiSmartEndpointingPlan.cs +++ b/src/Vapi.Net/Types/VapiSmartEndpointingPlan.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Selects Vapi smart endpointing to determine when customer speech is complete. +/// [Serializable] public record VapiSmartEndpointingPlan : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/VapiTranscriber.cs b/src/Vapi.Net/Types/VapiTranscriber.cs new file mode 100644 index 00000000..49a06aff --- /dev/null +++ b/src/Vapi.Net/Types/VapiTranscriber.cs @@ -0,0 +1,68 @@ +using global::System.Text.Json; +using global::System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[Serializable] +public record VapiTranscriber : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + /// + /// This is the version of the Vapi transcriber. Vapi manages the underlying + /// model and routing. When omitted, the latest version is used. + /// + /// Managed version params are additive-only and `'latest'` is an auto-update + /// channel — see the param-evolution INVARIANT in `vapiManaged/types.ts`. + /// + [JsonPropertyName("version")] + public VapiTranscriberVersion? Version { get; set; } + + /// + /// This is the language for transcription as an ISO 639-1 code (e.g. `en`). + /// Selecting a language locks transcription to it. For multiple languages, + /// use `languages` instead. When neither `language` nor `languages` is set, + /// the transcriber auto-detects the spoken language. + /// + [JsonPropertyName("language")] + public VapiTranscriberLanguage? Language { get; set; } + + /// + /// These are the languages for transcription as ISO 639-1 codes. Set one or + /// more codes to restrict and bias recognition to those languages. An empty + /// array `[]` (or omitting both this and `language`) enables auto-detection + /// of the spoken language. + /// + [JsonPropertyName("languages")] + public IEnumerable? Languages { get; set; } + + /// + /// These are custom keywords/vocabulary to boost recognition of use-case + /// specific words (company names, product names, jargon). + /// + [JsonPropertyName("keywords")] + public IEnumerable? Keywords { get; set; } + + /// + /// This is the turn-taking mode. `intelligent` uses the underlying model's + /// native end-of-turn detection; `manual` ignores it and waits a fixed + /// end-of-turn delay. Defaults to `intelligent`. + /// + [JsonPropertyName("turnTaking")] + public VapiTranscriberTurnTaking? TurnTaking { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/VapiTranscriberLanguage.cs b/src/Vapi.Net/Types/VapiTranscriberLanguage.cs new file mode 100644 index 00000000..6d880e70 --- /dev/null +++ b/src/Vapi.Net/Types/VapiTranscriberLanguage.cs @@ -0,0 +1,999 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(VapiTranscriberLanguageSerializer))] +public enum VapiTranscriberLanguage +{ + [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, +} + +internal class VapiTranscriberLanguageSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + VapiTranscriberLanguage + > _stringToEnum = new() + { + { "aa", VapiTranscriberLanguage.Aa }, + { "ab", VapiTranscriberLanguage.Ab }, + { "ae", VapiTranscriberLanguage.Ae }, + { "af", VapiTranscriberLanguage.Af }, + { "ak", VapiTranscriberLanguage.Ak }, + { "am", VapiTranscriberLanguage.Am }, + { "an", VapiTranscriberLanguage.An }, + { "ar", VapiTranscriberLanguage.Ar }, + { "as", VapiTranscriberLanguage.As }, + { "av", VapiTranscriberLanguage.Av }, + { "ay", VapiTranscriberLanguage.Ay }, + { "az", VapiTranscriberLanguage.Az }, + { "ba", VapiTranscriberLanguage.Ba }, + { "be", VapiTranscriberLanguage.Be }, + { "bg", VapiTranscriberLanguage.Bg }, + { "bh", VapiTranscriberLanguage.Bh }, + { "bi", VapiTranscriberLanguage.Bi }, + { "bm", VapiTranscriberLanguage.Bm }, + { "bn", VapiTranscriberLanguage.Bn }, + { "bo", VapiTranscriberLanguage.Bo }, + { "br", VapiTranscriberLanguage.Br }, + { "bs", VapiTranscriberLanguage.Bs }, + { "ca", VapiTranscriberLanguage.Ca }, + { "ce", VapiTranscriberLanguage.Ce }, + { "ch", VapiTranscriberLanguage.Ch }, + { "co", VapiTranscriberLanguage.Co }, + { "cr", VapiTranscriberLanguage.Cr }, + { "cs", VapiTranscriberLanguage.Cs }, + { "cu", VapiTranscriberLanguage.Cu }, + { "cv", VapiTranscriberLanguage.Cv }, + { "cy", VapiTranscriberLanguage.Cy }, + { "da", VapiTranscriberLanguage.Da }, + { "de", VapiTranscriberLanguage.De }, + { "dv", VapiTranscriberLanguage.Dv }, + { "dz", VapiTranscriberLanguage.Dz }, + { "ee", VapiTranscriberLanguage.Ee }, + { "el", VapiTranscriberLanguage.El }, + { "en", VapiTranscriberLanguage.En }, + { "eo", VapiTranscriberLanguage.Eo }, + { "es", VapiTranscriberLanguage.Es }, + { "et", VapiTranscriberLanguage.Et }, + { "eu", VapiTranscriberLanguage.Eu }, + { "fa", VapiTranscriberLanguage.Fa }, + { "ff", VapiTranscriberLanguage.Ff }, + { "fi", VapiTranscriberLanguage.Fi }, + { "fj", VapiTranscriberLanguage.Fj }, + { "fo", VapiTranscriberLanguage.Fo }, + { "fr", VapiTranscriberLanguage.Fr }, + { "fy", VapiTranscriberLanguage.Fy }, + { "ga", VapiTranscriberLanguage.Ga }, + { "gd", VapiTranscriberLanguage.Gd }, + { "gl", VapiTranscriberLanguage.Gl }, + { "gn", VapiTranscriberLanguage.Gn }, + { "gu", VapiTranscriberLanguage.Gu }, + { "gv", VapiTranscriberLanguage.Gv }, + { "ha", VapiTranscriberLanguage.Ha }, + { "he", VapiTranscriberLanguage.He }, + { "hi", VapiTranscriberLanguage.Hi }, + { "ho", VapiTranscriberLanguage.Ho }, + { "hr", VapiTranscriberLanguage.Hr }, + { "ht", VapiTranscriberLanguage.Ht }, + { "hu", VapiTranscriberLanguage.Hu }, + { "hy", VapiTranscriberLanguage.Hy }, + { "hz", VapiTranscriberLanguage.Hz }, + { "ia", VapiTranscriberLanguage.Ia }, + { "id", VapiTranscriberLanguage.Id }, + { "ie", VapiTranscriberLanguage.Ie }, + { "ig", VapiTranscriberLanguage.Ig }, + { "ii", VapiTranscriberLanguage.Ii }, + { "ik", VapiTranscriberLanguage.Ik }, + { "io", VapiTranscriberLanguage.Io }, + { "is", VapiTranscriberLanguage.Is }, + { "it", VapiTranscriberLanguage.It }, + { "iu", VapiTranscriberLanguage.Iu }, + { "ja", VapiTranscriberLanguage.Ja }, + { "jv", VapiTranscriberLanguage.Jv }, + { "ka", VapiTranscriberLanguage.Ka }, + { "kg", VapiTranscriberLanguage.Kg }, + { "ki", VapiTranscriberLanguage.Ki }, + { "kj", VapiTranscriberLanguage.Kj }, + { "kk", VapiTranscriberLanguage.Kk }, + { "kl", VapiTranscriberLanguage.Kl }, + { "km", VapiTranscriberLanguage.Km }, + { "kn", VapiTranscriberLanguage.Kn }, + { "ko", VapiTranscriberLanguage.Ko }, + { "kr", VapiTranscriberLanguage.Kr }, + { "ks", VapiTranscriberLanguage.Ks }, + { "ku", VapiTranscriberLanguage.Ku }, + { "kv", VapiTranscriberLanguage.Kv }, + { "kw", VapiTranscriberLanguage.Kw }, + { "ky", VapiTranscriberLanguage.Ky }, + { "la", VapiTranscriberLanguage.La }, + { "lb", VapiTranscriberLanguage.Lb }, + { "lg", VapiTranscriberLanguage.Lg }, + { "li", VapiTranscriberLanguage.Li }, + { "ln", VapiTranscriberLanguage.Ln }, + { "lo", VapiTranscriberLanguage.Lo }, + { "lt", VapiTranscriberLanguage.Lt }, + { "lu", VapiTranscriberLanguage.Lu }, + { "lv", VapiTranscriberLanguage.Lv }, + { "mg", VapiTranscriberLanguage.Mg }, + { "mh", VapiTranscriberLanguage.Mh }, + { "mi", VapiTranscriberLanguage.Mi }, + { "mk", VapiTranscriberLanguage.Mk }, + { "ml", VapiTranscriberLanguage.Ml }, + { "mn", VapiTranscriberLanguage.Mn }, + { "mr", VapiTranscriberLanguage.Mr }, + { "ms", VapiTranscriberLanguage.Ms }, + { "mt", VapiTranscriberLanguage.Mt }, + { "my", VapiTranscriberLanguage.My }, + { "na", VapiTranscriberLanguage.Na }, + { "nb", VapiTranscriberLanguage.Nb }, + { "nd", VapiTranscriberLanguage.Nd }, + { "ne", VapiTranscriberLanguage.Ne }, + { "ng", VapiTranscriberLanguage.Ng }, + { "nl", VapiTranscriberLanguage.Nl }, + { "nn", VapiTranscriberLanguage.Nn }, + { "no", VapiTranscriberLanguage.No }, + { "nr", VapiTranscriberLanguage.Nr }, + { "nv", VapiTranscriberLanguage.Nv }, + { "ny", VapiTranscriberLanguage.Ny }, + { "oc", VapiTranscriberLanguage.Oc }, + { "oj", VapiTranscriberLanguage.Oj }, + { "om", VapiTranscriberLanguage.Om }, + { "or", VapiTranscriberLanguage.Or }, + { "os", VapiTranscriberLanguage.Os }, + { "pa", VapiTranscriberLanguage.Pa }, + { "pi", VapiTranscriberLanguage.Pi }, + { "pl", VapiTranscriberLanguage.Pl }, + { "ps", VapiTranscriberLanguage.Ps }, + { "pt", VapiTranscriberLanguage.Pt }, + { "qu", VapiTranscriberLanguage.Qu }, + { "rm", VapiTranscriberLanguage.Rm }, + { "rn", VapiTranscriberLanguage.Rn }, + { "ro", VapiTranscriberLanguage.Ro }, + { "ru", VapiTranscriberLanguage.Ru }, + { "rw", VapiTranscriberLanguage.Rw }, + { "sa", VapiTranscriberLanguage.Sa }, + { "sc", VapiTranscriberLanguage.Sc }, + { "sd", VapiTranscriberLanguage.Sd }, + { "se", VapiTranscriberLanguage.Se }, + { "sg", VapiTranscriberLanguage.Sg }, + { "si", VapiTranscriberLanguage.Si }, + { "sk", VapiTranscriberLanguage.Sk }, + { "sl", VapiTranscriberLanguage.Sl }, + { "sm", VapiTranscriberLanguage.Sm }, + { "sn", VapiTranscriberLanguage.Sn }, + { "so", VapiTranscriberLanguage.So }, + { "sq", VapiTranscriberLanguage.Sq }, + { "sr", VapiTranscriberLanguage.Sr }, + { "ss", VapiTranscriberLanguage.Ss }, + { "st", VapiTranscriberLanguage.St }, + { "su", VapiTranscriberLanguage.Su }, + { "sv", VapiTranscriberLanguage.Sv }, + { "sw", VapiTranscriberLanguage.Sw }, + { "ta", VapiTranscriberLanguage.Ta }, + { "te", VapiTranscriberLanguage.Te }, + { "tg", VapiTranscriberLanguage.Tg }, + { "th", VapiTranscriberLanguage.Th }, + { "ti", VapiTranscriberLanguage.Ti }, + { "tk", VapiTranscriberLanguage.Tk }, + { "tl", VapiTranscriberLanguage.Tl }, + { "tn", VapiTranscriberLanguage.Tn }, + { "to", VapiTranscriberLanguage.To }, + { "tr", VapiTranscriberLanguage.Tr }, + { "ts", VapiTranscriberLanguage.Ts }, + { "tt", VapiTranscriberLanguage.Tt }, + { "tw", VapiTranscriberLanguage.Tw }, + { "ty", VapiTranscriberLanguage.Ty }, + { "ug", VapiTranscriberLanguage.Ug }, + { "uk", VapiTranscriberLanguage.Uk }, + { "ur", VapiTranscriberLanguage.Ur }, + { "uz", VapiTranscriberLanguage.Uz }, + { "ve", VapiTranscriberLanguage.Ve }, + { "vi", VapiTranscriberLanguage.Vi }, + { "vo", VapiTranscriberLanguage.Vo }, + { "wa", VapiTranscriberLanguage.Wa }, + { "wo", VapiTranscriberLanguage.Wo }, + { "xh", VapiTranscriberLanguage.Xh }, + { "yi", VapiTranscriberLanguage.Yi }, + { "yue", VapiTranscriberLanguage.Yue }, + { "yo", VapiTranscriberLanguage.Yo }, + { "za", VapiTranscriberLanguage.Za }, + { "zh", VapiTranscriberLanguage.Zh }, + { "zu", VapiTranscriberLanguage.Zu }, + }; + + private static readonly global::System.Collections.Generic.Dictionary< + VapiTranscriberLanguage, + string + > _enumToString = new() + { + { VapiTranscriberLanguage.Aa, "aa" }, + { VapiTranscriberLanguage.Ab, "ab" }, + { VapiTranscriberLanguage.Ae, "ae" }, + { VapiTranscriberLanguage.Af, "af" }, + { VapiTranscriberLanguage.Ak, "ak" }, + { VapiTranscriberLanguage.Am, "am" }, + { VapiTranscriberLanguage.An, "an" }, + { VapiTranscriberLanguage.Ar, "ar" }, + { VapiTranscriberLanguage.As, "as" }, + { VapiTranscriberLanguage.Av, "av" }, + { VapiTranscriberLanguage.Ay, "ay" }, + { VapiTranscriberLanguage.Az, "az" }, + { VapiTranscriberLanguage.Ba, "ba" }, + { VapiTranscriberLanguage.Be, "be" }, + { VapiTranscriberLanguage.Bg, "bg" }, + { VapiTranscriberLanguage.Bh, "bh" }, + { VapiTranscriberLanguage.Bi, "bi" }, + { VapiTranscriberLanguage.Bm, "bm" }, + { VapiTranscriberLanguage.Bn, "bn" }, + { VapiTranscriberLanguage.Bo, "bo" }, + { VapiTranscriberLanguage.Br, "br" }, + { VapiTranscriberLanguage.Bs, "bs" }, + { VapiTranscriberLanguage.Ca, "ca" }, + { VapiTranscriberLanguage.Ce, "ce" }, + { VapiTranscriberLanguage.Ch, "ch" }, + { VapiTranscriberLanguage.Co, "co" }, + { VapiTranscriberLanguage.Cr, "cr" }, + { VapiTranscriberLanguage.Cs, "cs" }, + { VapiTranscriberLanguage.Cu, "cu" }, + { VapiTranscriberLanguage.Cv, "cv" }, + { VapiTranscriberLanguage.Cy, "cy" }, + { VapiTranscriberLanguage.Da, "da" }, + { VapiTranscriberLanguage.De, "de" }, + { VapiTranscriberLanguage.Dv, "dv" }, + { VapiTranscriberLanguage.Dz, "dz" }, + { VapiTranscriberLanguage.Ee, "ee" }, + { VapiTranscriberLanguage.El, "el" }, + { VapiTranscriberLanguage.En, "en" }, + { VapiTranscriberLanguage.Eo, "eo" }, + { VapiTranscriberLanguage.Es, "es" }, + { VapiTranscriberLanguage.Et, "et" }, + { VapiTranscriberLanguage.Eu, "eu" }, + { VapiTranscriberLanguage.Fa, "fa" }, + { VapiTranscriberLanguage.Ff, "ff" }, + { VapiTranscriberLanguage.Fi, "fi" }, + { VapiTranscriberLanguage.Fj, "fj" }, + { VapiTranscriberLanguage.Fo, "fo" }, + { VapiTranscriberLanguage.Fr, "fr" }, + { VapiTranscriberLanguage.Fy, "fy" }, + { VapiTranscriberLanguage.Ga, "ga" }, + { VapiTranscriberLanguage.Gd, "gd" }, + { VapiTranscriberLanguage.Gl, "gl" }, + { VapiTranscriberLanguage.Gn, "gn" }, + { VapiTranscriberLanguage.Gu, "gu" }, + { VapiTranscriberLanguage.Gv, "gv" }, + { VapiTranscriberLanguage.Ha, "ha" }, + { VapiTranscriberLanguage.He, "he" }, + { VapiTranscriberLanguage.Hi, "hi" }, + { VapiTranscriberLanguage.Ho, "ho" }, + { VapiTranscriberLanguage.Hr, "hr" }, + { VapiTranscriberLanguage.Ht, "ht" }, + { VapiTranscriberLanguage.Hu, "hu" }, + { VapiTranscriberLanguage.Hy, "hy" }, + { VapiTranscriberLanguage.Hz, "hz" }, + { VapiTranscriberLanguage.Ia, "ia" }, + { VapiTranscriberLanguage.Id, "id" }, + { VapiTranscriberLanguage.Ie, "ie" }, + { VapiTranscriberLanguage.Ig, "ig" }, + { VapiTranscriberLanguage.Ii, "ii" }, + { VapiTranscriberLanguage.Ik, "ik" }, + { VapiTranscriberLanguage.Io, "io" }, + { VapiTranscriberLanguage.Is, "is" }, + { VapiTranscriberLanguage.It, "it" }, + { VapiTranscriberLanguage.Iu, "iu" }, + { VapiTranscriberLanguage.Ja, "ja" }, + { VapiTranscriberLanguage.Jv, "jv" }, + { VapiTranscriberLanguage.Ka, "ka" }, + { VapiTranscriberLanguage.Kg, "kg" }, + { VapiTranscriberLanguage.Ki, "ki" }, + { VapiTranscriberLanguage.Kj, "kj" }, + { VapiTranscriberLanguage.Kk, "kk" }, + { VapiTranscriberLanguage.Kl, "kl" }, + { VapiTranscriberLanguage.Km, "km" }, + { VapiTranscriberLanguage.Kn, "kn" }, + { VapiTranscriberLanguage.Ko, "ko" }, + { VapiTranscriberLanguage.Kr, "kr" }, + { VapiTranscriberLanguage.Ks, "ks" }, + { VapiTranscriberLanguage.Ku, "ku" }, + { VapiTranscriberLanguage.Kv, "kv" }, + { VapiTranscriberLanguage.Kw, "kw" }, + { VapiTranscriberLanguage.Ky, "ky" }, + { VapiTranscriberLanguage.La, "la" }, + { VapiTranscriberLanguage.Lb, "lb" }, + { VapiTranscriberLanguage.Lg, "lg" }, + { VapiTranscriberLanguage.Li, "li" }, + { VapiTranscriberLanguage.Ln, "ln" }, + { VapiTranscriberLanguage.Lo, "lo" }, + { VapiTranscriberLanguage.Lt, "lt" }, + { VapiTranscriberLanguage.Lu, "lu" }, + { VapiTranscriberLanguage.Lv, "lv" }, + { VapiTranscriberLanguage.Mg, "mg" }, + { VapiTranscriberLanguage.Mh, "mh" }, + { VapiTranscriberLanguage.Mi, "mi" }, + { VapiTranscriberLanguage.Mk, "mk" }, + { VapiTranscriberLanguage.Ml, "ml" }, + { VapiTranscriberLanguage.Mn, "mn" }, + { VapiTranscriberLanguage.Mr, "mr" }, + { VapiTranscriberLanguage.Ms, "ms" }, + { VapiTranscriberLanguage.Mt, "mt" }, + { VapiTranscriberLanguage.My, "my" }, + { VapiTranscriberLanguage.Na, "na" }, + { VapiTranscriberLanguage.Nb, "nb" }, + { VapiTranscriberLanguage.Nd, "nd" }, + { VapiTranscriberLanguage.Ne, "ne" }, + { VapiTranscriberLanguage.Ng, "ng" }, + { VapiTranscriberLanguage.Nl, "nl" }, + { VapiTranscriberLanguage.Nn, "nn" }, + { VapiTranscriberLanguage.No, "no" }, + { VapiTranscriberLanguage.Nr, "nr" }, + { VapiTranscriberLanguage.Nv, "nv" }, + { VapiTranscriberLanguage.Ny, "ny" }, + { VapiTranscriberLanguage.Oc, "oc" }, + { VapiTranscriberLanguage.Oj, "oj" }, + { VapiTranscriberLanguage.Om, "om" }, + { VapiTranscriberLanguage.Or, "or" }, + { VapiTranscriberLanguage.Os, "os" }, + { VapiTranscriberLanguage.Pa, "pa" }, + { VapiTranscriberLanguage.Pi, "pi" }, + { VapiTranscriberLanguage.Pl, "pl" }, + { VapiTranscriberLanguage.Ps, "ps" }, + { VapiTranscriberLanguage.Pt, "pt" }, + { VapiTranscriberLanguage.Qu, "qu" }, + { VapiTranscriberLanguage.Rm, "rm" }, + { VapiTranscriberLanguage.Rn, "rn" }, + { VapiTranscriberLanguage.Ro, "ro" }, + { VapiTranscriberLanguage.Ru, "ru" }, + { VapiTranscriberLanguage.Rw, "rw" }, + { VapiTranscriberLanguage.Sa, "sa" }, + { VapiTranscriberLanguage.Sc, "sc" }, + { VapiTranscriberLanguage.Sd, "sd" }, + { VapiTranscriberLanguage.Se, "se" }, + { VapiTranscriberLanguage.Sg, "sg" }, + { VapiTranscriberLanguage.Si, "si" }, + { VapiTranscriberLanguage.Sk, "sk" }, + { VapiTranscriberLanguage.Sl, "sl" }, + { VapiTranscriberLanguage.Sm, "sm" }, + { VapiTranscriberLanguage.Sn, "sn" }, + { VapiTranscriberLanguage.So, "so" }, + { VapiTranscriberLanguage.Sq, "sq" }, + { VapiTranscriberLanguage.Sr, "sr" }, + { VapiTranscriberLanguage.Ss, "ss" }, + { VapiTranscriberLanguage.St, "st" }, + { VapiTranscriberLanguage.Su, "su" }, + { VapiTranscriberLanguage.Sv, "sv" }, + { VapiTranscriberLanguage.Sw, "sw" }, + { VapiTranscriberLanguage.Ta, "ta" }, + { VapiTranscriberLanguage.Te, "te" }, + { VapiTranscriberLanguage.Tg, "tg" }, + { VapiTranscriberLanguage.Th, "th" }, + { VapiTranscriberLanguage.Ti, "ti" }, + { VapiTranscriberLanguage.Tk, "tk" }, + { VapiTranscriberLanguage.Tl, "tl" }, + { VapiTranscriberLanguage.Tn, "tn" }, + { VapiTranscriberLanguage.To, "to" }, + { VapiTranscriberLanguage.Tr, "tr" }, + { VapiTranscriberLanguage.Ts, "ts" }, + { VapiTranscriberLanguage.Tt, "tt" }, + { VapiTranscriberLanguage.Tw, "tw" }, + { VapiTranscriberLanguage.Ty, "ty" }, + { VapiTranscriberLanguage.Ug, "ug" }, + { VapiTranscriberLanguage.Uk, "uk" }, + { VapiTranscriberLanguage.Ur, "ur" }, + { VapiTranscriberLanguage.Uz, "uz" }, + { VapiTranscriberLanguage.Ve, "ve" }, + { VapiTranscriberLanguage.Vi, "vi" }, + { VapiTranscriberLanguage.Vo, "vo" }, + { VapiTranscriberLanguage.Wa, "wa" }, + { VapiTranscriberLanguage.Wo, "wo" }, + { VapiTranscriberLanguage.Xh, "xh" }, + { VapiTranscriberLanguage.Yi, "yi" }, + { VapiTranscriberLanguage.Yue, "yue" }, + { VapiTranscriberLanguage.Yo, "yo" }, + { VapiTranscriberLanguage.Za, "za" }, + { VapiTranscriberLanguage.Zh, "zh" }, + { VapiTranscriberLanguage.Zu, "zu" }, + }; + + public override VapiTranscriberLanguage Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + VapiTranscriberLanguage value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override VapiTranscriberLanguage ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + VapiTranscriberLanguage value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/VapiTranscriberLanguagesItem.cs b/src/Vapi.Net/Types/VapiTranscriberLanguagesItem.cs new file mode 100644 index 00000000..c4b966c3 --- /dev/null +++ b/src/Vapi.Net/Types/VapiTranscriberLanguagesItem.cs @@ -0,0 +1,999 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(VapiTranscriberLanguagesItemSerializer))] +public enum VapiTranscriberLanguagesItem +{ + [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, +} + +internal class VapiTranscriberLanguagesItemSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + VapiTranscriberLanguagesItem + > _stringToEnum = new() + { + { "aa", VapiTranscriberLanguagesItem.Aa }, + { "ab", VapiTranscriberLanguagesItem.Ab }, + { "ae", VapiTranscriberLanguagesItem.Ae }, + { "af", VapiTranscriberLanguagesItem.Af }, + { "ak", VapiTranscriberLanguagesItem.Ak }, + { "am", VapiTranscriberLanguagesItem.Am }, + { "an", VapiTranscriberLanguagesItem.An }, + { "ar", VapiTranscriberLanguagesItem.Ar }, + { "as", VapiTranscriberLanguagesItem.As }, + { "av", VapiTranscriberLanguagesItem.Av }, + { "ay", VapiTranscriberLanguagesItem.Ay }, + { "az", VapiTranscriberLanguagesItem.Az }, + { "ba", VapiTranscriberLanguagesItem.Ba }, + { "be", VapiTranscriberLanguagesItem.Be }, + { "bg", VapiTranscriberLanguagesItem.Bg }, + { "bh", VapiTranscriberLanguagesItem.Bh }, + { "bi", VapiTranscriberLanguagesItem.Bi }, + { "bm", VapiTranscriberLanguagesItem.Bm }, + { "bn", VapiTranscriberLanguagesItem.Bn }, + { "bo", VapiTranscriberLanguagesItem.Bo }, + { "br", VapiTranscriberLanguagesItem.Br }, + { "bs", VapiTranscriberLanguagesItem.Bs }, + { "ca", VapiTranscriberLanguagesItem.Ca }, + { "ce", VapiTranscriberLanguagesItem.Ce }, + { "ch", VapiTranscriberLanguagesItem.Ch }, + { "co", VapiTranscriberLanguagesItem.Co }, + { "cr", VapiTranscriberLanguagesItem.Cr }, + { "cs", VapiTranscriberLanguagesItem.Cs }, + { "cu", VapiTranscriberLanguagesItem.Cu }, + { "cv", VapiTranscriberLanguagesItem.Cv }, + { "cy", VapiTranscriberLanguagesItem.Cy }, + { "da", VapiTranscriberLanguagesItem.Da }, + { "de", VapiTranscriberLanguagesItem.De }, + { "dv", VapiTranscriberLanguagesItem.Dv }, + { "dz", VapiTranscriberLanguagesItem.Dz }, + { "ee", VapiTranscriberLanguagesItem.Ee }, + { "el", VapiTranscriberLanguagesItem.El }, + { "en", VapiTranscriberLanguagesItem.En }, + { "eo", VapiTranscriberLanguagesItem.Eo }, + { "es", VapiTranscriberLanguagesItem.Es }, + { "et", VapiTranscriberLanguagesItem.Et }, + { "eu", VapiTranscriberLanguagesItem.Eu }, + { "fa", VapiTranscriberLanguagesItem.Fa }, + { "ff", VapiTranscriberLanguagesItem.Ff }, + { "fi", VapiTranscriberLanguagesItem.Fi }, + { "fj", VapiTranscriberLanguagesItem.Fj }, + { "fo", VapiTranscriberLanguagesItem.Fo }, + { "fr", VapiTranscriberLanguagesItem.Fr }, + { "fy", VapiTranscriberLanguagesItem.Fy }, + { "ga", VapiTranscriberLanguagesItem.Ga }, + { "gd", VapiTranscriberLanguagesItem.Gd }, + { "gl", VapiTranscriberLanguagesItem.Gl }, + { "gn", VapiTranscriberLanguagesItem.Gn }, + { "gu", VapiTranscriberLanguagesItem.Gu }, + { "gv", VapiTranscriberLanguagesItem.Gv }, + { "ha", VapiTranscriberLanguagesItem.Ha }, + { "he", VapiTranscriberLanguagesItem.He }, + { "hi", VapiTranscriberLanguagesItem.Hi }, + { "ho", VapiTranscriberLanguagesItem.Ho }, + { "hr", VapiTranscriberLanguagesItem.Hr }, + { "ht", VapiTranscriberLanguagesItem.Ht }, + { "hu", VapiTranscriberLanguagesItem.Hu }, + { "hy", VapiTranscriberLanguagesItem.Hy }, + { "hz", VapiTranscriberLanguagesItem.Hz }, + { "ia", VapiTranscriberLanguagesItem.Ia }, + { "id", VapiTranscriberLanguagesItem.Id }, + { "ie", VapiTranscriberLanguagesItem.Ie }, + { "ig", VapiTranscriberLanguagesItem.Ig }, + { "ii", VapiTranscriberLanguagesItem.Ii }, + { "ik", VapiTranscriberLanguagesItem.Ik }, + { "io", VapiTranscriberLanguagesItem.Io }, + { "is", VapiTranscriberLanguagesItem.Is }, + { "it", VapiTranscriberLanguagesItem.It }, + { "iu", VapiTranscriberLanguagesItem.Iu }, + { "ja", VapiTranscriberLanguagesItem.Ja }, + { "jv", VapiTranscriberLanguagesItem.Jv }, + { "ka", VapiTranscriberLanguagesItem.Ka }, + { "kg", VapiTranscriberLanguagesItem.Kg }, + { "ki", VapiTranscriberLanguagesItem.Ki }, + { "kj", VapiTranscriberLanguagesItem.Kj }, + { "kk", VapiTranscriberLanguagesItem.Kk }, + { "kl", VapiTranscriberLanguagesItem.Kl }, + { "km", VapiTranscriberLanguagesItem.Km }, + { "kn", VapiTranscriberLanguagesItem.Kn }, + { "ko", VapiTranscriberLanguagesItem.Ko }, + { "kr", VapiTranscriberLanguagesItem.Kr }, + { "ks", VapiTranscriberLanguagesItem.Ks }, + { "ku", VapiTranscriberLanguagesItem.Ku }, + { "kv", VapiTranscriberLanguagesItem.Kv }, + { "kw", VapiTranscriberLanguagesItem.Kw }, + { "ky", VapiTranscriberLanguagesItem.Ky }, + { "la", VapiTranscriberLanguagesItem.La }, + { "lb", VapiTranscriberLanguagesItem.Lb }, + { "lg", VapiTranscriberLanguagesItem.Lg }, + { "li", VapiTranscriberLanguagesItem.Li }, + { "ln", VapiTranscriberLanguagesItem.Ln }, + { "lo", VapiTranscriberLanguagesItem.Lo }, + { "lt", VapiTranscriberLanguagesItem.Lt }, + { "lu", VapiTranscriberLanguagesItem.Lu }, + { "lv", VapiTranscriberLanguagesItem.Lv }, + { "mg", VapiTranscriberLanguagesItem.Mg }, + { "mh", VapiTranscriberLanguagesItem.Mh }, + { "mi", VapiTranscriberLanguagesItem.Mi }, + { "mk", VapiTranscriberLanguagesItem.Mk }, + { "ml", VapiTranscriberLanguagesItem.Ml }, + { "mn", VapiTranscriberLanguagesItem.Mn }, + { "mr", VapiTranscriberLanguagesItem.Mr }, + { "ms", VapiTranscriberLanguagesItem.Ms }, + { "mt", VapiTranscriberLanguagesItem.Mt }, + { "my", VapiTranscriberLanguagesItem.My }, + { "na", VapiTranscriberLanguagesItem.Na }, + { "nb", VapiTranscriberLanguagesItem.Nb }, + { "nd", VapiTranscriberLanguagesItem.Nd }, + { "ne", VapiTranscriberLanguagesItem.Ne }, + { "ng", VapiTranscriberLanguagesItem.Ng }, + { "nl", VapiTranscriberLanguagesItem.Nl }, + { "nn", VapiTranscriberLanguagesItem.Nn }, + { "no", VapiTranscriberLanguagesItem.No }, + { "nr", VapiTranscriberLanguagesItem.Nr }, + { "nv", VapiTranscriberLanguagesItem.Nv }, + { "ny", VapiTranscriberLanguagesItem.Ny }, + { "oc", VapiTranscriberLanguagesItem.Oc }, + { "oj", VapiTranscriberLanguagesItem.Oj }, + { "om", VapiTranscriberLanguagesItem.Om }, + { "or", VapiTranscriberLanguagesItem.Or }, + { "os", VapiTranscriberLanguagesItem.Os }, + { "pa", VapiTranscriberLanguagesItem.Pa }, + { "pi", VapiTranscriberLanguagesItem.Pi }, + { "pl", VapiTranscriberLanguagesItem.Pl }, + { "ps", VapiTranscriberLanguagesItem.Ps }, + { "pt", VapiTranscriberLanguagesItem.Pt }, + { "qu", VapiTranscriberLanguagesItem.Qu }, + { "rm", VapiTranscriberLanguagesItem.Rm }, + { "rn", VapiTranscriberLanguagesItem.Rn }, + { "ro", VapiTranscriberLanguagesItem.Ro }, + { "ru", VapiTranscriberLanguagesItem.Ru }, + { "rw", VapiTranscriberLanguagesItem.Rw }, + { "sa", VapiTranscriberLanguagesItem.Sa }, + { "sc", VapiTranscriberLanguagesItem.Sc }, + { "sd", VapiTranscriberLanguagesItem.Sd }, + { "se", VapiTranscriberLanguagesItem.Se }, + { "sg", VapiTranscriberLanguagesItem.Sg }, + { "si", VapiTranscriberLanguagesItem.Si }, + { "sk", VapiTranscriberLanguagesItem.Sk }, + { "sl", VapiTranscriberLanguagesItem.Sl }, + { "sm", VapiTranscriberLanguagesItem.Sm }, + { "sn", VapiTranscriberLanguagesItem.Sn }, + { "so", VapiTranscriberLanguagesItem.So }, + { "sq", VapiTranscriberLanguagesItem.Sq }, + { "sr", VapiTranscriberLanguagesItem.Sr }, + { "ss", VapiTranscriberLanguagesItem.Ss }, + { "st", VapiTranscriberLanguagesItem.St }, + { "su", VapiTranscriberLanguagesItem.Su }, + { "sv", VapiTranscriberLanguagesItem.Sv }, + { "sw", VapiTranscriberLanguagesItem.Sw }, + { "ta", VapiTranscriberLanguagesItem.Ta }, + { "te", VapiTranscriberLanguagesItem.Te }, + { "tg", VapiTranscriberLanguagesItem.Tg }, + { "th", VapiTranscriberLanguagesItem.Th }, + { "ti", VapiTranscriberLanguagesItem.Ti }, + { "tk", VapiTranscriberLanguagesItem.Tk }, + { "tl", VapiTranscriberLanguagesItem.Tl }, + { "tn", VapiTranscriberLanguagesItem.Tn }, + { "to", VapiTranscriberLanguagesItem.To }, + { "tr", VapiTranscriberLanguagesItem.Tr }, + { "ts", VapiTranscriberLanguagesItem.Ts }, + { "tt", VapiTranscriberLanguagesItem.Tt }, + { "tw", VapiTranscriberLanguagesItem.Tw }, + { "ty", VapiTranscriberLanguagesItem.Ty }, + { "ug", VapiTranscriberLanguagesItem.Ug }, + { "uk", VapiTranscriberLanguagesItem.Uk }, + { "ur", VapiTranscriberLanguagesItem.Ur }, + { "uz", VapiTranscriberLanguagesItem.Uz }, + { "ve", VapiTranscriberLanguagesItem.Ve }, + { "vi", VapiTranscriberLanguagesItem.Vi }, + { "vo", VapiTranscriberLanguagesItem.Vo }, + { "wa", VapiTranscriberLanguagesItem.Wa }, + { "wo", VapiTranscriberLanguagesItem.Wo }, + { "xh", VapiTranscriberLanguagesItem.Xh }, + { "yi", VapiTranscriberLanguagesItem.Yi }, + { "yue", VapiTranscriberLanguagesItem.Yue }, + { "yo", VapiTranscriberLanguagesItem.Yo }, + { "za", VapiTranscriberLanguagesItem.Za }, + { "zh", VapiTranscriberLanguagesItem.Zh }, + { "zu", VapiTranscriberLanguagesItem.Zu }, + }; + + private static readonly global::System.Collections.Generic.Dictionary< + VapiTranscriberLanguagesItem, + string + > _enumToString = new() + { + { VapiTranscriberLanguagesItem.Aa, "aa" }, + { VapiTranscriberLanguagesItem.Ab, "ab" }, + { VapiTranscriberLanguagesItem.Ae, "ae" }, + { VapiTranscriberLanguagesItem.Af, "af" }, + { VapiTranscriberLanguagesItem.Ak, "ak" }, + { VapiTranscriberLanguagesItem.Am, "am" }, + { VapiTranscriberLanguagesItem.An, "an" }, + { VapiTranscriberLanguagesItem.Ar, "ar" }, + { VapiTranscriberLanguagesItem.As, "as" }, + { VapiTranscriberLanguagesItem.Av, "av" }, + { VapiTranscriberLanguagesItem.Ay, "ay" }, + { VapiTranscriberLanguagesItem.Az, "az" }, + { VapiTranscriberLanguagesItem.Ba, "ba" }, + { VapiTranscriberLanguagesItem.Be, "be" }, + { VapiTranscriberLanguagesItem.Bg, "bg" }, + { VapiTranscriberLanguagesItem.Bh, "bh" }, + { VapiTranscriberLanguagesItem.Bi, "bi" }, + { VapiTranscriberLanguagesItem.Bm, "bm" }, + { VapiTranscriberLanguagesItem.Bn, "bn" }, + { VapiTranscriberLanguagesItem.Bo, "bo" }, + { VapiTranscriberLanguagesItem.Br, "br" }, + { VapiTranscriberLanguagesItem.Bs, "bs" }, + { VapiTranscriberLanguagesItem.Ca, "ca" }, + { VapiTranscriberLanguagesItem.Ce, "ce" }, + { VapiTranscriberLanguagesItem.Ch, "ch" }, + { VapiTranscriberLanguagesItem.Co, "co" }, + { VapiTranscriberLanguagesItem.Cr, "cr" }, + { VapiTranscriberLanguagesItem.Cs, "cs" }, + { VapiTranscriberLanguagesItem.Cu, "cu" }, + { VapiTranscriberLanguagesItem.Cv, "cv" }, + { VapiTranscriberLanguagesItem.Cy, "cy" }, + { VapiTranscriberLanguagesItem.Da, "da" }, + { VapiTranscriberLanguagesItem.De, "de" }, + { VapiTranscriberLanguagesItem.Dv, "dv" }, + { VapiTranscriberLanguagesItem.Dz, "dz" }, + { VapiTranscriberLanguagesItem.Ee, "ee" }, + { VapiTranscriberLanguagesItem.El, "el" }, + { VapiTranscriberLanguagesItem.En, "en" }, + { VapiTranscriberLanguagesItem.Eo, "eo" }, + { VapiTranscriberLanguagesItem.Es, "es" }, + { VapiTranscriberLanguagesItem.Et, "et" }, + { VapiTranscriberLanguagesItem.Eu, "eu" }, + { VapiTranscriberLanguagesItem.Fa, "fa" }, + { VapiTranscriberLanguagesItem.Ff, "ff" }, + { VapiTranscriberLanguagesItem.Fi, "fi" }, + { VapiTranscriberLanguagesItem.Fj, "fj" }, + { VapiTranscriberLanguagesItem.Fo, "fo" }, + { VapiTranscriberLanguagesItem.Fr, "fr" }, + { VapiTranscriberLanguagesItem.Fy, "fy" }, + { VapiTranscriberLanguagesItem.Ga, "ga" }, + { VapiTranscriberLanguagesItem.Gd, "gd" }, + { VapiTranscriberLanguagesItem.Gl, "gl" }, + { VapiTranscriberLanguagesItem.Gn, "gn" }, + { VapiTranscriberLanguagesItem.Gu, "gu" }, + { VapiTranscriberLanguagesItem.Gv, "gv" }, + { VapiTranscriberLanguagesItem.Ha, "ha" }, + { VapiTranscriberLanguagesItem.He, "he" }, + { VapiTranscriberLanguagesItem.Hi, "hi" }, + { VapiTranscriberLanguagesItem.Ho, "ho" }, + { VapiTranscriberLanguagesItem.Hr, "hr" }, + { VapiTranscriberLanguagesItem.Ht, "ht" }, + { VapiTranscriberLanguagesItem.Hu, "hu" }, + { VapiTranscriberLanguagesItem.Hy, "hy" }, + { VapiTranscriberLanguagesItem.Hz, "hz" }, + { VapiTranscriberLanguagesItem.Ia, "ia" }, + { VapiTranscriberLanguagesItem.Id, "id" }, + { VapiTranscriberLanguagesItem.Ie, "ie" }, + { VapiTranscriberLanguagesItem.Ig, "ig" }, + { VapiTranscriberLanguagesItem.Ii, "ii" }, + { VapiTranscriberLanguagesItem.Ik, "ik" }, + { VapiTranscriberLanguagesItem.Io, "io" }, + { VapiTranscriberLanguagesItem.Is, "is" }, + { VapiTranscriberLanguagesItem.It, "it" }, + { VapiTranscriberLanguagesItem.Iu, "iu" }, + { VapiTranscriberLanguagesItem.Ja, "ja" }, + { VapiTranscriberLanguagesItem.Jv, "jv" }, + { VapiTranscriberLanguagesItem.Ka, "ka" }, + { VapiTranscriberLanguagesItem.Kg, "kg" }, + { VapiTranscriberLanguagesItem.Ki, "ki" }, + { VapiTranscriberLanguagesItem.Kj, "kj" }, + { VapiTranscriberLanguagesItem.Kk, "kk" }, + { VapiTranscriberLanguagesItem.Kl, "kl" }, + { VapiTranscriberLanguagesItem.Km, "km" }, + { VapiTranscriberLanguagesItem.Kn, "kn" }, + { VapiTranscriberLanguagesItem.Ko, "ko" }, + { VapiTranscriberLanguagesItem.Kr, "kr" }, + { VapiTranscriberLanguagesItem.Ks, "ks" }, + { VapiTranscriberLanguagesItem.Ku, "ku" }, + { VapiTranscriberLanguagesItem.Kv, "kv" }, + { VapiTranscriberLanguagesItem.Kw, "kw" }, + { VapiTranscriberLanguagesItem.Ky, "ky" }, + { VapiTranscriberLanguagesItem.La, "la" }, + { VapiTranscriberLanguagesItem.Lb, "lb" }, + { VapiTranscriberLanguagesItem.Lg, "lg" }, + { VapiTranscriberLanguagesItem.Li, "li" }, + { VapiTranscriberLanguagesItem.Ln, "ln" }, + { VapiTranscriberLanguagesItem.Lo, "lo" }, + { VapiTranscriberLanguagesItem.Lt, "lt" }, + { VapiTranscriberLanguagesItem.Lu, "lu" }, + { VapiTranscriberLanguagesItem.Lv, "lv" }, + { VapiTranscriberLanguagesItem.Mg, "mg" }, + { VapiTranscriberLanguagesItem.Mh, "mh" }, + { VapiTranscriberLanguagesItem.Mi, "mi" }, + { VapiTranscriberLanguagesItem.Mk, "mk" }, + { VapiTranscriberLanguagesItem.Ml, "ml" }, + { VapiTranscriberLanguagesItem.Mn, "mn" }, + { VapiTranscriberLanguagesItem.Mr, "mr" }, + { VapiTranscriberLanguagesItem.Ms, "ms" }, + { VapiTranscriberLanguagesItem.Mt, "mt" }, + { VapiTranscriberLanguagesItem.My, "my" }, + { VapiTranscriberLanguagesItem.Na, "na" }, + { VapiTranscriberLanguagesItem.Nb, "nb" }, + { VapiTranscriberLanguagesItem.Nd, "nd" }, + { VapiTranscriberLanguagesItem.Ne, "ne" }, + { VapiTranscriberLanguagesItem.Ng, "ng" }, + { VapiTranscriberLanguagesItem.Nl, "nl" }, + { VapiTranscriberLanguagesItem.Nn, "nn" }, + { VapiTranscriberLanguagesItem.No, "no" }, + { VapiTranscriberLanguagesItem.Nr, "nr" }, + { VapiTranscriberLanguagesItem.Nv, "nv" }, + { VapiTranscriberLanguagesItem.Ny, "ny" }, + { VapiTranscriberLanguagesItem.Oc, "oc" }, + { VapiTranscriberLanguagesItem.Oj, "oj" }, + { VapiTranscriberLanguagesItem.Om, "om" }, + { VapiTranscriberLanguagesItem.Or, "or" }, + { VapiTranscriberLanguagesItem.Os, "os" }, + { VapiTranscriberLanguagesItem.Pa, "pa" }, + { VapiTranscriberLanguagesItem.Pi, "pi" }, + { VapiTranscriberLanguagesItem.Pl, "pl" }, + { VapiTranscriberLanguagesItem.Ps, "ps" }, + { VapiTranscriberLanguagesItem.Pt, "pt" }, + { VapiTranscriberLanguagesItem.Qu, "qu" }, + { VapiTranscriberLanguagesItem.Rm, "rm" }, + { VapiTranscriberLanguagesItem.Rn, "rn" }, + { VapiTranscriberLanguagesItem.Ro, "ro" }, + { VapiTranscriberLanguagesItem.Ru, "ru" }, + { VapiTranscriberLanguagesItem.Rw, "rw" }, + { VapiTranscriberLanguagesItem.Sa, "sa" }, + { VapiTranscriberLanguagesItem.Sc, "sc" }, + { VapiTranscriberLanguagesItem.Sd, "sd" }, + { VapiTranscriberLanguagesItem.Se, "se" }, + { VapiTranscriberLanguagesItem.Sg, "sg" }, + { VapiTranscriberLanguagesItem.Si, "si" }, + { VapiTranscriberLanguagesItem.Sk, "sk" }, + { VapiTranscriberLanguagesItem.Sl, "sl" }, + { VapiTranscriberLanguagesItem.Sm, "sm" }, + { VapiTranscriberLanguagesItem.Sn, "sn" }, + { VapiTranscriberLanguagesItem.So, "so" }, + { VapiTranscriberLanguagesItem.Sq, "sq" }, + { VapiTranscriberLanguagesItem.Sr, "sr" }, + { VapiTranscriberLanguagesItem.Ss, "ss" }, + { VapiTranscriberLanguagesItem.St, "st" }, + { VapiTranscriberLanguagesItem.Su, "su" }, + { VapiTranscriberLanguagesItem.Sv, "sv" }, + { VapiTranscriberLanguagesItem.Sw, "sw" }, + { VapiTranscriberLanguagesItem.Ta, "ta" }, + { VapiTranscriberLanguagesItem.Te, "te" }, + { VapiTranscriberLanguagesItem.Tg, "tg" }, + { VapiTranscriberLanguagesItem.Th, "th" }, + { VapiTranscriberLanguagesItem.Ti, "ti" }, + { VapiTranscriberLanguagesItem.Tk, "tk" }, + { VapiTranscriberLanguagesItem.Tl, "tl" }, + { VapiTranscriberLanguagesItem.Tn, "tn" }, + { VapiTranscriberLanguagesItem.To, "to" }, + { VapiTranscriberLanguagesItem.Tr, "tr" }, + { VapiTranscriberLanguagesItem.Ts, "ts" }, + { VapiTranscriberLanguagesItem.Tt, "tt" }, + { VapiTranscriberLanguagesItem.Tw, "tw" }, + { VapiTranscriberLanguagesItem.Ty, "ty" }, + { VapiTranscriberLanguagesItem.Ug, "ug" }, + { VapiTranscriberLanguagesItem.Uk, "uk" }, + { VapiTranscriberLanguagesItem.Ur, "ur" }, + { VapiTranscriberLanguagesItem.Uz, "uz" }, + { VapiTranscriberLanguagesItem.Ve, "ve" }, + { VapiTranscriberLanguagesItem.Vi, "vi" }, + { VapiTranscriberLanguagesItem.Vo, "vo" }, + { VapiTranscriberLanguagesItem.Wa, "wa" }, + { VapiTranscriberLanguagesItem.Wo, "wo" }, + { VapiTranscriberLanguagesItem.Xh, "xh" }, + { VapiTranscriberLanguagesItem.Yi, "yi" }, + { VapiTranscriberLanguagesItem.Yue, "yue" }, + { VapiTranscriberLanguagesItem.Yo, "yo" }, + { VapiTranscriberLanguagesItem.Za, "za" }, + { VapiTranscriberLanguagesItem.Zh, "zh" }, + { VapiTranscriberLanguagesItem.Zu, "zu" }, + }; + + public override VapiTranscriberLanguagesItem Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + VapiTranscriberLanguagesItem value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override VapiTranscriberLanguagesItem ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + VapiTranscriberLanguagesItem value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/VapiTranscriberTurnTaking.cs b/src/Vapi.Net/Types/VapiTranscriberTurnTaking.cs new file mode 100644 index 00000000..70a3314c --- /dev/null +++ b/src/Vapi.Net/Types/VapiTranscriberTurnTaking.cs @@ -0,0 +1,84 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(VapiTranscriberTurnTakingSerializer))] +public enum VapiTranscriberTurnTaking +{ + [EnumMember(Value = "intelligent")] + Intelligent, + + [EnumMember(Value = "manual")] + Manual, +} + +internal class VapiTranscriberTurnTakingSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + VapiTranscriberTurnTaking + > _stringToEnum = new() + { + { "intelligent", VapiTranscriberTurnTaking.Intelligent }, + { "manual", VapiTranscriberTurnTaking.Manual }, + }; + + private static readonly global::System.Collections.Generic.Dictionary< + VapiTranscriberTurnTaking, + string + > _enumToString = new() + { + { VapiTranscriberTurnTaking.Intelligent, "intelligent" }, + { VapiTranscriberTurnTaking.Manual, "manual" }, + }; + + public override VapiTranscriberTurnTaking Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + VapiTranscriberTurnTaking value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override VapiTranscriberTurnTaking ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + VapiTranscriberTurnTaking value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/VapiTranscriberVersion.cs b/src/Vapi.Net/Types/VapiTranscriberVersion.cs new file mode 100644 index 00000000..f283fe80 --- /dev/null +++ b/src/Vapi.Net/Types/VapiTranscriberVersion.cs @@ -0,0 +1,84 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(VapiTranscriberVersionSerializer))] +public enum VapiTranscriberVersion +{ + [EnumMember(Value = "latest")] + Latest, + + [EnumMember(Value = "1")] + One, +} + +internal class VapiTranscriberVersionSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + VapiTranscriberVersion + > _stringToEnum = new() + { + { "latest", VapiTranscriberVersion.Latest }, + { "1", VapiTranscriberVersion.One }, + }; + + private static readonly global::System.Collections.Generic.Dictionary< + VapiTranscriberVersion, + string + > _enumToString = new() + { + { VapiTranscriberVersion.Latest, "latest" }, + { VapiTranscriberVersion.One, "1" }, + }; + + public override VapiTranscriberVersion Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + VapiTranscriberVersion value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override VapiTranscriberVersion ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + VapiTranscriberVersion value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/VapiVoice.cs b/src/Vapi.Net/Types/VapiVoice.cs index 5f73295c..a973e4c0 100644 --- a/src/Vapi.Net/Types/VapiVoice.cs +++ b/src/Vapi.Net/Types/VapiVoice.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Configuration for synthesizing assistant speech with Vapi, including voice selection, speed, pronunciation dictionary, chunking, caching, and fallback settings. +/// [Serializable] public record VapiVoice : IJsonOnDeserialized { @@ -23,6 +26,12 @@ public record VapiVoice : IJsonOnDeserialized [JsonPropertyName("voiceId")] public required VapiVoiceVoiceId VoiceId { get; set; } + /// + /// The Vapi voice routing generation. `latest` auto-updates to the newest generation; version 1 uses legacy mappings; version 2 can use xAI-backed voices when available. When omitted, Version 1 is used. Accepts the string channel ('latest', '1', '2'); legacy numeric values (1, 2) are also accepted and coerced to their string form. + /// + [JsonPropertyName("version")] + public VapiVoiceVersion? Version { get; set; } + /// /// This is the speed multiplier that will be used. /// @@ -31,6 +40,12 @@ public record VapiVoice : IJsonOnDeserialized [JsonPropertyName("speed")] public double? Speed { get; set; } + /// + /// Language for Vapi voice synthesis. For Version 2, omit this field or set `auto` for automatic language detection. Version 1 supports legacy Vapi language values. + /// + [JsonPropertyName("language")] + public VapiVoiceLanguage? Language { get; set; } + /// /// List of pronunciation dictionary locators for custom word pronunciations. /// @@ -43,12 +58,6 @@ public record VapiVoice : IJsonOnDeserialized [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; } - [JsonIgnore] public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); diff --git a/src/Vapi.Net/Types/VapiVoiceLanguage.cs b/src/Vapi.Net/Types/VapiVoiceLanguage.cs new file mode 100644 index 00000000..855de71c --- /dev/null +++ b/src/Vapi.Net/Types/VapiVoiceLanguage.cs @@ -0,0 +1,359 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(VapiVoiceLanguageSerializer))] +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, + + [EnumMember(Value = "auto")] + Auto, + + [EnumMember(Value = "en")] + En, + + [EnumMember(Value = "ar")] + Ar, + + [EnumMember(Value = "ar-EG")] + ArEg, + + [EnumMember(Value = "bn")] + Bn, + + [EnumMember(Value = "es")] + Es, + + [EnumMember(Value = "fr")] + Fr, + + [EnumMember(Value = "gu")] + Gu, + + [EnumMember(Value = "he")] + He, + + [EnumMember(Value = "ka")] + Ka, + + [EnumMember(Value = "kn")] + Kn, + + [EnumMember(Value = "ml")] + Ml, + + [EnumMember(Value = "mr")] + Mr, + + [EnumMember(Value = "pa")] + Pa, + + [EnumMember(Value = "pt")] + Pt, + + [EnumMember(Value = "te")] + Te, + + [EnumMember(Value = "th")] + Th, + + [EnumMember(Value = "tl")] + Tl, +} + +internal class VapiVoiceLanguageSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + VapiVoiceLanguage + > _stringToEnum = new() + { + { "en-US", VapiVoiceLanguage.EnUs }, + { "en-GB", VapiVoiceLanguage.EnGb }, + { "en-AU", VapiVoiceLanguage.EnAu }, + { "en-CA", VapiVoiceLanguage.EnCa }, + { "ja", VapiVoiceLanguage.Ja }, + { "zh", VapiVoiceLanguage.Zh }, + { "de", VapiVoiceLanguage.De }, + { "hi", VapiVoiceLanguage.Hi }, + { "fr-FR", VapiVoiceLanguage.FrFr }, + { "fr-CA", VapiVoiceLanguage.FrCa }, + { "ko", VapiVoiceLanguage.Ko }, + { "pt-BR", VapiVoiceLanguage.PtBr }, + { "pt-PT", VapiVoiceLanguage.PtPt }, + { "it", VapiVoiceLanguage.It }, + { "es-ES", VapiVoiceLanguage.EsEs }, + { "es-MX", VapiVoiceLanguage.EsMx }, + { "id", VapiVoiceLanguage.Id }, + { "nl", VapiVoiceLanguage.Nl }, + { "tr", VapiVoiceLanguage.Tr }, + { "fil", VapiVoiceLanguage.Fil }, + { "pl", VapiVoiceLanguage.Pl }, + { "sv", VapiVoiceLanguage.Sv }, + { "bg", VapiVoiceLanguage.Bg }, + { "ro", VapiVoiceLanguage.Ro }, + { "ar-SA", VapiVoiceLanguage.ArSa }, + { "ar-AE", VapiVoiceLanguage.ArAe }, + { "cs", VapiVoiceLanguage.Cs }, + { "el", VapiVoiceLanguage.El }, + { "fi", VapiVoiceLanguage.Fi }, + { "hr", VapiVoiceLanguage.Hr }, + { "ms", VapiVoiceLanguage.Ms }, + { "sk", VapiVoiceLanguage.Sk }, + { "da", VapiVoiceLanguage.Da }, + { "ta", VapiVoiceLanguage.Ta }, + { "uk", VapiVoiceLanguage.Uk }, + { "ru", VapiVoiceLanguage.Ru }, + { "hu", VapiVoiceLanguage.Hu }, + { "no", VapiVoiceLanguage.No }, + { "vi", VapiVoiceLanguage.Vi }, + { "auto", VapiVoiceLanguage.Auto }, + { "en", VapiVoiceLanguage.En }, + { "ar", VapiVoiceLanguage.Ar }, + { "ar-EG", VapiVoiceLanguage.ArEg }, + { "bn", VapiVoiceLanguage.Bn }, + { "es", VapiVoiceLanguage.Es }, + { "fr", VapiVoiceLanguage.Fr }, + { "gu", VapiVoiceLanguage.Gu }, + { "he", VapiVoiceLanguage.He }, + { "ka", VapiVoiceLanguage.Ka }, + { "kn", VapiVoiceLanguage.Kn }, + { "ml", VapiVoiceLanguage.Ml }, + { "mr", VapiVoiceLanguage.Mr }, + { "pa", VapiVoiceLanguage.Pa }, + { "pt", VapiVoiceLanguage.Pt }, + { "te", VapiVoiceLanguage.Te }, + { "th", VapiVoiceLanguage.Th }, + { "tl", VapiVoiceLanguage.Tl }, + }; + + private static readonly global::System.Collections.Generic.Dictionary< + VapiVoiceLanguage, + string + > _enumToString = new() + { + { VapiVoiceLanguage.EnUs, "en-US" }, + { VapiVoiceLanguage.EnGb, "en-GB" }, + { VapiVoiceLanguage.EnAu, "en-AU" }, + { VapiVoiceLanguage.EnCa, "en-CA" }, + { VapiVoiceLanguage.Ja, "ja" }, + { VapiVoiceLanguage.Zh, "zh" }, + { VapiVoiceLanguage.De, "de" }, + { VapiVoiceLanguage.Hi, "hi" }, + { VapiVoiceLanguage.FrFr, "fr-FR" }, + { VapiVoiceLanguage.FrCa, "fr-CA" }, + { VapiVoiceLanguage.Ko, "ko" }, + { VapiVoiceLanguage.PtBr, "pt-BR" }, + { VapiVoiceLanguage.PtPt, "pt-PT" }, + { VapiVoiceLanguage.It, "it" }, + { VapiVoiceLanguage.EsEs, "es-ES" }, + { VapiVoiceLanguage.EsMx, "es-MX" }, + { VapiVoiceLanguage.Id, "id" }, + { VapiVoiceLanguage.Nl, "nl" }, + { VapiVoiceLanguage.Tr, "tr" }, + { VapiVoiceLanguage.Fil, "fil" }, + { VapiVoiceLanguage.Pl, "pl" }, + { VapiVoiceLanguage.Sv, "sv" }, + { VapiVoiceLanguage.Bg, "bg" }, + { VapiVoiceLanguage.Ro, "ro" }, + { VapiVoiceLanguage.ArSa, "ar-SA" }, + { VapiVoiceLanguage.ArAe, "ar-AE" }, + { VapiVoiceLanguage.Cs, "cs" }, + { VapiVoiceLanguage.El, "el" }, + { VapiVoiceLanguage.Fi, "fi" }, + { VapiVoiceLanguage.Hr, "hr" }, + { VapiVoiceLanguage.Ms, "ms" }, + { VapiVoiceLanguage.Sk, "sk" }, + { VapiVoiceLanguage.Da, "da" }, + { VapiVoiceLanguage.Ta, "ta" }, + { VapiVoiceLanguage.Uk, "uk" }, + { VapiVoiceLanguage.Ru, "ru" }, + { VapiVoiceLanguage.Hu, "hu" }, + { VapiVoiceLanguage.No, "no" }, + { VapiVoiceLanguage.Vi, "vi" }, + { VapiVoiceLanguage.Auto, "auto" }, + { VapiVoiceLanguage.En, "en" }, + { VapiVoiceLanguage.Ar, "ar" }, + { VapiVoiceLanguage.ArEg, "ar-EG" }, + { VapiVoiceLanguage.Bn, "bn" }, + { VapiVoiceLanguage.Es, "es" }, + { VapiVoiceLanguage.Fr, "fr" }, + { VapiVoiceLanguage.Gu, "gu" }, + { VapiVoiceLanguage.He, "he" }, + { VapiVoiceLanguage.Ka, "ka" }, + { VapiVoiceLanguage.Kn, "kn" }, + { VapiVoiceLanguage.Ml, "ml" }, + { VapiVoiceLanguage.Mr, "mr" }, + { VapiVoiceLanguage.Pa, "pa" }, + { VapiVoiceLanguage.Pt, "pt" }, + { VapiVoiceLanguage.Te, "te" }, + { VapiVoiceLanguage.Th, "th" }, + { VapiVoiceLanguage.Tl, "tl" }, + }; + + public override VapiVoiceLanguage Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + VapiVoiceLanguage value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override VapiVoiceLanguage ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + VapiVoiceLanguage value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/VapiVoiceVersion.cs b/src/Vapi.Net/Types/VapiVoiceVersion.cs new file mode 100644 index 00000000..1953343a --- /dev/null +++ b/src/Vapi.Net/Types/VapiVoiceVersion.cs @@ -0,0 +1,89 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(VapiVoiceVersionSerializer))] +public enum VapiVoiceVersion +{ + [EnumMember(Value = "1")] + One, + + [EnumMember(Value = "2")] + Two, + + [EnumMember(Value = "latest")] + Latest, +} + +internal class VapiVoiceVersionSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + VapiVoiceVersion + > _stringToEnum = new() + { + { "1", VapiVoiceVersion.One }, + { "2", VapiVoiceVersion.Two }, + { "latest", VapiVoiceVersion.Latest }, + }; + + private static readonly global::System.Collections.Generic.Dictionary< + VapiVoiceVersion, + string + > _enumToString = new() + { + { VapiVoiceVersion.One, "1" }, + { VapiVoiceVersion.Two, "2" }, + { VapiVoiceVersion.Latest, "latest" }, + }; + + public override VapiVoiceVersion Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + VapiVoiceVersion value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override VapiVoiceVersion ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + VapiVoiceVersion value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/VapiVoiceVoiceId.cs b/src/Vapi.Net/Types/VapiVoiceVoiceId.cs index a637f24d..534e1f18 100644 --- a/src/Vapi.Net/Types/VapiVoiceVoiceId.cs +++ b/src/Vapi.Net/Types/VapiVoiceVoiceId.cs @@ -12,6 +12,27 @@ public enum VapiVoiceVoiceId [EnumMember(Value = "Godfrey")] Godfrey, + [EnumMember(Value = "Elliot")] + Elliot, + + [EnumMember(Value = "Savannah")] + Savannah, + + [EnumMember(Value = "Nico")] + Nico, + + [EnumMember(Value = "Kai")] + Kai, + + [EnumMember(Value = "Emma")] + Emma, + + [EnumMember(Value = "Sagar")] + Sagar, + + [EnumMember(Value = "Neil")] + Neil, + [EnumMember(Value = "Layla")] Layla, @@ -21,9 +42,6 @@ public enum VapiVoiceVoiceId [EnumMember(Value = "Gustavo")] Gustavo, - [EnumMember(Value = "Elliot")] - Elliot, - [EnumMember(Value = "Kylie")] Kylie, @@ -33,9 +51,6 @@ public enum VapiVoiceVoiceId [EnumMember(Value = "Lily")] Lily, - [EnumMember(Value = "Savannah")] - Savannah, - [EnumMember(Value = "Hana")] Hana, @@ -54,21 +69,6 @@ public enum VapiVoiceVoiceId [EnumMember(Value = "Spencer")] Spencer, - [EnumMember(Value = "Nico")] - Nico, - - [EnumMember(Value = "Kai")] - Kai, - - [EnumMember(Value = "Emma")] - Emma, - - [EnumMember(Value = "Sagar")] - Sagar, - - [EnumMember(Value = "Neil")] - Neil, - [EnumMember(Value = "Naina")] Naina, @@ -107,25 +107,25 @@ internal class VapiVoiceVoiceIdSerializer { { "Clara", VapiVoiceVoiceId.Clara }, { "Godfrey", VapiVoiceVoiceId.Godfrey }, + { "Elliot", VapiVoiceVoiceId.Elliot }, + { "Savannah", VapiVoiceVoiceId.Savannah }, + { "Nico", VapiVoiceVoiceId.Nico }, + { "Kai", VapiVoiceVoiceId.Kai }, + { "Emma", VapiVoiceVoiceId.Emma }, + { "Sagar", VapiVoiceVoiceId.Sagar }, + { "Neil", VapiVoiceVoiceId.Neil }, { "Layla", VapiVoiceVoiceId.Layla }, { "Sid", VapiVoiceVoiceId.Sid }, { "Gustavo", VapiVoiceVoiceId.Gustavo }, - { "Elliot", VapiVoiceVoiceId.Elliot }, { "Kylie", VapiVoiceVoiceId.Kylie }, { "Rohan", VapiVoiceVoiceId.Rohan }, { "Lily", VapiVoiceVoiceId.Lily }, - { "Savannah", VapiVoiceVoiceId.Savannah }, { "Hana", VapiVoiceVoiceId.Hana }, { "Neha", VapiVoiceVoiceId.Neha }, { "Cole", VapiVoiceVoiceId.Cole }, { "Harry", VapiVoiceVoiceId.Harry }, { "Paige", VapiVoiceVoiceId.Paige }, { "Spencer", VapiVoiceVoiceId.Spencer }, - { "Nico", VapiVoiceVoiceId.Nico }, - { "Kai", VapiVoiceVoiceId.Kai }, - { "Emma", VapiVoiceVoiceId.Emma }, - { "Sagar", VapiVoiceVoiceId.Sagar }, - { "Neil", VapiVoiceVoiceId.Neil }, { "Naina", VapiVoiceVoiceId.Naina }, { "Leah", VapiVoiceVoiceId.Leah }, { "Tara", VapiVoiceVoiceId.Tara }, @@ -144,25 +144,25 @@ internal class VapiVoiceVoiceIdSerializer { { VapiVoiceVoiceId.Clara, "Clara" }, { VapiVoiceVoiceId.Godfrey, "Godfrey" }, + { VapiVoiceVoiceId.Elliot, "Elliot" }, + { VapiVoiceVoiceId.Savannah, "Savannah" }, + { VapiVoiceVoiceId.Nico, "Nico" }, + { VapiVoiceVoiceId.Kai, "Kai" }, + { VapiVoiceVoiceId.Emma, "Emma" }, + { VapiVoiceVoiceId.Sagar, "Sagar" }, + { VapiVoiceVoiceId.Neil, "Neil" }, { VapiVoiceVoiceId.Layla, "Layla" }, { VapiVoiceVoiceId.Sid, "Sid" }, { VapiVoiceVoiceId.Gustavo, "Gustavo" }, - { VapiVoiceVoiceId.Elliot, "Elliot" }, { VapiVoiceVoiceId.Kylie, "Kylie" }, { VapiVoiceVoiceId.Rohan, "Rohan" }, { VapiVoiceVoiceId.Lily, "Lily" }, - { VapiVoiceVoiceId.Savannah, "Savannah" }, { VapiVoiceVoiceId.Hana, "Hana" }, { VapiVoiceVoiceId.Neha, "Neha" }, { VapiVoiceVoiceId.Cole, "Cole" }, { VapiVoiceVoiceId.Harry, "Harry" }, { VapiVoiceVoiceId.Paige, "Paige" }, { VapiVoiceVoiceId.Spencer, "Spencer" }, - { VapiVoiceVoiceId.Nico, "Nico" }, - { VapiVoiceVoiceId.Kai, "Kai" }, - { VapiVoiceVoiceId.Emma, "Emma" }, - { VapiVoiceVoiceId.Sagar, "Sagar" }, - { VapiVoiceVoiceId.Neil, "Neil" }, { VapiVoiceVoiceId.Naina, "Naina" }, { VapiVoiceVoiceId.Leah, "Leah" }, { VapiVoiceVoiceId.Tara, "Tara" }, diff --git a/src/Vapi.Net/Types/VapiVoicemailDetectionPlan.cs b/src/Vapi.Net/Types/VapiVoicemailDetectionPlan.cs index ee401f83..e42d43dd 100644 --- a/src/Vapi.Net/Types/VapiVoicemailDetectionPlan.cs +++ b/src/Vapi.Net/Types/VapiVoicemailDetectionPlan.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Configuration for detecting voicemail with Vapi, including detection type, maximum beep wait, and retry backoff. +/// [Serializable] public record VapiVoicemailDetectionPlan : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/VapiWebCallTransport.cs b/src/Vapi.Net/Types/VapiWebCallTransport.cs new file mode 100644 index 00000000..d48f8b7c --- /dev/null +++ b/src/Vapi.Net/Types/VapiWebCallTransport.cs @@ -0,0 +1,53 @@ +using global::System.Text.Json; +using global::System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[Serializable] +public record VapiWebCallTransport : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + /// + /// This is the conversation type of the call (ie, voice or chat). + /// + [JsonPropertyName("conversationType")] + public VapiWebCallTransportConversationType? ConversationType { get; set; } + + /// + /// This determines whether the daily room will be deleted and all participants will be kicked once the user leaves the room. + /// If set to `false`, the room will be kept alive even after the user leaves, allowing clients to reconnect to the same room. + /// If set to `true`, the room will be deleted and reconnection will not be allowed. + /// + /// Defaults to `true`. + /// + [JsonPropertyName("roomDeleteOnUserLeaveEnabled")] + public bool? RoomDeleteOnUserLeaveEnabled { get; set; } + + /// + /// This is the URL of the web call. + /// + [JsonPropertyName("callUrl")] + public string? CallUrl { get; set; } + + /// + /// This is the SIP URI of the web call. + /// + [JsonPropertyName("callSipUri")] + public string? CallSipUri { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/VapiWebCallTransportConversationType.cs b/src/Vapi.Net/Types/VapiWebCallTransportConversationType.cs new file mode 100644 index 00000000..2b7facfe --- /dev/null +++ b/src/Vapi.Net/Types/VapiWebCallTransportConversationType.cs @@ -0,0 +1,73 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(VapiWebCallTransportConversationTypeSerializer))] +public enum VapiWebCallTransportConversationType +{ + [EnumMember(Value = "voice")] + Voice, +} + +internal class VapiWebCallTransportConversationTypeSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + VapiWebCallTransportConversationType + > _stringToEnum = new() { { "voice", VapiWebCallTransportConversationType.Voice } }; + + private static readonly global::System.Collections.Generic.Dictionary< + VapiWebCallTransportConversationType, + string + > _enumToString = new() { { VapiWebCallTransportConversationType.Voice, "voice" } }; + + public override VapiWebCallTransportConversationType Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + VapiWebCallTransportConversationType value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override VapiWebCallTransportConversationType ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + VapiWebCallTransportConversationType value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/VapiWebsocketTransport.cs b/src/Vapi.Net/Types/VapiWebsocketTransport.cs new file mode 100644 index 00000000..cec3284d --- /dev/null +++ b/src/Vapi.Net/Types/VapiWebsocketTransport.cs @@ -0,0 +1,37 @@ +using global::System.Text.Json; +using global::System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[Serializable] +public record VapiWebsocketTransport : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + /// + /// This is the conversation type of the call (ie, voice or chat). + /// + [JsonPropertyName("conversationType")] + public VapiWebsocketTransportConversationType? ConversationType { get; set; } + + /// + /// This is the audio format of the call. Defaults to 16KHz raw pcm_s16le + /// + [JsonPropertyName("audioFormat")] + public AudioFormat? AudioFormat { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/VapiWebsocketTransportConversationType.cs b/src/Vapi.Net/Types/VapiWebsocketTransportConversationType.cs new file mode 100644 index 00000000..69e37897 --- /dev/null +++ b/src/Vapi.Net/Types/VapiWebsocketTransportConversationType.cs @@ -0,0 +1,73 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(VapiWebsocketTransportConversationTypeSerializer))] +public enum VapiWebsocketTransportConversationType +{ + [EnumMember(Value = "voice")] + Voice, +} + +internal class VapiWebsocketTransportConversationTypeSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + VapiWebsocketTransportConversationType + > _stringToEnum = new() { { "voice", VapiWebsocketTransportConversationType.Voice } }; + + private static readonly global::System.Collections.Generic.Dictionary< + VapiWebsocketTransportConversationType, + string + > _enumToString = new() { { VapiWebsocketTransportConversationType.Voice, "voice" } }; + + public override VapiWebsocketTransportConversationType Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + VapiWebsocketTransportConversationType value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override VapiWebsocketTransportConversationType ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + VapiWebsocketTransportConversationType value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/VariableExtractionAlias.cs b/src/Vapi.Net/Types/VariableExtractionAlias.cs index 438be8d5..c5a6dfc7 100644 --- a/src/Vapi.Net/Types/VariableExtractionAlias.cs +++ b/src/Vapi.Net/Types/VariableExtractionAlias.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Defines an additional Liquid-based variable from values extracted during a call. +/// [Serializable] public record VariableExtractionAlias : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/VariableExtractionPlan.cs b/src/Vapi.Net/Types/VariableExtractionPlan.cs index 74901b8c..e3999a76 100644 --- a/src/Vapi.Net/Types/VariableExtractionPlan.cs +++ b/src/Vapi.Net/Types/VariableExtractionPlan.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Defines structured variables to extract and optional aliases made available during and after a call. +/// [Serializable] public record VariableExtractionPlan : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/VariableValueGroupBy.cs b/src/Vapi.Net/Types/VariableValueGroupBy.cs index 36de5f89..e3a4a853 100644 --- a/src/Vapi.Net/Types/VariableValueGroupBy.cs +++ b/src/Vapi.Net/Types/VariableValueGroupBy.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Groups analytics results by a selected assistant variable-value key. +/// [Serializable] public record VariableValueGroupBy : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/VersionPinConflictResponseDto.cs b/src/Vapi.Net/Types/VersionPinConflictResponseDto.cs new file mode 100644 index 00000000..55f1f8d8 --- /dev/null +++ b/src/Vapi.Net/Types/VersionPinConflictResponseDto.cs @@ -0,0 +1,41 @@ +using global::System.Text.Json; +using global::System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[Serializable] +public record VersionPinConflictResponseDto : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("error")] + public required VersionPinConflictResponseDtoError Error { get; set; } + + /// + /// Human-readable reason the delete was rejected. + /// + [JsonPropertyName("message")] + public required string Message { get; set; } + + /// + /// Pins that block the delete. + /// + [JsonPropertyName("pinnedBy")] + public IEnumerable PinnedBy { get; set; } = + new List(); + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/VersionPinConflictResponseDtoError.cs b/src/Vapi.Net/Types/VersionPinConflictResponseDtoError.cs new file mode 100644 index 00000000..d5e15874 --- /dev/null +++ b/src/Vapi.Net/Types/VersionPinConflictResponseDtoError.cs @@ -0,0 +1,79 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(VersionPinConflictResponseDtoErrorSerializer))] +public enum VersionPinConflictResponseDtoError +{ + [EnumMember(Value = "version_pinned")] + VersionPinned, +} + +internal class VersionPinConflictResponseDtoErrorSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + VersionPinConflictResponseDtoError + > _stringToEnum = new() + { + { "version_pinned", VersionPinConflictResponseDtoError.VersionPinned }, + }; + + private static readonly global::System.Collections.Generic.Dictionary< + VersionPinConflictResponseDtoError, + string + > _enumToString = new() + { + { VersionPinConflictResponseDtoError.VersionPinned, "version_pinned" }, + }; + + public override VersionPinConflictResponseDtoError Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + VersionPinConflictResponseDtoError value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override VersionPinConflictResponseDtoError ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + VersionPinConflictResponseDtoError value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/VersionPinReference.cs b/src/Vapi.Net/Types/VersionPinReference.cs new file mode 100644 index 00000000..930c822c --- /dev/null +++ b/src/Vapi.Net/Types/VersionPinReference.cs @@ -0,0 +1,37 @@ +using global::System.Text.Json; +using global::System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[Serializable] +public record VersionPinReference : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + /// + /// Kind of source row the pin originates from. + /// + [JsonPropertyName("sourceType")] + public required VersionPinReferenceSourceType SourceType { get; set; } + + /// + /// UUID of the source row (polymorphic, not FK-enforced). + /// + [JsonPropertyName("sourceId")] + public required string SourceId { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/VersionPinReferenceSourceType.cs b/src/Vapi.Net/Types/VersionPinReferenceSourceType.cs new file mode 100644 index 00000000..96ce1c78 --- /dev/null +++ b/src/Vapi.Net/Types/VersionPinReferenceSourceType.cs @@ -0,0 +1,89 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(VersionPinReferenceSourceTypeSerializer))] +public enum VersionPinReferenceSourceType +{ + [EnumMember(Value = "assistant_version")] + AssistantVersion, + + [EnumMember(Value = "squad")] + Squad, + + [EnumMember(Value = "tool_version")] + ToolVersion, +} + +internal class VersionPinReferenceSourceTypeSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + VersionPinReferenceSourceType + > _stringToEnum = new() + { + { "assistant_version", VersionPinReferenceSourceType.AssistantVersion }, + { "squad", VersionPinReferenceSourceType.Squad }, + { "tool_version", VersionPinReferenceSourceType.ToolVersion }, + }; + + private static readonly global::System.Collections.Generic.Dictionary< + VersionPinReferenceSourceType, + string + > _enumToString = new() + { + { VersionPinReferenceSourceType.AssistantVersion, "assistant_version" }, + { VersionPinReferenceSourceType.Squad, "squad" }, + { VersionPinReferenceSourceType.ToolVersion, "tool_version" }, + }; + + public override VersionPinReferenceSourceType Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + VersionPinReferenceSourceType value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override VersionPinReferenceSourceType ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + VersionPinReferenceSourceType value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/VoiceCost.cs b/src/Vapi.Net/Types/VoiceCost.cs index 39318248..83a900d9 100644 --- a/src/Vapi.Net/Types/VoiceCost.cs +++ b/src/Vapi.Net/Types/VoiceCost.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Voice-synthesis cost for a call, including voice, character usage, and amount. +/// [Serializable] public record VoiceCost : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/VoiceLibraryVoiceResponse.cs b/src/Vapi.Net/Types/VoiceLibraryVoiceResponse.cs index 0e146e51..45e4daaa 100644 --- a/src/Vapi.Net/Types/VoiceLibraryVoiceResponse.cs +++ b/src/Vapi.Net/Types/VoiceLibraryVoiceResponse.cs @@ -1,5 +1,6 @@ using global::System.Text.Json; using global::System.Text.Json.Serialization; +using OneOf; using Vapi.Net.Core; namespace Vapi.Net; @@ -11,6 +12,9 @@ public record VoiceLibraryVoiceResponse : IJsonOnDeserialized private readonly IDictionary _extensionData = new Dictionary(); + [JsonPropertyName("age")] + public OneOf? Age { get; set; } + [JsonPropertyName("voiceId")] public required string VoiceId { get; set; } @@ -26,9 +30,6 @@ public record VoiceLibraryVoiceResponse : IJsonOnDeserialized [JsonPropertyName("gender")] public string? Gender { get; set; } - [JsonPropertyName("age")] - public object? Age { get; set; } - [JsonPropertyName("accent")] public string? Accent { get; set; } diff --git a/src/Vapi.Net/Types/VoicemailDetectionBackoffPlan.cs b/src/Vapi.Net/Types/VoicemailDetectionBackoffPlan.cs index f90acdf8..57b0d8f9 100644 --- a/src/Vapi.Net/Types/VoicemailDetectionBackoffPlan.cs +++ b/src/Vapi.Net/Types/VoicemailDetectionBackoffPlan.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Controls voicemail-detection retry timing, including when retries start, retry frequency, and maximum attempts. +/// [Serializable] public record VoicemailDetectionBackoffPlan : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/VoicemailDetectionCost.cs b/src/Vapi.Net/Types/VoicemailDetectionCost.cs index 60c2cd4a..f2f13c21 100644 --- a/src/Vapi.Net/Types/VoicemailDetectionCost.cs +++ b/src/Vapi.Net/Types/VoicemailDetectionCost.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Voicemail-detection model cost, including provider, model, multimodal token usage, and amount. +/// [Serializable] public record VoicemailDetectionCost : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/VoicemailTool.cs b/src/Vapi.Net/Types/VoicemailTool.cs index 34697271..e0a38ff8 100644 --- a/src/Vapi.Net/Types/VoicemailTool.cs +++ b/src/Vapi.Net/Types/VoicemailTool.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// A reusable voicemail-detection tool with optional beep detection for supported calls. +/// [Serializable] public record VoicemailTool : IJsonOnDeserialized { @@ -11,10 +14,11 @@ public record VoicemailTool : IJsonOnDeserialized private readonly IDictionary _extensionData = new Dictionary(); + [JsonPropertyName("latestVersion")] + public string? LatestVersion { 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. + /// Messages spoken while the tool is running. Multiple request-start messages are variants. For request-response-delayed, same timing means variants and different timings mean staged updates. /// [JsonPropertyName("messages")] public IEnumerable? Messages { get; set; } diff --git a/src/Vapi.Net/Types/VonagePhoneNumber.cs b/src/Vapi.Net/Types/VonagePhoneNumber.cs index ae065162..49ad9705 100644 --- a/src/Vapi.Net/Types/VonagePhoneNumber.cs +++ b/src/Vapi.Net/Types/VonagePhoneNumber.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// A Vonage phone number connected to Vapi, including its credential, routing, hooks, server settings, and lifecycle metadata. +/// [Serializable] public record VonagePhoneNumber : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/VonageTransport.cs b/src/Vapi.Net/Types/VonageTransport.cs new file mode 100644 index 00000000..e22c4726 --- /dev/null +++ b/src/Vapi.Net/Types/VonageTransport.cs @@ -0,0 +1,43 @@ +using global::System.Text.Json; +using global::System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[Serializable] +public record VonageTransport : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + /// + /// This is the conversation type of the call (ie, voice or chat). + /// + [JsonPropertyName("conversationType")] + public VonageTransportConversationType? ConversationType { get; set; } + + /// + /// This is the conversation UUID of the Vonage call. + /// + [JsonPropertyName("conversationUUID")] + public string? ConversationUuid { get; set; } + + /// + /// This is the call ID of the Vonage call. + /// + [JsonPropertyName("callUUID")] + public string? CallUuid { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/VonageTransportConversationType.cs b/src/Vapi.Net/Types/VonageTransportConversationType.cs new file mode 100644 index 00000000..c8e47984 --- /dev/null +++ b/src/Vapi.Net/Types/VonageTransportConversationType.cs @@ -0,0 +1,73 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(VonageTransportConversationTypeSerializer))] +public enum VonageTransportConversationType +{ + [EnumMember(Value = "voice")] + Voice, +} + +internal class VonageTransportConversationTypeSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + VonageTransportConversationType + > _stringToEnum = new() { { "voice", VonageTransportConversationType.Voice } }; + + private static readonly global::System.Collections.Generic.Dictionary< + VonageTransportConversationType, + string + > _enumToString = new() { { VonageTransportConversationType.Voice, "voice" } }; + + public override VonageTransportConversationType Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + VonageTransportConversationType value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override VonageTransportConversationType ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + VonageTransportConversationType value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/WellSaidVoice.cs b/src/Vapi.Net/Types/WellSaidVoice.cs index a914f2c8..58854d55 100644 --- a/src/Vapi.Net/Types/WellSaidVoice.cs +++ b/src/Vapi.Net/Types/WellSaidVoice.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Configuration for synthesizing assistant speech with WellSaid, including voice and model selection, Speech Synthesis Markup Language support, voice libraries, chunking, caching, and fallback settings. +/// [Serializable] public record WellSaidVoice : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/WorkflowAnthropicBedrockModel.cs b/src/Vapi.Net/Types/WorkflowAnthropicBedrockModel.cs index 009b11c6..0ebff88c 100644 --- a/src/Vapi.Net/Types/WorkflowAnthropicBedrockModel.cs +++ b/src/Vapi.Net/Types/WorkflowAnthropicBedrockModel.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Workflow model configuration for Anthropic through Amazon Bedrock, including model selection, thinking, temperature, and maximum output tokens. +/// [Serializable] public record WorkflowAnthropicBedrockModel : IJsonOnDeserialized { @@ -11,6 +14,21 @@ public record WorkflowAnthropicBedrockModel : IJsonOnDeserialized private readonly IDictionary _extensionData = new Dictionary(); + /// + /// These are the messages used to customize the prompt used for structured output extraction. + /// + /// When provided, these messages replace the default prompts. Message contents support LiquidJS templating with the following variables: + /// - `{{transcript}}` or `{{messages}}` to reference the conversation (one is required) + /// - `{{structuredOutput.name}}`, `{{structuredOutput.description}}`, or `{{structuredOutput.schema}}` to reference the structured output definition (one is required) + /// - `{{systemPrompt}}`, `{{callEndedReason}}`, `{{duration}}`, `{{startedAt}}`, `{{endedAt}}`, and any `assistantOverrides.variableValues` + /// + /// `{{messages}}` is the full message history including tool calls; `{{transcript}}` is the spoken text only, which uses significantly fewer tokens. + /// + /// If not provided, default system and user prompts are used. + /// + [JsonPropertyName("messages")] + public IEnumerable? Messages { get; set; } + /// /// This is the specific model that will be used. /// diff --git a/src/Vapi.Net/Types/WorkflowAnthropicBedrockModelModel.cs b/src/Vapi.Net/Types/WorkflowAnthropicBedrockModelModel.cs index e9801937..f5a2237b 100644 --- a/src/Vapi.Net/Types/WorkflowAnthropicBedrockModelModel.cs +++ b/src/Vapi.Net/Types/WorkflowAnthropicBedrockModelModel.cs @@ -47,6 +47,9 @@ public enum WorkflowAnthropicBedrockModelModel [EnumMember(Value = "claude-haiku-4-5-20251001")] ClaudeHaiku4520251001, + + [EnumMember(Value = "global.anthropic.claude-haiku-4-5-20251001-v1:0")] + GlobalAnthropicClaudeHaiku4520251001V10, } internal class WorkflowAnthropicBedrockModelModelSerializer @@ -71,6 +74,10 @@ internal class WorkflowAnthropicBedrockModelModelSerializer { "claude-sonnet-4-5-20250929", WorkflowAnthropicBedrockModelModel.ClaudeSonnet4520250929 }, { "claude-sonnet-4-6", WorkflowAnthropicBedrockModelModel.ClaudeSonnet46 }, { "claude-haiku-4-5-20251001", WorkflowAnthropicBedrockModelModel.ClaudeHaiku4520251001 }, + { + "global.anthropic.claude-haiku-4-5-20251001-v1:0", + WorkflowAnthropicBedrockModelModel.GlobalAnthropicClaudeHaiku4520251001V10 + }, }; private static readonly global::System.Collections.Generic.Dictionary< @@ -92,6 +99,10 @@ internal class WorkflowAnthropicBedrockModelModelSerializer { WorkflowAnthropicBedrockModelModel.ClaudeSonnet4520250929, "claude-sonnet-4-5-20250929" }, { WorkflowAnthropicBedrockModelModel.ClaudeSonnet46, "claude-sonnet-4-6" }, { WorkflowAnthropicBedrockModelModel.ClaudeHaiku4520251001, "claude-haiku-4-5-20251001" }, + { + WorkflowAnthropicBedrockModelModel.GlobalAnthropicClaudeHaiku4520251001V10, + "global.anthropic.claude-haiku-4-5-20251001-v1:0" + }, }; public override WorkflowAnthropicBedrockModelModel Read( diff --git a/src/Vapi.Net/Types/WorkflowAnthropicModel.cs b/src/Vapi.Net/Types/WorkflowAnthropicModel.cs index 42841034..a6b65a98 100644 --- a/src/Vapi.Net/Types/WorkflowAnthropicModel.cs +++ b/src/Vapi.Net/Types/WorkflowAnthropicModel.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Workflow model configuration for Anthropic, including model selection, thinking, temperature, and maximum output tokens. +/// [Serializable] public record WorkflowAnthropicModel : IJsonOnDeserialized { @@ -11,6 +14,21 @@ public record WorkflowAnthropicModel : IJsonOnDeserialized private readonly IDictionary _extensionData = new Dictionary(); + /// + /// These are the messages used to customize the prompt used for structured output extraction. + /// + /// When provided, these messages replace the default prompts. Message contents support LiquidJS templating with the following variables: + /// - `{{transcript}}` or `{{messages}}` to reference the conversation (one is required) + /// - `{{structuredOutput.name}}`, `{{structuredOutput.description}}`, or `{{structuredOutput.schema}}` to reference the structured output definition (one is required) + /// - `{{systemPrompt}}`, `{{callEndedReason}}`, `{{duration}}`, `{{startedAt}}`, `{{endedAt}}`, and any `assistantOverrides.variableValues` + /// + /// `{{messages}}` is the full message history including tool calls; `{{transcript}}` is the spoken text only, which uses significantly fewer tokens. + /// + /// If not provided, default system and user prompts are used. + /// + [JsonPropertyName("messages")] + public IEnumerable? Messages { get; set; } + /// /// This is the specific model that will be used. /// diff --git a/src/Vapi.Net/Types/WorkflowAnthropicModelModel.cs b/src/Vapi.Net/Types/WorkflowAnthropicModelModel.cs index 56cee44d..10c7d347 100644 --- a/src/Vapi.Net/Types/WorkflowAnthropicModelModel.cs +++ b/src/Vapi.Net/Types/WorkflowAnthropicModelModel.cs @@ -45,6 +45,9 @@ public enum WorkflowAnthropicModelModel [EnumMember(Value = "claude-sonnet-4-6")] ClaudeSonnet46, + [EnumMember(Value = "claude-sonnet-5")] + ClaudeSonnet5, + [EnumMember(Value = "claude-haiku-4-5-20251001")] ClaudeHaiku4520251001, } @@ -70,6 +73,7 @@ internal class WorkflowAnthropicModelModelSerializer { "claude-sonnet-4-20250514", WorkflowAnthropicModelModel.ClaudeSonnet420250514 }, { "claude-sonnet-4-5-20250929", WorkflowAnthropicModelModel.ClaudeSonnet4520250929 }, { "claude-sonnet-4-6", WorkflowAnthropicModelModel.ClaudeSonnet46 }, + { "claude-sonnet-5", WorkflowAnthropicModelModel.ClaudeSonnet5 }, { "claude-haiku-4-5-20251001", WorkflowAnthropicModelModel.ClaudeHaiku4520251001 }, }; @@ -91,6 +95,7 @@ internal class WorkflowAnthropicModelModelSerializer { WorkflowAnthropicModelModel.ClaudeSonnet420250514, "claude-sonnet-4-20250514" }, { WorkflowAnthropicModelModel.ClaudeSonnet4520250929, "claude-sonnet-4-5-20250929" }, { WorkflowAnthropicModelModel.ClaudeSonnet46, "claude-sonnet-4-6" }, + { WorkflowAnthropicModelModel.ClaudeSonnet5, "claude-sonnet-5" }, { WorkflowAnthropicModelModel.ClaudeHaiku4520251001, "claude-haiku-4-5-20251001" }, }; diff --git a/src/Vapi.Net/Types/WorkflowCustomModel.cs b/src/Vapi.Net/Types/WorkflowCustomModel.cs index 89f58349..64ecd783 100644 --- a/src/Vapi.Net/Types/WorkflowCustomModel.cs +++ b/src/Vapi.Net/Types/WorkflowCustomModel.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Workflow model configuration for a custom language model endpoint, including URL, headers, metadata delivery, timeout, model, temperature, and maximum output tokens. +/// [Serializable] public record WorkflowCustomModel : IJsonOnDeserialized { @@ -11,6 +14,21 @@ public record WorkflowCustomModel : IJsonOnDeserialized private readonly IDictionary _extensionData = new Dictionary(); + /// + /// These are the messages used to customize the prompt used for structured output extraction. + /// + /// When provided, these messages replace the default prompts. Message contents support LiquidJS templating with the following variables: + /// - `{{transcript}}` or `{{messages}}` to reference the conversation (one is required) + /// - `{{structuredOutput.name}}`, `{{structuredOutput.description}}`, or `{{structuredOutput.schema}}` to reference the structured output definition (one is required) + /// - `{{systemPrompt}}`, `{{callEndedReason}}`, `{{duration}}`, `{{startedAt}}`, `{{endedAt}}`, and any `assistantOverrides.variableValues` + /// + /// `{{messages}}` is the full message history including tool calls; `{{transcript}}` is the spoken text only, which uses significantly fewer tokens. + /// + /// If not provided, default system and user prompts are used. + /// + [JsonPropertyName("messages")] + public IEnumerable? Messages { get; set; } + /// /// This determines whether metadata is sent in requests to the custom provider. /// diff --git a/src/Vapi.Net/Types/WorkflowGoogleModel.cs b/src/Vapi.Net/Types/WorkflowGoogleModel.cs index 8b047751..05153686 100644 --- a/src/Vapi.Net/Types/WorkflowGoogleModel.cs +++ b/src/Vapi.Net/Types/WorkflowGoogleModel.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Workflow model configuration for Google, including model selection, temperature, and maximum output tokens. +/// [Serializable] public record WorkflowGoogleModel : IJsonOnDeserialized { @@ -11,6 +14,21 @@ public record WorkflowGoogleModel : IJsonOnDeserialized private readonly IDictionary _extensionData = new Dictionary(); + /// + /// These are the messages used to customize the prompt used for structured output extraction. + /// + /// When provided, these messages replace the default prompts. Message contents support LiquidJS templating with the following variables: + /// - `{{transcript}}` or `{{messages}}` to reference the conversation (one is required) + /// - `{{structuredOutput.name}}`, `{{structuredOutput.description}}`, or `{{structuredOutput.schema}}` to reference the structured output definition (one is required) + /// - `{{systemPrompt}}`, `{{callEndedReason}}`, `{{duration}}`, `{{startedAt}}`, `{{endedAt}}`, and any `assistantOverrides.variableValues` + /// + /// `{{messages}}` is the full message history including tool calls; `{{transcript}}` is the spoken text only, which uses significantly fewer tokens. + /// + /// If not provided, default system and user prompts are used. + /// + [JsonPropertyName("messages")] + public IEnumerable? Messages { get; set; } + /// /// This is the name of the model. Ex. cognitivecomputations/dolphin-mixtral-8x7b /// diff --git a/src/Vapi.Net/Types/WorkflowGoogleModelModel.cs b/src/Vapi.Net/Types/WorkflowGoogleModelModel.cs index c1ea7d5b..161cbbd9 100644 --- a/src/Vapi.Net/Types/WorkflowGoogleModelModel.cs +++ b/src/Vapi.Net/Types/WorkflowGoogleModelModel.cs @@ -6,6 +6,12 @@ namespace Vapi.Net; [JsonConverter(typeof(WorkflowGoogleModelModelSerializer))] public enum WorkflowGoogleModelModel { + [EnumMember(Value = "gemini-3.5-flash")] + Gemini35Flash, + + [EnumMember(Value = "gemini-3.1-flash-lite")] + Gemini31FlashLite, + [EnumMember(Value = "gemini-3-flash-preview")] Gemini3FlashPreview, @@ -60,6 +66,8 @@ internal class WorkflowGoogleModelModelSerializer WorkflowGoogleModelModel > _stringToEnum = new() { + { "gemini-3.5-flash", WorkflowGoogleModelModel.Gemini35Flash }, + { "gemini-3.1-flash-lite", WorkflowGoogleModelModel.Gemini31FlashLite }, { "gemini-3-flash-preview", WorkflowGoogleModelModel.Gemini3FlashPreview }, { "gemini-2.5-pro", WorkflowGoogleModelModel.Gemini25Pro }, { "gemini-2.5-flash", WorkflowGoogleModelModel.Gemini25Flash }, @@ -82,6 +90,8 @@ internal class WorkflowGoogleModelModelSerializer string > _enumToString = new() { + { WorkflowGoogleModelModel.Gemini35Flash, "gemini-3.5-flash" }, + { WorkflowGoogleModelModel.Gemini31FlashLite, "gemini-3.1-flash-lite" }, { WorkflowGoogleModelModel.Gemini3FlashPreview, "gemini-3-flash-preview" }, { WorkflowGoogleModelModel.Gemini25Pro, "gemini-2.5-pro" }, { WorkflowGoogleModelModel.Gemini25Flash, "gemini-2.5-flash" }, diff --git a/src/Vapi.Net/Types/WorkflowOpenAiModel.cs b/src/Vapi.Net/Types/WorkflowOpenAiModel.cs index c9bc9476..e3c1d06b 100644 --- a/src/Vapi.Net/Types/WorkflowOpenAiModel.cs +++ b/src/Vapi.Net/Types/WorkflowOpenAiModel.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Workflow model configuration for OpenAI, including model selection, temperature, and maximum output tokens. +/// [Serializable] public record WorkflowOpenAiModel : IJsonOnDeserialized { @@ -11,6 +14,21 @@ public record WorkflowOpenAiModel : IJsonOnDeserialized private readonly IDictionary _extensionData = new Dictionary(); + /// + /// These are the messages used to customize the prompt used for structured output extraction. + /// + /// When provided, these messages replace the default prompts. Message contents support LiquidJS templating with the following variables: + /// - `{{transcript}}` or `{{messages}}` to reference the conversation (one is required) + /// - `{{structuredOutput.name}}`, `{{structuredOutput.description}}`, or `{{structuredOutput.schema}}` to reference the structured output definition (one is required) + /// - `{{systemPrompt}}`, `{{callEndedReason}}`, `{{duration}}`, `{{startedAt}}`, `{{endedAt}}`, and any `assistantOverrides.variableValues` + /// + /// `{{messages}}` is the full message history including tool calls; `{{transcript}}` is the spoken text only, which uses significantly fewer tokens. + /// + /// If not provided, default system and user prompts are used. + /// + [JsonPropertyName("messages")] + public IEnumerable? Messages { get; set; } + /// /// This is the OpenAI model that will be used. /// diff --git a/src/Vapi.Net/Types/WorkflowOpenAiModelModel.cs b/src/Vapi.Net/Types/WorkflowOpenAiModelModel.cs index 5c11e92d..2c921ba2 100644 --- a/src/Vapi.Net/Types/WorkflowOpenAiModelModel.cs +++ b/src/Vapi.Net/Types/WorkflowOpenAiModelModel.cs @@ -6,6 +6,21 @@ namespace Vapi.Net; [JsonConverter(typeof(WorkflowOpenAiModelModelSerializer))] public enum WorkflowOpenAiModelModel { + [EnumMember(Value = "gpt-5.6-sol")] + Gpt56Sol, + + [EnumMember(Value = "gpt-5.6-terra")] + Gpt56Terra, + + [EnumMember(Value = "gpt-5.6-luna")] + Gpt56Luna, + + [EnumMember(Value = "gpt-5.5")] + Gpt55, + + [EnumMember(Value = "chat-latest")] + ChatLatest, + [EnumMember(Value = "gpt-5.4")] Gpt54, @@ -344,6 +359,15 @@ public enum WorkflowOpenAiModelModel [EnumMember(Value = "gpt-3.5-turbo-1106:westus")] Gpt35Turbo1106Westus, + + [EnumMember(Value = "gpt-4.1:australiaeast")] + Gpt41Australiaeast, + + [EnumMember(Value = "gpt-4o:australiaeast")] + Gpt4OAustraliaeast, + + [EnumMember(Value = "gpt-5.4-mini:australiaeast")] + Gpt54MiniAustraliaeast, } internal class WorkflowOpenAiModelModelSerializer @@ -354,6 +378,11 @@ internal class WorkflowOpenAiModelModelSerializer WorkflowOpenAiModelModel > _stringToEnum = new() { + { "gpt-5.6-sol", WorkflowOpenAiModelModel.Gpt56Sol }, + { "gpt-5.6-terra", WorkflowOpenAiModelModel.Gpt56Terra }, + { "gpt-5.6-luna", WorkflowOpenAiModelModel.Gpt56Luna }, + { "gpt-5.5", WorkflowOpenAiModelModel.Gpt55 }, + { "chat-latest", WorkflowOpenAiModelModel.ChatLatest }, { "gpt-5.4", WorkflowOpenAiModelModel.Gpt54 }, { "gpt-5.4-mini", WorkflowOpenAiModelModel.Gpt54Mini }, { "gpt-5.4-nano", WorkflowOpenAiModelModel.Gpt54Nano }, @@ -542,6 +571,9 @@ internal class WorkflowOpenAiModelModelSerializer }, { "gpt-3.5-turbo-1106:canadaeast", WorkflowOpenAiModelModel.Gpt35Turbo1106Canadaeast }, { "gpt-3.5-turbo-1106:westus", WorkflowOpenAiModelModel.Gpt35Turbo1106Westus }, + { "gpt-4.1:australiaeast", WorkflowOpenAiModelModel.Gpt41Australiaeast }, + { "gpt-4o:australiaeast", WorkflowOpenAiModelModel.Gpt4OAustraliaeast }, + { "gpt-5.4-mini:australiaeast", WorkflowOpenAiModelModel.Gpt54MiniAustraliaeast }, }; private static readonly global::System.Collections.Generic.Dictionary< @@ -549,6 +581,11 @@ internal class WorkflowOpenAiModelModelSerializer string > _enumToString = new() { + { WorkflowOpenAiModelModel.Gpt56Sol, "gpt-5.6-sol" }, + { WorkflowOpenAiModelModel.Gpt56Terra, "gpt-5.6-terra" }, + { WorkflowOpenAiModelModel.Gpt56Luna, "gpt-5.6-luna" }, + { WorkflowOpenAiModelModel.Gpt55, "gpt-5.5" }, + { WorkflowOpenAiModelModel.ChatLatest, "chat-latest" }, { WorkflowOpenAiModelModel.Gpt54, "gpt-5.4" }, { WorkflowOpenAiModelModel.Gpt54Mini, "gpt-5.4-mini" }, { WorkflowOpenAiModelModel.Gpt54Nano, "gpt-5.4-nano" }, @@ -737,6 +774,9 @@ internal class WorkflowOpenAiModelModelSerializer }, { WorkflowOpenAiModelModel.Gpt35Turbo1106Canadaeast, "gpt-3.5-turbo-1106:canadaeast" }, { WorkflowOpenAiModelModel.Gpt35Turbo1106Westus, "gpt-3.5-turbo-1106:westus" }, + { WorkflowOpenAiModelModel.Gpt41Australiaeast, "gpt-4.1:australiaeast" }, + { WorkflowOpenAiModelModel.Gpt4OAustraliaeast, "gpt-4o:australiaeast" }, + { WorkflowOpenAiModelModel.Gpt54MiniAustraliaeast, "gpt-5.4-mini:australiaeast" }, }; public override WorkflowOpenAiModelModel Read( diff --git a/src/Vapi.Net/Types/WorkflowOverrides.cs b/src/Vapi.Net/Types/WorkflowOverrides.cs index 32fbb046..82cbc8fc 100644 --- a/src/Vapi.Net/Types/WorkflowOverrides.cs +++ b/src/Vapi.Net/Types/WorkflowOverrides.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Per-call overrides for values used in workflow template variables. +/// [Serializable] public record WorkflowOverrides : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Types/XaiModel.cs b/src/Vapi.Net/Types/XaiModel.cs index 9880ef4c..b39d8065 100644 --- a/src/Vapi.Net/Types/XaiModel.cs +++ b/src/Vapi.Net/Types/XaiModel.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Configuration for generating assistant responses with xAI, including model, prompts, tools, knowledge-base access, and generation settings. +/// [Serializable] public record XaiModel : IJsonOnDeserialized { @@ -33,6 +36,15 @@ public record XaiModel : IJsonOnDeserialized [JsonPropertyName("toolIds")] public IEnumerable? ToolIds { get; set; } + /// + /// These are version-pinned references to tools. Each entry pins a specific + /// version of a tool by `(toolId, version)`. When the same `toolId` appears + /// in both `toolIds` and `toolRefs[]`, the `toolRefs` pin wins (the + /// `toolIds` entry is dropped at write time). + /// + [JsonPropertyName("toolRefs")] + public IEnumerable? ToolRefs { get; set; } + /// /// These are the options for the knowledge base. /// @@ -46,7 +58,7 @@ public record XaiModel : IJsonOnDeserialized 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. + /// This is the temperature that will be used for calls. Default is 0.5. /// [JsonPropertyName("temperature")] public double? Temperature { get; set; } diff --git a/src/Vapi.Net/Types/XaiModelModel.cs b/src/Vapi.Net/Types/XaiModelModel.cs index e7137e16..7d87e1a0 100644 --- a/src/Vapi.Net/Types/XaiModelModel.cs +++ b/src/Vapi.Net/Types/XaiModelModel.cs @@ -20,6 +20,15 @@ public enum XaiModelModel [EnumMember(Value = "grok-4-fast-non-reasoning")] Grok4FastNonReasoning, + + [EnumMember(Value = "grok-4.20-0309-reasoning")] + Grok4200309Reasoning, + + [EnumMember(Value = "grok-4.20-0309-non-reasoning")] + Grok4200309NonReasoning, + + [EnumMember(Value = "grok-4.3")] + Grok43, } internal class XaiModelModelSerializer @@ -35,6 +44,9 @@ internal class XaiModelModelSerializer { "grok-3", XaiModelModel.Grok3 }, { "grok-4-fast-reasoning", XaiModelModel.Grok4FastReasoning }, { "grok-4-fast-non-reasoning", XaiModelModel.Grok4FastNonReasoning }, + { "grok-4.20-0309-reasoning", XaiModelModel.Grok4200309Reasoning }, + { "grok-4.20-0309-non-reasoning", XaiModelModel.Grok4200309NonReasoning }, + { "grok-4.3", XaiModelModel.Grok43 }, }; private static readonly global::System.Collections.Generic.Dictionary< @@ -47,6 +59,9 @@ internal class XaiModelModelSerializer { XaiModelModel.Grok3, "grok-3" }, { XaiModelModel.Grok4FastReasoning, "grok-4-fast-reasoning" }, { XaiModelModel.Grok4FastNonReasoning, "grok-4-fast-non-reasoning" }, + { XaiModelModel.Grok4200309Reasoning, "grok-4.20-0309-reasoning" }, + { XaiModelModel.Grok4200309NonReasoning, "grok-4.20-0309-non-reasoning" }, + { XaiModelModel.Grok43, "grok-4.3" }, }; public override XaiModelModel Read( diff --git a/src/Vapi.Net/Types/XaiTranscriber.cs b/src/Vapi.Net/Types/XaiTranscriber.cs new file mode 100644 index 00000000..c793b005 --- /dev/null +++ b/src/Vapi.Net/Types/XaiTranscriber.cs @@ -0,0 +1,43 @@ +using global::System.Text.Json; +using global::System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[Serializable] +public record XaiTranscriber : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + /// + /// The xAI speech-to-text model to use. xAI currently exposes a single STT model — placeholder for future model selection. + /// + [JsonPropertyName("model")] + public XaiTranscriberModel? Model { get; set; } + + /// + /// Single language for transcription as an ISO 639-1 code (e.g., `en`, `es`). Defaults to `en` if not set. xAI auto-detects when omitted via the API but Vapi defaults to English for deterministic behavior. + /// + [JsonPropertyName("language")] + public XaiTranscriberLanguage? Language { get; set; } + + /// + /// This is the plan for transcriber provider fallbacks in the event that the primary transcriber provider fails. + /// + [JsonPropertyName("fallbackPlan")] + public FallbackTranscriberPlan? FallbackPlan { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/XaiTranscriberLanguage.cs b/src/Vapi.Net/Types/XaiTranscriberLanguage.cs new file mode 100644 index 00000000..8e8658f0 --- /dev/null +++ b/src/Vapi.Net/Types/XaiTranscriberLanguage.cs @@ -0,0 +1,199 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(XaiTranscriberLanguageSerializer))] +public enum XaiTranscriberLanguage +{ + [EnumMember(Value = "ar")] + Ar, + + [EnumMember(Value = "cs")] + Cs, + + [EnumMember(Value = "da")] + Da, + + [EnumMember(Value = "nl")] + Nl, + + [EnumMember(Value = "en")] + En, + + [EnumMember(Value = "fil")] + Fil, + + [EnumMember(Value = "fr")] + Fr, + + [EnumMember(Value = "de")] + De, + + [EnumMember(Value = "hi")] + Hi, + + [EnumMember(Value = "id")] + Id, + + [EnumMember(Value = "it")] + It, + + [EnumMember(Value = "ja")] + Ja, + + [EnumMember(Value = "ko")] + Ko, + + [EnumMember(Value = "mk")] + Mk, + + [EnumMember(Value = "ms")] + Ms, + + [EnumMember(Value = "fa")] + Fa, + + [EnumMember(Value = "pl")] + Pl, + + [EnumMember(Value = "pt")] + Pt, + + [EnumMember(Value = "ro")] + Ro, + + [EnumMember(Value = "ru")] + Ru, + + [EnumMember(Value = "es")] + Es, + + [EnumMember(Value = "sv")] + Sv, + + [EnumMember(Value = "th")] + Th, + + [EnumMember(Value = "tr")] + Tr, + + [EnumMember(Value = "vi")] + Vi, +} + +internal class XaiTranscriberLanguageSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + XaiTranscriberLanguage + > _stringToEnum = new() + { + { "ar", XaiTranscriberLanguage.Ar }, + { "cs", XaiTranscriberLanguage.Cs }, + { "da", XaiTranscriberLanguage.Da }, + { "nl", XaiTranscriberLanguage.Nl }, + { "en", XaiTranscriberLanguage.En }, + { "fil", XaiTranscriberLanguage.Fil }, + { "fr", XaiTranscriberLanguage.Fr }, + { "de", XaiTranscriberLanguage.De }, + { "hi", XaiTranscriberLanguage.Hi }, + { "id", XaiTranscriberLanguage.Id }, + { "it", XaiTranscriberLanguage.It }, + { "ja", XaiTranscriberLanguage.Ja }, + { "ko", XaiTranscriberLanguage.Ko }, + { "mk", XaiTranscriberLanguage.Mk }, + { "ms", XaiTranscriberLanguage.Ms }, + { "fa", XaiTranscriberLanguage.Fa }, + { "pl", XaiTranscriberLanguage.Pl }, + { "pt", XaiTranscriberLanguage.Pt }, + { "ro", XaiTranscriberLanguage.Ro }, + { "ru", XaiTranscriberLanguage.Ru }, + { "es", XaiTranscriberLanguage.Es }, + { "sv", XaiTranscriberLanguage.Sv }, + { "th", XaiTranscriberLanguage.Th }, + { "tr", XaiTranscriberLanguage.Tr }, + { "vi", XaiTranscriberLanguage.Vi }, + }; + + private static readonly global::System.Collections.Generic.Dictionary< + XaiTranscriberLanguage, + string + > _enumToString = new() + { + { XaiTranscriberLanguage.Ar, "ar" }, + { XaiTranscriberLanguage.Cs, "cs" }, + { XaiTranscriberLanguage.Da, "da" }, + { XaiTranscriberLanguage.Nl, "nl" }, + { XaiTranscriberLanguage.En, "en" }, + { XaiTranscriberLanguage.Fil, "fil" }, + { XaiTranscriberLanguage.Fr, "fr" }, + { XaiTranscriberLanguage.De, "de" }, + { XaiTranscriberLanguage.Hi, "hi" }, + { XaiTranscriberLanguage.Id, "id" }, + { XaiTranscriberLanguage.It, "it" }, + { XaiTranscriberLanguage.Ja, "ja" }, + { XaiTranscriberLanguage.Ko, "ko" }, + { XaiTranscriberLanguage.Mk, "mk" }, + { XaiTranscriberLanguage.Ms, "ms" }, + { XaiTranscriberLanguage.Fa, "fa" }, + { XaiTranscriberLanguage.Pl, "pl" }, + { XaiTranscriberLanguage.Pt, "pt" }, + { XaiTranscriberLanguage.Ro, "ro" }, + { XaiTranscriberLanguage.Ru, "ru" }, + { XaiTranscriberLanguage.Es, "es" }, + { XaiTranscriberLanguage.Sv, "sv" }, + { XaiTranscriberLanguage.Th, "th" }, + { XaiTranscriberLanguage.Tr, "tr" }, + { XaiTranscriberLanguage.Vi, "vi" }, + }; + + public override XaiTranscriberLanguage Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + XaiTranscriberLanguage value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override XaiTranscriberLanguage ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + XaiTranscriberLanguage value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/XaiTranscriberModel.cs b/src/Vapi.Net/Types/XaiTranscriberModel.cs new file mode 100644 index 00000000..44712b8d --- /dev/null +++ b/src/Vapi.Net/Types/XaiTranscriberModel.cs @@ -0,0 +1,73 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(XaiTranscriberModelSerializer))] +public enum XaiTranscriberModel +{ + [EnumMember(Value = "default")] + Default, +} + +internal class XaiTranscriberModelSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + XaiTranscriberModel + > _stringToEnum = new() { { "default", XaiTranscriberModel.Default } }; + + private static readonly global::System.Collections.Generic.Dictionary< + XaiTranscriberModel, + string + > _enumToString = new() { { XaiTranscriberModel.Default, "default" } }; + + public override XaiTranscriberModel Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + XaiTranscriberModel value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override XaiTranscriberModel ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + XaiTranscriberModel value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/XaiVoice.cs b/src/Vapi.Net/Types/XaiVoice.cs new file mode 100644 index 00000000..56d90e71 --- /dev/null +++ b/src/Vapi.Net/Types/XaiVoice.cs @@ -0,0 +1,61 @@ +using global::System.Text.Json; +using global::System.Text.Json.Serialization; +using Vapi.Net.Core; + +namespace Vapi.Net; + +[Serializable] +public record XaiVoice : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + /// + /// This is the flag to toggle voice caching for the assistant. + /// + [JsonPropertyName("cachingEnabled")] + public bool? CachingEnabled { get; set; } + + /// + /// Built-in voices: eve, ara, rex, sal, leo. Cloned voice IDs are also accepted. + /// + [JsonPropertyName("voiceId")] + public required XaiVoiceVoiceId VoiceId { get; set; } + + /// + /// BCP-47 language code for xAI TTS synthesis. + /// + [JsonPropertyName("language")] + public XaiVoiceLanguage? Language { get; set; } + + /// + /// Speed multiplier for xAI TTS synthesis. + /// + [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; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/Vapi.Net/Types/XaiVoiceLanguage.cs b/src/Vapi.Net/Types/XaiVoiceLanguage.cs new file mode 100644 index 00000000..73ad54fb --- /dev/null +++ b/src/Vapi.Net/Types/XaiVoiceLanguage.cs @@ -0,0 +1,179 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(XaiVoiceLanguageSerializer))] +public enum XaiVoiceLanguage +{ + [EnumMember(Value = "auto")] + Auto, + + [EnumMember(Value = "en")] + En, + + [EnumMember(Value = "ar-EG")] + ArEg, + + [EnumMember(Value = "ar-SA")] + ArSa, + + [EnumMember(Value = "ar-AE")] + ArAe, + + [EnumMember(Value = "bn")] + Bn, + + [EnumMember(Value = "zh")] + Zh, + + [EnumMember(Value = "fr")] + Fr, + + [EnumMember(Value = "de")] + De, + + [EnumMember(Value = "hi")] + Hi, + + [EnumMember(Value = "id")] + Id, + + [EnumMember(Value = "it")] + It, + + [EnumMember(Value = "ja")] + Ja, + + [EnumMember(Value = "ko")] + Ko, + + [EnumMember(Value = "pt-BR")] + PtBr, + + [EnumMember(Value = "pt-PT")] + PtPt, + + [EnumMember(Value = "ru")] + Ru, + + [EnumMember(Value = "es-MX")] + EsMx, + + [EnumMember(Value = "es-ES")] + EsEs, + + [EnumMember(Value = "tr")] + Tr, + + [EnumMember(Value = "vi")] + Vi, +} + +internal class XaiVoiceLanguageSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + XaiVoiceLanguage + > _stringToEnum = new() + { + { "auto", XaiVoiceLanguage.Auto }, + { "en", XaiVoiceLanguage.En }, + { "ar-EG", XaiVoiceLanguage.ArEg }, + { "ar-SA", XaiVoiceLanguage.ArSa }, + { "ar-AE", XaiVoiceLanguage.ArAe }, + { "bn", XaiVoiceLanguage.Bn }, + { "zh", XaiVoiceLanguage.Zh }, + { "fr", XaiVoiceLanguage.Fr }, + { "de", XaiVoiceLanguage.De }, + { "hi", XaiVoiceLanguage.Hi }, + { "id", XaiVoiceLanguage.Id }, + { "it", XaiVoiceLanguage.It }, + { "ja", XaiVoiceLanguage.Ja }, + { "ko", XaiVoiceLanguage.Ko }, + { "pt-BR", XaiVoiceLanguage.PtBr }, + { "pt-PT", XaiVoiceLanguage.PtPt }, + { "ru", XaiVoiceLanguage.Ru }, + { "es-MX", XaiVoiceLanguage.EsMx }, + { "es-ES", XaiVoiceLanguage.EsEs }, + { "tr", XaiVoiceLanguage.Tr }, + { "vi", XaiVoiceLanguage.Vi }, + }; + + private static readonly global::System.Collections.Generic.Dictionary< + XaiVoiceLanguage, + string + > _enumToString = new() + { + { XaiVoiceLanguage.Auto, "auto" }, + { XaiVoiceLanguage.En, "en" }, + { XaiVoiceLanguage.ArEg, "ar-EG" }, + { XaiVoiceLanguage.ArSa, "ar-SA" }, + { XaiVoiceLanguage.ArAe, "ar-AE" }, + { XaiVoiceLanguage.Bn, "bn" }, + { XaiVoiceLanguage.Zh, "zh" }, + { XaiVoiceLanguage.Fr, "fr" }, + { XaiVoiceLanguage.De, "de" }, + { XaiVoiceLanguage.Hi, "hi" }, + { XaiVoiceLanguage.Id, "id" }, + { XaiVoiceLanguage.It, "it" }, + { XaiVoiceLanguage.Ja, "ja" }, + { XaiVoiceLanguage.Ko, "ko" }, + { XaiVoiceLanguage.PtBr, "pt-BR" }, + { XaiVoiceLanguage.PtPt, "pt-PT" }, + { XaiVoiceLanguage.Ru, "ru" }, + { XaiVoiceLanguage.EsMx, "es-MX" }, + { XaiVoiceLanguage.EsEs, "es-ES" }, + { XaiVoiceLanguage.Tr, "tr" }, + { XaiVoiceLanguage.Vi, "vi" }, + }; + + public override XaiVoiceLanguage Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + XaiVoiceLanguage value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override XaiVoiceLanguage ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + XaiVoiceLanguage value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/XaiVoiceVoiceId.cs b/src/Vapi.Net/Types/XaiVoiceVoiceId.cs new file mode 100644 index 00000000..93d8fd42 --- /dev/null +++ b/src/Vapi.Net/Types/XaiVoiceVoiceId.cs @@ -0,0 +1,99 @@ +using global::System.Runtime.Serialization; +using global::System.Text.Json.Serialization; + +namespace Vapi.Net; + +[JsonConverter(typeof(XaiVoiceVoiceIdSerializer))] +public enum XaiVoiceVoiceId +{ + [EnumMember(Value = "eve")] + Eve, + + [EnumMember(Value = "ara")] + Ara, + + [EnumMember(Value = "rex")] + Rex, + + [EnumMember(Value = "sal")] + Sal, + + [EnumMember(Value = "leo")] + Leo, +} + +internal class XaiVoiceVoiceIdSerializer + : global::System.Text.Json.Serialization.JsonConverter +{ + private static readonly global::System.Collections.Generic.Dictionary< + string, + XaiVoiceVoiceId + > _stringToEnum = new() + { + { "eve", XaiVoiceVoiceId.Eve }, + { "ara", XaiVoiceVoiceId.Ara }, + { "rex", XaiVoiceVoiceId.Rex }, + { "sal", XaiVoiceVoiceId.Sal }, + { "leo", XaiVoiceVoiceId.Leo }, + }; + + private static readonly global::System.Collections.Generic.Dictionary< + XaiVoiceVoiceId, + string + > _enumToString = new() + { + { XaiVoiceVoiceId.Eve, "eve" }, + { XaiVoiceVoiceId.Ara, "ara" }, + { XaiVoiceVoiceId.Rex, "rex" }, + { XaiVoiceVoiceId.Sal, "sal" }, + { XaiVoiceVoiceId.Leo, "leo" }, + }; + + public override XaiVoiceVoiceId Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + XaiVoiceVoiceId value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WriteStringValue( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : null + ); + } + + public override XaiVoiceVoiceId ReadAsPropertyName( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void WriteAsPropertyName( + global::System.Text.Json.Utf8JsonWriter writer, + XaiVoiceVoiceId value, + global::System.Text.Json.JsonSerializerOptions options + ) + { + writer.WritePropertyName( + _enumToString.TryGetValue(value, out var stringValue) ? stringValue : value.ToString() + ); + } +} diff --git a/src/Vapi.Net/Types/XssSecurityFilter.cs b/src/Vapi.Net/Types/XssSecurityFilter.cs index e56cc583..fee7cff0 100644 --- a/src/Vapi.Net/Types/XssSecurityFilter.cs +++ b/src/Vapi.Net/Types/XssSecurityFilter.cs @@ -4,6 +4,9 @@ namespace Vapi.Net; +/// +/// Filters potential cross-site scripting (XSS) patterns from transcripts. +/// [Serializable] public record XssSecurityFilter : IJsonOnDeserialized { diff --git a/src/Vapi.Net/Vapi.Net.csproj b/src/Vapi.Net/Vapi.Net.csproj index 61b5c86b..b6831bde 100644 --- a/src/Vapi.Net/Vapi.Net.csproj +++ b/src/Vapi.Net/Vapi.Net.csproj @@ -4,7 +4,7 @@ enable 12 enable - 2.0.0 + 0.0.0-fern-placeholder $(Version) $(Version) README.md diff --git a/src/Vapi.Net/VapiClient.cs b/src/Vapi.Net/VapiClient.cs index 11614919..8cec5aed 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/2.0.0" }, + { "User-Agent", "Vapi.Net/0.0.0-fern-placeholder" }, } ); foreach (var header in platformHeaders) @@ -45,6 +45,7 @@ public VapiClient(string? token = null, ClientOptions? clientOptions = null) Files = new FilesClient(_client); StructuredOutputs = new StructuredOutputsClient(_client); Insight = new InsightClient(_client); + Board = new BoardClient(_client); Eval = new EvalClient(_client); ObservabilityScorecard = new ObservabilityScorecardClient(_client); ProviderResources = new ProviderResourcesClient(_client); @@ -73,6 +74,8 @@ public VapiClient(string? token = null, ClientOptions? clientOptions = null) public IInsightClient Insight { get; } + public IBoardClient Board { get; } + public IEvalClient Eval { get; } public IObservabilityScorecardClient ObservabilityScorecard { get; } From c071127bd03310330fdfd6aba5105535ea716548 Mon Sep 17 00:00:00 2001 From: "fern-api[bot]" <115122769+fern-api[bot]@users.noreply.github.com> Date: Fri, 31 Jul 2026 22:05:31 +0000 Subject: [PATCH 2/4] [fern-autoversion] SDK regeneration MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 🌿 Generated with Fern --- .fern/metadata.json | 2 +- src/Vapi.Net/Core/Public/Version.cs | 2 +- src/Vapi.Net/Vapi.Net.csproj | 2 +- src/Vapi.Net/VapiClient.cs | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.fern/metadata.json b/.fern/metadata.json index 24ad03f3..8c66732d 100644 --- a/.fern/metadata.json +++ b/.fern/metadata.json @@ -17,5 +17,5 @@ "invokedBy": "ci", "requestedVersion": "AUTO", "ciProvider": "unknown", - "sdkVersion": "0.0.0-fern-placeholder" + "sdkVersion": "2.0.1" } \ No newline at end of file diff --git a/src/Vapi.Net/Core/Public/Version.cs b/src/Vapi.Net/Core/Public/Version.cs index 38406f35..1685a0dd 100644 --- a/src/Vapi.Net/Core/Public/Version.cs +++ b/src/Vapi.Net/Core/Public/Version.cs @@ -3,5 +3,5 @@ namespace Vapi.Net; [Serializable] internal class Version { - public const string Current = "0.0.0-fern-placeholder"; + public const string Current = "2.0.1"; } diff --git a/src/Vapi.Net/Vapi.Net.csproj b/src/Vapi.Net/Vapi.Net.csproj index b6831bde..3d5ad0c9 100644 --- a/src/Vapi.Net/Vapi.Net.csproj +++ b/src/Vapi.Net/Vapi.Net.csproj @@ -4,7 +4,7 @@ enable 12 enable - 0.0.0-fern-placeholder + 2.0.1 $(Version) $(Version) README.md diff --git a/src/Vapi.Net/VapiClient.cs b/src/Vapi.Net/VapiClient.cs index 8cec5aed..772d2b91 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.0.0-fern-placeholder" }, + { "User-Agent", "Vapi.Net/2.0.1" }, } ); foreach (var header in platformHeaders) From a4ea7aeeb778ee23b85305c3f82e4c8c4209bc69 Mon Sep 17 00:00:00 2001 From: "fern-api[bot]" <115122769+fern-api[bot]@users.noreply.github.com> Date: Fri, 31 Jul 2026 22:05:31 +0000 Subject: [PATCH 3/4] [fern-replay] advance lockfile --- .fern/replay.lock | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.fern/replay.lock b/.fern/replay.lock index 50d73420..9f61eb7f 100644 --- a/.fern/replay.lock +++ b/.fern/replay.lock @@ -6,5 +6,11 @@ generations: timestamp: 2026-07-31T22:04:24.075Z cli_version: unknown generator_versions: {} -current_generation: 6ee2f1cc74dd9f71a5250dc543072a20fe241e05 + - commit_sha: 310ba8e9fcff679183cdabe7de39e306e8d09429 + tree_hash: 6722479915136b06a3dbd38adcfec7db3b5333ff + timestamp: 2026-07-31T22:04:25.366Z + cli_version: unknown + generator_versions: + fernapi/fern-csharp-sdk: 2.58.0 +current_generation: 310ba8e9fcff679183cdabe7de39e306e8d09429 patches: [] From 7b3181d34ce2c08453745b75ee503a8ab1671f06 Mon Sep 17 00:00:00 2001 From: "fern-api[bot]" <115122769+fern-api[bot]@users.noreply.github.com> Date: Fri, 31 Jul 2026 22:05:31 +0000 Subject: [PATCH 4/4] SDK regeneration MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 🌿 Generated with Fern --- changelog.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/changelog.md b/changelog.md index c0fd9841..bc2bacde 100644 --- a/changelog.md +++ b/changelog.md @@ -1,3 +1,5 @@ +## [2.0.1] - 2026-07-31 + ## 2.0.0 - 2026-06-24 ### Breaking Changes * **`CartesiaExperimentalControlsSpeedZero`** has been renamed to **`CartesiaSpeedControlZero`**; update all references and the type argument in `CartesiaExperimentalControls.Speed` (`OneOf?`).