From 24a5b70bc8b7bc66a6493fb1ae1938c579980455 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 12 Nov 2024 15:22:00 +0000 Subject: [PATCH] feat: Updated OpenAPI spec --- ...umentFileStudioV1ChatFilesConvertPost.g.cs | 103 ++++++++++-- ...onnectedUsersOrganizationIdTokensPost.g.cs | 107 +++++++++--- ...ationIdDataSourcesDataSourceStatusGet.g.cs | 107 +++++++++--- ...ctedUsersOrganizationIdDataSourcesGet.g.cs | 107 +++++++++--- .../AI21.Ai21Api.V1ConversationalRag.g.cs | 107 +++++++++--- src/libs/AI21/Generated/AI21.Ai21Api.g.cs | 14 ++ .../AI21.ChatClient.V1J2UltraChat.g.cs | 107 +++++++++--- src/libs/AI21/Generated/AI21.ChatClient.g.cs | 5 + ...1.CompletionClient.V1J2GrandeComplete.g.cs | 103 ++++++++++-- ...nClient.V1J2GrandeCustomModelComplete.g.cs | 103 ++++++++++-- ...tionClient.V1J2GrandeInstructComplete.g.cs | 103 ++++++++++-- ...21.CompletionClient.V1J2JumboComplete.g.cs | 103 ++++++++++-- ...1.CompletionClient.V1J2JumboComplete2.g.cs | 103 ++++++++++-- ...etionClient.V1J2JumboInstructComplete.g.cs | 103 ++++++++++-- ...21.CompletionClient.V1J2LargeComplete.g.cs | 103 ++++++++++-- ...onClient.V1J2LargeCustomModelComplete.g.cs | 103 ++++++++++-- ...etionClient.V1J2LargeInstructComplete.g.cs | 103 ++++++++++-- ...21.CompletionClient.V1J2LightComplete.g.cs | 103 ++++++++++-- ...onClient.V1J2LightCustomModelComplete.g.cs | 103 ++++++++++-- ...AI21.CompletionClient.V1J2MidComplete.g.cs | 103 ++++++++++-- ...tionClient.V1J2MidCustomModelComplete.g.cs | 103 ++++++++++-- ...21.CompletionClient.V1J2UltraComplete.g.cs | 103 ++++++++++-- ...1.CompletionClient.V1J2UltraComplete2.g.cs | 103 ++++++++++-- .../AI21/Generated/AI21.CompletionClient.g.cs | 5 + ...ustomModelsClient.V1CreateCustomModel.g.cs | 103 ++++++++++-- ...ustomModelsClient.V1DeleteCustomModel.g.cs | 103 ++++++++++-- ...1.CustomModelsClient.V1GetCustomModel.g.cs | 103 ++++++++++-- ....CustomModelsClient.V1GetCustomModels.g.cs | 103 ++++++++++-- ...ustomModelsClient.V1UpdateCustomModel.g.cs | 103 ++++++++++-- .../Generated/AI21.CustomModelsClient.g.cs | 5 + src/libs/AI21/Generated/AI21.Exceptions.g.cs | 90 ++++++++++ ...umentFileStudioV1ChatFilesConvertPost.g.cs | 2 +- ...onnectedUsersOrganizationIdTokensPost.g.cs | 2 +- ...ationIdDataSourcesDataSourceStatusGet.g.cs | 2 +- ...ctedUsersOrganizationIdDataSourcesGet.g.cs | 2 +- .../AI21.IAi21Api.V1ConversationalRag.g.cs | 2 +- src/libs/AI21/Generated/AI21.IAi21Api.g.cs | 6 + .../AI21.IChatClient.V1J2UltraChat.g.cs | 2 +- src/libs/AI21/Generated/AI21.IChatClient.g.cs | 6 + ....ICompletionClient.V1J2GrandeComplete.g.cs | 2 +- ...nClient.V1J2GrandeCustomModelComplete.g.cs | 2 +- ...tionClient.V1J2GrandeInstructComplete.g.cs | 2 +- ...1.ICompletionClient.V1J2JumboComplete.g.cs | 2 +- ....ICompletionClient.V1J2JumboComplete2.g.cs | 2 +- ...etionClient.V1J2JumboInstructComplete.g.cs | 2 +- ...1.ICompletionClient.V1J2LargeComplete.g.cs | 2 +- ...onClient.V1J2LargeCustomModelComplete.g.cs | 2 +- ...etionClient.V1J2LargeInstructComplete.g.cs | 2 +- ...1.ICompletionClient.V1J2LightComplete.g.cs | 2 +- ...onClient.V1J2LightCustomModelComplete.g.cs | 2 +- ...I21.ICompletionClient.V1J2MidComplete.g.cs | 2 +- ...tionClient.V1J2MidCustomModelComplete.g.cs | 2 +- ...1.ICompletionClient.V1J2UltraComplete.g.cs | 2 +- ....ICompletionClient.V1J2UltraComplete2.g.cs | 2 +- .../Generated/AI21.ICompletionClient.g.cs | 6 + ...ustomModelsClient.V1CreateCustomModel.g.cs | 2 +- ...ustomModelsClient.V1DeleteCustomModel.g.cs | 2 +- ....ICustomModelsClient.V1GetCustomModel.g.cs | 2 +- ...ICustomModelsClient.V1GetCustomModels.g.cs | 2 +- ...ustomModelsClient.V1UpdateCustomModel.g.cs | 2 +- .../Generated/AI21.ICustomModelsClient.g.cs | 6 + ...1.IJambaCompleteClient.V1ChatComplete.g.cs | 2 +- .../Generated/AI21.IJambaCompleteClient.g.cs | 6 + ...braryManagementClient.V1LibraryDelete.g.cs | 2 +- ...yManagementClient.V1LibraryManagement.g.cs | 2 +- ...ManagementClient.V1LibraryManagement2.g.cs | 2 +- ...ManagementClient.V1LibraryManagement3.g.cs | 2 +- ...braryManagementClient.V1LibraryUpload.g.cs | 2 +- .../AI21.ILibraryManagementClient.g.cs | 6 + .../AI21.IParaphraseClient.V1Paraphraze.g.cs | 2 +- .../Generated/AI21.IParaphraseClient.g.cs | 6 + ...AI21.IRAGEngineClient.V1LibraryAnswer.g.cs | 2 +- ....IRAGEngineClient.V1LibraryManagement.g.cs | 2 +- ...AI21.IRAGEngineClient.V1LibrarySearch.g.cs | 2 +- .../AI21/Generated/AI21.IRAGEngineClient.g.cs | 6 + ...21.ISegmentationClient.V1Segmentation.g.cs | 2 +- .../Generated/AI21.ISegmentationClient.g.cs | 6 + .../AI21.ISummarizeClient.V1Summarize.g.cs | 2 +- ...ISummarizeClient.V1SummarizeBySegment.g.cs | 2 +- .../AI21/Generated/AI21.ISummarizeClient.g.cs | 6 + ...21.JambaCompleteClient.V1ChatComplete.g.cs | 107 +++++++++--- .../Generated/AI21.JambaCompleteClient.g.cs | 5 + ...braryManagementClient.V1LibraryDelete.g.cs | 107 +++++++++--- ...yManagementClient.V1LibraryManagement.g.cs | 107 +++++++++--- ...ManagementClient.V1LibraryManagement2.g.cs | 107 +++++++++--- ...ManagementClient.V1LibraryManagement3.g.cs | 103 ++++++++++-- ...braryManagementClient.V1LibraryUpload.g.cs | 107 +++++++++--- .../AI21.LibraryManagementClient.g.cs | 5 + .../AI21.Models.AssistantMessage.Json.g.cs | 92 +++++++++++ .../AI21.Models.AssistantMessage.g.cs | 103 +++--------- ...FileStudioV1ChatFilesConvertPost.Json.g.cs | 92 +++++++++++ ...umentFileStudioV1ChatFilesConvertPost.g.cs | 85 +--------- .../AI21.Models.BodyV1LibraryUpload.Json.g.cs | 92 +++++++++++ .../AI21.Models.BodyV1LibraryUpload.g.cs | 100 +++--------- .../AI21.Models.ChatCompletion.Json.g.cs | 92 +++++++++++ .../Generated/AI21.Models.ChatCompletion.g.cs | 100 +++--------- .../AI21.Models.ChatCompletionMeta.Json.g.cs | 92 +++++++++++ .../AI21.Models.ChatCompletionMeta.g.cs | 86 +--------- ...els.ChatCompletionResponseChoice.Json.g.cs | 92 +++++++++++ ...1.Models.ChatCompletionResponseChoice.g.cs | 103 +++--------- ...hatCompletionResponseDeltaChoice.Json.g.cs | 92 +++++++++++ ...els.ChatCompletionResponseDeltaChoice.g.cs | 106 ++++-------- ...atCompletionVllmStreamingMessage.Json.g.cs | 92 +++++++++++ ...ls.ChatCompletionVllmStreamingMessage.g.cs | 100 +++--------- ...mpletionVllmStreamingMessageMeta.Json.g.cs | 92 +++++++++++ ...hatCompletionVllmStreamingMessageMeta.g.cs | 86 +--------- .../AI21.Models.ChatMessage.Json.g.cs | 92 +++++++++++ .../Generated/AI21.Models.ChatMessage.g.cs | 90 ++-------- .../AI21.Models.ChatOutput.Json.g.cs | 92 +++++++++++ .../Generated/AI21.Models.ChatOutput.g.cs | 93 ++--------- .../AI21.Models.ChatResponse.Json.g.cs | 92 +++++++++++ .../Generated/AI21.Models.ChatResponse.g.cs | 92 ++--------- ...Models.ChatStreamingContentDelta.Json.g.cs | 92 +++++++++++ ...AI21.Models.ChatStreamingContentDelta.g.cs | 85 +--------- ...1.Models.ChatStreamingFirstDelta.Json.g.cs | 92 +++++++++++ .../AI21.Models.ChatStreamingFirstDelta.g.cs | 96 +++-------- .../AI21.Models.ComparisonOperator.Json.g.cs | 92 +++++++++++ .../AI21.Models.ComparisonOperator.g.cs | 86 +--------- .../AI21.Models.CompletionBody.Json.g.cs | 92 +++++++++++ .../Generated/AI21.Models.CompletionBody.g.cs | 138 +++++++--------- ...1.Models.CompletionBodyLogitBias.Json.g.cs | 92 +++++++++++ .../AI21.Models.CompletionBodyLogitBias.g.cs | 86 +--------- ...I21.Models.ConnectorsDataSources.Json.g.cs | 92 +++++++++++ .../AI21.Models.ConnectorsDataSources.g.cs | 85 +--------- .../AI21.Models.ConnectorsStatus.Json.g.cs | 92 +++++++++++ .../AI21.Models.ConnectorsStatus.g.cs | 96 +++-------- .../AI21.Models.ConnectorsToken.Json.g.cs | 92 +++++++++++ .../AI21.Models.ConnectorsToken.g.cs | 85 +--------- ...1.Models.ConversationalRagConfig.Json.g.cs | 92 +++++++++++ .../AI21.Models.ConversationalRagConfig.g.cs | 119 +++++--------- ...1.Models.ConversationalRagResult.Json.g.cs | 92 +++++++++++ .../AI21.Models.ConversationalRagResult.g.cs | 104 +++--------- ...1.Models.ConversationalRagSource.Json.g.cs | 92 +++++++++++ .../AI21.Models.ConversationalRagSource.g.cs | 103 +++--------- ...ioV1ChatFilesConvertPostResponse.Json.g.cs | 92 +++++++++++ ...eStudioV1ChatFilesConvertPostResponse.g.cs | 86 +--------- .../AI21.Models.CustomModelInput.Json.g.cs | 92 +++++++++++ .../AI21.Models.CustomModelInput.g.cs | 99 +++-------- ...I21.Models.CustomModelUpdateBody.Json.g.cs | 92 +++++++++++ .../AI21.Models.CustomModelUpdateBody.g.cs | 85 +--------- .../AI21.Models.DataSourceMetadata.Json.g.cs | 92 +++++++++++ .../AI21.Models.DataSourceMetadata.g.cs | 97 +++-------- .../AI21.Models.DocumentSchema.Json.g.cs | 92 +++++++++++ .../Generated/AI21.Models.DocumentSchema.g.cs | 95 ++--------- ...21.Models.DocumentSchemaMetadata.Json.g.cs | 92 +++++++++++ .../AI21.Models.DocumentSchemaMetadata.g.cs | 86 +--------- .../AI21.Models.FileDeleteResponse.Json.g.cs | 92 +++++++++++ .../AI21.Models.FileDeleteResponse.g.cs | 94 ++--------- .../AI21.Models.FileResponse.Json.g.cs | 92 +++++++++++ .../Generated/AI21.Models.FileResponse.g.cs | 154 +++++++++--------- .../AI21.Models.FileUploadResponse.Json.g.cs | 92 +++++++++++ .../AI21.Models.FileUploadResponse.g.cs | 96 +++-------- .../AI21.Models.FilesUpdateRequest.Json.g.cs | 92 +++++++++++ .../AI21.Models.FilesUpdateRequest.g.cs | 95 ++--------- .../AI21.Models.FinishReason.Json.g.cs | 92 +++++++++++ .../Generated/AI21.Models.FinishReason.g.cs | 91 ++--------- ...21.Models.FunctionToolDefinition.Json.g.cs | 92 +++++++++++ .../AI21.Models.FunctionToolDefinition.g.cs | 91 ++--------- .../AI21.Models.HTTPValidationError.Json.g.cs | 92 +++++++++++ .../AI21.Models.HTTPValidationError.g.cs | 85 +--------- .../Generated/AI21.Models.Highlight.Json.g.cs | 92 +++++++++++ .../AI21/Generated/AI21.Models.Highlight.g.cs | 91 ++--------- ...piServerDataTypesChatChatRequest.Json.g.cs | 92 +++++++++++ ...udioApiServerDataTypesChatChatRequest.g.cs | 135 +++++++-------- ...tChatRequestMessageDiscriminator.Json.g.cs | 92 +++++++++++ ...esChatChatRequestMessageDiscriminator.g.cs | 85 +--------- ...ServerDataTypesJ2ChatChatRequest.Json.g.cs | 92 +++++++++++ ...ioApiServerDataTypesJ2ChatChatRequest.g.cs | 132 +++++++-------- ...AI21.Models.LibraryAnswerRequest.Json.g.cs | 92 +++++++++++ .../AI21.Models.LibraryAnswerRequest.g.cs | 126 ++++++-------- ...I21.Models.LibraryAnswerResponse.Json.g.cs | 92 +++++++++++ .../AI21.Models.LibraryAnswerResponse.g.cs | 98 +++-------- ...AI21.Models.LibrarySearchRequest.Json.g.cs | 92 +++++++++++ .../AI21.Models.LibrarySearchRequest.g.cs | 121 +++++--------- ...I21.Models.LibrarySearchResponse.Json.g.cs | 92 +++++++++++ .../AI21.Models.LibrarySearchResponse.g.cs | 92 ++--------- .../AI21.Models.LibrarySearchResult.Json.g.cs | 92 +++++++++++ .../AI21.Models.LibrarySearchResult.g.cs | 103 +++--------- .../AI21.Models.LogicalOperator.Json.g.cs | 92 +++++++++++ .../AI21.Models.LogicalOperator.g.cs | 86 +--------- .../AI21.Models.LogicalOperatorItem.Json.g.cs | 92 +++++++++++ .../AI21.Models.LogicalOperatorItem.g.cs | 86 +--------- .../Generated/AI21.Models.Logprobs.Json.g.cs | 92 +++++++++++ .../AI21/Generated/AI21.Models.Logprobs.g.cs | 85 +--------- .../AI21.Models.LogprobsData.Json.g.cs | 92 +++++++++++ .../Generated/AI21.Models.LogprobsData.g.cs | 91 ++--------- .../Generated/AI21.Models.Message.Json.g.cs | 92 +++++++++++ .../AI21/Generated/AI21.Models.Message.g.cs | 99 +++-------- .../AI21.Models.MessagesItem.Json.g.cs | 92 +++++++++++ .../Generated/AI21.Models.MessagesItem.g.cs | 91 +---------- .../AI21.Models.MockResponseConfig.Json.g.cs | 92 +++++++++++ .../AI21.Models.MockResponseConfig.g.cs | 92 ++--------- .../AI21.Models.ParaphraseBody.Json.g.cs | 92 +++++++++++ .../Generated/AI21.Models.ParaphraseBody.g.cs | 98 +++-------- .../Generated/AI21.Models.Penalty.Json.g.cs | 92 +++++++++++ .../AI21/Generated/AI21.Models.Penalty.g.cs | 110 ++++--------- .../AI21.Models.QueryFilter.Json.g.cs | 92 +++++++++++ .../Generated/AI21.Models.QueryFilter.g.cs | 91 +---------- .../AI21.Models.QueryFilterVariant3.Json.g.cs | 92 +++++++++++ .../AI21.Models.QueryFilterVariant3.g.cs | 86 +--------- .../AI21.Models.ResponseFormat.Json.g.cs | 92 +++++++++++ .../Generated/AI21.Models.ResponseFormat.g.cs | 85 +--------- .../Generated/AI21.Models.Segment.Json.g.cs | 92 +++++++++++ .../AI21/Generated/AI21.Models.Segment.g.cs | 88 ++-------- .../AI21.Models.SegmentSummary.Json.g.cs | 92 +++++++++++ .../Generated/AI21.Models.SegmentSummary.g.cs | 100 +++--------- .../AI21.Models.SegmentationBody.Json.g.cs | 92 +++++++++++ .../AI21.Models.SegmentationBody.g.cs | 90 ++-------- ...AI21.Models.SegmentationResponse.Json.g.cs | 92 +++++++++++ .../AI21.Models.SegmentationResponse.g.cs | 92 ++--------- ...AI21.Models.SegmentedSummaryBody.Json.g.cs | 92 +++++++++++ .../AI21.Models.SegmentedSummaryBody.g.cs | 93 ++--------- .../AI21.Models.SourceDocument.Json.g.cs | 92 +++++++++++ .../Generated/AI21.Models.SourceDocument.g.cs | 97 +++-------- ...I21.Models.SummarizationResponse.Json.g.cs | 92 +++++++++++ .../AI21.Models.SummarizationResponse.g.cs | 92 ++--------- .../AI21.Models.SummarizeBody.Json.g.cs | 92 +++++++++++ .../Generated/AI21.Models.SummarizeBody.g.cs | 98 +++-------- ...odels.SummarizeBySegmentResponse.Json.g.cs | 92 +++++++++++ ...I21.Models.SummarizeBySegmentResponse.g.cs | 92 ++--------- .../AI21.Models.SystemMessage.Json.g.cs | 92 +++++++++++ .../Generated/AI21.Models.SystemMessage.g.cs | 100 +++--------- .../Generated/AI21.Models.ToolCall.Json.g.cs | 92 +++++++++++ .../AI21/Generated/AI21.Models.ToolCall.g.cs | 97 +++-------- .../AI21.Models.ToolDefinition.Json.g.cs | 92 +++++++++++ .../Generated/AI21.Models.ToolDefinition.g.cs | 88 ++-------- .../AI21.Models.ToolFunction.Json.g.cs | 92 +++++++++++ .../Generated/AI21.Models.ToolFunction.g.cs | 88 ++-------- .../AI21.Models.ToolMessage.Json.g.cs | 92 +++++++++++ .../Generated/AI21.Models.ToolMessage.g.cs | 103 +++--------- .../AI21.Models.ToolParameters.Json.g.cs | 92 +++++++++++ .../Generated/AI21.Models.ToolParameters.g.cs | 96 +++-------- ....Models.ToolParametersProperties.Json.g.cs | 92 +++++++++++ .../AI21.Models.ToolParametersProperties.g.cs | 86 +--------- .../AI21.Models.TopLogprobsData.Json.g.cs | 92 +++++++++++ .../AI21.Models.TopLogprobsData.g.cs | 88 ++-------- .../Generated/AI21.Models.UsageInfo.Json.g.cs | 92 +++++++++++ .../AI21/Generated/AI21.Models.UsageInfo.g.cs | 101 +++--------- .../AI21.Models.UserMessage.Json.g.cs | 92 +++++++++++ .../Generated/AI21.Models.UserMessage.g.cs | 100 +++--------- ...dels.V1CreateCustomModelResponse.Json.g.cs | 92 +++++++++++ ...21.Models.V1CreateCustomModelResponse.g.cs | 86 +--------- ...dels.V1DeleteCustomModelResponse.Json.g.cs | 92 +++++++++++ ...21.Models.V1DeleteCustomModelResponse.g.cs | 86 +--------- ....Models.V1GetCustomModelResponse.Json.g.cs | 92 +++++++++++ .../AI21.Models.V1GetCustomModelResponse.g.cs | 86 +--------- ...Models.V1GetCustomModelsResponse.Json.g.cs | 92 +++++++++++ ...AI21.Models.V1GetCustomModelsResponse.g.cs | 86 +--------- ...odels.V1J2GrandeCompleteResponse.Json.g.cs | 92 +++++++++++ ...I21.Models.V1J2GrandeCompleteResponse.g.cs | 86 +--------- ...randeCustomModelCompleteResponse.Json.g.cs | 92 +++++++++++ ...V1J2GrandeCustomModelCompleteResponse.g.cs | 86 +--------- ...J2GrandeInstructCompleteResponse.Json.g.cs | 92 +++++++++++ ...ls.V1J2GrandeInstructCompleteResponse.g.cs | 86 +--------- ...Models.V1J2JumboCompleteResponse.Json.g.cs | 92 +++++++++++ ...AI21.Models.V1J2JumboCompleteResponse.g.cs | 86 +--------- ...odels.V1J2JumboCompleteResponse2.Json.g.cs | 92 +++++++++++ ...I21.Models.V1J2JumboCompleteResponse2.g.cs | 86 +--------- ...1J2JumboInstructCompleteResponse.Json.g.cs | 92 +++++++++++ ...els.V1J2JumboInstructCompleteResponse.g.cs | 86 +--------- ...Models.V1J2LargeCompleteResponse.Json.g.cs | 92 +++++++++++ ...AI21.Models.V1J2LargeCompleteResponse.g.cs | 86 +--------- ...LargeCustomModelCompleteResponse.Json.g.cs | 92 +++++++++++ ....V1J2LargeCustomModelCompleteResponse.g.cs | 86 +--------- ...1J2LargeInstructCompleteResponse.Json.g.cs | 92 +++++++++++ ...els.V1J2LargeInstructCompleteResponse.g.cs | 86 +--------- ...Models.V1J2LightCompleteResponse.Json.g.cs | 92 +++++++++++ ...AI21.Models.V1J2LightCompleteResponse.g.cs | 86 +--------- ...LightCustomModelCompleteResponse.Json.g.cs | 92 +++++++++++ ....V1J2LightCustomModelCompleteResponse.g.cs | 86 +--------- ...1.Models.V1J2MidCompleteResponse.Json.g.cs | 92 +++++++++++ .../AI21.Models.V1J2MidCompleteResponse.g.cs | 86 +--------- ...J2MidCustomModelCompleteResponse.Json.g.cs | 92 +++++++++++ ...ls.V1J2MidCustomModelCompleteResponse.g.cs | 86 +--------- ...Models.V1J2UltraCompleteResponse.Json.g.cs | 92 +++++++++++ ...AI21.Models.V1J2UltraCompleteResponse.g.cs | 86 +--------- ...odels.V1J2UltraCompleteResponse2.Json.g.cs | 92 +++++++++++ ...I21.Models.V1J2UltraCompleteResponse2.g.cs | 86 +--------- ...dels.V1LibraryManagementResponse.Json.g.cs | 92 +++++++++++ ...21.Models.V1LibraryManagementResponse.g.cs | 86 +--------- ...AI21.Models.V1ParaphrazeResponse.Json.g.cs | 92 +++++++++++ .../AI21.Models.V1ParaphrazeResponse.g.cs | 86 +--------- ...dels.V1UpdateCustomModelResponse.Json.g.cs | 92 +++++++++++ ...21.Models.V1UpdateCustomModelResponse.g.cs | 86 +--------- .../AI21.Models.ValidationError.Json.g.cs | 92 +++++++++++ .../AI21.Models.ValidationError.g.cs | 91 ++--------- .../AI21.ParaphraseClient.V1Paraphraze.g.cs | 103 ++++++++++-- .../AI21/Generated/AI21.ParaphraseClient.g.cs | 5 + src/libs/AI21/Generated/AI21.PathBuilder.g.cs | 14 +- src/libs/AI21/Generated/AI21.Polyfills.g.cs | 2 +- .../AI21.RAGEngineClient.V1LibraryAnswer.g.cs | 107 +++++++++--- ...1.RAGEngineClient.V1LibraryManagement.g.cs | 103 ++++++++++-- .../AI21.RAGEngineClient.V1LibrarySearch.g.cs | 107 +++++++++--- .../AI21/Generated/AI21.RAGEngineClient.g.cs | 5 + ...I21.SegmentationClient.V1Segmentation.g.cs | 107 +++++++++--- .../Generated/AI21.SegmentationClient.g.cs | 5 + .../AI21.SummarizeClient.V1Summarize.g.cs | 107 +++++++++--- ....SummarizeClient.V1SummarizeBySegment.g.cs | 107 +++++++++--- .../AI21/Generated/AI21.SummarizeClient.g.cs | 5 + src/libs/AI21/Generated/AnyOf.2.Json.g.cs | 92 +++++++++++ src/libs/AI21/Generated/AnyOf.2.g.cs | 91 +---------- 301 files changed, 14374 insertions(+), 8633 deletions(-) create mode 100644 src/libs/AI21/Generated/AI21.Exceptions.g.cs create mode 100644 src/libs/AI21/Generated/AI21.Models.AssistantMessage.Json.g.cs create mode 100644 src/libs/AI21/Generated/AI21.Models.BodyConvertDocumentFileStudioV1ChatFilesConvertPost.Json.g.cs create mode 100644 src/libs/AI21/Generated/AI21.Models.BodyV1LibraryUpload.Json.g.cs create mode 100644 src/libs/AI21/Generated/AI21.Models.ChatCompletion.Json.g.cs create mode 100644 src/libs/AI21/Generated/AI21.Models.ChatCompletionMeta.Json.g.cs create mode 100644 src/libs/AI21/Generated/AI21.Models.ChatCompletionResponseChoice.Json.g.cs create mode 100644 src/libs/AI21/Generated/AI21.Models.ChatCompletionResponseDeltaChoice.Json.g.cs create mode 100644 src/libs/AI21/Generated/AI21.Models.ChatCompletionVllmStreamingMessage.Json.g.cs create mode 100644 src/libs/AI21/Generated/AI21.Models.ChatCompletionVllmStreamingMessageMeta.Json.g.cs create mode 100644 src/libs/AI21/Generated/AI21.Models.ChatMessage.Json.g.cs create mode 100644 src/libs/AI21/Generated/AI21.Models.ChatOutput.Json.g.cs create mode 100644 src/libs/AI21/Generated/AI21.Models.ChatResponse.Json.g.cs create mode 100644 src/libs/AI21/Generated/AI21.Models.ChatStreamingContentDelta.Json.g.cs create mode 100644 src/libs/AI21/Generated/AI21.Models.ChatStreamingFirstDelta.Json.g.cs create mode 100644 src/libs/AI21/Generated/AI21.Models.ComparisonOperator.Json.g.cs create mode 100644 src/libs/AI21/Generated/AI21.Models.CompletionBody.Json.g.cs create mode 100644 src/libs/AI21/Generated/AI21.Models.CompletionBodyLogitBias.Json.g.cs create mode 100644 src/libs/AI21/Generated/AI21.Models.ConnectorsDataSources.Json.g.cs create mode 100644 src/libs/AI21/Generated/AI21.Models.ConnectorsStatus.Json.g.cs create mode 100644 src/libs/AI21/Generated/AI21.Models.ConnectorsToken.Json.g.cs create mode 100644 src/libs/AI21/Generated/AI21.Models.ConversationalRagConfig.Json.g.cs create mode 100644 src/libs/AI21/Generated/AI21.Models.ConversationalRagResult.Json.g.cs create mode 100644 src/libs/AI21/Generated/AI21.Models.ConversationalRagSource.Json.g.cs create mode 100644 src/libs/AI21/Generated/AI21.Models.ConvertDocumentFileStudioV1ChatFilesConvertPostResponse.Json.g.cs create mode 100644 src/libs/AI21/Generated/AI21.Models.CustomModelInput.Json.g.cs create mode 100644 src/libs/AI21/Generated/AI21.Models.CustomModelUpdateBody.Json.g.cs create mode 100644 src/libs/AI21/Generated/AI21.Models.DataSourceMetadata.Json.g.cs create mode 100644 src/libs/AI21/Generated/AI21.Models.DocumentSchema.Json.g.cs create mode 100644 src/libs/AI21/Generated/AI21.Models.DocumentSchemaMetadata.Json.g.cs create mode 100644 src/libs/AI21/Generated/AI21.Models.FileDeleteResponse.Json.g.cs create mode 100644 src/libs/AI21/Generated/AI21.Models.FileResponse.Json.g.cs create mode 100644 src/libs/AI21/Generated/AI21.Models.FileUploadResponse.Json.g.cs create mode 100644 src/libs/AI21/Generated/AI21.Models.FilesUpdateRequest.Json.g.cs create mode 100644 src/libs/AI21/Generated/AI21.Models.FinishReason.Json.g.cs create mode 100644 src/libs/AI21/Generated/AI21.Models.FunctionToolDefinition.Json.g.cs create mode 100644 src/libs/AI21/Generated/AI21.Models.HTTPValidationError.Json.g.cs create mode 100644 src/libs/AI21/Generated/AI21.Models.Highlight.Json.g.cs create mode 100644 src/libs/AI21/Generated/AI21.Models.LanguageStudioApiServerDataTypesChatChatRequest.Json.g.cs create mode 100644 src/libs/AI21/Generated/AI21.Models.LanguageStudioApiServerDataTypesChatChatRequestMessageDiscriminator.Json.g.cs create mode 100644 src/libs/AI21/Generated/AI21.Models.LanguageStudioApiServerDataTypesJ2ChatChatRequest.Json.g.cs create mode 100644 src/libs/AI21/Generated/AI21.Models.LibraryAnswerRequest.Json.g.cs create mode 100644 src/libs/AI21/Generated/AI21.Models.LibraryAnswerResponse.Json.g.cs create mode 100644 src/libs/AI21/Generated/AI21.Models.LibrarySearchRequest.Json.g.cs create mode 100644 src/libs/AI21/Generated/AI21.Models.LibrarySearchResponse.Json.g.cs create mode 100644 src/libs/AI21/Generated/AI21.Models.LibrarySearchResult.Json.g.cs create mode 100644 src/libs/AI21/Generated/AI21.Models.LogicalOperator.Json.g.cs create mode 100644 src/libs/AI21/Generated/AI21.Models.LogicalOperatorItem.Json.g.cs create mode 100644 src/libs/AI21/Generated/AI21.Models.Logprobs.Json.g.cs create mode 100644 src/libs/AI21/Generated/AI21.Models.LogprobsData.Json.g.cs create mode 100644 src/libs/AI21/Generated/AI21.Models.Message.Json.g.cs create mode 100644 src/libs/AI21/Generated/AI21.Models.MessagesItem.Json.g.cs create mode 100644 src/libs/AI21/Generated/AI21.Models.MockResponseConfig.Json.g.cs create mode 100644 src/libs/AI21/Generated/AI21.Models.ParaphraseBody.Json.g.cs create mode 100644 src/libs/AI21/Generated/AI21.Models.Penalty.Json.g.cs create mode 100644 src/libs/AI21/Generated/AI21.Models.QueryFilter.Json.g.cs create mode 100644 src/libs/AI21/Generated/AI21.Models.QueryFilterVariant3.Json.g.cs create mode 100644 src/libs/AI21/Generated/AI21.Models.ResponseFormat.Json.g.cs create mode 100644 src/libs/AI21/Generated/AI21.Models.Segment.Json.g.cs create mode 100644 src/libs/AI21/Generated/AI21.Models.SegmentSummary.Json.g.cs create mode 100644 src/libs/AI21/Generated/AI21.Models.SegmentationBody.Json.g.cs create mode 100644 src/libs/AI21/Generated/AI21.Models.SegmentationResponse.Json.g.cs create mode 100644 src/libs/AI21/Generated/AI21.Models.SegmentedSummaryBody.Json.g.cs create mode 100644 src/libs/AI21/Generated/AI21.Models.SourceDocument.Json.g.cs create mode 100644 src/libs/AI21/Generated/AI21.Models.SummarizationResponse.Json.g.cs create mode 100644 src/libs/AI21/Generated/AI21.Models.SummarizeBody.Json.g.cs create mode 100644 src/libs/AI21/Generated/AI21.Models.SummarizeBySegmentResponse.Json.g.cs create mode 100644 src/libs/AI21/Generated/AI21.Models.SystemMessage.Json.g.cs create mode 100644 src/libs/AI21/Generated/AI21.Models.ToolCall.Json.g.cs create mode 100644 src/libs/AI21/Generated/AI21.Models.ToolDefinition.Json.g.cs create mode 100644 src/libs/AI21/Generated/AI21.Models.ToolFunction.Json.g.cs create mode 100644 src/libs/AI21/Generated/AI21.Models.ToolMessage.Json.g.cs create mode 100644 src/libs/AI21/Generated/AI21.Models.ToolParameters.Json.g.cs create mode 100644 src/libs/AI21/Generated/AI21.Models.ToolParametersProperties.Json.g.cs create mode 100644 src/libs/AI21/Generated/AI21.Models.TopLogprobsData.Json.g.cs create mode 100644 src/libs/AI21/Generated/AI21.Models.UsageInfo.Json.g.cs create mode 100644 src/libs/AI21/Generated/AI21.Models.UserMessage.Json.g.cs create mode 100644 src/libs/AI21/Generated/AI21.Models.V1CreateCustomModelResponse.Json.g.cs create mode 100644 src/libs/AI21/Generated/AI21.Models.V1DeleteCustomModelResponse.Json.g.cs create mode 100644 src/libs/AI21/Generated/AI21.Models.V1GetCustomModelResponse.Json.g.cs create mode 100644 src/libs/AI21/Generated/AI21.Models.V1GetCustomModelsResponse.Json.g.cs create mode 100644 src/libs/AI21/Generated/AI21.Models.V1J2GrandeCompleteResponse.Json.g.cs create mode 100644 src/libs/AI21/Generated/AI21.Models.V1J2GrandeCustomModelCompleteResponse.Json.g.cs create mode 100644 src/libs/AI21/Generated/AI21.Models.V1J2GrandeInstructCompleteResponse.Json.g.cs create mode 100644 src/libs/AI21/Generated/AI21.Models.V1J2JumboCompleteResponse.Json.g.cs create mode 100644 src/libs/AI21/Generated/AI21.Models.V1J2JumboCompleteResponse2.Json.g.cs create mode 100644 src/libs/AI21/Generated/AI21.Models.V1J2JumboInstructCompleteResponse.Json.g.cs create mode 100644 src/libs/AI21/Generated/AI21.Models.V1J2LargeCompleteResponse.Json.g.cs create mode 100644 src/libs/AI21/Generated/AI21.Models.V1J2LargeCustomModelCompleteResponse.Json.g.cs create mode 100644 src/libs/AI21/Generated/AI21.Models.V1J2LargeInstructCompleteResponse.Json.g.cs create mode 100644 src/libs/AI21/Generated/AI21.Models.V1J2LightCompleteResponse.Json.g.cs create mode 100644 src/libs/AI21/Generated/AI21.Models.V1J2LightCustomModelCompleteResponse.Json.g.cs create mode 100644 src/libs/AI21/Generated/AI21.Models.V1J2MidCompleteResponse.Json.g.cs create mode 100644 src/libs/AI21/Generated/AI21.Models.V1J2MidCustomModelCompleteResponse.Json.g.cs create mode 100644 src/libs/AI21/Generated/AI21.Models.V1J2UltraCompleteResponse.Json.g.cs create mode 100644 src/libs/AI21/Generated/AI21.Models.V1J2UltraCompleteResponse2.Json.g.cs create mode 100644 src/libs/AI21/Generated/AI21.Models.V1LibraryManagementResponse.Json.g.cs create mode 100644 src/libs/AI21/Generated/AI21.Models.V1ParaphrazeResponse.Json.g.cs create mode 100644 src/libs/AI21/Generated/AI21.Models.V1UpdateCustomModelResponse.Json.g.cs create mode 100644 src/libs/AI21/Generated/AI21.Models.ValidationError.Json.g.cs create mode 100644 src/libs/AI21/Generated/AnyOf.2.Json.g.cs diff --git a/src/libs/AI21/Generated/AI21.Ai21Api.ConvertDocumentFileStudioV1ChatFilesConvertPost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Api.ConvertDocumentFileStudioV1ChatFilesConvertPost.g.cs index 4119b61..6234203 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Api.ConvertDocumentFileStudioV1ChatFilesConvertPost.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Api.ConvertDocumentFileStudioV1ChatFilesConvertPost.g.cs @@ -31,7 +31,7 @@ partial void ProcessConvertDocumentFileStudioV1ChatFilesConvertPostResponseConte /// /// /// The token to cancel the operation with - /// + /// public async global::System.Threading.Tasks.Task ConvertDocumentFileStudioV1ChatFilesConvertPostAsync( global::AI21.BodyConvertDocumentFileStudioV1ChatFilesConvertPost request, int? requestStartTime = default, @@ -104,28 +104,97 @@ partial void ProcessConvertDocumentFileStudioV1ChatFilesConvertPostResponseConte ProcessConvertDocumentFileStudioV1ChatFilesConvertPostResponse( httpClient: HttpClient, httpResponseMessage: __response); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + if (ReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + var __contentStream_422 = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); + __value_422 = await global::AI21.HTTPValidationError.FromJsonStreamAsync(__contentStream_422, JsonSerializerContext).ConfigureAwait(false); + } - var __content = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessConvertDocumentFileStudioV1ChatFilesConvertPostResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); + throw new global::AI21.ApiException( + message: __response.ReasonPhrase ?? string.Empty, + statusCode: __response.StatusCode) + { + ResponseBody = __content_422, + ResponseObject = __value_422, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } - try + if (ReadResponseAsString) { - __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessConvertDocumentFileStudioV1ChatFilesConvertPostResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + } + catch (global::System.Net.Http.HttpRequestException __ex) + { + throw new global::AI21.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + + return __content; } - catch (global::System.Net.Http.HttpRequestException __ex) + else { - throw new global::System.InvalidOperationException(__content, __ex); - } + try + { + __response.EnsureSuccessStatusCode(); + } + catch (global::System.Net.Http.HttpRequestException __ex) + { + throw new global::AI21.ApiException( + message: __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } - return __content; + using var __responseStream = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); + + var __responseValue = await global::System.Text.Json.JsonSerializer.DeserializeAsync(__responseStream, typeof(string), JsonSerializerContext).ConfigureAwait(false) as string; + + return + __responseValue ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } } /// diff --git a/src/libs/AI21/Generated/AI21.Ai21Api.GenerateOrgTokenStudioV1ConnectorsConnectedUsersOrganizationIdTokensPost.g.cs b/src/libs/AI21/Generated/AI21.Ai21Api.GenerateOrgTokenStudioV1ConnectorsConnectedUsersOrganizationIdTokensPost.g.cs index 4da753c..1b6d0b5 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Api.GenerateOrgTokenStudioV1ConnectorsConnectedUsersOrganizationIdTokensPost.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Api.GenerateOrgTokenStudioV1ConnectorsConnectedUsersOrganizationIdTokensPost.g.cs @@ -31,7 +31,7 @@ partial void ProcessGenerateOrgTokenStudioV1ConnectorsConnectedUsersOrganization /// Default Value: 1730898900272 /// /// The token to cancel the operation with - /// + /// public async global::System.Threading.Tasks.Task GenerateOrgTokenStudioV1ConnectorsConnectedUsersOrganizationIdTokensPostAsync( string organizationId, int? requestStartTime = default, @@ -91,30 +91,99 @@ partial void ProcessGenerateOrgTokenStudioV1ConnectorsConnectedUsersOrganization ProcessGenerateOrgTokenStudioV1ConnectorsConnectedUsersOrganizationIdTokensPostResponse( httpClient: HttpClient, httpResponseMessage: __response); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + if (ReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + var __contentStream_422 = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); + __value_422 = await global::AI21.HTTPValidationError.FromJsonStreamAsync(__contentStream_422, JsonSerializerContext).ConfigureAwait(false); + } - var __content = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessGenerateOrgTokenStudioV1ConnectorsConnectedUsersOrganizationIdTokensPostResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); + throw new global::AI21.ApiException( + message: __response.ReasonPhrase ?? string.Empty, + statusCode: __response.StatusCode) + { + ResponseBody = __content_422, + ResponseObject = __value_422, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } - try + if (ReadResponseAsString) { - __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessGenerateOrgTokenStudioV1ConnectorsConnectedUsersOrganizationIdTokensPostResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + } + catch (global::System.Net.Http.HttpRequestException __ex) + { + throw new global::AI21.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + + return + global::AI21.ConnectorsToken.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } - catch (global::System.Net.Http.HttpRequestException __ex) + else { - throw new global::System.InvalidOperationException(__content, __ex); - } + try + { + __response.EnsureSuccessStatusCode(); + } + catch (global::System.Net.Http.HttpRequestException __ex) + { + throw new global::AI21.ApiException( + message: __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } - return - global::AI21.ConnectorsToken.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + using var __responseStream = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); + + var __responseValue = await global::AI21.ConnectorsToken.FromJsonStreamAsync(__responseStream, JsonSerializerContext).ConfigureAwait(false); + + return + __responseValue ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } } } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Api.GetDataSourceStatusStudioV1ConnectorsConnectedUsersOrganizationIdDataSourcesDataSourceStatusGet.g.cs b/src/libs/AI21/Generated/AI21.Ai21Api.GetDataSourceStatusStudioV1ConnectorsConnectedUsersOrganizationIdDataSourcesDataSourceStatusGet.g.cs index d8bd5c9..5200bd8 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Api.GetDataSourceStatusStudioV1ConnectorsConnectedUsersOrganizationIdDataSourcesDataSourceStatusGet.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Api.GetDataSourceStatusStudioV1ConnectorsConnectedUsersOrganizationIdDataSourcesDataSourceStatusGet.g.cs @@ -34,7 +34,7 @@ partial void ProcessGetDataSourceStatusStudioV1ConnectorsConnectedUsersOrganizat /// Default Value: 1730898900272 /// /// The token to cancel the operation with - /// + /// public async global::System.Threading.Tasks.Task GetDataSourceStatusStudioV1ConnectorsConnectedUsersOrganizationIdDataSourcesDataSourceStatusGetAsync( string organizationId, string dataSource, @@ -97,30 +97,99 @@ partial void ProcessGetDataSourceStatusStudioV1ConnectorsConnectedUsersOrganizat ProcessGetDataSourceStatusStudioV1ConnectorsConnectedUsersOrganizationIdDataSourcesDataSourceStatusGetResponse( httpClient: HttpClient, httpResponseMessage: __response); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + if (ReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + var __contentStream_422 = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); + __value_422 = await global::AI21.HTTPValidationError.FromJsonStreamAsync(__contentStream_422, JsonSerializerContext).ConfigureAwait(false); + } - var __content = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessGetDataSourceStatusStudioV1ConnectorsConnectedUsersOrganizationIdDataSourcesDataSourceStatusGetResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); + throw new global::AI21.ApiException( + message: __response.ReasonPhrase ?? string.Empty, + statusCode: __response.StatusCode) + { + ResponseBody = __content_422, + ResponseObject = __value_422, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } - try + if (ReadResponseAsString) { - __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessGetDataSourceStatusStudioV1ConnectorsConnectedUsersOrganizationIdDataSourcesDataSourceStatusGetResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + } + catch (global::System.Net.Http.HttpRequestException __ex) + { + throw new global::AI21.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + + return + global::AI21.ConnectorsStatus.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } - catch (global::System.Net.Http.HttpRequestException __ex) + else { - throw new global::System.InvalidOperationException(__content, __ex); - } + try + { + __response.EnsureSuccessStatusCode(); + } + catch (global::System.Net.Http.HttpRequestException __ex) + { + throw new global::AI21.ApiException( + message: __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } - return - global::AI21.ConnectorsStatus.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + using var __responseStream = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); + + var __responseValue = await global::AI21.ConnectorsStatus.FromJsonStreamAsync(__responseStream, JsonSerializerContext).ConfigureAwait(false); + + return + __responseValue ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } } } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Api.GetOrgDataSourcesInfoStudioV1ConnectorsConnectedUsersOrganizationIdDataSourcesGet.g.cs b/src/libs/AI21/Generated/AI21.Ai21Api.GetOrgDataSourcesInfoStudioV1ConnectorsConnectedUsersOrganizationIdDataSourcesGet.g.cs index f8a5b75..ac6ce84 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Api.GetOrgDataSourcesInfoStudioV1ConnectorsConnectedUsersOrganizationIdDataSourcesGet.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Api.GetOrgDataSourcesInfoStudioV1ConnectorsConnectedUsersOrganizationIdDataSourcesGet.g.cs @@ -31,7 +31,7 @@ partial void ProcessGetOrgDataSourcesInfoStudioV1ConnectorsConnectedUsersOrganiz /// Default Value: 1730898900272 /// /// The token to cancel the operation with - /// + /// public async global::System.Threading.Tasks.Task GetOrgDataSourcesInfoStudioV1ConnectorsConnectedUsersOrganizationIdDataSourcesGetAsync( string organizationId, int? requestStartTime = default, @@ -91,30 +91,99 @@ partial void ProcessGetOrgDataSourcesInfoStudioV1ConnectorsConnectedUsersOrganiz ProcessGetOrgDataSourcesInfoStudioV1ConnectorsConnectedUsersOrganizationIdDataSourcesGetResponse( httpClient: HttpClient, httpResponseMessage: __response); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + if (ReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + var __contentStream_422 = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); + __value_422 = await global::AI21.HTTPValidationError.FromJsonStreamAsync(__contentStream_422, JsonSerializerContext).ConfigureAwait(false); + } - var __content = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessGetOrgDataSourcesInfoStudioV1ConnectorsConnectedUsersOrganizationIdDataSourcesGetResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); + throw new global::AI21.ApiException( + message: __response.ReasonPhrase ?? string.Empty, + statusCode: __response.StatusCode) + { + ResponseBody = __content_422, + ResponseObject = __value_422, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } - try + if (ReadResponseAsString) { - __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessGetOrgDataSourcesInfoStudioV1ConnectorsConnectedUsersOrganizationIdDataSourcesGetResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + } + catch (global::System.Net.Http.HttpRequestException __ex) + { + throw new global::AI21.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + + return + global::AI21.ConnectorsDataSources.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } - catch (global::System.Net.Http.HttpRequestException __ex) + else { - throw new global::System.InvalidOperationException(__content, __ex); - } + try + { + __response.EnsureSuccessStatusCode(); + } + catch (global::System.Net.Http.HttpRequestException __ex) + { + throw new global::AI21.ApiException( + message: __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } - return - global::AI21.ConnectorsDataSources.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + using var __responseStream = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); + + var __responseValue = await global::AI21.ConnectorsDataSources.FromJsonStreamAsync(__responseStream, JsonSerializerContext).ConfigureAwait(false); + + return + __responseValue ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } } } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Ai21Api.V1ConversationalRag.g.cs b/src/libs/AI21/Generated/AI21.Ai21Api.V1ConversationalRag.g.cs index 9efb5f3..e2da186 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Api.V1ConversationalRag.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Api.V1ConversationalRag.g.cs @@ -31,7 +31,7 @@ partial void ProcessV1ConversationalRagResponseContent( /// /// /// The token to cancel the operation with - /// + /// public async global::System.Threading.Tasks.Task V1ConversationalRagAsync( global::AI21.ConversationalRagConfig request, int? requestStartTime = default, @@ -99,30 +99,99 @@ partial void ProcessV1ConversationalRagResponseContent( ProcessV1ConversationalRagResponse( httpClient: HttpClient, httpResponseMessage: __response); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + if (ReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + var __contentStream_422 = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); + __value_422 = await global::AI21.HTTPValidationError.FromJsonStreamAsync(__contentStream_422, JsonSerializerContext).ConfigureAwait(false); + } - var __content = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessV1ConversationalRagResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); + throw new global::AI21.ApiException( + message: __response.ReasonPhrase ?? string.Empty, + statusCode: __response.StatusCode) + { + ResponseBody = __content_422, + ResponseObject = __value_422, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } - try + if (ReadResponseAsString) { - __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1ConversationalRagResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + } + catch (global::System.Net.Http.HttpRequestException __ex) + { + throw new global::AI21.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + + return + global::AI21.ConversationalRagResult.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } - catch (global::System.Net.Http.HttpRequestException __ex) + else { - throw new global::System.InvalidOperationException(__content, __ex); - } + try + { + __response.EnsureSuccessStatusCode(); + } + catch (global::System.Net.Http.HttpRequestException __ex) + { + throw new global::AI21.ApiException( + message: __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } - return - global::AI21.ConversationalRagResult.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + using var __responseStream = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); + + var __responseValue = await global::AI21.ConversationalRagResult.FromJsonStreamAsync(__responseStream, JsonSerializerContext).ConfigureAwait(false); + + return + __responseValue ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } } /// diff --git a/src/libs/AI21/Generated/AI21.Ai21Api.g.cs b/src/libs/AI21/Generated/AI21.Ai21Api.g.cs index b406306..9f53754 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Api.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Api.g.cs @@ -26,6 +26,11 @@ public sealed partial class Ai21Api : global::AI21.IAi21Api, global::System.IDis /// public global::System.Collections.Generic.List Authorizations { get; } + /// + public bool ReadResponseAsString { get; set; } +#if DEBUG + = true; +#endif /// /// /// @@ -37,6 +42,7 @@ public sealed partial class Ai21Api : global::AI21.IAi21Api, global::System.IDis /// public JambaCompleteClient JambaComplete => new JambaCompleteClient(HttpClient, authorizations: Authorizations) { + ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, }; @@ -45,6 +51,7 @@ public sealed partial class Ai21Api : global::AI21.IAi21Api, global::System.IDis /// public CompletionClient Completion => new CompletionClient(HttpClient, authorizations: Authorizations) { + ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, }; @@ -53,6 +60,7 @@ public sealed partial class Ai21Api : global::AI21.IAi21Api, global::System.IDis /// public CustomModelsClient CustomModels => new CustomModelsClient(HttpClient, authorizations: Authorizations) { + ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, }; @@ -61,6 +69,7 @@ public sealed partial class Ai21Api : global::AI21.IAi21Api, global::System.IDis /// public ParaphraseClient Paraphrase => new ParaphraseClient(HttpClient, authorizations: Authorizations) { + ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, }; @@ -69,6 +78,7 @@ public sealed partial class Ai21Api : global::AI21.IAi21Api, global::System.IDis /// public SummarizeClient Summarize => new SummarizeClient(HttpClient, authorizations: Authorizations) { + ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, }; @@ -77,6 +87,7 @@ public sealed partial class Ai21Api : global::AI21.IAi21Api, global::System.IDis /// public SegmentationClient Segmentation => new SegmentationClient(HttpClient, authorizations: Authorizations) { + ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, }; @@ -85,6 +96,7 @@ public sealed partial class Ai21Api : global::AI21.IAi21Api, global::System.IDis /// public LibraryManagementClient LibraryManagement => new LibraryManagementClient(HttpClient, authorizations: Authorizations) { + ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, }; @@ -93,6 +105,7 @@ public sealed partial class Ai21Api : global::AI21.IAi21Api, global::System.IDis /// public RAGEngineClient RAGEngine => new RAGEngineClient(HttpClient, authorizations: Authorizations) { + ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, }; @@ -101,6 +114,7 @@ public sealed partial class Ai21Api : global::AI21.IAi21Api, global::System.IDis /// public ChatClient Chat => new ChatClient(HttpClient, authorizations: Authorizations) { + ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, }; diff --git a/src/libs/AI21/Generated/AI21.ChatClient.V1J2UltraChat.g.cs b/src/libs/AI21/Generated/AI21.ChatClient.V1J2UltraChat.g.cs index f40954b..87342a3 100644 --- a/src/libs/AI21/Generated/AI21.ChatClient.V1J2UltraChat.g.cs +++ b/src/libs/AI21/Generated/AI21.ChatClient.V1J2UltraChat.g.cs @@ -36,7 +36,7 @@ partial void ProcessV1J2UltraChatResponseContent( /// /// /// The token to cancel the operation with - /// + /// public async global::System.Threading.Tasks.Task V1J2UltraChatAsync( global::AI21.LanguageStudioApiServerDataTypesJ2ChatChatRequest request, string? model = default, @@ -108,30 +108,99 @@ partial void ProcessV1J2UltraChatResponseContent( ProcessV1J2UltraChatResponse( httpClient: HttpClient, httpResponseMessage: __response); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + if (ReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + var __contentStream_422 = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); + __value_422 = await global::AI21.HTTPValidationError.FromJsonStreamAsync(__contentStream_422, JsonSerializerContext).ConfigureAwait(false); + } - var __content = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessV1J2UltraChatResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); + throw new global::AI21.ApiException( + message: __response.ReasonPhrase ?? string.Empty, + statusCode: __response.StatusCode) + { + ResponseBody = __content_422, + ResponseObject = __value_422, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } - try + if (ReadResponseAsString) { - __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1J2UltraChatResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + } + catch (global::System.Net.Http.HttpRequestException __ex) + { + throw new global::AI21.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + + return + global::AI21.ChatResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } - catch (global::System.Net.Http.HttpRequestException __ex) + else { - throw new global::System.InvalidOperationException(__content, __ex); - } + try + { + __response.EnsureSuccessStatusCode(); + } + catch (global::System.Net.Http.HttpRequestException __ex) + { + throw new global::AI21.ApiException( + message: __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } - return - global::AI21.ChatResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + using var __responseStream = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); + + var __responseValue = await global::AI21.ChatResponse.FromJsonStreamAsync(__responseStream, JsonSerializerContext).ConfigureAwait(false); + + return + __responseValue ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } } /// diff --git a/src/libs/AI21/Generated/AI21.ChatClient.g.cs b/src/libs/AI21/Generated/AI21.ChatClient.g.cs index e239b7d..333c216 100644 --- a/src/libs/AI21/Generated/AI21.ChatClient.g.cs +++ b/src/libs/AI21/Generated/AI21.ChatClient.g.cs @@ -25,6 +25,11 @@ public sealed partial class ChatClient : global::AI21.IChatClient, global::Syste /// public global::System.Collections.Generic.List Authorizations { get; } + /// + public bool ReadResponseAsString { get; set; } +#if DEBUG + = true; +#endif /// /// /// diff --git a/src/libs/AI21/Generated/AI21.CompletionClient.V1J2GrandeComplete.g.cs b/src/libs/AI21/Generated/AI21.CompletionClient.V1J2GrandeComplete.g.cs index 86de0d3..3795fa0 100644 --- a/src/libs/AI21/Generated/AI21.CompletionClient.V1J2GrandeComplete.g.cs +++ b/src/libs/AI21/Generated/AI21.CompletionClient.V1J2GrandeComplete.g.cs @@ -36,7 +36,7 @@ partial void ProcessV1J2GrandeCompleteResponseContent( /// /// /// The token to cancel the operation with - /// + /// public async global::System.Threading.Tasks.Task V1J2GrandeCompleteAsync( global::AI21.CompletionBody request, string? model = default, @@ -108,28 +108,97 @@ partial void ProcessV1J2GrandeCompleteResponseContent( ProcessV1J2GrandeCompleteResponse( httpClient: HttpClient, httpResponseMessage: __response); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + if (ReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + var __contentStream_422 = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); + __value_422 = await global::AI21.HTTPValidationError.FromJsonStreamAsync(__contentStream_422, JsonSerializerContext).ConfigureAwait(false); + } - var __content = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessV1J2GrandeCompleteResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); + throw new global::AI21.ApiException( + message: __response.ReasonPhrase ?? string.Empty, + statusCode: __response.StatusCode) + { + ResponseBody = __content_422, + ResponseObject = __value_422, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } - try + if (ReadResponseAsString) { - __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1J2GrandeCompleteResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + } + catch (global::System.Net.Http.HttpRequestException __ex) + { + throw new global::AI21.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + + return __content; } - catch (global::System.Net.Http.HttpRequestException __ex) + else { - throw new global::System.InvalidOperationException(__content, __ex); - } + try + { + __response.EnsureSuccessStatusCode(); + } + catch (global::System.Net.Http.HttpRequestException __ex) + { + throw new global::AI21.ApiException( + message: __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } - return __content; + using var __responseStream = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); + + var __responseValue = await global::System.Text.Json.JsonSerializer.DeserializeAsync(__responseStream, typeof(string), JsonSerializerContext).ConfigureAwait(false) as string; + + return + __responseValue ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } } /// diff --git a/src/libs/AI21/Generated/AI21.CompletionClient.V1J2GrandeCustomModelComplete.g.cs b/src/libs/AI21/Generated/AI21.CompletionClient.V1J2GrandeCustomModelComplete.g.cs index 722dd5f..9ecab81 100644 --- a/src/libs/AI21/Generated/AI21.CompletionClient.V1J2GrandeCustomModelComplete.g.cs +++ b/src/libs/AI21/Generated/AI21.CompletionClient.V1J2GrandeCustomModelComplete.g.cs @@ -39,7 +39,7 @@ partial void ProcessV1J2GrandeCustomModelCompleteResponseContent( /// /// /// The token to cancel the operation with - /// + /// public async global::System.Threading.Tasks.Task V1J2GrandeCustomModelCompleteAsync( string customModelName, global::AI21.CompletionBody request, @@ -114,28 +114,97 @@ partial void ProcessV1J2GrandeCustomModelCompleteResponseContent( ProcessV1J2GrandeCustomModelCompleteResponse( httpClient: HttpClient, httpResponseMessage: __response); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + if (ReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + var __contentStream_422 = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); + __value_422 = await global::AI21.HTTPValidationError.FromJsonStreamAsync(__contentStream_422, JsonSerializerContext).ConfigureAwait(false); + } - var __content = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessV1J2GrandeCustomModelCompleteResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); + throw new global::AI21.ApiException( + message: __response.ReasonPhrase ?? string.Empty, + statusCode: __response.StatusCode) + { + ResponseBody = __content_422, + ResponseObject = __value_422, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } - try + if (ReadResponseAsString) { - __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1J2GrandeCustomModelCompleteResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + } + catch (global::System.Net.Http.HttpRequestException __ex) + { + throw new global::AI21.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + + return __content; } - catch (global::System.Net.Http.HttpRequestException __ex) + else { - throw new global::System.InvalidOperationException(__content, __ex); - } + try + { + __response.EnsureSuccessStatusCode(); + } + catch (global::System.Net.Http.HttpRequestException __ex) + { + throw new global::AI21.ApiException( + message: __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } - return __content; + using var __responseStream = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); + + var __responseValue = await global::System.Text.Json.JsonSerializer.DeserializeAsync(__responseStream, typeof(string), JsonSerializerContext).ConfigureAwait(false) as string; + + return + __responseValue ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } } /// diff --git a/src/libs/AI21/Generated/AI21.CompletionClient.V1J2GrandeInstructComplete.g.cs b/src/libs/AI21/Generated/AI21.CompletionClient.V1J2GrandeInstructComplete.g.cs index 17b7ea5..9ba04cd 100644 --- a/src/libs/AI21/Generated/AI21.CompletionClient.V1J2GrandeInstructComplete.g.cs +++ b/src/libs/AI21/Generated/AI21.CompletionClient.V1J2GrandeInstructComplete.g.cs @@ -36,7 +36,7 @@ partial void ProcessV1J2GrandeInstructCompleteResponseContent( /// /// /// The token to cancel the operation with - /// + /// public async global::System.Threading.Tasks.Task V1J2GrandeInstructCompleteAsync( global::AI21.CompletionBody request, string? model = default, @@ -108,28 +108,97 @@ partial void ProcessV1J2GrandeInstructCompleteResponseContent( ProcessV1J2GrandeInstructCompleteResponse( httpClient: HttpClient, httpResponseMessage: __response); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + if (ReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + var __contentStream_422 = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); + __value_422 = await global::AI21.HTTPValidationError.FromJsonStreamAsync(__contentStream_422, JsonSerializerContext).ConfigureAwait(false); + } - var __content = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessV1J2GrandeInstructCompleteResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); + throw new global::AI21.ApiException( + message: __response.ReasonPhrase ?? string.Empty, + statusCode: __response.StatusCode) + { + ResponseBody = __content_422, + ResponseObject = __value_422, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } - try + if (ReadResponseAsString) { - __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1J2GrandeInstructCompleteResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + } + catch (global::System.Net.Http.HttpRequestException __ex) + { + throw new global::AI21.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + + return __content; } - catch (global::System.Net.Http.HttpRequestException __ex) + else { - throw new global::System.InvalidOperationException(__content, __ex); - } + try + { + __response.EnsureSuccessStatusCode(); + } + catch (global::System.Net.Http.HttpRequestException __ex) + { + throw new global::AI21.ApiException( + message: __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } - return __content; + using var __responseStream = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); + + var __responseValue = await global::System.Text.Json.JsonSerializer.DeserializeAsync(__responseStream, typeof(string), JsonSerializerContext).ConfigureAwait(false) as string; + + return + __responseValue ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } } /// diff --git a/src/libs/AI21/Generated/AI21.CompletionClient.V1J2JumboComplete.g.cs b/src/libs/AI21/Generated/AI21.CompletionClient.V1J2JumboComplete.g.cs index 1d79399..cd716b2 100644 --- a/src/libs/AI21/Generated/AI21.CompletionClient.V1J2JumboComplete.g.cs +++ b/src/libs/AI21/Generated/AI21.CompletionClient.V1J2JumboComplete.g.cs @@ -36,7 +36,7 @@ partial void ProcessV1J2JumboCompleteResponseContent( /// /// /// The token to cancel the operation with - /// + /// public async global::System.Threading.Tasks.Task V1J2JumboCompleteAsync( global::AI21.CompletionBody request, string? model = default, @@ -108,28 +108,97 @@ partial void ProcessV1J2JumboCompleteResponseContent( ProcessV1J2JumboCompleteResponse( httpClient: HttpClient, httpResponseMessage: __response); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + if (ReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + var __contentStream_422 = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); + __value_422 = await global::AI21.HTTPValidationError.FromJsonStreamAsync(__contentStream_422, JsonSerializerContext).ConfigureAwait(false); + } - var __content = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessV1J2JumboCompleteResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); + throw new global::AI21.ApiException( + message: __response.ReasonPhrase ?? string.Empty, + statusCode: __response.StatusCode) + { + ResponseBody = __content_422, + ResponseObject = __value_422, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } - try + if (ReadResponseAsString) { - __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1J2JumboCompleteResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + } + catch (global::System.Net.Http.HttpRequestException __ex) + { + throw new global::AI21.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + + return __content; } - catch (global::System.Net.Http.HttpRequestException __ex) + else { - throw new global::System.InvalidOperationException(__content, __ex); - } + try + { + __response.EnsureSuccessStatusCode(); + } + catch (global::System.Net.Http.HttpRequestException __ex) + { + throw new global::AI21.ApiException( + message: __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } - return __content; + using var __responseStream = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); + + var __responseValue = await global::System.Text.Json.JsonSerializer.DeserializeAsync(__responseStream, typeof(string), JsonSerializerContext).ConfigureAwait(false) as string; + + return + __responseValue ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } } /// diff --git a/src/libs/AI21/Generated/AI21.CompletionClient.V1J2JumboComplete2.g.cs b/src/libs/AI21/Generated/AI21.CompletionClient.V1J2JumboComplete2.g.cs index d8b9336..06fec88 100644 --- a/src/libs/AI21/Generated/AI21.CompletionClient.V1J2JumboComplete2.g.cs +++ b/src/libs/AI21/Generated/AI21.CompletionClient.V1J2JumboComplete2.g.cs @@ -39,7 +39,7 @@ partial void ProcessV1J2JumboComplete2ResponseContent( /// /// /// The token to cancel the operation with - /// + /// public async global::System.Threading.Tasks.Task V1J2JumboComplete2Async( string customModelName, global::AI21.CompletionBody request, @@ -114,28 +114,97 @@ partial void ProcessV1J2JumboComplete2ResponseContent( ProcessV1J2JumboComplete2Response( httpClient: HttpClient, httpResponseMessage: __response); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + if (ReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + var __contentStream_422 = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); + __value_422 = await global::AI21.HTTPValidationError.FromJsonStreamAsync(__contentStream_422, JsonSerializerContext).ConfigureAwait(false); + } - var __content = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessV1J2JumboComplete2ResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); + throw new global::AI21.ApiException( + message: __response.ReasonPhrase ?? string.Empty, + statusCode: __response.StatusCode) + { + ResponseBody = __content_422, + ResponseObject = __value_422, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } - try + if (ReadResponseAsString) { - __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1J2JumboComplete2ResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + } + catch (global::System.Net.Http.HttpRequestException __ex) + { + throw new global::AI21.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + + return __content; } - catch (global::System.Net.Http.HttpRequestException __ex) + else { - throw new global::System.InvalidOperationException(__content, __ex); - } + try + { + __response.EnsureSuccessStatusCode(); + } + catch (global::System.Net.Http.HttpRequestException __ex) + { + throw new global::AI21.ApiException( + message: __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } - return __content; + using var __responseStream = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); + + var __responseValue = await global::System.Text.Json.JsonSerializer.DeserializeAsync(__responseStream, typeof(string), JsonSerializerContext).ConfigureAwait(false) as string; + + return + __responseValue ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } } /// diff --git a/src/libs/AI21/Generated/AI21.CompletionClient.V1J2JumboInstructComplete.g.cs b/src/libs/AI21/Generated/AI21.CompletionClient.V1J2JumboInstructComplete.g.cs index d1f9bce..a311432 100644 --- a/src/libs/AI21/Generated/AI21.CompletionClient.V1J2JumboInstructComplete.g.cs +++ b/src/libs/AI21/Generated/AI21.CompletionClient.V1J2JumboInstructComplete.g.cs @@ -36,7 +36,7 @@ partial void ProcessV1J2JumboInstructCompleteResponseContent( /// /// /// The token to cancel the operation with - /// + /// public async global::System.Threading.Tasks.Task V1J2JumboInstructCompleteAsync( global::AI21.CompletionBody request, string? model = default, @@ -108,28 +108,97 @@ partial void ProcessV1J2JumboInstructCompleteResponseContent( ProcessV1J2JumboInstructCompleteResponse( httpClient: HttpClient, httpResponseMessage: __response); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + if (ReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + var __contentStream_422 = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); + __value_422 = await global::AI21.HTTPValidationError.FromJsonStreamAsync(__contentStream_422, JsonSerializerContext).ConfigureAwait(false); + } - var __content = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessV1J2JumboInstructCompleteResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); + throw new global::AI21.ApiException( + message: __response.ReasonPhrase ?? string.Empty, + statusCode: __response.StatusCode) + { + ResponseBody = __content_422, + ResponseObject = __value_422, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } - try + if (ReadResponseAsString) { - __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1J2JumboInstructCompleteResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + } + catch (global::System.Net.Http.HttpRequestException __ex) + { + throw new global::AI21.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + + return __content; } - catch (global::System.Net.Http.HttpRequestException __ex) + else { - throw new global::System.InvalidOperationException(__content, __ex); - } + try + { + __response.EnsureSuccessStatusCode(); + } + catch (global::System.Net.Http.HttpRequestException __ex) + { + throw new global::AI21.ApiException( + message: __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } - return __content; + using var __responseStream = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); + + var __responseValue = await global::System.Text.Json.JsonSerializer.DeserializeAsync(__responseStream, typeof(string), JsonSerializerContext).ConfigureAwait(false) as string; + + return + __responseValue ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } } /// diff --git a/src/libs/AI21/Generated/AI21.CompletionClient.V1J2LargeComplete.g.cs b/src/libs/AI21/Generated/AI21.CompletionClient.V1J2LargeComplete.g.cs index 2294f46..d62f696 100644 --- a/src/libs/AI21/Generated/AI21.CompletionClient.V1J2LargeComplete.g.cs +++ b/src/libs/AI21/Generated/AI21.CompletionClient.V1J2LargeComplete.g.cs @@ -36,7 +36,7 @@ partial void ProcessV1J2LargeCompleteResponseContent( /// /// /// The token to cancel the operation with - /// + /// public async global::System.Threading.Tasks.Task V1J2LargeCompleteAsync( global::AI21.CompletionBody request, string? model = default, @@ -108,28 +108,97 @@ partial void ProcessV1J2LargeCompleteResponseContent( ProcessV1J2LargeCompleteResponse( httpClient: HttpClient, httpResponseMessage: __response); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + if (ReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + var __contentStream_422 = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); + __value_422 = await global::AI21.HTTPValidationError.FromJsonStreamAsync(__contentStream_422, JsonSerializerContext).ConfigureAwait(false); + } - var __content = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessV1J2LargeCompleteResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); + throw new global::AI21.ApiException( + message: __response.ReasonPhrase ?? string.Empty, + statusCode: __response.StatusCode) + { + ResponseBody = __content_422, + ResponseObject = __value_422, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } - try + if (ReadResponseAsString) { - __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1J2LargeCompleteResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + } + catch (global::System.Net.Http.HttpRequestException __ex) + { + throw new global::AI21.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + + return __content; } - catch (global::System.Net.Http.HttpRequestException __ex) + else { - throw new global::System.InvalidOperationException(__content, __ex); - } + try + { + __response.EnsureSuccessStatusCode(); + } + catch (global::System.Net.Http.HttpRequestException __ex) + { + throw new global::AI21.ApiException( + message: __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } - return __content; + using var __responseStream = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); + + var __responseValue = await global::System.Text.Json.JsonSerializer.DeserializeAsync(__responseStream, typeof(string), JsonSerializerContext).ConfigureAwait(false) as string; + + return + __responseValue ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } } /// diff --git a/src/libs/AI21/Generated/AI21.CompletionClient.V1J2LargeCustomModelComplete.g.cs b/src/libs/AI21/Generated/AI21.CompletionClient.V1J2LargeCustomModelComplete.g.cs index f89a10c..e88f48f 100644 --- a/src/libs/AI21/Generated/AI21.CompletionClient.V1J2LargeCustomModelComplete.g.cs +++ b/src/libs/AI21/Generated/AI21.CompletionClient.V1J2LargeCustomModelComplete.g.cs @@ -39,7 +39,7 @@ partial void ProcessV1J2LargeCustomModelCompleteResponseContent( /// /// /// The token to cancel the operation with - /// + /// public async global::System.Threading.Tasks.Task V1J2LargeCustomModelCompleteAsync( string customModelName, global::AI21.CompletionBody request, @@ -114,28 +114,97 @@ partial void ProcessV1J2LargeCustomModelCompleteResponseContent( ProcessV1J2LargeCustomModelCompleteResponse( httpClient: HttpClient, httpResponseMessage: __response); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + if (ReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + var __contentStream_422 = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); + __value_422 = await global::AI21.HTTPValidationError.FromJsonStreamAsync(__contentStream_422, JsonSerializerContext).ConfigureAwait(false); + } - var __content = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessV1J2LargeCustomModelCompleteResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); + throw new global::AI21.ApiException( + message: __response.ReasonPhrase ?? string.Empty, + statusCode: __response.StatusCode) + { + ResponseBody = __content_422, + ResponseObject = __value_422, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } - try + if (ReadResponseAsString) { - __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1J2LargeCustomModelCompleteResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + } + catch (global::System.Net.Http.HttpRequestException __ex) + { + throw new global::AI21.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + + return __content; } - catch (global::System.Net.Http.HttpRequestException __ex) + else { - throw new global::System.InvalidOperationException(__content, __ex); - } + try + { + __response.EnsureSuccessStatusCode(); + } + catch (global::System.Net.Http.HttpRequestException __ex) + { + throw new global::AI21.ApiException( + message: __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } - return __content; + using var __responseStream = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); + + var __responseValue = await global::System.Text.Json.JsonSerializer.DeserializeAsync(__responseStream, typeof(string), JsonSerializerContext).ConfigureAwait(false) as string; + + return + __responseValue ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } } /// diff --git a/src/libs/AI21/Generated/AI21.CompletionClient.V1J2LargeInstructComplete.g.cs b/src/libs/AI21/Generated/AI21.CompletionClient.V1J2LargeInstructComplete.g.cs index 78f928d..e27daa5 100644 --- a/src/libs/AI21/Generated/AI21.CompletionClient.V1J2LargeInstructComplete.g.cs +++ b/src/libs/AI21/Generated/AI21.CompletionClient.V1J2LargeInstructComplete.g.cs @@ -36,7 +36,7 @@ partial void ProcessV1J2LargeInstructCompleteResponseContent( /// /// /// The token to cancel the operation with - /// + /// public async global::System.Threading.Tasks.Task V1J2LargeInstructCompleteAsync( global::AI21.CompletionBody request, string? model = default, @@ -108,28 +108,97 @@ partial void ProcessV1J2LargeInstructCompleteResponseContent( ProcessV1J2LargeInstructCompleteResponse( httpClient: HttpClient, httpResponseMessage: __response); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + if (ReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + var __contentStream_422 = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); + __value_422 = await global::AI21.HTTPValidationError.FromJsonStreamAsync(__contentStream_422, JsonSerializerContext).ConfigureAwait(false); + } - var __content = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessV1J2LargeInstructCompleteResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); + throw new global::AI21.ApiException( + message: __response.ReasonPhrase ?? string.Empty, + statusCode: __response.StatusCode) + { + ResponseBody = __content_422, + ResponseObject = __value_422, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } - try + if (ReadResponseAsString) { - __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1J2LargeInstructCompleteResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + } + catch (global::System.Net.Http.HttpRequestException __ex) + { + throw new global::AI21.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + + return __content; } - catch (global::System.Net.Http.HttpRequestException __ex) + else { - throw new global::System.InvalidOperationException(__content, __ex); - } + try + { + __response.EnsureSuccessStatusCode(); + } + catch (global::System.Net.Http.HttpRequestException __ex) + { + throw new global::AI21.ApiException( + message: __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } - return __content; + using var __responseStream = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); + + var __responseValue = await global::System.Text.Json.JsonSerializer.DeserializeAsync(__responseStream, typeof(string), JsonSerializerContext).ConfigureAwait(false) as string; + + return + __responseValue ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } } /// diff --git a/src/libs/AI21/Generated/AI21.CompletionClient.V1J2LightComplete.g.cs b/src/libs/AI21/Generated/AI21.CompletionClient.V1J2LightComplete.g.cs index 7a778ef..42842a3 100644 --- a/src/libs/AI21/Generated/AI21.CompletionClient.V1J2LightComplete.g.cs +++ b/src/libs/AI21/Generated/AI21.CompletionClient.V1J2LightComplete.g.cs @@ -36,7 +36,7 @@ partial void ProcessV1J2LightCompleteResponseContent( /// /// /// The token to cancel the operation with - /// + /// public async global::System.Threading.Tasks.Task V1J2LightCompleteAsync( global::AI21.CompletionBody request, string? model = default, @@ -108,28 +108,97 @@ partial void ProcessV1J2LightCompleteResponseContent( ProcessV1J2LightCompleteResponse( httpClient: HttpClient, httpResponseMessage: __response); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + if (ReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + var __contentStream_422 = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); + __value_422 = await global::AI21.HTTPValidationError.FromJsonStreamAsync(__contentStream_422, JsonSerializerContext).ConfigureAwait(false); + } - var __content = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessV1J2LightCompleteResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); + throw new global::AI21.ApiException( + message: __response.ReasonPhrase ?? string.Empty, + statusCode: __response.StatusCode) + { + ResponseBody = __content_422, + ResponseObject = __value_422, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } - try + if (ReadResponseAsString) { - __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1J2LightCompleteResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + } + catch (global::System.Net.Http.HttpRequestException __ex) + { + throw new global::AI21.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + + return __content; } - catch (global::System.Net.Http.HttpRequestException __ex) + else { - throw new global::System.InvalidOperationException(__content, __ex); - } + try + { + __response.EnsureSuccessStatusCode(); + } + catch (global::System.Net.Http.HttpRequestException __ex) + { + throw new global::AI21.ApiException( + message: __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } - return __content; + using var __responseStream = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); + + var __responseValue = await global::System.Text.Json.JsonSerializer.DeserializeAsync(__responseStream, typeof(string), JsonSerializerContext).ConfigureAwait(false) as string; + + return + __responseValue ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } } /// diff --git a/src/libs/AI21/Generated/AI21.CompletionClient.V1J2LightCustomModelComplete.g.cs b/src/libs/AI21/Generated/AI21.CompletionClient.V1J2LightCustomModelComplete.g.cs index 79fa9e3..b00c57b 100644 --- a/src/libs/AI21/Generated/AI21.CompletionClient.V1J2LightCustomModelComplete.g.cs +++ b/src/libs/AI21/Generated/AI21.CompletionClient.V1J2LightCustomModelComplete.g.cs @@ -39,7 +39,7 @@ partial void ProcessV1J2LightCustomModelCompleteResponseContent( /// /// /// The token to cancel the operation with - /// + /// public async global::System.Threading.Tasks.Task V1J2LightCustomModelCompleteAsync( string customModelName, global::AI21.CompletionBody request, @@ -114,28 +114,97 @@ partial void ProcessV1J2LightCustomModelCompleteResponseContent( ProcessV1J2LightCustomModelCompleteResponse( httpClient: HttpClient, httpResponseMessage: __response); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + if (ReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + var __contentStream_422 = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); + __value_422 = await global::AI21.HTTPValidationError.FromJsonStreamAsync(__contentStream_422, JsonSerializerContext).ConfigureAwait(false); + } - var __content = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessV1J2LightCustomModelCompleteResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); + throw new global::AI21.ApiException( + message: __response.ReasonPhrase ?? string.Empty, + statusCode: __response.StatusCode) + { + ResponseBody = __content_422, + ResponseObject = __value_422, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } - try + if (ReadResponseAsString) { - __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1J2LightCustomModelCompleteResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + } + catch (global::System.Net.Http.HttpRequestException __ex) + { + throw new global::AI21.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + + return __content; } - catch (global::System.Net.Http.HttpRequestException __ex) + else { - throw new global::System.InvalidOperationException(__content, __ex); - } + try + { + __response.EnsureSuccessStatusCode(); + } + catch (global::System.Net.Http.HttpRequestException __ex) + { + throw new global::AI21.ApiException( + message: __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } - return __content; + using var __responseStream = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); + + var __responseValue = await global::System.Text.Json.JsonSerializer.DeserializeAsync(__responseStream, typeof(string), JsonSerializerContext).ConfigureAwait(false) as string; + + return + __responseValue ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } } /// diff --git a/src/libs/AI21/Generated/AI21.CompletionClient.V1J2MidComplete.g.cs b/src/libs/AI21/Generated/AI21.CompletionClient.V1J2MidComplete.g.cs index b54468e..10d6af8 100644 --- a/src/libs/AI21/Generated/AI21.CompletionClient.V1J2MidComplete.g.cs +++ b/src/libs/AI21/Generated/AI21.CompletionClient.V1J2MidComplete.g.cs @@ -36,7 +36,7 @@ partial void ProcessV1J2MidCompleteResponseContent( /// /// /// The token to cancel the operation with - /// + /// public async global::System.Threading.Tasks.Task V1J2MidCompleteAsync( global::AI21.CompletionBody request, string? model = default, @@ -108,28 +108,97 @@ partial void ProcessV1J2MidCompleteResponseContent( ProcessV1J2MidCompleteResponse( httpClient: HttpClient, httpResponseMessage: __response); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + if (ReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + var __contentStream_422 = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); + __value_422 = await global::AI21.HTTPValidationError.FromJsonStreamAsync(__contentStream_422, JsonSerializerContext).ConfigureAwait(false); + } - var __content = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessV1J2MidCompleteResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); + throw new global::AI21.ApiException( + message: __response.ReasonPhrase ?? string.Empty, + statusCode: __response.StatusCode) + { + ResponseBody = __content_422, + ResponseObject = __value_422, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } - try + if (ReadResponseAsString) { - __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1J2MidCompleteResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + } + catch (global::System.Net.Http.HttpRequestException __ex) + { + throw new global::AI21.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + + return __content; } - catch (global::System.Net.Http.HttpRequestException __ex) + else { - throw new global::System.InvalidOperationException(__content, __ex); - } + try + { + __response.EnsureSuccessStatusCode(); + } + catch (global::System.Net.Http.HttpRequestException __ex) + { + throw new global::AI21.ApiException( + message: __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } - return __content; + using var __responseStream = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); + + var __responseValue = await global::System.Text.Json.JsonSerializer.DeserializeAsync(__responseStream, typeof(string), JsonSerializerContext).ConfigureAwait(false) as string; + + return + __responseValue ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } } /// diff --git a/src/libs/AI21/Generated/AI21.CompletionClient.V1J2MidCustomModelComplete.g.cs b/src/libs/AI21/Generated/AI21.CompletionClient.V1J2MidCustomModelComplete.g.cs index e9509ad..82f159b 100644 --- a/src/libs/AI21/Generated/AI21.CompletionClient.V1J2MidCustomModelComplete.g.cs +++ b/src/libs/AI21/Generated/AI21.CompletionClient.V1J2MidCustomModelComplete.g.cs @@ -39,7 +39,7 @@ partial void ProcessV1J2MidCustomModelCompleteResponseContent( /// /// /// The token to cancel the operation with - /// + /// public async global::System.Threading.Tasks.Task V1J2MidCustomModelCompleteAsync( string customModelName, global::AI21.CompletionBody request, @@ -114,28 +114,97 @@ partial void ProcessV1J2MidCustomModelCompleteResponseContent( ProcessV1J2MidCustomModelCompleteResponse( httpClient: HttpClient, httpResponseMessage: __response); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + if (ReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + var __contentStream_422 = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); + __value_422 = await global::AI21.HTTPValidationError.FromJsonStreamAsync(__contentStream_422, JsonSerializerContext).ConfigureAwait(false); + } - var __content = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessV1J2MidCustomModelCompleteResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); + throw new global::AI21.ApiException( + message: __response.ReasonPhrase ?? string.Empty, + statusCode: __response.StatusCode) + { + ResponseBody = __content_422, + ResponseObject = __value_422, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } - try + if (ReadResponseAsString) { - __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1J2MidCustomModelCompleteResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + } + catch (global::System.Net.Http.HttpRequestException __ex) + { + throw new global::AI21.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + + return __content; } - catch (global::System.Net.Http.HttpRequestException __ex) + else { - throw new global::System.InvalidOperationException(__content, __ex); - } + try + { + __response.EnsureSuccessStatusCode(); + } + catch (global::System.Net.Http.HttpRequestException __ex) + { + throw new global::AI21.ApiException( + message: __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } - return __content; + using var __responseStream = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); + + var __responseValue = await global::System.Text.Json.JsonSerializer.DeserializeAsync(__responseStream, typeof(string), JsonSerializerContext).ConfigureAwait(false) as string; + + return + __responseValue ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } } /// diff --git a/src/libs/AI21/Generated/AI21.CompletionClient.V1J2UltraComplete.g.cs b/src/libs/AI21/Generated/AI21.CompletionClient.V1J2UltraComplete.g.cs index 7e618ad..3cb1524 100644 --- a/src/libs/AI21/Generated/AI21.CompletionClient.V1J2UltraComplete.g.cs +++ b/src/libs/AI21/Generated/AI21.CompletionClient.V1J2UltraComplete.g.cs @@ -36,7 +36,7 @@ partial void ProcessV1J2UltraCompleteResponseContent( /// /// /// The token to cancel the operation with - /// + /// public async global::System.Threading.Tasks.Task V1J2UltraCompleteAsync( global::AI21.CompletionBody request, string? model = default, @@ -108,28 +108,97 @@ partial void ProcessV1J2UltraCompleteResponseContent( ProcessV1J2UltraCompleteResponse( httpClient: HttpClient, httpResponseMessage: __response); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + if (ReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + var __contentStream_422 = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); + __value_422 = await global::AI21.HTTPValidationError.FromJsonStreamAsync(__contentStream_422, JsonSerializerContext).ConfigureAwait(false); + } - var __content = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessV1J2UltraCompleteResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); + throw new global::AI21.ApiException( + message: __response.ReasonPhrase ?? string.Empty, + statusCode: __response.StatusCode) + { + ResponseBody = __content_422, + ResponseObject = __value_422, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } - try + if (ReadResponseAsString) { - __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1J2UltraCompleteResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + } + catch (global::System.Net.Http.HttpRequestException __ex) + { + throw new global::AI21.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + + return __content; } - catch (global::System.Net.Http.HttpRequestException __ex) + else { - throw new global::System.InvalidOperationException(__content, __ex); - } + try + { + __response.EnsureSuccessStatusCode(); + } + catch (global::System.Net.Http.HttpRequestException __ex) + { + throw new global::AI21.ApiException( + message: __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } - return __content; + using var __responseStream = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); + + var __responseValue = await global::System.Text.Json.JsonSerializer.DeserializeAsync(__responseStream, typeof(string), JsonSerializerContext).ConfigureAwait(false) as string; + + return + __responseValue ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } } /// diff --git a/src/libs/AI21/Generated/AI21.CompletionClient.V1J2UltraComplete2.g.cs b/src/libs/AI21/Generated/AI21.CompletionClient.V1J2UltraComplete2.g.cs index 55d41fc..c1f73b4 100644 --- a/src/libs/AI21/Generated/AI21.CompletionClient.V1J2UltraComplete2.g.cs +++ b/src/libs/AI21/Generated/AI21.CompletionClient.V1J2UltraComplete2.g.cs @@ -39,7 +39,7 @@ partial void ProcessV1J2UltraComplete2ResponseContent( /// /// /// The token to cancel the operation with - /// + /// public async global::System.Threading.Tasks.Task V1J2UltraComplete2Async( string customModelName, global::AI21.CompletionBody request, @@ -114,28 +114,97 @@ partial void ProcessV1J2UltraComplete2ResponseContent( ProcessV1J2UltraComplete2Response( httpClient: HttpClient, httpResponseMessage: __response); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + if (ReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + var __contentStream_422 = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); + __value_422 = await global::AI21.HTTPValidationError.FromJsonStreamAsync(__contentStream_422, JsonSerializerContext).ConfigureAwait(false); + } - var __content = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessV1J2UltraComplete2ResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); + throw new global::AI21.ApiException( + message: __response.ReasonPhrase ?? string.Empty, + statusCode: __response.StatusCode) + { + ResponseBody = __content_422, + ResponseObject = __value_422, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } - try + if (ReadResponseAsString) { - __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1J2UltraComplete2ResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + } + catch (global::System.Net.Http.HttpRequestException __ex) + { + throw new global::AI21.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + + return __content; } - catch (global::System.Net.Http.HttpRequestException __ex) + else { - throw new global::System.InvalidOperationException(__content, __ex); - } + try + { + __response.EnsureSuccessStatusCode(); + } + catch (global::System.Net.Http.HttpRequestException __ex) + { + throw new global::AI21.ApiException( + message: __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } - return __content; + using var __responseStream = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); + + var __responseValue = await global::System.Text.Json.JsonSerializer.DeserializeAsync(__responseStream, typeof(string), JsonSerializerContext).ConfigureAwait(false) as string; + + return + __responseValue ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } } /// diff --git a/src/libs/AI21/Generated/AI21.CompletionClient.g.cs b/src/libs/AI21/Generated/AI21.CompletionClient.g.cs index 7bb1b9e..795e67b 100644 --- a/src/libs/AI21/Generated/AI21.CompletionClient.g.cs +++ b/src/libs/AI21/Generated/AI21.CompletionClient.g.cs @@ -25,6 +25,11 @@ public sealed partial class CompletionClient : global::AI21.ICompletionClient, g /// public global::System.Collections.Generic.List Authorizations { get; } + /// + public bool ReadResponseAsString { get; set; } +#if DEBUG + = true; +#endif /// /// /// diff --git a/src/libs/AI21/Generated/AI21.CustomModelsClient.V1CreateCustomModel.g.cs b/src/libs/AI21/Generated/AI21.CustomModelsClient.V1CreateCustomModel.g.cs index 1636fc5..412bd1b 100644 --- a/src/libs/AI21/Generated/AI21.CustomModelsClient.V1CreateCustomModel.g.cs +++ b/src/libs/AI21/Generated/AI21.CustomModelsClient.V1CreateCustomModel.g.cs @@ -31,7 +31,7 @@ partial void ProcessV1CreateCustomModelResponseContent( /// /// /// The token to cancel the operation with - /// + /// public async global::System.Threading.Tasks.Task V1CreateCustomModelAsync( global::AI21.CustomModelInput request, int? requestStartTime = default, @@ -99,28 +99,97 @@ partial void ProcessV1CreateCustomModelResponseContent( ProcessV1CreateCustomModelResponse( httpClient: HttpClient, httpResponseMessage: __response); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + if (ReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + var __contentStream_422 = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); + __value_422 = await global::AI21.HTTPValidationError.FromJsonStreamAsync(__contentStream_422, JsonSerializerContext).ConfigureAwait(false); + } - var __content = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessV1CreateCustomModelResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); + throw new global::AI21.ApiException( + message: __response.ReasonPhrase ?? string.Empty, + statusCode: __response.StatusCode) + { + ResponseBody = __content_422, + ResponseObject = __value_422, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } - try + if (ReadResponseAsString) { - __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1CreateCustomModelResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + } + catch (global::System.Net.Http.HttpRequestException __ex) + { + throw new global::AI21.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + + return __content; } - catch (global::System.Net.Http.HttpRequestException __ex) + else { - throw new global::System.InvalidOperationException(__content, __ex); - } + try + { + __response.EnsureSuccessStatusCode(); + } + catch (global::System.Net.Http.HttpRequestException __ex) + { + throw new global::AI21.ApiException( + message: __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } - return __content; + using var __responseStream = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); + + var __responseValue = await global::System.Text.Json.JsonSerializer.DeserializeAsync(__responseStream, typeof(string), JsonSerializerContext).ConfigureAwait(false) as string; + + return + __responseValue ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } } /// diff --git a/src/libs/AI21/Generated/AI21.CustomModelsClient.V1DeleteCustomModel.g.cs b/src/libs/AI21/Generated/AI21.CustomModelsClient.V1DeleteCustomModel.g.cs index 206368d..68f916a 100644 --- a/src/libs/AI21/Generated/AI21.CustomModelsClient.V1DeleteCustomModel.g.cs +++ b/src/libs/AI21/Generated/AI21.CustomModelsClient.V1DeleteCustomModel.g.cs @@ -31,7 +31,7 @@ partial void ProcessV1DeleteCustomModelResponseContent( /// Default Value: 1730898900272 /// /// The token to cancel the operation with - /// + /// public async global::System.Threading.Tasks.Task V1DeleteCustomModelAsync( string modelPid, int? requestStartTime = default, @@ -91,28 +91,97 @@ partial void ProcessV1DeleteCustomModelResponseContent( ProcessV1DeleteCustomModelResponse( httpClient: HttpClient, httpResponseMessage: __response); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + if (ReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + var __contentStream_422 = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); + __value_422 = await global::AI21.HTTPValidationError.FromJsonStreamAsync(__contentStream_422, JsonSerializerContext).ConfigureAwait(false); + } - var __content = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessV1DeleteCustomModelResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); + throw new global::AI21.ApiException( + message: __response.ReasonPhrase ?? string.Empty, + statusCode: __response.StatusCode) + { + ResponseBody = __content_422, + ResponseObject = __value_422, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } - try + if (ReadResponseAsString) { - __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1DeleteCustomModelResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + } + catch (global::System.Net.Http.HttpRequestException __ex) + { + throw new global::AI21.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + + return __content; } - catch (global::System.Net.Http.HttpRequestException __ex) + else { - throw new global::System.InvalidOperationException(__content, __ex); - } + try + { + __response.EnsureSuccessStatusCode(); + } + catch (global::System.Net.Http.HttpRequestException __ex) + { + throw new global::AI21.ApiException( + message: __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } - return __content; + using var __responseStream = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); + + var __responseValue = await global::System.Text.Json.JsonSerializer.DeserializeAsync(__responseStream, typeof(string), JsonSerializerContext).ConfigureAwait(false) as string; + + return + __responseValue ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } } } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.CustomModelsClient.V1GetCustomModel.g.cs b/src/libs/AI21/Generated/AI21.CustomModelsClient.V1GetCustomModel.g.cs index 9ea13f7..97d0d71 100644 --- a/src/libs/AI21/Generated/AI21.CustomModelsClient.V1GetCustomModel.g.cs +++ b/src/libs/AI21/Generated/AI21.CustomModelsClient.V1GetCustomModel.g.cs @@ -31,7 +31,7 @@ partial void ProcessV1GetCustomModelResponseContent( /// Default Value: 1730898900272 /// /// The token to cancel the operation with - /// + /// public async global::System.Threading.Tasks.Task V1GetCustomModelAsync( string customModelPid, int? requestStartTime = default, @@ -91,28 +91,97 @@ partial void ProcessV1GetCustomModelResponseContent( ProcessV1GetCustomModelResponse( httpClient: HttpClient, httpResponseMessage: __response); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + if (ReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + var __contentStream_422 = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); + __value_422 = await global::AI21.HTTPValidationError.FromJsonStreamAsync(__contentStream_422, JsonSerializerContext).ConfigureAwait(false); + } - var __content = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessV1GetCustomModelResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); + throw new global::AI21.ApiException( + message: __response.ReasonPhrase ?? string.Empty, + statusCode: __response.StatusCode) + { + ResponseBody = __content_422, + ResponseObject = __value_422, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } - try + if (ReadResponseAsString) { - __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1GetCustomModelResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + } + catch (global::System.Net.Http.HttpRequestException __ex) + { + throw new global::AI21.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + + return __content; } - catch (global::System.Net.Http.HttpRequestException __ex) + else { - throw new global::System.InvalidOperationException(__content, __ex); - } + try + { + __response.EnsureSuccessStatusCode(); + } + catch (global::System.Net.Http.HttpRequestException __ex) + { + throw new global::AI21.ApiException( + message: __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } - return __content; + using var __responseStream = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); + + var __responseValue = await global::System.Text.Json.JsonSerializer.DeserializeAsync(__responseStream, typeof(string), JsonSerializerContext).ConfigureAwait(false) as string; + + return + __responseValue ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } } } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.CustomModelsClient.V1GetCustomModels.g.cs b/src/libs/AI21/Generated/AI21.CustomModelsClient.V1GetCustomModels.g.cs index 82b7110..41c746e 100644 --- a/src/libs/AI21/Generated/AI21.CustomModelsClient.V1GetCustomModels.g.cs +++ b/src/libs/AI21/Generated/AI21.CustomModelsClient.V1GetCustomModels.g.cs @@ -33,7 +33,7 @@ partial void ProcessV1GetCustomModelsResponseContent( /// Default Value: 1730898900272 /// /// The token to cancel the operation with - /// + /// public async global::System.Threading.Tasks.Task V1GetCustomModelsAsync( bool? includeMetadata = default, int? requestStartTime = default, @@ -94,28 +94,97 @@ partial void ProcessV1GetCustomModelsResponseContent( ProcessV1GetCustomModelsResponse( httpClient: HttpClient, httpResponseMessage: __response); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + if (ReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + var __contentStream_422 = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); + __value_422 = await global::AI21.HTTPValidationError.FromJsonStreamAsync(__contentStream_422, JsonSerializerContext).ConfigureAwait(false); + } - var __content = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessV1GetCustomModelsResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); + throw new global::AI21.ApiException( + message: __response.ReasonPhrase ?? string.Empty, + statusCode: __response.StatusCode) + { + ResponseBody = __content_422, + ResponseObject = __value_422, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } - try + if (ReadResponseAsString) { - __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1GetCustomModelsResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + } + catch (global::System.Net.Http.HttpRequestException __ex) + { + throw new global::AI21.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + + return __content; } - catch (global::System.Net.Http.HttpRequestException __ex) + else { - throw new global::System.InvalidOperationException(__content, __ex); - } + try + { + __response.EnsureSuccessStatusCode(); + } + catch (global::System.Net.Http.HttpRequestException __ex) + { + throw new global::AI21.ApiException( + message: __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } - return __content; + using var __responseStream = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); + + var __responseValue = await global::System.Text.Json.JsonSerializer.DeserializeAsync(__responseStream, typeof(string), JsonSerializerContext).ConfigureAwait(false) as string; + + return + __responseValue ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } } } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.CustomModelsClient.V1UpdateCustomModel.g.cs b/src/libs/AI21/Generated/AI21.CustomModelsClient.V1UpdateCustomModel.g.cs index c1b65bf..49bbf95 100644 --- a/src/libs/AI21/Generated/AI21.CustomModelsClient.V1UpdateCustomModel.g.cs +++ b/src/libs/AI21/Generated/AI21.CustomModelsClient.V1UpdateCustomModel.g.cs @@ -34,7 +34,7 @@ partial void ProcessV1UpdateCustomModelResponseContent( /// /// /// The token to cancel the operation with - /// + /// public async global::System.Threading.Tasks.Task V1UpdateCustomModelAsync( string customModelPid, global::AI21.CustomModelUpdateBody request, @@ -105,28 +105,97 @@ partial void ProcessV1UpdateCustomModelResponseContent( ProcessV1UpdateCustomModelResponse( httpClient: HttpClient, httpResponseMessage: __response); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + if (ReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + var __contentStream_422 = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); + __value_422 = await global::AI21.HTTPValidationError.FromJsonStreamAsync(__contentStream_422, JsonSerializerContext).ConfigureAwait(false); + } - var __content = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessV1UpdateCustomModelResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); + throw new global::AI21.ApiException( + message: __response.ReasonPhrase ?? string.Empty, + statusCode: __response.StatusCode) + { + ResponseBody = __content_422, + ResponseObject = __value_422, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } - try + if (ReadResponseAsString) { - __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1UpdateCustomModelResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + } + catch (global::System.Net.Http.HttpRequestException __ex) + { + throw new global::AI21.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + + return __content; } - catch (global::System.Net.Http.HttpRequestException __ex) + else { - throw new global::System.InvalidOperationException(__content, __ex); - } + try + { + __response.EnsureSuccessStatusCode(); + } + catch (global::System.Net.Http.HttpRequestException __ex) + { + throw new global::AI21.ApiException( + message: __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } - return __content; + using var __responseStream = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); + + var __responseValue = await global::System.Text.Json.JsonSerializer.DeserializeAsync(__responseStream, typeof(string), JsonSerializerContext).ConfigureAwait(false) as string; + + return + __responseValue ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } } /// diff --git a/src/libs/AI21/Generated/AI21.CustomModelsClient.g.cs b/src/libs/AI21/Generated/AI21.CustomModelsClient.g.cs index 9890406..6f59aa0 100644 --- a/src/libs/AI21/Generated/AI21.CustomModelsClient.g.cs +++ b/src/libs/AI21/Generated/AI21.CustomModelsClient.g.cs @@ -25,6 +25,11 @@ public sealed partial class CustomModelsClient : global::AI21.ICustomModelsClien /// public global::System.Collections.Generic.List Authorizations { get; } + /// + public bool ReadResponseAsString { get; set; } +#if DEBUG + = true; +#endif /// /// /// diff --git a/src/libs/AI21/Generated/AI21.Exceptions.g.cs b/src/libs/AI21/Generated/AI21.Exceptions.g.cs new file mode 100644 index 0000000..d786fbd --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Exceptions.g.cs @@ -0,0 +1,90 @@ +#nullable enable + +namespace AI21 +{ + /// + /// Represents an exception thrown by the API. + /// + [global::System.Serializable] + public partial class ApiException : global::System.Exception + { + /// + /// The HTTP status code of the response. + /// + public global::System.Net.HttpStatusCode StatusCode { get; } + /// + /// The response body. + /// + public string? ResponseBody { get; set; } + /// + /// The response headers. + /// + public global::System.Collections.Generic.Dictionary>? ResponseHeaders { get; set; } + /// + /// Initializes a new instance of the class. + /// + public ApiException() + { + } + + /// + /// Initializes a new instance of the class with a specified error message. + /// + /// The message that describes the error. + /// The HTTP status code of the response. + public ApiException(string message, global::System.Net.HttpStatusCode statusCode) : base(message) + { + StatusCode = statusCode; + } + + /// + /// Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. + /// + /// The error message that explains the reason for the exception. + /// The exception that is the cause of the current exception, or a null reference if no inner exception is specified. + /// The HTTP status code of the response. + public ApiException(string message, global::System.Exception innerException, global::System.Net.HttpStatusCode statusCode) : base(message, innerException) + { + StatusCode = statusCode; + } + } + + /// + /// Represents an exception thrown by the API. + /// + /// + [global::System.Serializable] + public partial class ApiException : ApiException + { + /// + /// The response object. + /// + public T? ResponseObject { get; set; } + + /// + /// Initializes a new instance of the class. + /// + public ApiException() + { + } + + /// + /// Initializes a new instance of the class with a specified error message. + /// + /// The message that describes the error. + /// The HTTP status code of the response. + public ApiException(string message, global::System.Net.HttpStatusCode statusCode) : base(message, statusCode) + { + } + + /// + /// Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. + /// + /// The error message that explains the reason for the exception. + /// The exception that is the cause of the current exception, or a null reference if no inner exception is specified. + /// The HTTP status code of the response. + public ApiException(string message, global::System.Exception innerException, global::System.Net.HttpStatusCode statusCode) : base(message, innerException, statusCode) + { + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.IAi21Api.ConvertDocumentFileStudioV1ChatFilesConvertPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Api.ConvertDocumentFileStudioV1ChatFilesConvertPost.g.cs index 15765b8..19125e0 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Api.ConvertDocumentFileStudioV1ChatFilesConvertPost.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Api.ConvertDocumentFileStudioV1ChatFilesConvertPost.g.cs @@ -12,7 +12,7 @@ public partial interface IAi21Api /// /// /// The token to cancel the operation with - /// + /// global::System.Threading.Tasks.Task ConvertDocumentFileStudioV1ChatFilesConvertPostAsync( global::AI21.BodyConvertDocumentFileStudioV1ChatFilesConvertPost request, int? requestStartTime = default, diff --git a/src/libs/AI21/Generated/AI21.IAi21Api.GenerateOrgTokenStudioV1ConnectorsConnectedUsersOrganizationIdTokensPost.g.cs b/src/libs/AI21/Generated/AI21.IAi21Api.GenerateOrgTokenStudioV1ConnectorsConnectedUsersOrganizationIdTokensPost.g.cs index 6ceebc2..3a535c3 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Api.GenerateOrgTokenStudioV1ConnectorsConnectedUsersOrganizationIdTokensPost.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Api.GenerateOrgTokenStudioV1ConnectorsConnectedUsersOrganizationIdTokensPost.g.cs @@ -12,7 +12,7 @@ public partial interface IAi21Api /// Default Value: 1730898900272 /// /// The token to cancel the operation with - /// + /// global::System.Threading.Tasks.Task GenerateOrgTokenStudioV1ConnectorsConnectedUsersOrganizationIdTokensPostAsync( string organizationId, int? requestStartTime = default, diff --git a/src/libs/AI21/Generated/AI21.IAi21Api.GetDataSourceStatusStudioV1ConnectorsConnectedUsersOrganizationIdDataSourcesDataSourceStatusGet.g.cs b/src/libs/AI21/Generated/AI21.IAi21Api.GetDataSourceStatusStudioV1ConnectorsConnectedUsersOrganizationIdDataSourcesDataSourceStatusGet.g.cs index a58ad51..161ee8c 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Api.GetDataSourceStatusStudioV1ConnectorsConnectedUsersOrganizationIdDataSourcesDataSourceStatusGet.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Api.GetDataSourceStatusStudioV1ConnectorsConnectedUsersOrganizationIdDataSourcesDataSourceStatusGet.g.cs @@ -13,7 +13,7 @@ public partial interface IAi21Api /// Default Value: 1730898900272 /// /// The token to cancel the operation with - /// + /// global::System.Threading.Tasks.Task GetDataSourceStatusStudioV1ConnectorsConnectedUsersOrganizationIdDataSourcesDataSourceStatusGetAsync( string organizationId, string dataSource, diff --git a/src/libs/AI21/Generated/AI21.IAi21Api.GetOrgDataSourcesInfoStudioV1ConnectorsConnectedUsersOrganizationIdDataSourcesGet.g.cs b/src/libs/AI21/Generated/AI21.IAi21Api.GetOrgDataSourcesInfoStudioV1ConnectorsConnectedUsersOrganizationIdDataSourcesGet.g.cs index fbc2fd0..822448f 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Api.GetOrgDataSourcesInfoStudioV1ConnectorsConnectedUsersOrganizationIdDataSourcesGet.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Api.GetOrgDataSourcesInfoStudioV1ConnectorsConnectedUsersOrganizationIdDataSourcesGet.g.cs @@ -12,7 +12,7 @@ public partial interface IAi21Api /// Default Value: 1730898900272 /// /// The token to cancel the operation with - /// + /// global::System.Threading.Tasks.Task GetOrgDataSourcesInfoStudioV1ConnectorsConnectedUsersOrganizationIdDataSourcesGetAsync( string organizationId, int? requestStartTime = default, diff --git a/src/libs/AI21/Generated/AI21.IAi21Api.V1ConversationalRag.g.cs b/src/libs/AI21/Generated/AI21.IAi21Api.V1ConversationalRag.g.cs index b642710..76a51b9 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Api.V1ConversationalRag.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Api.V1ConversationalRag.g.cs @@ -12,7 +12,7 @@ public partial interface IAi21Api /// /// /// The token to cancel the operation with - /// + /// global::System.Threading.Tasks.Task V1ConversationalRagAsync( global::AI21.ConversationalRagConfig request, int? requestStartTime = default, diff --git a/src/libs/AI21/Generated/AI21.IAi21Api.g.cs b/src/libs/AI21/Generated/AI21.IAi21Api.g.cs index 176f5d3..5629d52 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Api.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Api.g.cs @@ -25,6 +25,12 @@ public partial interface IAi21Api : global::System.IDisposable /// public global::System.Collections.Generic.List Authorizations { get; } + /// + /// Gets or sets a value indicating whether the response content should be read as a string. + /// True by default in debug builds, false otherwise. + /// + public bool ReadResponseAsString { get; set; } + /// /// /// diff --git a/src/libs/AI21/Generated/AI21.IChatClient.V1J2UltraChat.g.cs b/src/libs/AI21/Generated/AI21.IChatClient.V1J2UltraChat.g.cs index 3df2843..68b5012 100644 --- a/src/libs/AI21/Generated/AI21.IChatClient.V1J2UltraChat.g.cs +++ b/src/libs/AI21/Generated/AI21.IChatClient.V1J2UltraChat.g.cs @@ -15,7 +15,7 @@ public partial interface IChatClient /// /// /// The token to cancel the operation with - /// + /// global::System.Threading.Tasks.Task V1J2UltraChatAsync( global::AI21.LanguageStudioApiServerDataTypesJ2ChatChatRequest request, string? model = default, diff --git a/src/libs/AI21/Generated/AI21.IChatClient.g.cs b/src/libs/AI21/Generated/AI21.IChatClient.g.cs index 1143915..52bda2a 100644 --- a/src/libs/AI21/Generated/AI21.IChatClient.g.cs +++ b/src/libs/AI21/Generated/AI21.IChatClient.g.cs @@ -24,6 +24,12 @@ public partial interface IChatClient : global::System.IDisposable /// public global::System.Collections.Generic.List Authorizations { get; } + /// + /// Gets or sets a value indicating whether the response content should be read as a string. + /// True by default in debug builds, false otherwise. + /// + public bool ReadResponseAsString { get; set; } + /// /// /// diff --git a/src/libs/AI21/Generated/AI21.ICompletionClient.V1J2GrandeComplete.g.cs b/src/libs/AI21/Generated/AI21.ICompletionClient.V1J2GrandeComplete.g.cs index b33757a..329b8e2 100644 --- a/src/libs/AI21/Generated/AI21.ICompletionClient.V1J2GrandeComplete.g.cs +++ b/src/libs/AI21/Generated/AI21.ICompletionClient.V1J2GrandeComplete.g.cs @@ -15,7 +15,7 @@ public partial interface ICompletionClient /// /// /// The token to cancel the operation with - /// + /// global::System.Threading.Tasks.Task V1J2GrandeCompleteAsync( global::AI21.CompletionBody request, string? model = default, diff --git a/src/libs/AI21/Generated/AI21.ICompletionClient.V1J2GrandeCustomModelComplete.g.cs b/src/libs/AI21/Generated/AI21.ICompletionClient.V1J2GrandeCustomModelComplete.g.cs index 4d34876..a61d51b 100644 --- a/src/libs/AI21/Generated/AI21.ICompletionClient.V1J2GrandeCustomModelComplete.g.cs +++ b/src/libs/AI21/Generated/AI21.ICompletionClient.V1J2GrandeCustomModelComplete.g.cs @@ -16,7 +16,7 @@ public partial interface ICompletionClient /// /// /// The token to cancel the operation with - /// + /// global::System.Threading.Tasks.Task V1J2GrandeCustomModelCompleteAsync( string customModelName, global::AI21.CompletionBody request, diff --git a/src/libs/AI21/Generated/AI21.ICompletionClient.V1J2GrandeInstructComplete.g.cs b/src/libs/AI21/Generated/AI21.ICompletionClient.V1J2GrandeInstructComplete.g.cs index e377bc4..21e1d2f 100644 --- a/src/libs/AI21/Generated/AI21.ICompletionClient.V1J2GrandeInstructComplete.g.cs +++ b/src/libs/AI21/Generated/AI21.ICompletionClient.V1J2GrandeInstructComplete.g.cs @@ -15,7 +15,7 @@ public partial interface ICompletionClient /// /// /// The token to cancel the operation with - /// + /// global::System.Threading.Tasks.Task V1J2GrandeInstructCompleteAsync( global::AI21.CompletionBody request, string? model = default, diff --git a/src/libs/AI21/Generated/AI21.ICompletionClient.V1J2JumboComplete.g.cs b/src/libs/AI21/Generated/AI21.ICompletionClient.V1J2JumboComplete.g.cs index eb9c8e2..cb184d7 100644 --- a/src/libs/AI21/Generated/AI21.ICompletionClient.V1J2JumboComplete.g.cs +++ b/src/libs/AI21/Generated/AI21.ICompletionClient.V1J2JumboComplete.g.cs @@ -15,7 +15,7 @@ public partial interface ICompletionClient /// /// /// The token to cancel the operation with - /// + /// global::System.Threading.Tasks.Task V1J2JumboCompleteAsync( global::AI21.CompletionBody request, string? model = default, diff --git a/src/libs/AI21/Generated/AI21.ICompletionClient.V1J2JumboComplete2.g.cs b/src/libs/AI21/Generated/AI21.ICompletionClient.V1J2JumboComplete2.g.cs index c20f44f..e685d30 100644 --- a/src/libs/AI21/Generated/AI21.ICompletionClient.V1J2JumboComplete2.g.cs +++ b/src/libs/AI21/Generated/AI21.ICompletionClient.V1J2JumboComplete2.g.cs @@ -16,7 +16,7 @@ public partial interface ICompletionClient /// /// /// The token to cancel the operation with - /// + /// global::System.Threading.Tasks.Task V1J2JumboComplete2Async( string customModelName, global::AI21.CompletionBody request, diff --git a/src/libs/AI21/Generated/AI21.ICompletionClient.V1J2JumboInstructComplete.g.cs b/src/libs/AI21/Generated/AI21.ICompletionClient.V1J2JumboInstructComplete.g.cs index d56a521..1cd52f2 100644 --- a/src/libs/AI21/Generated/AI21.ICompletionClient.V1J2JumboInstructComplete.g.cs +++ b/src/libs/AI21/Generated/AI21.ICompletionClient.V1J2JumboInstructComplete.g.cs @@ -15,7 +15,7 @@ public partial interface ICompletionClient /// /// /// The token to cancel the operation with - /// + /// global::System.Threading.Tasks.Task V1J2JumboInstructCompleteAsync( global::AI21.CompletionBody request, string? model = default, diff --git a/src/libs/AI21/Generated/AI21.ICompletionClient.V1J2LargeComplete.g.cs b/src/libs/AI21/Generated/AI21.ICompletionClient.V1J2LargeComplete.g.cs index 3d45185..f99b115 100644 --- a/src/libs/AI21/Generated/AI21.ICompletionClient.V1J2LargeComplete.g.cs +++ b/src/libs/AI21/Generated/AI21.ICompletionClient.V1J2LargeComplete.g.cs @@ -15,7 +15,7 @@ public partial interface ICompletionClient /// /// /// The token to cancel the operation with - /// + /// global::System.Threading.Tasks.Task V1J2LargeCompleteAsync( global::AI21.CompletionBody request, string? model = default, diff --git a/src/libs/AI21/Generated/AI21.ICompletionClient.V1J2LargeCustomModelComplete.g.cs b/src/libs/AI21/Generated/AI21.ICompletionClient.V1J2LargeCustomModelComplete.g.cs index 0e7e188..5d62057 100644 --- a/src/libs/AI21/Generated/AI21.ICompletionClient.V1J2LargeCustomModelComplete.g.cs +++ b/src/libs/AI21/Generated/AI21.ICompletionClient.V1J2LargeCustomModelComplete.g.cs @@ -16,7 +16,7 @@ public partial interface ICompletionClient /// /// /// The token to cancel the operation with - /// + /// global::System.Threading.Tasks.Task V1J2LargeCustomModelCompleteAsync( string customModelName, global::AI21.CompletionBody request, diff --git a/src/libs/AI21/Generated/AI21.ICompletionClient.V1J2LargeInstructComplete.g.cs b/src/libs/AI21/Generated/AI21.ICompletionClient.V1J2LargeInstructComplete.g.cs index 8ba5b43..ed732dd 100644 --- a/src/libs/AI21/Generated/AI21.ICompletionClient.V1J2LargeInstructComplete.g.cs +++ b/src/libs/AI21/Generated/AI21.ICompletionClient.V1J2LargeInstructComplete.g.cs @@ -15,7 +15,7 @@ public partial interface ICompletionClient /// /// /// The token to cancel the operation with - /// + /// global::System.Threading.Tasks.Task V1J2LargeInstructCompleteAsync( global::AI21.CompletionBody request, string? model = default, diff --git a/src/libs/AI21/Generated/AI21.ICompletionClient.V1J2LightComplete.g.cs b/src/libs/AI21/Generated/AI21.ICompletionClient.V1J2LightComplete.g.cs index c7b2cfa..7208268 100644 --- a/src/libs/AI21/Generated/AI21.ICompletionClient.V1J2LightComplete.g.cs +++ b/src/libs/AI21/Generated/AI21.ICompletionClient.V1J2LightComplete.g.cs @@ -15,7 +15,7 @@ public partial interface ICompletionClient /// /// /// The token to cancel the operation with - /// + /// global::System.Threading.Tasks.Task V1J2LightCompleteAsync( global::AI21.CompletionBody request, string? model = default, diff --git a/src/libs/AI21/Generated/AI21.ICompletionClient.V1J2LightCustomModelComplete.g.cs b/src/libs/AI21/Generated/AI21.ICompletionClient.V1J2LightCustomModelComplete.g.cs index e2e86fb..55d079b 100644 --- a/src/libs/AI21/Generated/AI21.ICompletionClient.V1J2LightCustomModelComplete.g.cs +++ b/src/libs/AI21/Generated/AI21.ICompletionClient.V1J2LightCustomModelComplete.g.cs @@ -16,7 +16,7 @@ public partial interface ICompletionClient /// /// /// The token to cancel the operation with - /// + /// global::System.Threading.Tasks.Task V1J2LightCustomModelCompleteAsync( string customModelName, global::AI21.CompletionBody request, diff --git a/src/libs/AI21/Generated/AI21.ICompletionClient.V1J2MidComplete.g.cs b/src/libs/AI21/Generated/AI21.ICompletionClient.V1J2MidComplete.g.cs index 3deb468..8e75176 100644 --- a/src/libs/AI21/Generated/AI21.ICompletionClient.V1J2MidComplete.g.cs +++ b/src/libs/AI21/Generated/AI21.ICompletionClient.V1J2MidComplete.g.cs @@ -15,7 +15,7 @@ public partial interface ICompletionClient /// /// /// The token to cancel the operation with - /// + /// global::System.Threading.Tasks.Task V1J2MidCompleteAsync( global::AI21.CompletionBody request, string? model = default, diff --git a/src/libs/AI21/Generated/AI21.ICompletionClient.V1J2MidCustomModelComplete.g.cs b/src/libs/AI21/Generated/AI21.ICompletionClient.V1J2MidCustomModelComplete.g.cs index 0000f1c..a2279af 100644 --- a/src/libs/AI21/Generated/AI21.ICompletionClient.V1J2MidCustomModelComplete.g.cs +++ b/src/libs/AI21/Generated/AI21.ICompletionClient.V1J2MidCustomModelComplete.g.cs @@ -16,7 +16,7 @@ public partial interface ICompletionClient /// /// /// The token to cancel the operation with - /// + /// global::System.Threading.Tasks.Task V1J2MidCustomModelCompleteAsync( string customModelName, global::AI21.CompletionBody request, diff --git a/src/libs/AI21/Generated/AI21.ICompletionClient.V1J2UltraComplete.g.cs b/src/libs/AI21/Generated/AI21.ICompletionClient.V1J2UltraComplete.g.cs index cc43349..e0b07ed 100644 --- a/src/libs/AI21/Generated/AI21.ICompletionClient.V1J2UltraComplete.g.cs +++ b/src/libs/AI21/Generated/AI21.ICompletionClient.V1J2UltraComplete.g.cs @@ -15,7 +15,7 @@ public partial interface ICompletionClient /// /// /// The token to cancel the operation with - /// + /// global::System.Threading.Tasks.Task V1J2UltraCompleteAsync( global::AI21.CompletionBody request, string? model = default, diff --git a/src/libs/AI21/Generated/AI21.ICompletionClient.V1J2UltraComplete2.g.cs b/src/libs/AI21/Generated/AI21.ICompletionClient.V1J2UltraComplete2.g.cs index dd0af59..c7d2bf4 100644 --- a/src/libs/AI21/Generated/AI21.ICompletionClient.V1J2UltraComplete2.g.cs +++ b/src/libs/AI21/Generated/AI21.ICompletionClient.V1J2UltraComplete2.g.cs @@ -16,7 +16,7 @@ public partial interface ICompletionClient /// /// /// The token to cancel the operation with - /// + /// global::System.Threading.Tasks.Task V1J2UltraComplete2Async( string customModelName, global::AI21.CompletionBody request, diff --git a/src/libs/AI21/Generated/AI21.ICompletionClient.g.cs b/src/libs/AI21/Generated/AI21.ICompletionClient.g.cs index 76b9882..d6b192b 100644 --- a/src/libs/AI21/Generated/AI21.ICompletionClient.g.cs +++ b/src/libs/AI21/Generated/AI21.ICompletionClient.g.cs @@ -24,6 +24,12 @@ public partial interface ICompletionClient : global::System.IDisposable /// public global::System.Collections.Generic.List Authorizations { get; } + /// + /// Gets or sets a value indicating whether the response content should be read as a string. + /// True by default in debug builds, false otherwise. + /// + public bool ReadResponseAsString { get; set; } + /// /// /// diff --git a/src/libs/AI21/Generated/AI21.ICustomModelsClient.V1CreateCustomModel.g.cs b/src/libs/AI21/Generated/AI21.ICustomModelsClient.V1CreateCustomModel.g.cs index 7d82816..afdaf67 100644 --- a/src/libs/AI21/Generated/AI21.ICustomModelsClient.V1CreateCustomModel.g.cs +++ b/src/libs/AI21/Generated/AI21.ICustomModelsClient.V1CreateCustomModel.g.cs @@ -12,7 +12,7 @@ public partial interface ICustomModelsClient /// /// /// The token to cancel the operation with - /// + /// global::System.Threading.Tasks.Task V1CreateCustomModelAsync( global::AI21.CustomModelInput request, int? requestStartTime = default, diff --git a/src/libs/AI21/Generated/AI21.ICustomModelsClient.V1DeleteCustomModel.g.cs b/src/libs/AI21/Generated/AI21.ICustomModelsClient.V1DeleteCustomModel.g.cs index e38be74..b5ce4f2 100644 --- a/src/libs/AI21/Generated/AI21.ICustomModelsClient.V1DeleteCustomModel.g.cs +++ b/src/libs/AI21/Generated/AI21.ICustomModelsClient.V1DeleteCustomModel.g.cs @@ -12,7 +12,7 @@ public partial interface ICustomModelsClient /// Default Value: 1730898900272 /// /// The token to cancel the operation with - /// + /// global::System.Threading.Tasks.Task V1DeleteCustomModelAsync( string modelPid, int? requestStartTime = default, diff --git a/src/libs/AI21/Generated/AI21.ICustomModelsClient.V1GetCustomModel.g.cs b/src/libs/AI21/Generated/AI21.ICustomModelsClient.V1GetCustomModel.g.cs index bf58efd..0521b60 100644 --- a/src/libs/AI21/Generated/AI21.ICustomModelsClient.V1GetCustomModel.g.cs +++ b/src/libs/AI21/Generated/AI21.ICustomModelsClient.V1GetCustomModel.g.cs @@ -12,7 +12,7 @@ public partial interface ICustomModelsClient /// Default Value: 1730898900272 /// /// The token to cancel the operation with - /// + /// global::System.Threading.Tasks.Task V1GetCustomModelAsync( string customModelPid, int? requestStartTime = default, diff --git a/src/libs/AI21/Generated/AI21.ICustomModelsClient.V1GetCustomModels.g.cs b/src/libs/AI21/Generated/AI21.ICustomModelsClient.V1GetCustomModels.g.cs index 044b436..c725405 100644 --- a/src/libs/AI21/Generated/AI21.ICustomModelsClient.V1GetCustomModels.g.cs +++ b/src/libs/AI21/Generated/AI21.ICustomModelsClient.V1GetCustomModels.g.cs @@ -14,7 +14,7 @@ public partial interface ICustomModelsClient /// Default Value: 1730898900272 /// /// The token to cancel the operation with - /// + /// global::System.Threading.Tasks.Task V1GetCustomModelsAsync( bool? includeMetadata = default, int? requestStartTime = default, diff --git a/src/libs/AI21/Generated/AI21.ICustomModelsClient.V1UpdateCustomModel.g.cs b/src/libs/AI21/Generated/AI21.ICustomModelsClient.V1UpdateCustomModel.g.cs index 4d45ffa..5e342a6 100644 --- a/src/libs/AI21/Generated/AI21.ICustomModelsClient.V1UpdateCustomModel.g.cs +++ b/src/libs/AI21/Generated/AI21.ICustomModelsClient.V1UpdateCustomModel.g.cs @@ -13,7 +13,7 @@ public partial interface ICustomModelsClient /// /// /// The token to cancel the operation with - /// + /// global::System.Threading.Tasks.Task V1UpdateCustomModelAsync( string customModelPid, global::AI21.CustomModelUpdateBody request, diff --git a/src/libs/AI21/Generated/AI21.ICustomModelsClient.g.cs b/src/libs/AI21/Generated/AI21.ICustomModelsClient.g.cs index effaffa..d66d59b 100644 --- a/src/libs/AI21/Generated/AI21.ICustomModelsClient.g.cs +++ b/src/libs/AI21/Generated/AI21.ICustomModelsClient.g.cs @@ -24,6 +24,12 @@ public partial interface ICustomModelsClient : global::System.IDisposable /// public global::System.Collections.Generic.List Authorizations { get; } + /// + /// Gets or sets a value indicating whether the response content should be read as a string. + /// True by default in debug builds, false otherwise. + /// + public bool ReadResponseAsString { get; set; } + /// /// /// diff --git a/src/libs/AI21/Generated/AI21.IJambaCompleteClient.V1ChatComplete.g.cs b/src/libs/AI21/Generated/AI21.IJambaCompleteClient.V1ChatComplete.g.cs index 23e08a8..28fa22d 100644 --- a/src/libs/AI21/Generated/AI21.IJambaCompleteClient.V1ChatComplete.g.cs +++ b/src/libs/AI21/Generated/AI21.IJambaCompleteClient.V1ChatComplete.g.cs @@ -18,7 +18,7 @@ public partial interface IJambaCompleteClient /// /// /// The token to cancel the operation with - /// + /// global::System.Threading.Tasks.Task>> V1ChatCompleteAsync( string authorization, global::AI21.LanguageStudioApiServerDataTypesChatChatRequest request, diff --git a/src/libs/AI21/Generated/AI21.IJambaCompleteClient.g.cs b/src/libs/AI21/Generated/AI21.IJambaCompleteClient.g.cs index d0836e7..0fc7440 100644 --- a/src/libs/AI21/Generated/AI21.IJambaCompleteClient.g.cs +++ b/src/libs/AI21/Generated/AI21.IJambaCompleteClient.g.cs @@ -24,6 +24,12 @@ public partial interface IJambaCompleteClient : global::System.IDisposable /// public global::System.Collections.Generic.List Authorizations { get; } + /// + /// Gets or sets a value indicating whether the response content should be read as a string. + /// True by default in debug builds, false otherwise. + /// + public bool ReadResponseAsString { get; set; } + /// /// /// diff --git a/src/libs/AI21/Generated/AI21.ILibraryManagementClient.V1LibraryDelete.g.cs b/src/libs/AI21/Generated/AI21.ILibraryManagementClient.V1LibraryDelete.g.cs index 0a57fb9..2d75955 100644 --- a/src/libs/AI21/Generated/AI21.ILibraryManagementClient.V1LibraryDelete.g.cs +++ b/src/libs/AI21/Generated/AI21.ILibraryManagementClient.V1LibraryDelete.g.cs @@ -15,7 +15,7 @@ public partial interface ILibraryManagementClient /// Default Value: 1730898900272 /// /// The token to cancel the operation with - /// + /// global::System.Threading.Tasks.Task V1LibraryDeleteAsync( global::System.Guid fileId, int? requestStartTime = default, diff --git a/src/libs/AI21/Generated/AI21.ILibraryManagementClient.V1LibraryManagement.g.cs b/src/libs/AI21/Generated/AI21.ILibraryManagementClient.V1LibraryManagement.g.cs index 8201270..3d59fdd 100644 --- a/src/libs/AI21/Generated/AI21.ILibraryManagementClient.V1LibraryManagement.g.cs +++ b/src/libs/AI21/Generated/AI21.ILibraryManagementClient.V1LibraryManagement.g.cs @@ -23,7 +23,7 @@ public partial interface ILibraryManagementClient /// /// /// The token to cancel the operation with - /// + /// global::System.Threading.Tasks.Task> V1LibraryManagementAsync( int? requestStartTime = default, string? name = default, diff --git a/src/libs/AI21/Generated/AI21.ILibraryManagementClient.V1LibraryManagement2.g.cs b/src/libs/AI21/Generated/AI21.ILibraryManagementClient.V1LibraryManagement2.g.cs index 04a86d2..29de315 100644 --- a/src/libs/AI21/Generated/AI21.ILibraryManagementClient.V1LibraryManagement2.g.cs +++ b/src/libs/AI21/Generated/AI21.ILibraryManagementClient.V1LibraryManagement2.g.cs @@ -20,7 +20,7 @@ public partial interface ILibraryManagementClient /// Default Value: 1730898900272 /// /// The token to cancel the operation with - /// + /// global::System.Threading.Tasks.Task V1LibraryManagement2Async( global::System.Guid fileId, int? requestStartTime = default, diff --git a/src/libs/AI21/Generated/AI21.ILibraryManagementClient.V1LibraryManagement3.g.cs b/src/libs/AI21/Generated/AI21.ILibraryManagementClient.V1LibraryManagement3.g.cs index 628aecb..e6066a4 100644 --- a/src/libs/AI21/Generated/AI21.ILibraryManagementClient.V1LibraryManagement3.g.cs +++ b/src/libs/AI21/Generated/AI21.ILibraryManagementClient.V1LibraryManagement3.g.cs @@ -21,7 +21,7 @@ public partial interface ILibraryManagementClient /// /// /// The token to cancel the operation with - /// + /// global::System.Threading.Tasks.Task V1LibraryManagement3Async( global::System.Guid fileId, global::AI21.FilesUpdateRequest request, diff --git a/src/libs/AI21/Generated/AI21.ILibraryManagementClient.V1LibraryUpload.g.cs b/src/libs/AI21/Generated/AI21.ILibraryManagementClient.V1LibraryUpload.g.cs index 24759a6..546ccae 100644 --- a/src/libs/AI21/Generated/AI21.ILibraryManagementClient.V1LibraryUpload.g.cs +++ b/src/libs/AI21/Generated/AI21.ILibraryManagementClient.V1LibraryUpload.g.cs @@ -18,7 +18,7 @@ public partial interface ILibraryManagementClient /// /// /// The token to cancel the operation with - /// + /// global::System.Threading.Tasks.Task V1LibraryUploadAsync( global::AI21.BodyV1LibraryUpload request, int? requestStartTime = default, diff --git a/src/libs/AI21/Generated/AI21.ILibraryManagementClient.g.cs b/src/libs/AI21/Generated/AI21.ILibraryManagementClient.g.cs index 3578372..ab3d974 100644 --- a/src/libs/AI21/Generated/AI21.ILibraryManagementClient.g.cs +++ b/src/libs/AI21/Generated/AI21.ILibraryManagementClient.g.cs @@ -24,6 +24,12 @@ public partial interface ILibraryManagementClient : global::System.IDisposable /// public global::System.Collections.Generic.List Authorizations { get; } + /// + /// Gets or sets a value indicating whether the response content should be read as a string. + /// True by default in debug builds, false otherwise. + /// + public bool ReadResponseAsString { get; set; } + /// /// /// diff --git a/src/libs/AI21/Generated/AI21.IParaphraseClient.V1Paraphraze.g.cs b/src/libs/AI21/Generated/AI21.IParaphraseClient.V1Paraphraze.g.cs index c6a8291..d25a98e 100644 --- a/src/libs/AI21/Generated/AI21.IParaphraseClient.V1Paraphraze.g.cs +++ b/src/libs/AI21/Generated/AI21.IParaphraseClient.V1Paraphraze.g.cs @@ -12,7 +12,7 @@ public partial interface IParaphraseClient /// /// /// The token to cancel the operation with - /// + /// global::System.Threading.Tasks.Task V1ParaphrazeAsync( global::AI21.ParaphraseBody request, int? requestStartTime = default, diff --git a/src/libs/AI21/Generated/AI21.IParaphraseClient.g.cs b/src/libs/AI21/Generated/AI21.IParaphraseClient.g.cs index 0aa85db..38cfc52 100644 --- a/src/libs/AI21/Generated/AI21.IParaphraseClient.g.cs +++ b/src/libs/AI21/Generated/AI21.IParaphraseClient.g.cs @@ -24,6 +24,12 @@ public partial interface IParaphraseClient : global::System.IDisposable /// public global::System.Collections.Generic.List Authorizations { get; } + /// + /// Gets or sets a value indicating whether the response content should be read as a string. + /// True by default in debug builds, false otherwise. + /// + public bool ReadResponseAsString { get; set; } + /// /// /// diff --git a/src/libs/AI21/Generated/AI21.IRAGEngineClient.V1LibraryAnswer.g.cs b/src/libs/AI21/Generated/AI21.IRAGEngineClient.V1LibraryAnswer.g.cs index e1105c8..70ccb95 100644 --- a/src/libs/AI21/Generated/AI21.IRAGEngineClient.V1LibraryAnswer.g.cs +++ b/src/libs/AI21/Generated/AI21.IRAGEngineClient.V1LibraryAnswer.g.cs @@ -12,7 +12,7 @@ public partial interface IRAGEngineClient /// /// /// The token to cancel the operation with - /// + /// global::System.Threading.Tasks.Task V1LibraryAnswerAsync( global::AI21.LibraryAnswerRequest request, int? requestStartTime = default, diff --git a/src/libs/AI21/Generated/AI21.IRAGEngineClient.V1LibraryManagement.g.cs b/src/libs/AI21/Generated/AI21.IRAGEngineClient.V1LibraryManagement.g.cs index 4cf56b2..3143d02 100644 --- a/src/libs/AI21/Generated/AI21.IRAGEngineClient.V1LibraryManagement.g.cs +++ b/src/libs/AI21/Generated/AI21.IRAGEngineClient.V1LibraryManagement.g.cs @@ -12,7 +12,7 @@ public partial interface IRAGEngineClient /// Default Value: 1730898900272 /// /// The token to cancel the operation with - /// + /// global::System.Threading.Tasks.Task V1LibraryManagementAsync( global::System.Guid fileId, int? requestStartTime = default, diff --git a/src/libs/AI21/Generated/AI21.IRAGEngineClient.V1LibrarySearch.g.cs b/src/libs/AI21/Generated/AI21.IRAGEngineClient.V1LibrarySearch.g.cs index 28e3727..9f6fc40 100644 --- a/src/libs/AI21/Generated/AI21.IRAGEngineClient.V1LibrarySearch.g.cs +++ b/src/libs/AI21/Generated/AI21.IRAGEngineClient.V1LibrarySearch.g.cs @@ -12,7 +12,7 @@ public partial interface IRAGEngineClient /// /// /// The token to cancel the operation with - /// + /// global::System.Threading.Tasks.Task V1LibrarySearchAsync( global::AI21.LibrarySearchRequest request, int? requestStartTime = default, diff --git a/src/libs/AI21/Generated/AI21.IRAGEngineClient.g.cs b/src/libs/AI21/Generated/AI21.IRAGEngineClient.g.cs index 70c04de..95a4a32 100644 --- a/src/libs/AI21/Generated/AI21.IRAGEngineClient.g.cs +++ b/src/libs/AI21/Generated/AI21.IRAGEngineClient.g.cs @@ -24,6 +24,12 @@ public partial interface IRAGEngineClient : global::System.IDisposable /// public global::System.Collections.Generic.List Authorizations { get; } + /// + /// Gets or sets a value indicating whether the response content should be read as a string. + /// True by default in debug builds, false otherwise. + /// + public bool ReadResponseAsString { get; set; } + /// /// /// diff --git a/src/libs/AI21/Generated/AI21.ISegmentationClient.V1Segmentation.g.cs b/src/libs/AI21/Generated/AI21.ISegmentationClient.V1Segmentation.g.cs index 2163e0c..8623ce0 100644 --- a/src/libs/AI21/Generated/AI21.ISegmentationClient.V1Segmentation.g.cs +++ b/src/libs/AI21/Generated/AI21.ISegmentationClient.V1Segmentation.g.cs @@ -12,7 +12,7 @@ public partial interface ISegmentationClient /// /// /// The token to cancel the operation with - /// + /// global::System.Threading.Tasks.Task V1SegmentationAsync( global::AI21.SegmentationBody request, int? requestStartTime = default, diff --git a/src/libs/AI21/Generated/AI21.ISegmentationClient.g.cs b/src/libs/AI21/Generated/AI21.ISegmentationClient.g.cs index 812d8b5..aeb4b3f 100644 --- a/src/libs/AI21/Generated/AI21.ISegmentationClient.g.cs +++ b/src/libs/AI21/Generated/AI21.ISegmentationClient.g.cs @@ -24,6 +24,12 @@ public partial interface ISegmentationClient : global::System.IDisposable /// public global::System.Collections.Generic.List Authorizations { get; } + /// + /// Gets or sets a value indicating whether the response content should be read as a string. + /// True by default in debug builds, false otherwise. + /// + public bool ReadResponseAsString { get; set; } + /// /// /// diff --git a/src/libs/AI21/Generated/AI21.ISummarizeClient.V1Summarize.g.cs b/src/libs/AI21/Generated/AI21.ISummarizeClient.V1Summarize.g.cs index e61361b..969a808 100644 --- a/src/libs/AI21/Generated/AI21.ISummarizeClient.V1Summarize.g.cs +++ b/src/libs/AI21/Generated/AI21.ISummarizeClient.V1Summarize.g.cs @@ -12,7 +12,7 @@ public partial interface ISummarizeClient /// /// /// The token to cancel the operation with - /// + /// global::System.Threading.Tasks.Task V1SummarizeAsync( global::AI21.SummarizeBody request, int? requestStartTime = default, diff --git a/src/libs/AI21/Generated/AI21.ISummarizeClient.V1SummarizeBySegment.g.cs b/src/libs/AI21/Generated/AI21.ISummarizeClient.V1SummarizeBySegment.g.cs index e8d3fdd..03cfaae 100644 --- a/src/libs/AI21/Generated/AI21.ISummarizeClient.V1SummarizeBySegment.g.cs +++ b/src/libs/AI21/Generated/AI21.ISummarizeClient.V1SummarizeBySegment.g.cs @@ -12,7 +12,7 @@ public partial interface ISummarizeClient /// /// /// The token to cancel the operation with - /// + /// global::System.Threading.Tasks.Task V1SummarizeBySegmentAsync( global::AI21.SegmentedSummaryBody request, int? requestStartTime = default, diff --git a/src/libs/AI21/Generated/AI21.ISummarizeClient.g.cs b/src/libs/AI21/Generated/AI21.ISummarizeClient.g.cs index c269c75..d5f4a09 100644 --- a/src/libs/AI21/Generated/AI21.ISummarizeClient.g.cs +++ b/src/libs/AI21/Generated/AI21.ISummarizeClient.g.cs @@ -24,6 +24,12 @@ public partial interface ISummarizeClient : global::System.IDisposable /// public global::System.Collections.Generic.List Authorizations { get; } + /// + /// Gets or sets a value indicating whether the response content should be read as a string. + /// True by default in debug builds, false otherwise. + /// + public bool ReadResponseAsString { get; set; } + /// /// /// diff --git a/src/libs/AI21/Generated/AI21.JambaCompleteClient.V1ChatComplete.g.cs b/src/libs/AI21/Generated/AI21.JambaCompleteClient.V1ChatComplete.g.cs index e605d7b..4aab6f2 100644 --- a/src/libs/AI21/Generated/AI21.JambaCompleteClient.V1ChatComplete.g.cs +++ b/src/libs/AI21/Generated/AI21.JambaCompleteClient.V1ChatComplete.g.cs @@ -39,7 +39,7 @@ partial void ProcessV1ChatCompleteResponseContent( /// /// /// The token to cancel the operation with - /// + /// public async global::System.Threading.Tasks.Task>> V1ChatCompleteAsync( string authorization, global::AI21.LanguageStudioApiServerDataTypesChatChatRequest request, @@ -113,30 +113,99 @@ partial void ProcessV1ChatCompleteResponseContent( ProcessV1ChatCompleteResponse( httpClient: HttpClient, httpResponseMessage: __response); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + if (ReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + var __contentStream_422 = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); + __value_422 = await global::AI21.HTTPValidationError.FromJsonStreamAsync(__contentStream_422, JsonSerializerContext).ConfigureAwait(false); + } - var __content = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessV1ChatCompleteResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); + throw new global::AI21.ApiException( + message: __response.ReasonPhrase ?? string.Empty, + statusCode: __response.StatusCode) + { + ResponseBody = __content_422, + ResponseObject = __value_422, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } - try + if (ReadResponseAsString) { - __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1ChatCompleteResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + } + catch (global::System.Net.Http.HttpRequestException __ex) + { + throw new global::AI21.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + + return + global::AI21.AnyOf>.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } - catch (global::System.Net.Http.HttpRequestException __ex) + else { - throw new global::System.InvalidOperationException(__content, __ex); - } + try + { + __response.EnsureSuccessStatusCode(); + } + catch (global::System.Net.Http.HttpRequestException __ex) + { + throw new global::AI21.ApiException( + message: __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } - return - global::AI21.AnyOf>.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + using var __responseStream = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); + + var __responseValue = await global::AI21.AnyOf>.FromJsonStreamAsync(__responseStream, JsonSerializerContext).ConfigureAwait(false); + + return + __responseValue ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } } /// diff --git a/src/libs/AI21/Generated/AI21.JambaCompleteClient.g.cs b/src/libs/AI21/Generated/AI21.JambaCompleteClient.g.cs index fed23fc..0d11eb0 100644 --- a/src/libs/AI21/Generated/AI21.JambaCompleteClient.g.cs +++ b/src/libs/AI21/Generated/AI21.JambaCompleteClient.g.cs @@ -25,6 +25,11 @@ public sealed partial class JambaCompleteClient : global::AI21.IJambaCompleteCli /// public global::System.Collections.Generic.List Authorizations { get; } + /// + public bool ReadResponseAsString { get; set; } +#if DEBUG + = true; +#endif /// /// /// diff --git a/src/libs/AI21/Generated/AI21.LibraryManagementClient.V1LibraryDelete.g.cs b/src/libs/AI21/Generated/AI21.LibraryManagementClient.V1LibraryDelete.g.cs index a2041a1..b0896c5 100644 --- a/src/libs/AI21/Generated/AI21.LibraryManagementClient.V1LibraryDelete.g.cs +++ b/src/libs/AI21/Generated/AI21.LibraryManagementClient.V1LibraryDelete.g.cs @@ -34,7 +34,7 @@ partial void ProcessV1LibraryDeleteResponseContent( /// Default Value: 1730898900272 /// /// The token to cancel the operation with - /// + /// public async global::System.Threading.Tasks.Task V1LibraryDeleteAsync( global::System.Guid fileId, int? requestStartTime = default, @@ -94,30 +94,99 @@ partial void ProcessV1LibraryDeleteResponseContent( ProcessV1LibraryDeleteResponse( httpClient: HttpClient, httpResponseMessage: __response); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + if (ReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + var __contentStream_422 = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); + __value_422 = await global::AI21.HTTPValidationError.FromJsonStreamAsync(__contentStream_422, JsonSerializerContext).ConfigureAwait(false); + } - var __content = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessV1LibraryDeleteResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); + throw new global::AI21.ApiException( + message: __response.ReasonPhrase ?? string.Empty, + statusCode: __response.StatusCode) + { + ResponseBody = __content_422, + ResponseObject = __value_422, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } - try + if (ReadResponseAsString) { - __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1LibraryDeleteResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + } + catch (global::System.Net.Http.HttpRequestException __ex) + { + throw new global::AI21.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + + return + global::AI21.FileDeleteResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } - catch (global::System.Net.Http.HttpRequestException __ex) + else { - throw new global::System.InvalidOperationException(__content, __ex); - } + try + { + __response.EnsureSuccessStatusCode(); + } + catch (global::System.Net.Http.HttpRequestException __ex) + { + throw new global::AI21.ApiException( + message: __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } - return - global::AI21.FileDeleteResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + using var __responseStream = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); + + var __responseValue = await global::AI21.FileDeleteResponse.FromJsonStreamAsync(__responseStream, JsonSerializerContext).ConfigureAwait(false); + + return + __responseValue ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } } } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.LibraryManagementClient.V1LibraryManagement.g.cs b/src/libs/AI21/Generated/AI21.LibraryManagementClient.V1LibraryManagement.g.cs index 4ed9553..6466a8f 100644 --- a/src/libs/AI21/Generated/AI21.LibraryManagementClient.V1LibraryManagement.g.cs +++ b/src/libs/AI21/Generated/AI21.LibraryManagementClient.V1LibraryManagement.g.cs @@ -52,7 +52,7 @@ partial void ProcessV1LibraryManagementResponseContent( /// /// /// The token to cancel the operation with - /// + /// public async global::System.Threading.Tasks.Task> V1LibraryManagementAsync( int? requestStartTime = default, string? name = default, @@ -133,30 +133,99 @@ partial void ProcessV1LibraryManagementResponseContent( ProcessV1LibraryManagementResponse( httpClient: HttpClient, httpResponseMessage: __response); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + if (ReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + var __contentStream_422 = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); + __value_422 = await global::AI21.HTTPValidationError.FromJsonStreamAsync(__contentStream_422, JsonSerializerContext).ConfigureAwait(false); + } - var __content = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessV1LibraryManagementResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); + throw new global::AI21.ApiException( + message: __response.ReasonPhrase ?? string.Empty, + statusCode: __response.StatusCode) + { + ResponseBody = __content_422, + ResponseObject = __value_422, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } - try + if (ReadResponseAsString) { - __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1LibraryManagementResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + } + catch (global::System.Net.Http.HttpRequestException __ex) + { + throw new global::AI21.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + + return + global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) as global::System.Collections.Generic.IList ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } - catch (global::System.Net.Http.HttpRequestException __ex) + else { - throw new global::System.InvalidOperationException(__content, __ex); - } + try + { + __response.EnsureSuccessStatusCode(); + } + catch (global::System.Net.Http.HttpRequestException __ex) + { + throw new global::AI21.ApiException( + message: __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } - return - global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) as global::System.Collections.Generic.IList ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + using var __responseStream = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); + + var __responseValue = await global::System.Text.Json.JsonSerializer.DeserializeAsync(__responseStream, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) as global::System.Collections.Generic.IList; + + return + __responseValue ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } } } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.LibraryManagementClient.V1LibraryManagement2.g.cs b/src/libs/AI21/Generated/AI21.LibraryManagementClient.V1LibraryManagement2.g.cs index d9d240f..fc13eea 100644 --- a/src/libs/AI21/Generated/AI21.LibraryManagementClient.V1LibraryManagement2.g.cs +++ b/src/libs/AI21/Generated/AI21.LibraryManagementClient.V1LibraryManagement2.g.cs @@ -39,7 +39,7 @@ partial void ProcessV1LibraryManagement2ResponseContent( /// Default Value: 1730898900272 /// /// The token to cancel the operation with - /// + /// public async global::System.Threading.Tasks.Task V1LibraryManagement2Async( global::System.Guid fileId, int? requestStartTime = default, @@ -99,30 +99,99 @@ partial void ProcessV1LibraryManagement2ResponseContent( ProcessV1LibraryManagement2Response( httpClient: HttpClient, httpResponseMessage: __response); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + if (ReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + var __contentStream_422 = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); + __value_422 = await global::AI21.HTTPValidationError.FromJsonStreamAsync(__contentStream_422, JsonSerializerContext).ConfigureAwait(false); + } - var __content = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessV1LibraryManagement2ResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); + throw new global::AI21.ApiException( + message: __response.ReasonPhrase ?? string.Empty, + statusCode: __response.StatusCode) + { + ResponseBody = __content_422, + ResponseObject = __value_422, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } - try + if (ReadResponseAsString) { - __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1LibraryManagement2ResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + } + catch (global::System.Net.Http.HttpRequestException __ex) + { + throw new global::AI21.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + + return + global::AI21.FileResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } - catch (global::System.Net.Http.HttpRequestException __ex) + else { - throw new global::System.InvalidOperationException(__content, __ex); - } + try + { + __response.EnsureSuccessStatusCode(); + } + catch (global::System.Net.Http.HttpRequestException __ex) + { + throw new global::AI21.ApiException( + message: __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } - return - global::AI21.FileResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + using var __responseStream = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); + + var __responseValue = await global::AI21.FileResponse.FromJsonStreamAsync(__responseStream, JsonSerializerContext).ConfigureAwait(false); + + return + __responseValue ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } } } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.LibraryManagementClient.V1LibraryManagement3.g.cs b/src/libs/AI21/Generated/AI21.LibraryManagementClient.V1LibraryManagement3.g.cs index be40854..e7bcf1b 100644 --- a/src/libs/AI21/Generated/AI21.LibraryManagementClient.V1LibraryManagement3.g.cs +++ b/src/libs/AI21/Generated/AI21.LibraryManagementClient.V1LibraryManagement3.g.cs @@ -42,7 +42,7 @@ partial void ProcessV1LibraryManagement3ResponseContent( /// /// /// The token to cancel the operation with - /// + /// public async global::System.Threading.Tasks.Task V1LibraryManagement3Async( global::System.Guid fileId, global::AI21.FilesUpdateRequest request, @@ -113,28 +113,97 @@ partial void ProcessV1LibraryManagement3ResponseContent( ProcessV1LibraryManagement3Response( httpClient: HttpClient, httpResponseMessage: __response); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + if (ReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + var __contentStream_422 = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); + __value_422 = await global::AI21.HTTPValidationError.FromJsonStreamAsync(__contentStream_422, JsonSerializerContext).ConfigureAwait(false); + } - var __content = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessV1LibraryManagement3ResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); + throw new global::AI21.ApiException( + message: __response.ReasonPhrase ?? string.Empty, + statusCode: __response.StatusCode) + { + ResponseBody = __content_422, + ResponseObject = __value_422, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } - try + if (ReadResponseAsString) { - __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1LibraryManagement3ResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + } + catch (global::System.Net.Http.HttpRequestException __ex) + { + throw new global::AI21.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + + return __content; } - catch (global::System.Net.Http.HttpRequestException __ex) + else { - throw new global::System.InvalidOperationException(__content, __ex); - } + try + { + __response.EnsureSuccessStatusCode(); + } + catch (global::System.Net.Http.HttpRequestException __ex) + { + throw new global::AI21.ApiException( + message: __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } - return __content; + using var __responseStream = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); + + var __responseValue = await global::System.Text.Json.JsonSerializer.DeserializeAsync(__responseStream, typeof(string), JsonSerializerContext).ConfigureAwait(false) as string; + + return + __responseValue ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } } /// diff --git a/src/libs/AI21/Generated/AI21.LibraryManagementClient.V1LibraryUpload.g.cs b/src/libs/AI21/Generated/AI21.LibraryManagementClient.V1LibraryUpload.g.cs index 15e4bee..eecae42 100644 --- a/src/libs/AI21/Generated/AI21.LibraryManagementClient.V1LibraryUpload.g.cs +++ b/src/libs/AI21/Generated/AI21.LibraryManagementClient.V1LibraryUpload.g.cs @@ -37,7 +37,7 @@ partial void ProcessV1LibraryUploadResponseContent( /// /// /// The token to cancel the operation with - /// + /// public async global::System.Threading.Tasks.Task V1LibraryUploadAsync( global::AI21.BodyV1LibraryUpload request, int? requestStartTime = default, @@ -135,30 +135,99 @@ partial void ProcessV1LibraryUploadResponseContent( ProcessV1LibraryUploadResponse( httpClient: HttpClient, httpResponseMessage: __response); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + if (ReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + var __contentStream_422 = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); + __value_422 = await global::AI21.HTTPValidationError.FromJsonStreamAsync(__contentStream_422, JsonSerializerContext).ConfigureAwait(false); + } - var __content = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessV1LibraryUploadResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); + throw new global::AI21.ApiException( + message: __response.ReasonPhrase ?? string.Empty, + statusCode: __response.StatusCode) + { + ResponseBody = __content_422, + ResponseObject = __value_422, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } - try + if (ReadResponseAsString) { - __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1LibraryUploadResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + } + catch (global::System.Net.Http.HttpRequestException __ex) + { + throw new global::AI21.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + + return + global::AI21.FileUploadResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } - catch (global::System.Net.Http.HttpRequestException __ex) + else { - throw new global::System.InvalidOperationException(__content, __ex); - } + try + { + __response.EnsureSuccessStatusCode(); + } + catch (global::System.Net.Http.HttpRequestException __ex) + { + throw new global::AI21.ApiException( + message: __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } - return - global::AI21.FileUploadResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + using var __responseStream = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); + + var __responseValue = await global::AI21.FileUploadResponse.FromJsonStreamAsync(__responseStream, JsonSerializerContext).ConfigureAwait(false); + + return + __responseValue ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } } /// diff --git a/src/libs/AI21/Generated/AI21.LibraryManagementClient.g.cs b/src/libs/AI21/Generated/AI21.LibraryManagementClient.g.cs index af2cd7c..167b639 100644 --- a/src/libs/AI21/Generated/AI21.LibraryManagementClient.g.cs +++ b/src/libs/AI21/Generated/AI21.LibraryManagementClient.g.cs @@ -25,6 +25,11 @@ public sealed partial class LibraryManagementClient : global::AI21.ILibraryManag /// public global::System.Collections.Generic.List Authorizations { get; } + /// + public bool ReadResponseAsString { get; set; } +#if DEBUG + = true; +#endif /// /// /// diff --git a/src/libs/AI21/Generated/AI21.Models.AssistantMessage.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.AssistantMessage.Json.g.cs new file mode 100644 index 0000000..b1e675d --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.AssistantMessage.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class AssistantMessage + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.AssistantMessage? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.AssistantMessage), + jsonSerializerContext) as global::AI21.AssistantMessage; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.AssistantMessage? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.AssistantMessage), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.AssistantMessage; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.AssistantMessage.g.cs b/src/libs/AI21/Generated/AI21.Models.AssistantMessage.g.cs index 4ef7eb4..b02e34e 100644 --- a/src/libs/AI21/Generated/AI21.Models.AssistantMessage.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.AssistantMessage.g.cs @@ -43,91 +43,40 @@ public sealed partial class AssistantMessage [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// Initializes a new instance of the class. /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.AssistantMessage? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.AssistantMessage), - jsonSerializerContext) as global::AI21.AssistantMessage; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.AssistantMessage? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + /// + /// The role of an individual message.
+ /// - `user`: Input provided by the user. Any instructions given here that conflict
+ /// with instructions given in the `system` prompt take precedence over the `system`
+ /// prompt instructions.
+ /// - `assistant`: Response generated by the model.
+ /// - `system`: Initial instructions provided to the system to provide general guidance
+ /// on the tone and voice of the generated message. An initial system message is
+ /// optional but recommended to provide guidance on the tone of the chat. For
+ /// example, "You are a helpful chatbot with a background in earth sciences and a
+ /// charming French accent."
+ /// Default Value: assistant + /// + /// + /// + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public AssistantMessage( + global::AI21.AssistantMessageRole? role, + string? content, + global::System.Collections.Generic.IList? toolCalls) { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.AssistantMessage), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.AssistantMessage; + this.Role = role; + this.Content = content; + this.ToolCalls = toolCalls; } /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// Initializes a new instance of the class. /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + public AssistantMessage() { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); } - } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.BodyConvertDocumentFileStudioV1ChatFilesConvertPost.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.BodyConvertDocumentFileStudioV1ChatFilesConvertPost.Json.g.cs new file mode 100644 index 0000000..886c3d7 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.BodyConvertDocumentFileStudioV1ChatFilesConvertPost.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class BodyConvertDocumentFileStudioV1ChatFilesConvertPost + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.BodyConvertDocumentFileStudioV1ChatFilesConvertPost? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.BodyConvertDocumentFileStudioV1ChatFilesConvertPost), + jsonSerializerContext) as global::AI21.BodyConvertDocumentFileStudioV1ChatFilesConvertPost; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.BodyConvertDocumentFileStudioV1ChatFilesConvertPost? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.BodyConvertDocumentFileStudioV1ChatFilesConvertPost), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.BodyConvertDocumentFileStudioV1ChatFilesConvertPost; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.BodyConvertDocumentFileStudioV1ChatFilesConvertPost.g.cs b/src/libs/AI21/Generated/AI21.Models.BodyConvertDocumentFileStudioV1ChatFilesConvertPost.g.cs index 1e21e87..912e72f 100644 --- a/src/libs/AI21/Generated/AI21.Models.BodyConvertDocumentFileStudioV1ChatFilesConvertPost.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.BodyConvertDocumentFileStudioV1ChatFilesConvertPost.g.cs @@ -21,91 +21,22 @@ public sealed partial class BodyConvertDocumentFileStudioV1ChatFilesConvertPost [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. + /// Initializes a new instance of the class. /// - public static global::AI21.BodyConvertDocumentFileStudioV1ChatFilesConvertPost? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + /// + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public BodyConvertDocumentFileStudioV1ChatFilesConvertPost( + global::System.Collections.Generic.IList files) { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.BodyConvertDocumentFileStudioV1ChatFilesConvertPost), - jsonSerializerContext) as global::AI21.BodyConvertDocumentFileStudioV1ChatFilesConvertPost; + this.Files = files ?? throw new global::System.ArgumentNullException(nameof(files)); } /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// Initializes a new instance of the class. /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.BodyConvertDocumentFileStudioV1ChatFilesConvertPost? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + public BodyConvertDocumentFileStudioV1ChatFilesConvertPost() { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.BodyConvertDocumentFileStudioV1ChatFilesConvertPost), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.BodyConvertDocumentFileStudioV1ChatFilesConvertPost; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.BodyV1LibraryUpload.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.BodyV1LibraryUpload.Json.g.cs new file mode 100644 index 0000000..2d9060e --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.BodyV1LibraryUpload.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class BodyV1LibraryUpload + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.BodyV1LibraryUpload? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.BodyV1LibraryUpload), + jsonSerializerContext) as global::AI21.BodyV1LibraryUpload; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.BodyV1LibraryUpload? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.BodyV1LibraryUpload), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.BodyV1LibraryUpload; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.BodyV1LibraryUpload.g.cs b/src/libs/AI21/Generated/AI21.Models.BodyV1LibraryUpload.g.cs index 92ed4ea..e4e081a 100644 --- a/src/libs/AI21/Generated/AI21.Models.BodyV1LibraryUpload.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.BodyV1LibraryUpload.g.cs @@ -52,91 +52,37 @@ public sealed partial class BodyV1LibraryUpload [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. + /// Initializes a new instance of the class. /// - public static global::AI21.BodyV1LibraryUpload? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + /// + /// + /// + /// + /// + /// + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public BodyV1LibraryUpload( + byte[] file, + string filename, + string? path, + global::System.Collections.Generic.IList? labels, + string? publicUrl, + string? customConfigs) { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.BodyV1LibraryUpload), - jsonSerializerContext) as global::AI21.BodyV1LibraryUpload; + this.File = file ?? throw new global::System.ArgumentNullException(nameof(file)); + this.Filename = filename ?? throw new global::System.ArgumentNullException(nameof(filename)); + this.Path = path; + this.Labels = labels; + this.PublicUrl = publicUrl; + this.CustomConfigs = customConfigs; } /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// Initializes a new instance of the class. /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.BodyV1LibraryUpload? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + public BodyV1LibraryUpload() { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.BodyV1LibraryUpload), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.BodyV1LibraryUpload; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ChatCompletion.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.ChatCompletion.Json.g.cs new file mode 100644 index 0000000..a368f1f --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.ChatCompletion.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class ChatCompletion + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.ChatCompletion? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.ChatCompletion), + jsonSerializerContext) as global::AI21.ChatCompletion; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.ChatCompletion? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.ChatCompletion), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ChatCompletion; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.ChatCompletion.g.cs b/src/libs/AI21/Generated/AI21.Models.ChatCompletion.g.cs index a807c01..7613500 100644 --- a/src/libs/AI21/Generated/AI21.Models.ChatCompletion.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ChatCompletion.g.cs @@ -43,91 +43,37 @@ public sealed partial class ChatCompletion [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.ChatCompletion? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.ChatCompletion), - jsonSerializerContext) as global::AI21.ChatCompletion; - } - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// Initializes a new instance of the class. /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.ChatCompletion? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + /// + /// A unique ID for the request (not the message). Repeated identical requests
+ /// get different IDs. However, for a streaming response, the ID will be the same
+ /// for all responses in the stream. + /// + /// + /// One or more responses, depending on the `n` parameter from the request. + /// + /// + /// + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public ChatCompletion( + string id, + global::System.Collections.Generic.IList choices, + global::AI21.UsageInfo usage, + object? meta) { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.ChatCompletion), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ChatCompletion; + this.Id = id ?? throw new global::System.ArgumentNullException(nameof(id)); + this.Choices = choices ?? throw new global::System.ArgumentNullException(nameof(choices)); + this.Usage = usage ?? throw new global::System.ArgumentNullException(nameof(usage)); + this.Meta = meta; } /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// Initializes a new instance of the class. /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + public ChatCompletion() { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); } - } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ChatCompletionMeta.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.ChatCompletionMeta.Json.g.cs new file mode 100644 index 0000000..db6253e --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.ChatCompletionMeta.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class ChatCompletionMeta + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.ChatCompletionMeta? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.ChatCompletionMeta), + jsonSerializerContext) as global::AI21.ChatCompletionMeta; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.ChatCompletionMeta? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.ChatCompletionMeta), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ChatCompletionMeta; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.ChatCompletionMeta.g.cs b/src/libs/AI21/Generated/AI21.Models.ChatCompletionMeta.g.cs index 2e68dd1..9502a99 100644 --- a/src/libs/AI21/Generated/AI21.Models.ChatCompletionMeta.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ChatCompletionMeta.g.cs @@ -15,91 +15,13 @@ public sealed partial class ChatCompletionMeta [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. + /// Initializes a new instance of the class. /// - public static global::AI21.ChatCompletionMeta? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public ChatCompletionMeta( + ) { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.ChatCompletionMeta), - jsonSerializerContext) as global::AI21.ChatCompletionMeta; } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.ChatCompletionMeta? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.ChatCompletionMeta), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ChatCompletionMeta; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ChatCompletionResponseChoice.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.ChatCompletionResponseChoice.Json.g.cs new file mode 100644 index 0000000..51338c0 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.ChatCompletionResponseChoice.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class ChatCompletionResponseChoice + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.ChatCompletionResponseChoice? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.ChatCompletionResponseChoice), + jsonSerializerContext) as global::AI21.ChatCompletionResponseChoice; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.ChatCompletionResponseChoice? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.ChatCompletionResponseChoice), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ChatCompletionResponseChoice; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.ChatCompletionResponseChoice.g.cs b/src/libs/AI21/Generated/AI21.Models.ChatCompletionResponseChoice.g.cs index 234b45d..6e7789a 100644 --- a/src/libs/AI21/Generated/AI21.Models.ChatCompletionResponseChoice.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ChatCompletionResponseChoice.g.cs @@ -46,91 +46,40 @@ public sealed partial class ChatCompletionResponseChoice [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// Initializes a new instance of the class. /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.ChatCompletionResponseChoice? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.ChatCompletionResponseChoice), - jsonSerializerContext) as global::AI21.ChatCompletionResponseChoice; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.ChatCompletionResponseChoice? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + /// + /// Zero-based index of the message in the list of messages. Note that this might not
+ /// correspond with the position in the response list. + /// + /// + /// + /// + /// Why the message ended. Possible reasons:
+ /// - `stop`: The response ended naturally as a complete answer (due to
+ /// [end-of-sequence token](https://huggingface.co/docs/transformers/v4.32.1/en/llm_tutorial#generate-text))
+ /// or because the model generated a stop sequence provided in the request.
+ /// - `length`: The response ended by reaching `max_tokens`. + /// + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public ChatCompletionResponseChoice( + int index, + global::AI21.AssistantMessage message, + global::AI21.Logprobs? logprobs, + string? finishReason) { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.ChatCompletionResponseChoice), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ChatCompletionResponseChoice; + this.Index = index; + this.Message = message ?? throw new global::System.ArgumentNullException(nameof(message)); + this.Logprobs = logprobs; + this.FinishReason = finishReason; } /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// Initializes a new instance of the class. /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + public ChatCompletionResponseChoice() { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); } - } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ChatCompletionResponseDeltaChoice.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.ChatCompletionResponseDeltaChoice.Json.g.cs new file mode 100644 index 0000000..3ee460a --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.ChatCompletionResponseDeltaChoice.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class ChatCompletionResponseDeltaChoice + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.ChatCompletionResponseDeltaChoice? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.ChatCompletionResponseDeltaChoice), + jsonSerializerContext) as global::AI21.ChatCompletionResponseDeltaChoice; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.ChatCompletionResponseDeltaChoice? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.ChatCompletionResponseDeltaChoice), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ChatCompletionResponseDeltaChoice; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.ChatCompletionResponseDeltaChoice.g.cs b/src/libs/AI21/Generated/AI21.Models.ChatCompletionResponseDeltaChoice.g.cs index a2b7f85..c224d0e 100644 --- a/src/libs/AI21/Generated/AI21.Models.ChatCompletionResponseDeltaChoice.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ChatCompletionResponseDeltaChoice.g.cs @@ -49,91 +49,43 @@ public sealed partial class ChatCompletionResponseDeltaChoice [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.ChatCompletionResponseDeltaChoice? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.ChatCompletionResponseDeltaChoice), - jsonSerializerContext) as global::AI21.ChatCompletionResponseDeltaChoice; - } - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// Initializes a new instance of the class. /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.ChatCompletionResponseDeltaChoice? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + /// + /// Always zero in streamed responses. + /// + /// + /// - **The first message** in the stream will be an object set to `{"role":"assistant"}`.
+ /// - **Subsequent messages** will have an object `{"content": __token__}` with the generated token. + /// + /// + /// + /// One of the following string values:
+ /// - `null`: All messages but the last will return null for `finish_reason`.
+ /// - `stop`: The response ended naturally as a complete answer (due to
+ /// [end-of-sequence token](https://huggingface.co/docs/transformers/v4.32.1/en/llm_tutorial#generate-text))
+ /// or because the model generated a stop sequence provided in the request.
+ /// - `length`: The response ended by reaching `max_tokens`. + /// + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public ChatCompletionResponseDeltaChoice( + int index, + global::AI21.AnyOf delta, + global::AI21.Logprobs? logprobs, + string? finishReason) { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.ChatCompletionResponseDeltaChoice), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ChatCompletionResponseDeltaChoice; + this.Index = index; + this.Delta = delta; + this.Logprobs = logprobs; + this.FinishReason = finishReason; } /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// Initializes a new instance of the class. /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + public ChatCompletionResponseDeltaChoice() { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); } - } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ChatCompletionVllmStreamingMessage.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.ChatCompletionVllmStreamingMessage.Json.g.cs new file mode 100644 index 0000000..c81518b --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.ChatCompletionVllmStreamingMessage.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class ChatCompletionVllmStreamingMessage + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.ChatCompletionVllmStreamingMessage? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.ChatCompletionVllmStreamingMessage), + jsonSerializerContext) as global::AI21.ChatCompletionVllmStreamingMessage; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.ChatCompletionVllmStreamingMessage? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.ChatCompletionVllmStreamingMessage), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ChatCompletionVllmStreamingMessage; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.ChatCompletionVllmStreamingMessage.g.cs b/src/libs/AI21/Generated/AI21.Models.ChatCompletionVllmStreamingMessage.g.cs index 22d58ff..7b99545 100644 --- a/src/libs/AI21/Generated/AI21.Models.ChatCompletionVllmStreamingMessage.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ChatCompletionVllmStreamingMessage.g.cs @@ -42,91 +42,37 @@ public sealed partial class ChatCompletionVllmStreamingMessage [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.ChatCompletionVllmStreamingMessage? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.ChatCompletionVllmStreamingMessage), - jsonSerializerContext) as global::AI21.ChatCompletionVllmStreamingMessage; - } - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// Initializes a new instance of the class. /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.ChatCompletionVllmStreamingMessage? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + /// + /// A unique ID for the request (not the message). Repeated identical requests
+ /// get different IDs. However, for a streaming response, the ID will be the same
+ /// for all responses in the stream. + /// + /// + /// The message + /// + /// + /// + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public ChatCompletionVllmStreamingMessage( + string id, + global::System.Collections.Generic.IList choices, + global::AI21.UsageInfo? usage, + object? meta) { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.ChatCompletionVllmStreamingMessage), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ChatCompletionVllmStreamingMessage; + this.Id = id ?? throw new global::System.ArgumentNullException(nameof(id)); + this.Choices = choices ?? throw new global::System.ArgumentNullException(nameof(choices)); + this.Usage = usage; + this.Meta = meta; } /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// Initializes a new instance of the class. /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + public ChatCompletionVllmStreamingMessage() { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); } - } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ChatCompletionVllmStreamingMessageMeta.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.ChatCompletionVllmStreamingMessageMeta.Json.g.cs new file mode 100644 index 0000000..fff4d30 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.ChatCompletionVllmStreamingMessageMeta.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class ChatCompletionVllmStreamingMessageMeta + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.ChatCompletionVllmStreamingMessageMeta? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.ChatCompletionVllmStreamingMessageMeta), + jsonSerializerContext) as global::AI21.ChatCompletionVllmStreamingMessageMeta; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.ChatCompletionVllmStreamingMessageMeta? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.ChatCompletionVllmStreamingMessageMeta), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ChatCompletionVllmStreamingMessageMeta; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.ChatCompletionVllmStreamingMessageMeta.g.cs b/src/libs/AI21/Generated/AI21.Models.ChatCompletionVllmStreamingMessageMeta.g.cs index 4d56a33..e5465c8 100644 --- a/src/libs/AI21/Generated/AI21.Models.ChatCompletionVllmStreamingMessageMeta.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ChatCompletionVllmStreamingMessageMeta.g.cs @@ -15,91 +15,13 @@ public sealed partial class ChatCompletionVllmStreamingMessageMeta [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. + /// Initializes a new instance of the class. /// - public static global::AI21.ChatCompletionVllmStreamingMessageMeta? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public ChatCompletionVllmStreamingMessageMeta( + ) { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.ChatCompletionVllmStreamingMessageMeta), - jsonSerializerContext) as global::AI21.ChatCompletionVllmStreamingMessageMeta; } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.ChatCompletionVllmStreamingMessageMeta? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.ChatCompletionVllmStreamingMessageMeta), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ChatCompletionVllmStreamingMessageMeta; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ChatMessage.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.ChatMessage.Json.g.cs new file mode 100644 index 0000000..ac2f546 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.ChatMessage.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class ChatMessage + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.ChatMessage? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.ChatMessage), + jsonSerializerContext) as global::AI21.ChatMessage; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.ChatMessage? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.ChatMessage), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ChatMessage; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.ChatMessage.g.cs b/src/libs/AI21/Generated/AI21.Models.ChatMessage.g.cs index c5fd933..b6318c3 100644 --- a/src/libs/AI21/Generated/AI21.Models.ChatMessage.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ChatMessage.g.cs @@ -29,91 +29,27 @@ public sealed partial class ChatMessage [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// Initializes a new instance of the class. /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.ChatMessage? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.ChatMessage), - jsonSerializerContext) as global::AI21.ChatMessage; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.ChatMessage? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + /// + /// An enumeration. + /// + /// + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public ChatMessage( + global::AI21.RoleType role, + string text) { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.ChatMessage), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ChatMessage; + this.Role = role; + this.Text = text ?? throw new global::System.ArgumentNullException(nameof(text)); } /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// Initializes a new instance of the class. /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + public ChatMessage() { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); } - } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ChatOutput.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.ChatOutput.Json.g.cs new file mode 100644 index 0000000..33c0c7e --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.ChatOutput.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class ChatOutput + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.ChatOutput? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.ChatOutput), + jsonSerializerContext) as global::AI21.ChatOutput; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.ChatOutput? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.ChatOutput), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ChatOutput; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.ChatOutput.g.cs b/src/libs/AI21/Generated/AI21.Models.ChatOutput.g.cs index afb0eda..34c0e77 100644 --- a/src/libs/AI21/Generated/AI21.Models.ChatOutput.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ChatOutput.g.cs @@ -36,91 +36,30 @@ public sealed partial class ChatOutput [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// Initializes a new instance of the class. /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.ChatOutput? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.ChatOutput), - jsonSerializerContext) as global::AI21.ChatOutput; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.ChatOutput? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + /// + /// + /// An enumeration. + /// + /// + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public ChatOutput( + string text, + global::AI21.RoleType role, + global::AI21.FinishReason finishReason) { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.ChatOutput), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ChatOutput; + this.Text = text ?? throw new global::System.ArgumentNullException(nameof(text)); + this.Role = role; + this.FinishReason = finishReason ?? throw new global::System.ArgumentNullException(nameof(finishReason)); } /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// Initializes a new instance of the class. /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + public ChatOutput() { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); } - } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ChatResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.ChatResponse.Json.g.cs new file mode 100644 index 0000000..b0522d9 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.ChatResponse.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class ChatResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.ChatResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.ChatResponse), + jsonSerializerContext) as global::AI21.ChatResponse; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.ChatResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.ChatResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ChatResponse; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.ChatResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.ChatResponse.g.cs index 0558cce..0dd42f8 100644 --- a/src/libs/AI21/Generated/AI21.Models.ChatResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ChatResponse.g.cs @@ -30,91 +30,29 @@ public sealed partial class ChatResponse [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// Initializes a new instance of the class. /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.ChatResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.ChatResponse), - jsonSerializerContext) as global::AI21.ChatResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.ChatResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + /// + /// A unique ID for the request (not the message). Repeated identical requests
+ /// get different IDs. However, for a streaming response, the ID will be the same
+ /// for all responses in the stream. + /// + /// + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public ChatResponse( + string id, + global::System.Collections.Generic.IList outputs) { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.ChatResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ChatResponse; + this.Id = id ?? throw new global::System.ArgumentNullException(nameof(id)); + this.Outputs = outputs ?? throw new global::System.ArgumentNullException(nameof(outputs)); } /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// Initializes a new instance of the class. /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + public ChatResponse() { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); } - } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ChatStreamingContentDelta.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.ChatStreamingContentDelta.Json.g.cs new file mode 100644 index 0000000..c27a2ce --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.ChatStreamingContentDelta.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class ChatStreamingContentDelta + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.ChatStreamingContentDelta? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.ChatStreamingContentDelta), + jsonSerializerContext) as global::AI21.ChatStreamingContentDelta; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.ChatStreamingContentDelta? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.ChatStreamingContentDelta), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ChatStreamingContentDelta; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.ChatStreamingContentDelta.g.cs b/src/libs/AI21/Generated/AI21.Models.ChatStreamingContentDelta.g.cs index 0dd28e0..745265f 100644 --- a/src/libs/AI21/Generated/AI21.Models.ChatStreamingContentDelta.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ChatStreamingContentDelta.g.cs @@ -21,91 +21,22 @@ public sealed partial class ChatStreamingContentDelta [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. + /// Initializes a new instance of the class. /// - public static global::AI21.ChatStreamingContentDelta? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + /// + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public ChatStreamingContentDelta( + string content) { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.ChatStreamingContentDelta), - jsonSerializerContext) as global::AI21.ChatStreamingContentDelta; + this.Content = content ?? throw new global::System.ArgumentNullException(nameof(content)); } /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// Initializes a new instance of the class. /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.ChatStreamingContentDelta? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + public ChatStreamingContentDelta() { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.ChatStreamingContentDelta), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ChatStreamingContentDelta; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ChatStreamingFirstDelta.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.ChatStreamingFirstDelta.Json.g.cs new file mode 100644 index 0000000..c1219e7 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.ChatStreamingFirstDelta.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class ChatStreamingFirstDelta + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.ChatStreamingFirstDelta? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.ChatStreamingFirstDelta), + jsonSerializerContext) as global::AI21.ChatStreamingFirstDelta; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.ChatStreamingFirstDelta? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.ChatStreamingFirstDelta), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ChatStreamingFirstDelta; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.ChatStreamingFirstDelta.g.cs b/src/libs/AI21/Generated/AI21.Models.ChatStreamingFirstDelta.g.cs index 08544c8..648dc1b 100644 --- a/src/libs/AI21/Generated/AI21.Models.ChatStreamingFirstDelta.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ChatStreamingFirstDelta.g.cs @@ -31,91 +31,33 @@ public sealed partial class ChatStreamingFirstDelta [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.ChatStreamingFirstDelta? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.ChatStreamingFirstDelta), - jsonSerializerContext) as global::AI21.ChatStreamingFirstDelta; - } - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// Initializes a new instance of the class. /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.ChatStreamingFirstDelta? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + /// + /// The role of an individual message.
+ /// - `user`: Input provided by the user. Any instructions given here that conflict
+ /// with instructions given in the `system` prompt take precedence over the `system`
+ /// prompt instructions.
+ /// - `assistant`: Response generated by the model.
+ /// - `system`: Initial instructions provided to the system to provide general guidance
+ /// on the tone and voice of the generated message. An initial system message is
+ /// optional but recommended to provide guidance on the tone of the chat. For
+ /// example, "You are a helpful chatbot with a background in earth sciences and a
+ /// charming French accent." + /// + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public ChatStreamingFirstDelta( + global::AI21.ChatStreamingFirstDeltaRole role) { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.ChatStreamingFirstDelta), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ChatStreamingFirstDelta; + this.Role = role; } /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// Initializes a new instance of the class. /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + public ChatStreamingFirstDelta() { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); } - } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ComparisonOperator.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.ComparisonOperator.Json.g.cs new file mode 100644 index 0000000..50597d6 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.ComparisonOperator.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class ComparisonOperator + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.ComparisonOperator? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.ComparisonOperator), + jsonSerializerContext) as global::AI21.ComparisonOperator; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.ComparisonOperator? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.ComparisonOperator), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ComparisonOperator; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.ComparisonOperator.g.cs b/src/libs/AI21/Generated/AI21.Models.ComparisonOperator.g.cs index 0f9af5a..f1f71c6 100644 --- a/src/libs/AI21/Generated/AI21.Models.ComparisonOperator.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ComparisonOperator.g.cs @@ -15,91 +15,13 @@ public sealed partial class ComparisonOperator [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. + /// Initializes a new instance of the class. /// - public static global::AI21.ComparisonOperator? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public ComparisonOperator( + ) { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.ComparisonOperator), - jsonSerializerContext) as global::AI21.ComparisonOperator; } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.ComparisonOperator? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.ComparisonOperator), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ComparisonOperator; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.CompletionBody.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.CompletionBody.Json.g.cs new file mode 100644 index 0000000..c96b15c --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.CompletionBody.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class CompletionBody + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.CompletionBody? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.CompletionBody), + jsonSerializerContext) as global::AI21.CompletionBody; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.CompletionBody? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.CompletionBody), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.CompletionBody; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.CompletionBody.g.cs b/src/libs/AI21/Generated/AI21.Models.CompletionBody.g.cs index 8074ce3..db6e497 100644 --- a/src/libs/AI21/Generated/AI21.Models.CompletionBody.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.CompletionBody.g.cs @@ -99,91 +99,75 @@ public sealed partial class CompletionBody [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// Initializes a new instance of the class. /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.CompletionBody? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.CompletionBody), - jsonSerializerContext) as global::AI21.CompletionBody; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.CompletionBody? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + /// + /// + /// Default Value: 1 + /// + /// + /// Default Value: 16 + /// + /// + /// Default Value: 0 + /// + /// + /// Default Value: 1 + /// + /// + /// Default Value: 1 + /// + /// + /// Default Value: 0 + /// + /// + /// + /// Default Value: 0 + /// + /// + /// + /// + /// + /// + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public CompletionBody( + string prompt, + int? numResults, + int? maxTokens, + int? minTokens, + double? temperature, + double? topP, + double? minP, + global::System.Collections.Generic.IList? stopSequences, + int? topKReturn, + object? logitBias, + global::AI21.Penalty? frequencyPenalty, + global::AI21.Penalty? presencePenalty, + global::AI21.Penalty? countPenalty, + int? epoch) { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.CompletionBody), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.CompletionBody; + this.Prompt = prompt ?? throw new global::System.ArgumentNullException(nameof(prompt)); + this.NumResults = numResults; + this.MaxTokens = maxTokens; + this.MinTokens = minTokens; + this.Temperature = temperature; + this.TopP = topP; + this.MinP = minP; + this.StopSequences = stopSequences; + this.TopKReturn = topKReturn; + this.LogitBias = logitBias; + this.FrequencyPenalty = frequencyPenalty; + this.PresencePenalty = presencePenalty; + this.CountPenalty = countPenalty; + this.Epoch = epoch; } /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// Initializes a new instance of the class. /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + public CompletionBody() { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); } - } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.CompletionBodyLogitBias.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.CompletionBodyLogitBias.Json.g.cs new file mode 100644 index 0000000..00fac81 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.CompletionBodyLogitBias.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class CompletionBodyLogitBias + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.CompletionBodyLogitBias? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.CompletionBodyLogitBias), + jsonSerializerContext) as global::AI21.CompletionBodyLogitBias; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.CompletionBodyLogitBias? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.CompletionBodyLogitBias), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.CompletionBodyLogitBias; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.CompletionBodyLogitBias.g.cs b/src/libs/AI21/Generated/AI21.Models.CompletionBodyLogitBias.g.cs index 44dbf08..1137a1d 100644 --- a/src/libs/AI21/Generated/AI21.Models.CompletionBodyLogitBias.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.CompletionBodyLogitBias.g.cs @@ -15,91 +15,13 @@ public sealed partial class CompletionBodyLogitBias [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. + /// Initializes a new instance of the class. /// - public static global::AI21.CompletionBodyLogitBias? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public CompletionBodyLogitBias( + ) { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.CompletionBodyLogitBias), - jsonSerializerContext) as global::AI21.CompletionBodyLogitBias; } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.CompletionBodyLogitBias? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.CompletionBodyLogitBias), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.CompletionBodyLogitBias; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ConnectorsDataSources.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.ConnectorsDataSources.Json.g.cs new file mode 100644 index 0000000..db39aa3 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.ConnectorsDataSources.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class ConnectorsDataSources + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.ConnectorsDataSources? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.ConnectorsDataSources), + jsonSerializerContext) as global::AI21.ConnectorsDataSources; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.ConnectorsDataSources? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.ConnectorsDataSources), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ConnectorsDataSources; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.ConnectorsDataSources.g.cs b/src/libs/AI21/Generated/AI21.Models.ConnectorsDataSources.g.cs index c844fc6..3b3b358 100644 --- a/src/libs/AI21/Generated/AI21.Models.ConnectorsDataSources.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ConnectorsDataSources.g.cs @@ -21,91 +21,22 @@ public sealed partial class ConnectorsDataSources [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. + /// Initializes a new instance of the class. /// - public static global::AI21.ConnectorsDataSources? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + /// + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public ConnectorsDataSources( + global::System.Collections.Generic.IList dataSources) { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.ConnectorsDataSources), - jsonSerializerContext) as global::AI21.ConnectorsDataSources; + this.DataSources = dataSources ?? throw new global::System.ArgumentNullException(nameof(dataSources)); } /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// Initializes a new instance of the class. /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.ConnectorsDataSources? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + public ConnectorsDataSources() { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.ConnectorsDataSources), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ConnectorsDataSources; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ConnectorsStatus.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.ConnectorsStatus.Json.g.cs new file mode 100644 index 0000000..c09bcde --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.ConnectorsStatus.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class ConnectorsStatus + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.ConnectorsStatus? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.ConnectorsStatus), + jsonSerializerContext) as global::AI21.ConnectorsStatus; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.ConnectorsStatus? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.ConnectorsStatus), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ConnectorsStatus; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.ConnectorsStatus.g.cs b/src/libs/AI21/Generated/AI21.Models.ConnectorsStatus.g.cs index 3d03664..dd8e095 100644 --- a/src/libs/AI21/Generated/AI21.Models.ConnectorsStatus.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ConnectorsStatus.g.cs @@ -43,91 +43,33 @@ public sealed partial class ConnectorsStatus [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// Initializes a new instance of the class. /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.ConnectorsStatus? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.ConnectorsStatus), - jsonSerializerContext) as global::AI21.ConnectorsStatus; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.ConnectorsStatus? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + /// + /// + /// An enumeration. + /// + /// + /// + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public ConnectorsStatus( + string createdAt, + global::AI21.ConnectorsWorkflowStatus workflowStatus, + int filesSuccessfullyUploaded, + int failedUploadedFiles) { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.ConnectorsStatus), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ConnectorsStatus; + this.CreatedAt = createdAt ?? throw new global::System.ArgumentNullException(nameof(createdAt)); + this.WorkflowStatus = workflowStatus; + this.FilesSuccessfullyUploaded = filesSuccessfullyUploaded; + this.FailedUploadedFiles = failedUploadedFiles; } /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// Initializes a new instance of the class. /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + public ConnectorsStatus() { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); } - } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ConnectorsToken.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.ConnectorsToken.Json.g.cs new file mode 100644 index 0000000..e7742e2 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.ConnectorsToken.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class ConnectorsToken + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.ConnectorsToken? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.ConnectorsToken), + jsonSerializerContext) as global::AI21.ConnectorsToken; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.ConnectorsToken? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.ConnectorsToken), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ConnectorsToken; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.ConnectorsToken.g.cs b/src/libs/AI21/Generated/AI21.Models.ConnectorsToken.g.cs index 44cae4a..2a6f48b 100644 --- a/src/libs/AI21/Generated/AI21.Models.ConnectorsToken.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ConnectorsToken.g.cs @@ -21,91 +21,22 @@ public sealed partial class ConnectorsToken [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. + /// Initializes a new instance of the class. /// - public static global::AI21.ConnectorsToken? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + /// + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public ConnectorsToken( + string token) { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.ConnectorsToken), - jsonSerializerContext) as global::AI21.ConnectorsToken; + this.Token = token ?? throw new global::System.ArgumentNullException(nameof(token)); } /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// Initializes a new instance of the class. /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.ConnectorsToken? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + public ConnectorsToken() { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.ConnectorsToken), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ConnectorsToken; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ConversationalRagConfig.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.ConversationalRagConfig.Json.g.cs new file mode 100644 index 0000000..eed64f0 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.ConversationalRagConfig.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class ConversationalRagConfig + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.ConversationalRagConfig? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.ConversationalRagConfig), + jsonSerializerContext) as global::AI21.ConversationalRagConfig; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.ConversationalRagConfig? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.ConversationalRagConfig), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ConversationalRagConfig; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.ConversationalRagConfig.g.cs b/src/libs/AI21/Generated/AI21.Models.ConversationalRagConfig.g.cs index 2b02455..99644f6 100644 --- a/src/libs/AI21/Generated/AI21.Models.ConversationalRagConfig.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ConversationalRagConfig.g.cs @@ -70,91 +70,56 @@ public sealed partial class ConversationalRagConfig [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. + /// Initializes a new instance of the class. /// - public static global::AI21.ConversationalRagConfig? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.ConversationalRagConfig), - jsonSerializerContext) as global::AI21.ConversationalRagConfig; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.ConversationalRagConfig? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + /// + /// messages + /// + /// + /// + /// + /// + /// Default Value: 15 + /// + /// + /// Default Value: default + /// + /// + /// Default Value: 0.8 + /// + /// + /// + /// Default Value: 0.98 + /// + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public ConversationalRagConfig( + global::System.Collections.Generic.IList messages, + string? path, + global::System.Collections.Generic.IList? labels, + global::System.Collections.Generic.IList? fileIds, + int? maxSegments, + global::AI21.ConversationalRagConfigRetrievalStrategy? retrievalStrategy, + double? retrievalSimilarityThreshold, + int? maxNeighbors, + double? hybridSearchAlpha) { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.ConversationalRagConfig), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ConversationalRagConfig; + this.Messages = messages ?? throw new global::System.ArgumentNullException(nameof(messages)); + this.Path = path; + this.Labels = labels; + this.FileIds = fileIds; + this.MaxSegments = maxSegments; + this.RetrievalStrategy = retrievalStrategy; + this.RetrievalSimilarityThreshold = retrievalSimilarityThreshold; + this.MaxNeighbors = maxNeighbors; + this.HybridSearchAlpha = hybridSearchAlpha; } /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// Initializes a new instance of the class. /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + public ConversationalRagConfig() { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); } - } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ConversationalRagResult.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.ConversationalRagResult.Json.g.cs new file mode 100644 index 0000000..e85006c --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.ConversationalRagResult.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class ConversationalRagResult + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.ConversationalRagResult? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.ConversationalRagResult), + jsonSerializerContext) as global::AI21.ConversationalRagResult; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.ConversationalRagResult? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.ConversationalRagResult), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ConversationalRagResult; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.ConversationalRagResult.g.cs b/src/libs/AI21/Generated/AI21.Models.ConversationalRagResult.g.cs index 1a49a03..c13897f 100644 --- a/src/libs/AI21/Generated/AI21.Models.ConversationalRagResult.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ConversationalRagResult.g.cs @@ -57,91 +57,41 @@ public sealed partial class ConversationalRagResult [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// Initializes a new instance of the class. /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.ConversationalRagResult? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.ConversationalRagResult), - jsonSerializerContext) as global::AI21.ConversationalRagResult; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.ConversationalRagResult? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + /// + /// A unique ID for the request (not the message). Repeated identical requests
+ /// get different IDs. However, for a streaming response, the ID will be the same
+ /// for all responses in the stream. + /// + /// + /// + /// + /// + /// + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public ConversationalRagResult( + string id, + global::System.Collections.Generic.IList choices, + bool contextRetrieved, + bool answerInContext, + global::System.Collections.Generic.IList sources, + global::System.Collections.Generic.IList? searchQueries) { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.ConversationalRagResult), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ConversationalRagResult; + this.Id = id ?? throw new global::System.ArgumentNullException(nameof(id)); + this.Choices = choices ?? throw new global::System.ArgumentNullException(nameof(choices)); + this.ContextRetrieved = contextRetrieved; + this.AnswerInContext = answerInContext; + this.Sources = sources ?? throw new global::System.ArgumentNullException(nameof(sources)); + this.SearchQueries = searchQueries; } /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// Initializes a new instance of the class. /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + public ConversationalRagResult() { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); } - } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ConversationalRagSource.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.ConversationalRagSource.Json.g.cs new file mode 100644 index 0000000..a1ab366 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.ConversationalRagSource.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class ConversationalRagSource + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.ConversationalRagSource? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.ConversationalRagSource), + jsonSerializerContext) as global::AI21.ConversationalRagSource; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.ConversationalRagSource? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.ConversationalRagSource), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ConversationalRagSource; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.ConversationalRagSource.g.cs b/src/libs/AI21/Generated/AI21.Models.ConversationalRagSource.g.cs index d754145..61a9f66 100644 --- a/src/libs/AI21/Generated/AI21.Models.ConversationalRagSource.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ConversationalRagSource.g.cs @@ -60,91 +60,40 @@ public sealed partial class ConversationalRagSource [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. + /// Initializes a new instance of the class. /// - public static global::AI21.ConversationalRagSource? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + /// + /// + /// + /// + /// + /// + /// + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public ConversationalRagSource( + string text, + string fileId, + string fileName, + double score, + int? order, + string? publicUrl, + global::System.Collections.Generic.IList? labels) { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.ConversationalRagSource), - jsonSerializerContext) as global::AI21.ConversationalRagSource; + this.Text = text ?? throw new global::System.ArgumentNullException(nameof(text)); + this.FileId = fileId ?? throw new global::System.ArgumentNullException(nameof(fileId)); + this.FileName = fileName ?? throw new global::System.ArgumentNullException(nameof(fileName)); + this.Score = score; + this.Order = order; + this.PublicUrl = publicUrl; + this.Labels = labels; } /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// Initializes a new instance of the class. /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.ConversationalRagSource? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + public ConversationalRagSource() { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.ConversationalRagSource), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ConversationalRagSource; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ConvertDocumentFileStudioV1ChatFilesConvertPostResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.ConvertDocumentFileStudioV1ChatFilesConvertPostResponse.Json.g.cs new file mode 100644 index 0000000..0cee479 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.ConvertDocumentFileStudioV1ChatFilesConvertPostResponse.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class ConvertDocumentFileStudioV1ChatFilesConvertPostResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.ConvertDocumentFileStudioV1ChatFilesConvertPostResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.ConvertDocumentFileStudioV1ChatFilesConvertPostResponse), + jsonSerializerContext) as global::AI21.ConvertDocumentFileStudioV1ChatFilesConvertPostResponse; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.ConvertDocumentFileStudioV1ChatFilesConvertPostResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.ConvertDocumentFileStudioV1ChatFilesConvertPostResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ConvertDocumentFileStudioV1ChatFilesConvertPostResponse; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.ConvertDocumentFileStudioV1ChatFilesConvertPostResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.ConvertDocumentFileStudioV1ChatFilesConvertPostResponse.g.cs index 4b8f89b..fde6c08 100644 --- a/src/libs/AI21/Generated/AI21.Models.ConvertDocumentFileStudioV1ChatFilesConvertPostResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ConvertDocumentFileStudioV1ChatFilesConvertPostResponse.g.cs @@ -15,91 +15,13 @@ public sealed partial class ConvertDocumentFileStudioV1ChatFilesConvertPostRespo [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. + /// Initializes a new instance of the class. /// - public static global::AI21.ConvertDocumentFileStudioV1ChatFilesConvertPostResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public ConvertDocumentFileStudioV1ChatFilesConvertPostResponse( + ) { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.ConvertDocumentFileStudioV1ChatFilesConvertPostResponse), - jsonSerializerContext) as global::AI21.ConvertDocumentFileStudioV1ChatFilesConvertPostResponse; } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.ConvertDocumentFileStudioV1ChatFilesConvertPostResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.ConvertDocumentFileStudioV1ChatFilesConvertPostResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ConvertDocumentFileStudioV1ChatFilesConvertPostResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.CustomModelInput.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.CustomModelInput.Json.g.cs new file mode 100644 index 0000000..e33053d --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.CustomModelInput.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class CustomModelInput + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.CustomModelInput? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.CustomModelInput), + jsonSerializerContext) as global::AI21.CustomModelInput; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.CustomModelInput? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.CustomModelInput), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.CustomModelInput; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.CustomModelInput.g.cs b/src/libs/AI21/Generated/AI21.Models.CustomModelInput.g.cs index f08d4ae..dc0d703 100644 --- a/src/libs/AI21/Generated/AI21.Models.CustomModelInput.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.CustomModelInput.g.cs @@ -48,91 +48,36 @@ public sealed partial class CustomModelInput [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// Initializes a new instance of the class. /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.CustomModelInput? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.CustomModelInput), - jsonSerializerContext) as global::AI21.CustomModelInput; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.CustomModelInput? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + /// + /// An enumeration. + /// + /// + /// + /// + /// + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public CustomModelInput( + global::AI21.CustomModelType modelType, + string datasetId, + string modelName, + double? learningRate, + int? numEpochs) { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.CustomModelInput), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.CustomModelInput; + this.ModelType = modelType; + this.DatasetId = datasetId ?? throw new global::System.ArgumentNullException(nameof(datasetId)); + this.ModelName = modelName ?? throw new global::System.ArgumentNullException(nameof(modelName)); + this.LearningRate = learningRate; + this.NumEpochs = numEpochs; } /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// Initializes a new instance of the class. /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + public CustomModelInput() { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); } - } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.CustomModelUpdateBody.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.CustomModelUpdateBody.Json.g.cs new file mode 100644 index 0000000..69af691 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.CustomModelUpdateBody.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class CustomModelUpdateBody + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.CustomModelUpdateBody? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.CustomModelUpdateBody), + jsonSerializerContext) as global::AI21.CustomModelUpdateBody; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.CustomModelUpdateBody? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.CustomModelUpdateBody), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.CustomModelUpdateBody; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.CustomModelUpdateBody.g.cs b/src/libs/AI21/Generated/AI21.Models.CustomModelUpdateBody.g.cs index 24336ac..544ff5f 100644 --- a/src/libs/AI21/Generated/AI21.Models.CustomModelUpdateBody.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.CustomModelUpdateBody.g.cs @@ -20,91 +20,22 @@ public sealed partial class CustomModelUpdateBody [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. + /// Initializes a new instance of the class. /// - public static global::AI21.CustomModelUpdateBody? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + /// + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public CustomModelUpdateBody( + int? defaultEpoch) { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.CustomModelUpdateBody), - jsonSerializerContext) as global::AI21.CustomModelUpdateBody; + this.DefaultEpoch = defaultEpoch; } /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// Initializes a new instance of the class. /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.CustomModelUpdateBody? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + public CustomModelUpdateBody() { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.CustomModelUpdateBody), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.CustomModelUpdateBody; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.DataSourceMetadata.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.DataSourceMetadata.Json.g.cs new file mode 100644 index 0000000..0a23a5b --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.DataSourceMetadata.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class DataSourceMetadata + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.DataSourceMetadata? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.DataSourceMetadata), + jsonSerializerContext) as global::AI21.DataSourceMetadata; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.DataSourceMetadata? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.DataSourceMetadata), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.DataSourceMetadata; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.DataSourceMetadata.g.cs b/src/libs/AI21/Generated/AI21.Models.DataSourceMetadata.g.cs index bb646b4..feed7c3 100644 --- a/src/libs/AI21/Generated/AI21.Models.DataSourceMetadata.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.DataSourceMetadata.g.cs @@ -49,91 +49,34 @@ public sealed partial class DataSourceMetadata [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. + /// Initializes a new instance of the class. /// - public static global::AI21.DataSourceMetadata? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + /// + /// + /// + /// + /// + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public DataSourceMetadata( + string name, + string type, + string description, + string icon, + bool connected) { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.DataSourceMetadata), - jsonSerializerContext) as global::AI21.DataSourceMetadata; + this.Name = name ?? throw new global::System.ArgumentNullException(nameof(name)); + this.Type = type ?? throw new global::System.ArgumentNullException(nameof(type)); + this.Description = description ?? throw new global::System.ArgumentNullException(nameof(description)); + this.Icon = icon ?? throw new global::System.ArgumentNullException(nameof(icon)); + this.Connected = connected; } /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// Initializes a new instance of the class. /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.DataSourceMetadata? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + public DataSourceMetadata() { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.DataSourceMetadata), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.DataSourceMetadata; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.DocumentSchema.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.DocumentSchema.Json.g.cs new file mode 100644 index 0000000..26484de --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.DocumentSchema.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class DocumentSchema + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.DocumentSchema? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.DocumentSchema), + jsonSerializerContext) as global::AI21.DocumentSchema; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.DocumentSchema? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.DocumentSchema), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.DocumentSchema; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.DocumentSchema.g.cs b/src/libs/AI21/Generated/AI21.Models.DocumentSchema.g.cs index d6ff300..9ba41ad 100644 --- a/src/libs/AI21/Generated/AI21.Models.DocumentSchema.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.DocumentSchema.g.cs @@ -35,91 +35,32 @@ public sealed partial class DocumentSchema [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// Initializes a new instance of the class. /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.DocumentSchema? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.DocumentSchema), - jsonSerializerContext) as global::AI21.DocumentSchema; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.DocumentSchema? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + /// + /// A unique ID for the request (not the message). Repeated identical requests
+ /// get different IDs. However, for a streaming response, the ID will be the same
+ /// for all responses in the stream. + /// + /// + /// + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public DocumentSchema( + string content, + string? id, + global::System.Collections.Generic.Dictionary? metadata) { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.DocumentSchema), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.DocumentSchema; + this.Content = content ?? throw new global::System.ArgumentNullException(nameof(content)); + this.Id = id; + this.Metadata = metadata; } /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// Initializes a new instance of the class. /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + public DocumentSchema() { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); } - } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.DocumentSchemaMetadata.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.DocumentSchemaMetadata.Json.g.cs new file mode 100644 index 0000000..c6cbd00 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.DocumentSchemaMetadata.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class DocumentSchemaMetadata + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.DocumentSchemaMetadata? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.DocumentSchemaMetadata), + jsonSerializerContext) as global::AI21.DocumentSchemaMetadata; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.DocumentSchemaMetadata? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.DocumentSchemaMetadata), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.DocumentSchemaMetadata; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.DocumentSchemaMetadata.g.cs b/src/libs/AI21/Generated/AI21.Models.DocumentSchemaMetadata.g.cs index df79074..4918f57 100644 --- a/src/libs/AI21/Generated/AI21.Models.DocumentSchemaMetadata.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.DocumentSchemaMetadata.g.cs @@ -15,91 +15,13 @@ public sealed partial class DocumentSchemaMetadata [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. + /// Initializes a new instance of the class. /// - public static global::AI21.DocumentSchemaMetadata? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public DocumentSchemaMetadata( + ) { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.DocumentSchemaMetadata), - jsonSerializerContext) as global::AI21.DocumentSchemaMetadata; } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.DocumentSchemaMetadata? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.DocumentSchemaMetadata), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.DocumentSchemaMetadata; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.FileDeleteResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.FileDeleteResponse.Json.g.cs new file mode 100644 index 0000000..82b30c1 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.FileDeleteResponse.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class FileDeleteResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.FileDeleteResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.FileDeleteResponse), + jsonSerializerContext) as global::AI21.FileDeleteResponse; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.FileDeleteResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.FileDeleteResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.FileDeleteResponse; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.FileDeleteResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.FileDeleteResponse.g.cs index baf5c0a..6a57b14 100644 --- a/src/libs/AI21/Generated/AI21.Models.FileDeleteResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.FileDeleteResponse.g.cs @@ -30,91 +30,31 @@ public sealed partial class FileDeleteResponse [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.FileDeleteResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.FileDeleteResponse), - jsonSerializerContext) as global::AI21.FileDeleteResponse; - } - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// Initializes a new instance of the class. /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.FileDeleteResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + /// + /// A unique ID for the request (not the message). Repeated identical requests
+ /// get different IDs. However, for a streaming response, the ID will be the same
+ /// for all responses in the stream. + /// + /// + /// The RAG library ID of the deleted file. + /// + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public FileDeleteResponse( + string id, + string fileId) { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.FileDeleteResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.FileDeleteResponse; + this.Id = id ?? throw new global::System.ArgumentNullException(nameof(id)); + this.FileId = fileId ?? throw new global::System.ArgumentNullException(nameof(fileId)); } /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// Initializes a new instance of the class. /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + public FileDeleteResponse() { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); } - } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.FileResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.FileResponse.Json.g.cs new file mode 100644 index 0000000..49e4ef5 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.FileResponse.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class FileResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.FileResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.FileResponse), + jsonSerializerContext) as global::AI21.FileResponse; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.FileResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.FileResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.FileResponse; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.FileResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.FileResponse.g.cs index 2b1797a..7b4f88d 100644 --- a/src/libs/AI21/Generated/AI21.Models.FileResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.FileResponse.g.cs @@ -105,91 +105,91 @@ public sealed partial class FileResponse [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// Initializes a new instance of the class. /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.FileResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.FileResponse), - jsonSerializerContext) as global::AI21.FileResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.FileResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + /// + /// The unique identifier of the file, generated by AI21. + /// + /// + /// The name of the file. This is the local file name from when the file was
+ /// uploaded. It cannot be modified. + /// + /// + /// An arbitrary file-path-like string to indicate the content of a file. This has
+ /// nothing to do with the location of the file in storage or on disk, and is only
+ /// another label that you can assign to the file in path-like format to help you
+ /// organize the contents of the file or filter queries against your files. Example
+ /// paths might be `pets/fish` or `pets/dogs`. Then, when searching your library,
+ /// you can filter files by the full path or path prefix. So to search only files
+ /// in the "dog folder", filter by the path `/pets/dogs`. To search all files in
+ /// the "pet folder", filter your search by the path `pets/` when searching by path.
+ /// There isn't a restriction on whether a path must start or end with a / mark, but
+ /// be consistent in your usage, and all matches are prefix matching, not substring
+ /// matching. So filtering by `dog/` matches `dog/` and `dog/setter` but not `pets/dog/`. + /// + /// + /// The file type. See the file upload method to learn what file types are supported. + /// + /// + /// The size of the file, in bytes. + /// + /// + /// Any string labels you have associated with the file. You can apply arbitrary
+ /// string labels to your files and limit queries to files with one or more labels.
+ /// Similar to paths, but labels do not prefix match. Labels are case-sensitive.
+ /// There can be a maximum of 20 unique labels per account. + /// + /// + /// The public URL of the file, if any. This URL is not validated by
+ /// AI21 or used in any way. It is strictly a piece of metadata that you can
+ /// optionally attach to a file. + /// + /// + /// An internal identifier of the user who uploaded the file. + /// + /// + /// The date when the file was uploaded. + /// + /// + /// When the file data or metadata was last changed. + /// + /// + /// File status. One of the following values: "DB_RECORD_CREATED",
+ /// "UPLOADED", "UPLOAD_FAILED", "PROCESSED", "PROCESSING_FAILED" + /// + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public FileResponse( + global::System.Guid fileId, + string name, + string fileType, + int sizeBytes, + global::System.Guid createdBy, + global::System.DateTime creationDate, + global::System.DateTime lastUpdated, + string status, + string? path, + global::System.Collections.Generic.IList? labels, + string? publicUrl) { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.FileResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.FileResponse; + this.FileId = fileId; + this.Name = name ?? throw new global::System.ArgumentNullException(nameof(name)); + this.FileType = fileType ?? throw new global::System.ArgumentNullException(nameof(fileType)); + this.SizeBytes = sizeBytes; + this.CreatedBy = createdBy; + this.CreationDate = creationDate; + this.LastUpdated = lastUpdated; + this.Status = status ?? throw new global::System.ArgumentNullException(nameof(status)); + this.Path = path; + this.Labels = labels; + this.PublicUrl = publicUrl; } /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// Initializes a new instance of the class. /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + public FileResponse() { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); } - } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.FileUploadResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.FileUploadResponse.Json.g.cs new file mode 100644 index 0000000..566fbdd --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.FileUploadResponse.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class FileUploadResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.FileUploadResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.FileUploadResponse), + jsonSerializerContext) as global::AI21.FileUploadResponse; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.FileUploadResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.FileUploadResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.FileUploadResponse; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.FileUploadResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.FileUploadResponse.g.cs index c4db1c1..abec7e0 100644 --- a/src/libs/AI21/Generated/AI21.Models.FileUploadResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.FileUploadResponse.g.cs @@ -32,91 +32,33 @@ public sealed partial class FileUploadResponse [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.FileUploadResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.FileUploadResponse), - jsonSerializerContext) as global::AI21.FileUploadResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.FileUploadResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// Initializes a new instance of the class. /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + /// + /// A unique ID for the request (not the message). Repeated identical requests
+ /// get different IDs. However, for a streaming response, the ID will be the same
+ /// for all responses in the stream. + /// + /// + /// A unique identifier for the uploaded file. Use this later to request, modify metadata,
+ /// or delete the file. You don't need to store the value though, as it is returned
+ /// along with all file information in any file GET request. Example: da13301a-14e4-4487-aa2f-cc6048e73cdc + /// + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public FileUploadResponse( + string id, + string fileId) { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.FileUploadResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.FileUploadResponse; + this.Id = id ?? throw new global::System.ArgumentNullException(nameof(id)); + this.FileId = fileId ?? throw new global::System.ArgumentNullException(nameof(fileId)); } /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// Initializes a new instance of the class. /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + public FileUploadResponse() { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); } - } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.FilesUpdateRequest.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.FilesUpdateRequest.Json.g.cs new file mode 100644 index 0000000..587a30d --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.FilesUpdateRequest.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class FilesUpdateRequest + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.FilesUpdateRequest? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.FilesUpdateRequest), + jsonSerializerContext) as global::AI21.FilesUpdateRequest; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.FilesUpdateRequest? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.FilesUpdateRequest), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.FilesUpdateRequest; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.FilesUpdateRequest.g.cs b/src/libs/AI21/Generated/AI21.Models.FilesUpdateRequest.g.cs index 54224c6..d338720 100644 --- a/src/libs/AI21/Generated/AI21.Models.FilesUpdateRequest.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.FilesUpdateRequest.g.cs @@ -29,91 +29,32 @@ public sealed partial class FilesUpdateRequest [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. + /// Initializes a new instance of the class. /// - public static global::AI21.FilesUpdateRequest? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.FilesUpdateRequest), - jsonSerializerContext) as global::AI21.FilesUpdateRequest; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.FilesUpdateRequest? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + /// + /// The public URL of the file, if any. This URL is not validated by
+ /// AI21 or used in any way. It is strictly a piece of metadata that you can
+ /// optionally attach to a file. + /// + /// + /// Any labels to associate with this file. Separate multiple labels with commas. If
+ /// provided, will overwrite all existing labels. + /// + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public FilesUpdateRequest( + string? publicUrl, + global::System.Collections.Generic.IList? labels) { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.FilesUpdateRequest), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.FilesUpdateRequest; + this.PublicUrl = publicUrl; + this.Labels = labels; } /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// Initializes a new instance of the class. /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + public FilesUpdateRequest() { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); } - } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.FinishReason.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.FinishReason.Json.g.cs new file mode 100644 index 0000000..770a262 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.FinishReason.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class FinishReason + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.FinishReason? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.FinishReason), + jsonSerializerContext) as global::AI21.FinishReason; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.FinishReason? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.FinishReason), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.FinishReason; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.FinishReason.g.cs b/src/libs/AI21/Generated/AI21.Models.FinishReason.g.cs index 53e390e..f23771c 100644 --- a/src/libs/AI21/Generated/AI21.Models.FinishReason.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.FinishReason.g.cs @@ -33,91 +33,28 @@ public sealed partial class FinishReason [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. + /// Initializes a new instance of the class. /// - public static global::AI21.FinishReason? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + /// + /// + /// + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public FinishReason( + string reason, + int? length, + string? sequence) { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.FinishReason), - jsonSerializerContext) as global::AI21.FinishReason; + this.Reason = reason ?? throw new global::System.ArgumentNullException(nameof(reason)); + this.Length = length; + this.Sequence = sequence; } /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// Initializes a new instance of the class. /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.FinishReason? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + public FinishReason() { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.FinishReason), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.FinishReason; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.FunctionToolDefinition.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.FunctionToolDefinition.Json.g.cs new file mode 100644 index 0000000..1f90060 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.FunctionToolDefinition.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class FunctionToolDefinition + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.FunctionToolDefinition? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.FunctionToolDefinition), + jsonSerializerContext) as global::AI21.FunctionToolDefinition; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.FunctionToolDefinition? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.FunctionToolDefinition), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.FunctionToolDefinition; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.FunctionToolDefinition.g.cs b/src/libs/AI21/Generated/AI21.Models.FunctionToolDefinition.g.cs index 9a18bbf..3f1f26a 100644 --- a/src/libs/AI21/Generated/AI21.Models.FunctionToolDefinition.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.FunctionToolDefinition.g.cs @@ -33,91 +33,28 @@ public sealed partial class FunctionToolDefinition [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. + /// Initializes a new instance of the class. /// - public static global::AI21.FunctionToolDefinition? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + /// + /// + /// + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public FunctionToolDefinition( + string name, + string? description, + global::AI21.ToolParameters? parameters) { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.FunctionToolDefinition), - jsonSerializerContext) as global::AI21.FunctionToolDefinition; + this.Name = name ?? throw new global::System.ArgumentNullException(nameof(name)); + this.Description = description; + this.Parameters = parameters; } /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// Initializes a new instance of the class. /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.FunctionToolDefinition? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + public FunctionToolDefinition() { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.FunctionToolDefinition), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.FunctionToolDefinition; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.HTTPValidationError.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.HTTPValidationError.Json.g.cs new file mode 100644 index 0000000..245dad8 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.HTTPValidationError.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class HTTPValidationError + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.HTTPValidationError? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.HTTPValidationError), + jsonSerializerContext) as global::AI21.HTTPValidationError; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.HTTPValidationError? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.HTTPValidationError), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.HTTPValidationError; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.HTTPValidationError.g.cs b/src/libs/AI21/Generated/AI21.Models.HTTPValidationError.g.cs index d80efb8..8f45038 100644 --- a/src/libs/AI21/Generated/AI21.Models.HTTPValidationError.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.HTTPValidationError.g.cs @@ -20,91 +20,22 @@ public sealed partial class HTTPValidationError [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. + /// Initializes a new instance of the class. /// - public static global::AI21.HTTPValidationError? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + /// + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public HTTPValidationError( + global::System.Collections.Generic.IList? detail) { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.HTTPValidationError), - jsonSerializerContext) as global::AI21.HTTPValidationError; + this.Detail = detail; } /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// Initializes a new instance of the class. /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.HTTPValidationError? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + public HTTPValidationError() { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.HTTPValidationError), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.HTTPValidationError; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.Highlight.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.Highlight.Json.g.cs new file mode 100644 index 0000000..a72bfd9 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.Highlight.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class Highlight + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.Highlight? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.Highlight), + jsonSerializerContext) as global::AI21.Highlight; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.Highlight? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.Highlight), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.Highlight; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.Highlight.g.cs b/src/libs/AI21/Generated/AI21.Models.Highlight.g.cs index d72e1b8..653f369 100644 --- a/src/libs/AI21/Generated/AI21.Models.Highlight.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.Highlight.g.cs @@ -35,91 +35,28 @@ public sealed partial class Highlight [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. + /// Initializes a new instance of the class. /// - public static global::AI21.Highlight? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + /// + /// + /// + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public Highlight( + string text, + int startIndex, + int endIndex) { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.Highlight), - jsonSerializerContext) as global::AI21.Highlight; + this.Text = text ?? throw new global::System.ArgumentNullException(nameof(text)); + this.StartIndex = startIndex; + this.EndIndex = endIndex; } /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// Initializes a new instance of the class. /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.Highlight? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + public Highlight() { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.Highlight), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.Highlight; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.LanguageStudioApiServerDataTypesChatChatRequest.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.LanguageStudioApiServerDataTypesChatChatRequest.Json.g.cs new file mode 100644 index 0000000..12aa999 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.LanguageStudioApiServerDataTypesChatChatRequest.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class LanguageStudioApiServerDataTypesChatChatRequest + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.LanguageStudioApiServerDataTypesChatChatRequest? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.LanguageStudioApiServerDataTypesChatChatRequest), + jsonSerializerContext) as global::AI21.LanguageStudioApiServerDataTypesChatChatRequest; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.LanguageStudioApiServerDataTypesChatChatRequest? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.LanguageStudioApiServerDataTypesChatChatRequest), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.LanguageStudioApiServerDataTypesChatChatRequest; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.LanguageStudioApiServerDataTypesChatChatRequest.g.cs b/src/libs/AI21/Generated/AI21.Models.LanguageStudioApiServerDataTypesChatChatRequest.g.cs index c4c2486..ba4ba2c 100644 --- a/src/libs/AI21/Generated/AI21.Models.LanguageStudioApiServerDataTypesChatChatRequest.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.LanguageStudioApiServerDataTypesChatChatRequest.g.cs @@ -97,91 +97,72 @@ public sealed partial class LanguageStudioApiServerDataTypesChatChatRequest [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// Initializes a new instance of the class. /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.LanguageStudioApiServerDataTypesChatChatRequest? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.LanguageStudioApiServerDataTypesChatChatRequest), - jsonSerializerContext) as global::AI21.LanguageStudioApiServerDataTypesChatChatRequest; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.LanguageStudioApiServerDataTypesChatChatRequest? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + /// + /// An enumeration. + /// + /// + /// messages + /// + /// + /// + /// Default Value: 1 + /// + /// + /// Default Value: 4096 + /// + /// + /// + /// Default Value: 1 + /// + /// + /// + /// Whether or not to stream the result one token at a time using
+ /// [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events).
+ /// This can be useful when waiting for long results where a long wait time for an
+ /// answer can be problematic, such as a chatbot. If set to `True`, then `n` must
+ /// be 1. A streaming response is different than the non-streaming response.
+ /// Default Value: false + /// + /// + /// + /// + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public LanguageStudioApiServerDataTypesChatChatRequest( + global::AI21.ModelName model, + global::System.Collections.Generic.IList messages, + global::System.Collections.Generic.IList? tools, + int? n, + int? maxTokens, + double? temperature, + double? topP, + global::AI21.AnyOf>? stop, + bool? stream, + global::AI21.MockResponseConfig? mockResponse, + global::System.Collections.Generic.IList? documents, + global::AI21.ResponseFormat? responseFormat) { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.LanguageStudioApiServerDataTypesChatChatRequest), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.LanguageStudioApiServerDataTypesChatChatRequest; + this.Model = model; + this.Messages = messages ?? throw new global::System.ArgumentNullException(nameof(messages)); + this.Tools = tools; + this.N = n; + this.MaxTokens = maxTokens; + this.Temperature = temperature; + this.TopP = topP; + this.Stop = stop; + this.Stream = stream; + this.MockResponse = mockResponse; + this.Documents = documents; + this.ResponseFormat = responseFormat; } /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// Initializes a new instance of the class. /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + public LanguageStudioApiServerDataTypesChatChatRequest() { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); } - } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.LanguageStudioApiServerDataTypesChatChatRequestMessageDiscriminator.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.LanguageStudioApiServerDataTypesChatChatRequestMessageDiscriminator.Json.g.cs new file mode 100644 index 0000000..74dc972 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.LanguageStudioApiServerDataTypesChatChatRequestMessageDiscriminator.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class LanguageStudioApiServerDataTypesChatChatRequestMessageDiscriminator + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.LanguageStudioApiServerDataTypesChatChatRequestMessageDiscriminator? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.LanguageStudioApiServerDataTypesChatChatRequestMessageDiscriminator), + jsonSerializerContext) as global::AI21.LanguageStudioApiServerDataTypesChatChatRequestMessageDiscriminator; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.LanguageStudioApiServerDataTypesChatChatRequestMessageDiscriminator? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.LanguageStudioApiServerDataTypesChatChatRequestMessageDiscriminator), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.LanguageStudioApiServerDataTypesChatChatRequestMessageDiscriminator; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.LanguageStudioApiServerDataTypesChatChatRequestMessageDiscriminator.g.cs b/src/libs/AI21/Generated/AI21.Models.LanguageStudioApiServerDataTypesChatChatRequestMessageDiscriminator.g.cs index 8d19ce9..cd9849b 100644 --- a/src/libs/AI21/Generated/AI21.Models.LanguageStudioApiServerDataTypesChatChatRequestMessageDiscriminator.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.LanguageStudioApiServerDataTypesChatChatRequestMessageDiscriminator.g.cs @@ -21,91 +21,22 @@ public sealed partial class LanguageStudioApiServerDataTypesChatChatRequestMessa [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. + /// Initializes a new instance of the class. /// - public static global::AI21.LanguageStudioApiServerDataTypesChatChatRequestMessageDiscriminator? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + /// + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public LanguageStudioApiServerDataTypesChatChatRequestMessageDiscriminator( + global::AI21.LanguageStudioApiServerDataTypesChatChatRequestMessageDiscriminatorRole? role) { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.LanguageStudioApiServerDataTypesChatChatRequestMessageDiscriminator), - jsonSerializerContext) as global::AI21.LanguageStudioApiServerDataTypesChatChatRequestMessageDiscriminator; + this.Role = role; } /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// Initializes a new instance of the class. /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.LanguageStudioApiServerDataTypesChatChatRequestMessageDiscriminator? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + public LanguageStudioApiServerDataTypesChatChatRequestMessageDiscriminator() { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.LanguageStudioApiServerDataTypesChatChatRequestMessageDiscriminator), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.LanguageStudioApiServerDataTypesChatChatRequestMessageDiscriminator; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.LanguageStudioApiServerDataTypesJ2ChatChatRequest.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.LanguageStudioApiServerDataTypesJ2ChatChatRequest.Json.g.cs new file mode 100644 index 0000000..8c165a6 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.LanguageStudioApiServerDataTypesJ2ChatChatRequest.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class LanguageStudioApiServerDataTypesJ2ChatChatRequest + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.LanguageStudioApiServerDataTypesJ2ChatChatRequest? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.LanguageStudioApiServerDataTypesJ2ChatChatRequest), + jsonSerializerContext) as global::AI21.LanguageStudioApiServerDataTypesJ2ChatChatRequest; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.LanguageStudioApiServerDataTypesJ2ChatChatRequest? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.LanguageStudioApiServerDataTypesJ2ChatChatRequest), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.LanguageStudioApiServerDataTypesJ2ChatChatRequest; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.LanguageStudioApiServerDataTypesJ2ChatChatRequest.g.cs b/src/libs/AI21/Generated/AI21.Models.LanguageStudioApiServerDataTypesJ2ChatChatRequest.g.cs index df2f636..7e0c3b8 100644 --- a/src/libs/AI21/Generated/AI21.Models.LanguageStudioApiServerDataTypesJ2ChatChatRequest.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.LanguageStudioApiServerDataTypesJ2ChatChatRequest.g.cs @@ -88,91 +88,69 @@ public sealed partial class LanguageStudioApiServerDataTypesJ2ChatChatRequest [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// Initializes a new instance of the class. /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.LanguageStudioApiServerDataTypesJ2ChatChatRequest? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.LanguageStudioApiServerDataTypesJ2ChatChatRequest), - jsonSerializerContext) as global::AI21.LanguageStudioApiServerDataTypesJ2ChatChatRequest; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.LanguageStudioApiServerDataTypesJ2ChatChatRequest? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + /// + /// messages + /// + /// + /// + /// + /// + /// + /// Default Value: 1 + /// + /// + /// Default Value: 0.7 + /// + /// + /// Default Value: 300 + /// + /// + /// Default Value: 0 + /// + /// + /// Default Value: 1 + /// + /// + /// Default Value: 0 + /// + /// + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public LanguageStudioApiServerDataTypesJ2ChatChatRequest( + global::System.Collections.Generic.IList messages, + string system, + global::AI21.Penalty? frequencyPenalty, + global::AI21.Penalty? presencePenalty, + global::AI21.Penalty? countPenalty, + int? numResults, + double? temperature, + int? maxTokens, + int? minTokens, + double? topP, + int? topKReturn, + global::System.Collections.Generic.IList? stopSequences) { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.LanguageStudioApiServerDataTypesJ2ChatChatRequest), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.LanguageStudioApiServerDataTypesJ2ChatChatRequest; + this.Messages = messages ?? throw new global::System.ArgumentNullException(nameof(messages)); + this.System = system ?? throw new global::System.ArgumentNullException(nameof(system)); + this.FrequencyPenalty = frequencyPenalty; + this.PresencePenalty = presencePenalty; + this.CountPenalty = countPenalty; + this.NumResults = numResults; + this.Temperature = temperature; + this.MaxTokens = maxTokens; + this.MinTokens = minTokens; + this.TopP = topP; + this.TopKReturn = topKReturn; + this.StopSequences = stopSequences; } /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// Initializes a new instance of the class. /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + public LanguageStudioApiServerDataTypesJ2ChatChatRequest() { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); } - } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.LibraryAnswerRequest.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.LibraryAnswerRequest.Json.g.cs new file mode 100644 index 0000000..a420154 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.LibraryAnswerRequest.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class LibraryAnswerRequest + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.LibraryAnswerRequest? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.LibraryAnswerRequest), + jsonSerializerContext) as global::AI21.LibraryAnswerRequest; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.LibraryAnswerRequest? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.LibraryAnswerRequest), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.LibraryAnswerRequest; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.LibraryAnswerRequest.g.cs b/src/libs/AI21/Generated/AI21.Models.LibraryAnswerRequest.g.cs index 434e66c..7cf0591 100644 --- a/src/libs/AI21/Generated/AI21.Models.LibraryAnswerRequest.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.LibraryAnswerRequest.g.cs @@ -92,91 +92,63 @@ public sealed partial class LibraryAnswerRequest [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.LibraryAnswerRequest? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.LibraryAnswerRequest), - jsonSerializerContext) as global::AI21.LibraryAnswerRequest; - } - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// Initializes a new instance of the class. /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.LibraryAnswerRequest? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + /// + /// + /// + /// + /// + /// + /// Default Value: AND + /// + /// + /// + /// An enumeration. + /// + /// + /// An enumeration. + /// + /// + /// Default Value: default + /// + /// + /// + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public LibraryAnswerRequest( + string question, + int? maxSegments, + string? path, + global::System.Collections.Generic.IList? labels, + global::AI21.QueryFilter? labelsFilter, + global::AI21.LibraryAnswerRequestLabelsFilterMode? labelsFilterMode, + global::System.Collections.Generic.IList? fileIds, + global::AI21.AnswerLength? answerLength, + global::AI21.Mode? mode, + global::AI21.RetrievalStrategy? retrievalStrategy, + double? retrievalSimilarityThreshold, + double? hybridSearchAlpha) { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.LibraryAnswerRequest), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.LibraryAnswerRequest; + this.Question = question ?? throw new global::System.ArgumentNullException(nameof(question)); + this.MaxSegments = maxSegments; + this.Path = path; + this.Labels = labels; + this.LabelsFilter = labelsFilter; + this.LabelsFilterMode = labelsFilterMode; + this.FileIds = fileIds; + this.AnswerLength = answerLength; + this.Mode = mode; + this.RetrievalStrategy = retrievalStrategy; + this.RetrievalSimilarityThreshold = retrievalSimilarityThreshold; + this.HybridSearchAlpha = hybridSearchAlpha; } /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// Initializes a new instance of the class. /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + public LibraryAnswerRequest() { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); } - } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.LibraryAnswerResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.LibraryAnswerResponse.Json.g.cs new file mode 100644 index 0000000..5896008 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.LibraryAnswerResponse.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class LibraryAnswerResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.LibraryAnswerResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.LibraryAnswerResponse), + jsonSerializerContext) as global::AI21.LibraryAnswerResponse; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.LibraryAnswerResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.LibraryAnswerResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.LibraryAnswerResponse; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.LibraryAnswerResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.LibraryAnswerResponse.g.cs index fe6ba59..7d37d60 100644 --- a/src/libs/AI21/Generated/AI21.Models.LibraryAnswerResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.LibraryAnswerResponse.g.cs @@ -42,91 +42,35 @@ public sealed partial class LibraryAnswerResponse [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// Initializes a new instance of the class. /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.LibraryAnswerResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.LibraryAnswerResponse), - jsonSerializerContext) as global::AI21.LibraryAnswerResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.LibraryAnswerResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + /// + /// A unique ID for the request (not the message). Repeated identical requests
+ /// get different IDs. However, for a streaming response, the ID will be the same
+ /// for all responses in the stream. + /// + /// + /// + /// + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public LibraryAnswerResponse( + string id, + bool answerInContext, + string? answer, + global::System.Collections.Generic.IList? sources) { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.LibraryAnswerResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.LibraryAnswerResponse; + this.Id = id ?? throw new global::System.ArgumentNullException(nameof(id)); + this.AnswerInContext = answerInContext; + this.Answer = answer; + this.Sources = sources; } /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// Initializes a new instance of the class. /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + public LibraryAnswerResponse() { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); } - } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.LibrarySearchRequest.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.LibrarySearchRequest.Json.g.cs new file mode 100644 index 0000000..31e3994 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.LibrarySearchRequest.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class LibrarySearchRequest + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.LibrarySearchRequest? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.LibrarySearchRequest), + jsonSerializerContext) as global::AI21.LibrarySearchRequest; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.LibrarySearchRequest? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.LibrarySearchRequest), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.LibrarySearchRequest; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.LibrarySearchRequest.g.cs b/src/libs/AI21/Generated/AI21.Models.LibrarySearchRequest.g.cs index cb7c32a..280e6fc 100644 --- a/src/libs/AI21/Generated/AI21.Models.LibrarySearchRequest.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.LibrarySearchRequest.g.cs @@ -84,91 +84,58 @@ public sealed partial class LibrarySearchRequest [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// Initializes a new instance of the class. /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.LibrarySearchRequest? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.LibrarySearchRequest), - jsonSerializerContext) as global::AI21.LibrarySearchRequest; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.LibrarySearchRequest? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + /// + /// + /// + /// + /// + /// + /// Default Value: AND + /// + /// + /// + /// Default Value: default + /// + /// + /// Default Value: 1 + /// + /// + /// + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public LibrarySearchRequest( + string query, + int? maxSegments, + string? path, + global::System.Collections.Generic.IList? labels, + global::AI21.QueryFilter? labelsFilter, + global::AI21.LibrarySearchRequestLabelsFilterMode? labelsFilterMode, + global::System.Collections.Generic.IList? fileIds, + global::AI21.RetrievalStrategy? retrievalStrategy, + int? maxNeighbors, + double? retrievalSimilarityThreshold, + double? hybridSearchAlpha) { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.LibrarySearchRequest), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.LibrarySearchRequest; + this.Query = query ?? throw new global::System.ArgumentNullException(nameof(query)); + this.MaxSegments = maxSegments; + this.Path = path; + this.Labels = labels; + this.LabelsFilter = labelsFilter; + this.LabelsFilterMode = labelsFilterMode; + this.FileIds = fileIds; + this.RetrievalStrategy = retrievalStrategy; + this.MaxNeighbors = maxNeighbors; + this.RetrievalSimilarityThreshold = retrievalSimilarityThreshold; + this.HybridSearchAlpha = hybridSearchAlpha; } /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// Initializes a new instance of the class. /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + public LibrarySearchRequest() { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); } - } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.LibrarySearchResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.LibrarySearchResponse.Json.g.cs new file mode 100644 index 0000000..7aba548 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.LibrarySearchResponse.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class LibrarySearchResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.LibrarySearchResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.LibrarySearchResponse), + jsonSerializerContext) as global::AI21.LibrarySearchResponse; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.LibrarySearchResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.LibrarySearchResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.LibrarySearchResponse; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.LibrarySearchResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.LibrarySearchResponse.g.cs index 5a2eee3..3aa405b 100644 --- a/src/libs/AI21/Generated/AI21.Models.LibrarySearchResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.LibrarySearchResponse.g.cs @@ -30,91 +30,29 @@ public sealed partial class LibrarySearchResponse [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// Initializes a new instance of the class. /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.LibrarySearchResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.LibrarySearchResponse), - jsonSerializerContext) as global::AI21.LibrarySearchResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.LibrarySearchResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + /// + /// A unique ID for the request (not the message). Repeated identical requests
+ /// get different IDs. However, for a streaming response, the ID will be the same
+ /// for all responses in the stream. + /// + /// + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public LibrarySearchResponse( + string id, + global::System.Collections.Generic.IList results) { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.LibrarySearchResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.LibrarySearchResponse; + this.Id = id ?? throw new global::System.ArgumentNullException(nameof(id)); + this.Results = results ?? throw new global::System.ArgumentNullException(nameof(results)); } /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// Initializes a new instance of the class. /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + public LibrarySearchResponse() { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); } - } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.LibrarySearchResult.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.LibrarySearchResult.Json.g.cs new file mode 100644 index 0000000..838b460 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.LibrarySearchResult.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class LibrarySearchResult + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.LibrarySearchResult? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.LibrarySearchResult), + jsonSerializerContext) as global::AI21.LibrarySearchResult; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.LibrarySearchResult? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.LibrarySearchResult), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.LibrarySearchResult; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.LibrarySearchResult.g.cs b/src/libs/AI21/Generated/AI21.Models.LibrarySearchResult.g.cs index 3d473fd..4cf67bc 100644 --- a/src/libs/AI21/Generated/AI21.Models.LibrarySearchResult.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.LibrarySearchResult.g.cs @@ -60,91 +60,40 @@ public sealed partial class LibrarySearchResult [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. + /// Initializes a new instance of the class. /// - public static global::AI21.LibrarySearchResult? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + /// + /// + /// + /// + /// + /// + /// + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public LibrarySearchResult( + string text, + string fileId, + string fileName, + double score, + int? order, + string? publicUrl, + global::System.Collections.Generic.IList? labels) { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.LibrarySearchResult), - jsonSerializerContext) as global::AI21.LibrarySearchResult; + this.Text = text ?? throw new global::System.ArgumentNullException(nameof(text)); + this.FileId = fileId ?? throw new global::System.ArgumentNullException(nameof(fileId)); + this.FileName = fileName ?? throw new global::System.ArgumentNullException(nameof(fileName)); + this.Score = score; + this.Order = order; + this.PublicUrl = publicUrl; + this.Labels = labels; } /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// Initializes a new instance of the class. /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.LibrarySearchResult? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + public LibrarySearchResult() { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.LibrarySearchResult), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.LibrarySearchResult; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.LogicalOperator.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.LogicalOperator.Json.g.cs new file mode 100644 index 0000000..233fc38 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.LogicalOperator.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class LogicalOperator + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.LogicalOperator? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.LogicalOperator), + jsonSerializerContext) as global::AI21.LogicalOperator; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.LogicalOperator? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.LogicalOperator), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.LogicalOperator; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.LogicalOperator.g.cs b/src/libs/AI21/Generated/AI21.Models.LogicalOperator.g.cs index d5f29da..a967535 100644 --- a/src/libs/AI21/Generated/AI21.Models.LogicalOperator.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.LogicalOperator.g.cs @@ -15,91 +15,13 @@ public sealed partial class LogicalOperator [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. + /// Initializes a new instance of the class. /// - public static global::AI21.LogicalOperator? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public LogicalOperator( + ) { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.LogicalOperator), - jsonSerializerContext) as global::AI21.LogicalOperator; } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.LogicalOperator? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.LogicalOperator), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.LogicalOperator; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.LogicalOperatorItem.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.LogicalOperatorItem.Json.g.cs new file mode 100644 index 0000000..3c3b363 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.LogicalOperatorItem.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class LogicalOperatorItem + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.LogicalOperatorItem? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.LogicalOperatorItem), + jsonSerializerContext) as global::AI21.LogicalOperatorItem; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.LogicalOperatorItem? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.LogicalOperatorItem), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.LogicalOperatorItem; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.LogicalOperatorItem.g.cs b/src/libs/AI21/Generated/AI21.Models.LogicalOperatorItem.g.cs index 6d4b9ed..a5fe37f 100644 --- a/src/libs/AI21/Generated/AI21.Models.LogicalOperatorItem.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.LogicalOperatorItem.g.cs @@ -15,91 +15,13 @@ public sealed partial class LogicalOperatorItem [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. + /// Initializes a new instance of the class. /// - public static global::AI21.LogicalOperatorItem? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public LogicalOperatorItem( + ) { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.LogicalOperatorItem), - jsonSerializerContext) as global::AI21.LogicalOperatorItem; } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.LogicalOperatorItem? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.LogicalOperatorItem), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.LogicalOperatorItem; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.Logprobs.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.Logprobs.Json.g.cs new file mode 100644 index 0000000..b3d7a1a --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.Logprobs.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class Logprobs + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.Logprobs? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.Logprobs), + jsonSerializerContext) as global::AI21.Logprobs; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.Logprobs? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.Logprobs), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.Logprobs; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.Logprobs.g.cs b/src/libs/AI21/Generated/AI21.Models.Logprobs.g.cs index 763eacc..0034e85 100644 --- a/src/libs/AI21/Generated/AI21.Models.Logprobs.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.Logprobs.g.cs @@ -21,91 +21,22 @@ public sealed partial class Logprobs [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. + /// Initializes a new instance of the class. /// - public static global::AI21.Logprobs? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + /// + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public Logprobs( + global::System.Collections.Generic.IList content) { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.Logprobs), - jsonSerializerContext) as global::AI21.Logprobs; + this.Content = content ?? throw new global::System.ArgumentNullException(nameof(content)); } /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// Initializes a new instance of the class. /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.Logprobs? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + public Logprobs() { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.Logprobs), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.Logprobs; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.LogprobsData.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.LogprobsData.Json.g.cs new file mode 100644 index 0000000..ea27176 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.LogprobsData.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class LogprobsData + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.LogprobsData? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.LogprobsData), + jsonSerializerContext) as global::AI21.LogprobsData; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.LogprobsData? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.LogprobsData), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.LogprobsData; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.LogprobsData.g.cs b/src/libs/AI21/Generated/AI21.Models.LogprobsData.g.cs index 1fc4fe3..f633288 100644 --- a/src/libs/AI21/Generated/AI21.Models.LogprobsData.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.LogprobsData.g.cs @@ -34,91 +34,28 @@ public sealed partial class LogprobsData [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. + /// Initializes a new instance of the class. /// - public static global::AI21.LogprobsData? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + /// + /// + /// + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public LogprobsData( + string token, + double logprob, + global::System.Collections.Generic.IList? topLogprobs) { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.LogprobsData), - jsonSerializerContext) as global::AI21.LogprobsData; + this.Token = token ?? throw new global::System.ArgumentNullException(nameof(token)); + this.Logprob = logprob; + this.TopLogprobs = topLogprobs; } /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// Initializes a new instance of the class. /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.LogprobsData? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + public LogprobsData() { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.LogprobsData), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.LogprobsData; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.Message.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.Message.Json.g.cs new file mode 100644 index 0000000..8ee53a2 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.Message.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class Message + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.Message? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.Message), + jsonSerializerContext) as global::AI21.Message; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.Message? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.Message), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.Message; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.Message.g.cs b/src/libs/AI21/Generated/AI21.Models.Message.g.cs index 96a9ae3..ffbae6d 100644 --- a/src/libs/AI21/Generated/AI21.Models.Message.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.Message.g.cs @@ -38,91 +38,36 @@ public sealed partial class Message [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.Message? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.Message), - jsonSerializerContext) as global::AI21.Message; - } - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// Initializes a new instance of the class. /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.Message? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + /// + /// The role of an individual message.
+ /// - `user`: Input provided by the user. Any instructions given here that conflict
+ /// with instructions given in the `system` prompt take precedence over the `system`
+ /// prompt instructions.
+ /// - `assistant`: Response generated by the model.
+ /// - `system`: Initial instructions provided to the system to provide general guidance
+ /// on the tone and voice of the generated message. An initial system message is
+ /// optional but recommended to provide guidance on the tone of the chat. For
+ /// example, "You are a helpful chatbot with a background in earth sciences and a
+ /// charming French accent." + /// + /// + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public Message( + global::AI21.MessageRole role, + string content) { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.Message), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.Message; + this.Role = role; + this.Content = content ?? throw new global::System.ArgumentNullException(nameof(content)); } /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// Initializes a new instance of the class. /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + public Message() { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); } - } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.MessagesItem.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.MessagesItem.Json.g.cs new file mode 100644 index 0000000..2bb0f08 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.MessagesItem.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public readonly partial struct MessagesItem + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.MessagesItem? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.MessagesItem), + jsonSerializerContext) as global::AI21.MessagesItem?; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.MessagesItem? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.MessagesItem), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.MessagesItem?; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.MessagesItem.g.cs b/src/libs/AI21/Generated/AI21.Models.MessagesItem.g.cs index 68e1eb0..61a0d8e 100644 --- a/src/libs/AI21/Generated/AI21.Models.MessagesItem.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.MessagesItem.g.cs @@ -1,4 +1,3 @@ -using System.Linq; #pragma warning disable CS0618 // Type or member is obsolete #nullable enable @@ -281,7 +280,8 @@ public override int GetHashCode() static int HashCodeAggregator(int hashCode, object? value) => value == null ? (hashCode ^ 0) * prime : (hashCode ^ value.GetHashCode()) * prime; - return fields.Aggregate(offset, HashCodeAggregator); + + return global::System.Linq.Enumerable.Aggregate(fields, offset, HashCodeAggregator); } /// @@ -320,92 +320,5 @@ public override bool Equals(object? obj) { return obj is MessagesItem o && Equals(o); } - - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.MessagesItem? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.MessagesItem), - jsonSerializerContext) as global::AI21.MessagesItem?; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.MessagesItem? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.MessagesItem), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.MessagesItem?; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } } diff --git a/src/libs/AI21/Generated/AI21.Models.MockResponseConfig.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.MockResponseConfig.Json.g.cs new file mode 100644 index 0000000..0e4655c --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.MockResponseConfig.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class MockResponseConfig + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.MockResponseConfig? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.MockResponseConfig), + jsonSerializerContext) as global::AI21.MockResponseConfig; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.MockResponseConfig? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.MockResponseConfig), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.MockResponseConfig; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.MockResponseConfig.g.cs b/src/libs/AI21/Generated/AI21.Models.MockResponseConfig.g.cs index a1073a7..20a2232 100644 --- a/src/libs/AI21/Generated/AI21.Models.MockResponseConfig.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.MockResponseConfig.g.cs @@ -26,91 +26,29 @@ public sealed partial class MockResponseConfig [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.MockResponseConfig? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.MockResponseConfig), - jsonSerializerContext) as global::AI21.MockResponseConfig; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.MockResponseConfig? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// Initializes a new instance of the class. /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + /// + /// Default Value: 1 + /// + /// + /// Default Value: 0.1 + /// + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public MockResponseConfig( + double? responseDelaySeconds, + double? streamResponseDelayBetweenDeltasSeconds) { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.MockResponseConfig), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.MockResponseConfig; + this.ResponseDelaySeconds = responseDelaySeconds; + this.StreamResponseDelayBetweenDeltasSeconds = streamResponseDelayBetweenDeltasSeconds; } /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// Initializes a new instance of the class. /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + public MockResponseConfig() { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); } - } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ParaphraseBody.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.ParaphraseBody.Json.g.cs new file mode 100644 index 0000000..e1ccd8c --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.ParaphraseBody.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class ParaphraseBody + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.ParaphraseBody? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.ParaphraseBody), + jsonSerializerContext) as global::AI21.ParaphraseBody; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.ParaphraseBody? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.ParaphraseBody), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ParaphraseBody; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.ParaphraseBody.g.cs b/src/libs/AI21/Generated/AI21.Models.ParaphraseBody.g.cs index ba25c2b..c0e3a6f 100644 --- a/src/libs/AI21/Generated/AI21.Models.ParaphraseBody.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ParaphraseBody.g.cs @@ -40,91 +40,35 @@ public sealed partial class ParaphraseBody [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.ParaphraseBody? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.ParaphraseBody), - jsonSerializerContext) as global::AI21.ParaphraseBody; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.ParaphraseBody? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// Initializes a new instance of the class. /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + /// + /// + /// Default Value: general + /// + /// + /// Default Value: 0 + /// + /// + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public ParaphraseBody( + string text, + global::AI21.StyleType? style, + int? startIndex, + int? endIndex) { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.ParaphraseBody), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ParaphraseBody; + this.Text = text ?? throw new global::System.ArgumentNullException(nameof(text)); + this.Style = style; + this.StartIndex = startIndex; + this.EndIndex = endIndex; } /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// Initializes a new instance of the class. /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + public ParaphraseBody() { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); } - } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.Penalty.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.Penalty.Json.g.cs new file mode 100644 index 0000000..2988230 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.Penalty.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class Penalty + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.Penalty? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.Penalty), + jsonSerializerContext) as global::AI21.Penalty; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.Penalty? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.Penalty), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.Penalty; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.Penalty.g.cs b/src/libs/AI21/Generated/AI21.Models.Penalty.g.cs index ac46b94..e015f7c 100644 --- a/src/libs/AI21/Generated/AI21.Models.Penalty.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.Penalty.g.cs @@ -51,91 +51,47 @@ public sealed partial class Penalty [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. + /// Initializes a new instance of the class. /// - public static global::AI21.Penalty? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.Penalty), - jsonSerializerContext) as global::AI21.Penalty; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.Penalty? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + /// + /// + /// Default Value: true + /// + /// + /// Default Value: true + /// + /// + /// Default Value: true + /// + /// + /// Default Value: true + /// + /// + /// Default Value: true + /// + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public Penalty( + double scale, + bool? applyToWhitespaces, + bool? applyToPunctuations, + bool? applyToNumbers, + bool? applyToStopwords, + bool? applyToEmojis) { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.Penalty), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.Penalty; + this.Scale = scale; + this.ApplyToWhitespaces = applyToWhitespaces; + this.ApplyToPunctuations = applyToPunctuations; + this.ApplyToNumbers = applyToNumbers; + this.ApplyToStopwords = applyToStopwords; + this.ApplyToEmojis = applyToEmojis; } /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// Initializes a new instance of the class. /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + public Penalty() { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); } - } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.QueryFilter.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.QueryFilter.Json.g.cs new file mode 100644 index 0000000..e364e94 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.QueryFilter.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public readonly partial struct QueryFilter + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.QueryFilter? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.QueryFilter), + jsonSerializerContext) as global::AI21.QueryFilter?; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.QueryFilter? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.QueryFilter), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.QueryFilter?; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.QueryFilter.g.cs b/src/libs/AI21/Generated/AI21.Models.QueryFilter.g.cs index f6a24e1..0234eb2 100644 --- a/src/libs/AI21/Generated/AI21.Models.QueryFilter.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.QueryFilter.g.cs @@ -1,4 +1,3 @@ -using System.Linq; #pragma warning disable CS0618 // Type or member is obsolete #nullable enable @@ -213,7 +212,8 @@ public override int GetHashCode() static int HashCodeAggregator(int hashCode, object? value) => value == null ? (hashCode ^ 0) * prime : (hashCode ^ value.GetHashCode()) * prime; - return fields.Aggregate(offset, HashCodeAggregator); + + return global::System.Linq.Enumerable.Aggregate(fields, offset, HashCodeAggregator); } /// @@ -251,92 +251,5 @@ public override bool Equals(object? obj) { return obj is QueryFilter o && Equals(o); } - - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.QueryFilter? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.QueryFilter), - jsonSerializerContext) as global::AI21.QueryFilter?; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.QueryFilter? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.QueryFilter), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.QueryFilter?; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } } diff --git a/src/libs/AI21/Generated/AI21.Models.QueryFilterVariant3.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.QueryFilterVariant3.Json.g.cs new file mode 100644 index 0000000..8c9b77c --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.QueryFilterVariant3.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class QueryFilterVariant3 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.QueryFilterVariant3? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.QueryFilterVariant3), + jsonSerializerContext) as global::AI21.QueryFilterVariant3; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.QueryFilterVariant3? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.QueryFilterVariant3), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.QueryFilterVariant3; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.QueryFilterVariant3.g.cs b/src/libs/AI21/Generated/AI21.Models.QueryFilterVariant3.g.cs index 9b008f2..ebfe7d1 100644 --- a/src/libs/AI21/Generated/AI21.Models.QueryFilterVariant3.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.QueryFilterVariant3.g.cs @@ -15,91 +15,13 @@ public sealed partial class QueryFilterVariant3 [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. + /// Initializes a new instance of the class. /// - public static global::AI21.QueryFilterVariant3? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public QueryFilterVariant3( + ) { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.QueryFilterVariant3), - jsonSerializerContext) as global::AI21.QueryFilterVariant3; } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.QueryFilterVariant3? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.QueryFilterVariant3), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.QueryFilterVariant3; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ResponseFormat.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.ResponseFormat.Json.g.cs new file mode 100644 index 0000000..2e6384d --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.ResponseFormat.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class ResponseFormat + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.ResponseFormat? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.ResponseFormat), + jsonSerializerContext) as global::AI21.ResponseFormat; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.ResponseFormat? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.ResponseFormat), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ResponseFormat; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.ResponseFormat.g.cs b/src/libs/AI21/Generated/AI21.Models.ResponseFormat.g.cs index 61e7813..7151601 100644 --- a/src/libs/AI21/Generated/AI21.Models.ResponseFormat.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ResponseFormat.g.cs @@ -22,91 +22,22 @@ public sealed partial class ResponseFormat [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. + /// Initializes a new instance of the class. /// - public static global::AI21.ResponseFormat? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + /// + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public ResponseFormat( + global::AI21.ResponseFormatType type) { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.ResponseFormat), - jsonSerializerContext) as global::AI21.ResponseFormat; + this.Type = type; } /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// Initializes a new instance of the class. /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.ResponseFormat? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + public ResponseFormat() { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.ResponseFormat), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ResponseFormat; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.Segment.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.Segment.Json.g.cs new file mode 100644 index 0000000..8f2e715 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.Segment.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class Segment + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.Segment? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.Segment), + jsonSerializerContext) as global::AI21.Segment; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.Segment? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.Segment), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.Segment; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.Segment.g.cs b/src/libs/AI21/Generated/AI21.Models.Segment.g.cs index 9cb3a40..386d7e5 100644 --- a/src/libs/AI21/Generated/AI21.Models.Segment.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.Segment.g.cs @@ -28,91 +28,25 @@ public sealed partial class Segment [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. + /// Initializes a new instance of the class. /// - public static global::AI21.Segment? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + /// + /// + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public Segment( + string segmentText, + string segmentType) { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.Segment), - jsonSerializerContext) as global::AI21.Segment; + this.SegmentText = segmentText ?? throw new global::System.ArgumentNullException(nameof(segmentText)); + this.SegmentType = segmentType ?? throw new global::System.ArgumentNullException(nameof(segmentType)); } /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// Initializes a new instance of the class. /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.Segment? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + public Segment() { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.Segment), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.Segment; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.SegmentSummary.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.SegmentSummary.Json.g.cs new file mode 100644 index 0000000..9b206aa --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.SegmentSummary.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class SegmentSummary + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.SegmentSummary? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.SegmentSummary), + jsonSerializerContext) as global::AI21.SegmentSummary; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.SegmentSummary? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.SegmentSummary), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.SegmentSummary; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.SegmentSummary.g.cs b/src/libs/AI21/Generated/AI21.Models.SegmentSummary.g.cs index d4c51a3..6f5a648 100644 --- a/src/libs/AI21/Generated/AI21.Models.SegmentSummary.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.SegmentSummary.g.cs @@ -54,91 +54,37 @@ public sealed partial class SegmentSummary [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. + /// Initializes a new instance of the class. /// - public static global::AI21.SegmentSummary? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + /// + /// + /// + /// + /// + /// + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public SegmentSummary( + string segmentText, + string segmentType, + bool hasSummary, + global::System.Collections.Generic.IList highlights, + string? summary, + string? segmentHtml) { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.SegmentSummary), - jsonSerializerContext) as global::AI21.SegmentSummary; + this.SegmentText = segmentText ?? throw new global::System.ArgumentNullException(nameof(segmentText)); + this.SegmentType = segmentType ?? throw new global::System.ArgumentNullException(nameof(segmentType)); + this.HasSummary = hasSummary; + this.Highlights = highlights ?? throw new global::System.ArgumentNullException(nameof(highlights)); + this.Summary = summary; + this.SegmentHtml = segmentHtml; } /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// Initializes a new instance of the class. /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.SegmentSummary? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + public SegmentSummary() { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.SegmentSummary), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.SegmentSummary; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.SegmentationBody.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.SegmentationBody.Json.g.cs new file mode 100644 index 0000000..69e25fb --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.SegmentationBody.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class SegmentationBody + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.SegmentationBody? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.SegmentationBody), + jsonSerializerContext) as global::AI21.SegmentationBody; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.SegmentationBody? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.SegmentationBody), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.SegmentationBody; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.SegmentationBody.g.cs b/src/libs/AI21/Generated/AI21.Models.SegmentationBody.g.cs index d5fcf70..c7a7546 100644 --- a/src/libs/AI21/Generated/AI21.Models.SegmentationBody.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.SegmentationBody.g.cs @@ -29,91 +29,27 @@ public sealed partial class SegmentationBody [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// Initializes a new instance of the class. /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.SegmentationBody? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.SegmentationBody), - jsonSerializerContext) as global::AI21.SegmentationBody; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.SegmentationBody? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + /// + /// An enumeration. + /// + /// + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public SegmentationBody( + global::AI21.DocumentType sourceType, + string source) { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.SegmentationBody), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.SegmentationBody; + this.SourceType = sourceType; + this.Source = source ?? throw new global::System.ArgumentNullException(nameof(source)); } /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// Initializes a new instance of the class. /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + public SegmentationBody() { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); } - } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.SegmentationResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.SegmentationResponse.Json.g.cs new file mode 100644 index 0000000..743aacb --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.SegmentationResponse.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class SegmentationResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.SegmentationResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.SegmentationResponse), + jsonSerializerContext) as global::AI21.SegmentationResponse; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.SegmentationResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.SegmentationResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.SegmentationResponse; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.SegmentationResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.SegmentationResponse.g.cs index 49c293b..42c1c30 100644 --- a/src/libs/AI21/Generated/AI21.Models.SegmentationResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.SegmentationResponse.g.cs @@ -30,91 +30,29 @@ public sealed partial class SegmentationResponse [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// Initializes a new instance of the class. /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.SegmentationResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.SegmentationResponse), - jsonSerializerContext) as global::AI21.SegmentationResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.SegmentationResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + /// + /// A unique ID for the request (not the message). Repeated identical requests
+ /// get different IDs. However, for a streaming response, the ID will be the same
+ /// for all responses in the stream. + /// + /// + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public SegmentationResponse( + string id, + global::System.Collections.Generic.IList segments) { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.SegmentationResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.SegmentationResponse; + this.Id = id ?? throw new global::System.ArgumentNullException(nameof(id)); + this.Segments = segments ?? throw new global::System.ArgumentNullException(nameof(segments)); } /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// Initializes a new instance of the class. /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + public SegmentationResponse() { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); } - } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.SegmentedSummaryBody.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.SegmentedSummaryBody.Json.g.cs new file mode 100644 index 0000000..1f1837a --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.SegmentedSummaryBody.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class SegmentedSummaryBody + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.SegmentedSummaryBody? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.SegmentedSummaryBody), + jsonSerializerContext) as global::AI21.SegmentedSummaryBody; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.SegmentedSummaryBody? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.SegmentedSummaryBody), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.SegmentedSummaryBody; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.SegmentedSummaryBody.g.cs b/src/libs/AI21/Generated/AI21.Models.SegmentedSummaryBody.g.cs index 8617930..41f22a0 100644 --- a/src/libs/AI21/Generated/AI21.Models.SegmentedSummaryBody.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.SegmentedSummaryBody.g.cs @@ -35,91 +35,30 @@ public sealed partial class SegmentedSummaryBody [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// Initializes a new instance of the class. /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.SegmentedSummaryBody? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.SegmentedSummaryBody), - jsonSerializerContext) as global::AI21.SegmentedSummaryBody; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.SegmentedSummaryBody? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + /// + /// + /// An enumeration. + /// + /// + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public SegmentedSummaryBody( + string source, + global::AI21.DocumentType sourceType, + string? focus) { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.SegmentedSummaryBody), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.SegmentedSummaryBody; + this.Source = source ?? throw new global::System.ArgumentNullException(nameof(source)); + this.SourceType = sourceType; + this.Focus = focus; } /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// Initializes a new instance of the class. /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + public SegmentedSummaryBody() { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); } - } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.SourceDocument.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.SourceDocument.Json.g.cs new file mode 100644 index 0000000..97054d3 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.SourceDocument.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class SourceDocument + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.SourceDocument? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.SourceDocument), + jsonSerializerContext) as global::AI21.SourceDocument; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.SourceDocument? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.SourceDocument), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.SourceDocument; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.SourceDocument.g.cs b/src/libs/AI21/Generated/AI21.Models.SourceDocument.g.cs index 9f07ee4..8221683 100644 --- a/src/libs/AI21/Generated/AI21.Models.SourceDocument.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.SourceDocument.g.cs @@ -47,91 +47,34 @@ public sealed partial class SourceDocument [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. + /// Initializes a new instance of the class. /// - public static global::AI21.SourceDocument? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + /// + /// + /// + /// + /// + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public SourceDocument( + string fileId, + string name, + global::System.Collections.Generic.IList highlights, + string? publicUrl, + global::System.Collections.Generic.IList? labels) { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.SourceDocument), - jsonSerializerContext) as global::AI21.SourceDocument; + this.FileId = fileId ?? throw new global::System.ArgumentNullException(nameof(fileId)); + this.Name = name ?? throw new global::System.ArgumentNullException(nameof(name)); + this.Highlights = highlights ?? throw new global::System.ArgumentNullException(nameof(highlights)); + this.PublicUrl = publicUrl; + this.Labels = labels; } /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// Initializes a new instance of the class. /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.SourceDocument? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + public SourceDocument() { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.SourceDocument), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.SourceDocument; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.SummarizationResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.SummarizationResponse.Json.g.cs new file mode 100644 index 0000000..e49ddf1 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.SummarizationResponse.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class SummarizationResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.SummarizationResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.SummarizationResponse), + jsonSerializerContext) as global::AI21.SummarizationResponse; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.SummarizationResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.SummarizationResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.SummarizationResponse; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.SummarizationResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.SummarizationResponse.g.cs index 00e3e29..01716f7 100644 --- a/src/libs/AI21/Generated/AI21.Models.SummarizationResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.SummarizationResponse.g.cs @@ -30,91 +30,29 @@ public sealed partial class SummarizationResponse [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// Initializes a new instance of the class. /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.SummarizationResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.SummarizationResponse), - jsonSerializerContext) as global::AI21.SummarizationResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.SummarizationResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + /// + /// A unique ID for the request (not the message). Repeated identical requests
+ /// get different IDs. However, for a streaming response, the ID will be the same
+ /// for all responses in the stream. + /// + /// + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public SummarizationResponse( + string id, + string summary) { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.SummarizationResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.SummarizationResponse; + this.Id = id ?? throw new global::System.ArgumentNullException(nameof(id)); + this.Summary = summary ?? throw new global::System.ArgumentNullException(nameof(summary)); } /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// Initializes a new instance of the class. /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + public SummarizationResponse() { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); } - } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.SummarizeBody.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.SummarizeBody.Json.g.cs new file mode 100644 index 0000000..c84603b --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.SummarizeBody.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class SummarizeBody + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.SummarizeBody? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.SummarizeBody), + jsonSerializerContext) as global::AI21.SummarizeBody; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.SummarizeBody? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.SummarizeBody), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.SummarizeBody; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.SummarizeBody.g.cs b/src/libs/AI21/Generated/AI21.Models.SummarizeBody.g.cs index 2896d02..e84efab 100644 --- a/src/libs/AI21/Generated/AI21.Models.SummarizeBody.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.SummarizeBody.g.cs @@ -42,91 +42,35 @@ public sealed partial class SummarizeBody [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.SummarizeBody? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.SummarizeBody), - jsonSerializerContext) as global::AI21.SummarizeBody; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.SummarizeBody? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// Initializes a new instance of the class. /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + /// + /// + /// An enumeration. + /// + /// + /// + /// An enumeration. + /// + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public SummarizeBody( + string source, + global::AI21.DocumentType sourceType, + string? focus, + global::AI21.SummaryMethod? summaryMethod) { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.SummarizeBody), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.SummarizeBody; + this.Source = source ?? throw new global::System.ArgumentNullException(nameof(source)); + this.SourceType = sourceType; + this.Focus = focus; + this.SummaryMethod = summaryMethod; } /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// Initializes a new instance of the class. /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + public SummarizeBody() { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); } - } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.SummarizeBySegmentResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.SummarizeBySegmentResponse.Json.g.cs new file mode 100644 index 0000000..614c79f --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.SummarizeBySegmentResponse.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class SummarizeBySegmentResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.SummarizeBySegmentResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.SummarizeBySegmentResponse), + jsonSerializerContext) as global::AI21.SummarizeBySegmentResponse; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.SummarizeBySegmentResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.SummarizeBySegmentResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.SummarizeBySegmentResponse; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.SummarizeBySegmentResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.SummarizeBySegmentResponse.g.cs index f8f021c..78ac502 100644 --- a/src/libs/AI21/Generated/AI21.Models.SummarizeBySegmentResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.SummarizeBySegmentResponse.g.cs @@ -30,91 +30,29 @@ public sealed partial class SummarizeBySegmentResponse [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// Initializes a new instance of the class. /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.SummarizeBySegmentResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.SummarizeBySegmentResponse), - jsonSerializerContext) as global::AI21.SummarizeBySegmentResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.SummarizeBySegmentResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + /// + /// A unique ID for the request (not the message). Repeated identical requests
+ /// get different IDs. However, for a streaming response, the ID will be the same
+ /// for all responses in the stream. + /// + /// + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public SummarizeBySegmentResponse( + string id, + global::System.Collections.Generic.IList segments) { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.SummarizeBySegmentResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.SummarizeBySegmentResponse; + this.Id = id ?? throw new global::System.ArgumentNullException(nameof(id)); + this.Segments = segments ?? throw new global::System.ArgumentNullException(nameof(segments)); } /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// Initializes a new instance of the class. /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + public SummarizeBySegmentResponse() { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); } - } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.SystemMessage.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.SystemMessage.Json.g.cs new file mode 100644 index 0000000..f413226 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.SystemMessage.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class SystemMessage + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.SystemMessage? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.SystemMessage), + jsonSerializerContext) as global::AI21.SystemMessage; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.SystemMessage? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.SystemMessage), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.SystemMessage; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.SystemMessage.g.cs b/src/libs/AI21/Generated/AI21.Models.SystemMessage.g.cs index 4f1778b..63dc38d 100644 --- a/src/libs/AI21/Generated/AI21.Models.SystemMessage.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.SystemMessage.g.cs @@ -38,91 +38,37 @@ public sealed partial class SystemMessage [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// Initializes a new instance of the class. /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.SystemMessage? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.SystemMessage), - jsonSerializerContext) as global::AI21.SystemMessage; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.SystemMessage? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + /// + /// The role of an individual message.
+ /// - `user`: Input provided by the user. Any instructions given here that conflict
+ /// with instructions given in the `system` prompt take precedence over the `system`
+ /// prompt instructions.
+ /// - `assistant`: Response generated by the model.
+ /// - `system`: Initial instructions provided to the system to provide general guidance
+ /// on the tone and voice of the generated message. An initial system message is
+ /// optional but recommended to provide guidance on the tone of the chat. For
+ /// example, "You are a helpful chatbot with a background in earth sciences and a
+ /// charming French accent."
+ /// Default Value: system + /// + /// + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public SystemMessage( + string content, + global::AI21.SystemMessageRole? role) { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.SystemMessage), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.SystemMessage; + this.Content = content ?? throw new global::System.ArgumentNullException(nameof(content)); + this.Role = role; } /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// Initializes a new instance of the class. /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + public SystemMessage() { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); } - } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ToolCall.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.ToolCall.Json.g.cs new file mode 100644 index 0000000..24af3fd --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.ToolCall.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class ToolCall + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.ToolCall? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.ToolCall), + jsonSerializerContext) as global::AI21.ToolCall; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.ToolCall? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.ToolCall), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ToolCall; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.ToolCall.g.cs b/src/libs/AI21/Generated/AI21.Models.ToolCall.g.cs index bf68b05..4500ab7 100644 --- a/src/libs/AI21/Generated/AI21.Models.ToolCall.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ToolCall.g.cs @@ -37,91 +37,34 @@ public sealed partial class ToolCall [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.ToolCall? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.ToolCall), - jsonSerializerContext) as global::AI21.ToolCall; - } - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// Initializes a new instance of the class. /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.ToolCall? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + /// + /// A unique ID for the request (not the message). Repeated identical requests
+ /// get different IDs. However, for a streaming response, the ID will be the same
+ /// for all responses in the stream. + /// + /// + /// Default Value: function + /// + /// + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public ToolCall( + string id, + global::AI21.ToolFunction function, + global::AI21.ToolCallType? type) { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.ToolCall), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ToolCall; + this.Id = id ?? throw new global::System.ArgumentNullException(nameof(id)); + this.Function = function ?? throw new global::System.ArgumentNullException(nameof(function)); + this.Type = type; } /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// Initializes a new instance of the class. /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + public ToolCall() { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); } - } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ToolDefinition.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.ToolDefinition.Json.g.cs new file mode 100644 index 0000000..0492984 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.ToolDefinition.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class ToolDefinition + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.ToolDefinition? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.ToolDefinition), + jsonSerializerContext) as global::AI21.ToolDefinition; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.ToolDefinition? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.ToolDefinition), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ToolDefinition; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.ToolDefinition.g.cs b/src/libs/AI21/Generated/AI21.Models.ToolDefinition.g.cs index b6a4b94..044a2a0 100644 --- a/src/libs/AI21/Generated/AI21.Models.ToolDefinition.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ToolDefinition.g.cs @@ -28,91 +28,25 @@ public sealed partial class ToolDefinition [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. + /// Initializes a new instance of the class. /// - public static global::AI21.ToolDefinition? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + /// + /// + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public ToolDefinition( + global::AI21.FunctionToolDefinition function, + global::AI21.ToolDefinitionType type) { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.ToolDefinition), - jsonSerializerContext) as global::AI21.ToolDefinition; + this.Function = function ?? throw new global::System.ArgumentNullException(nameof(function)); + this.Type = type; } /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// Initializes a new instance of the class. /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.ToolDefinition? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + public ToolDefinition() { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.ToolDefinition), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ToolDefinition; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ToolFunction.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.ToolFunction.Json.g.cs new file mode 100644 index 0000000..a1b9fa9 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.ToolFunction.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class ToolFunction + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.ToolFunction? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.ToolFunction), + jsonSerializerContext) as global::AI21.ToolFunction; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.ToolFunction? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.ToolFunction), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ToolFunction; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.ToolFunction.g.cs b/src/libs/AI21/Generated/AI21.Models.ToolFunction.g.cs index b733297..fbcf823 100644 --- a/src/libs/AI21/Generated/AI21.Models.ToolFunction.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ToolFunction.g.cs @@ -28,91 +28,25 @@ public sealed partial class ToolFunction [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. + /// Initializes a new instance of the class. /// - public static global::AI21.ToolFunction? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + /// + /// + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public ToolFunction( + string name, + string arguments) { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.ToolFunction), - jsonSerializerContext) as global::AI21.ToolFunction; + this.Name = name ?? throw new global::System.ArgumentNullException(nameof(name)); + this.Arguments = arguments ?? throw new global::System.ArgumentNullException(nameof(arguments)); } /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// Initializes a new instance of the class. /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.ToolFunction? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + public ToolFunction() { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.ToolFunction), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ToolFunction; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ToolMessage.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.ToolMessage.Json.g.cs new file mode 100644 index 0000000..47a5403 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.ToolMessage.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class ToolMessage + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.ToolMessage? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.ToolMessage), + jsonSerializerContext) as global::AI21.ToolMessage; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.ToolMessage? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.ToolMessage), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ToolMessage; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.ToolMessage.g.cs b/src/libs/AI21/Generated/AI21.Models.ToolMessage.g.cs index 779fbe1..1a4cea6 100644 --- a/src/libs/AI21/Generated/AI21.Models.ToolMessage.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ToolMessage.g.cs @@ -45,91 +45,40 @@ public sealed partial class ToolMessage [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// Initializes a new instance of the class. /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.ToolMessage? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.ToolMessage), - jsonSerializerContext) as global::AI21.ToolMessage; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.ToolMessage? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + /// + /// The role of an individual message.
+ /// - `user`: Input provided by the user. Any instructions given here that conflict
+ /// with instructions given in the `system` prompt take precedence over the `system`
+ /// prompt instructions.
+ /// - `assistant`: Response generated by the model.
+ /// - `system`: Initial instructions provided to the system to provide general guidance
+ /// on the tone and voice of the generated message. An initial system message is
+ /// optional but recommended to provide guidance on the tone of the chat. For
+ /// example, "You are a helpful chatbot with a background in earth sciences and a
+ /// charming French accent."
+ /// Default Value: tool + /// + /// + /// + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public ToolMessage( + string content, + string toolCallId, + global::AI21.ToolMessageRole? role) { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.ToolMessage), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ToolMessage; + this.Content = content ?? throw new global::System.ArgumentNullException(nameof(content)); + this.ToolCallId = toolCallId ?? throw new global::System.ArgumentNullException(nameof(toolCallId)); + this.Role = role; } /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// Initializes a new instance of the class. /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + public ToolMessage() { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); } - } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ToolParameters.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.ToolParameters.Json.g.cs new file mode 100644 index 0000000..f63f9ec --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.ToolParameters.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class ToolParameters + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.ToolParameters? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.ToolParameters), + jsonSerializerContext) as global::AI21.ToolParameters; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.ToolParameters? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.ToolParameters), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ToolParameters; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.ToolParameters.g.cs b/src/libs/AI21/Generated/AI21.Models.ToolParameters.g.cs index 49a2ab1..78b9e38 100644 --- a/src/libs/AI21/Generated/AI21.Models.ToolParameters.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ToolParameters.g.cs @@ -35,91 +35,33 @@ public sealed partial class ToolParameters [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// Initializes a new instance of the class. /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.ToolParameters? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.ToolParameters), - jsonSerializerContext) as global::AI21.ToolParameters; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.ToolParameters? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + /// + /// Type of the parameter schema, only `object` is supported
+ /// Default Value: object + /// + /// + /// + /// List of required properties + /// + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public ToolParameters( + object properties, + global::AI21.ToolParametersType? type, + global::System.Collections.Generic.IList? required) { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.ToolParameters), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ToolParameters; + this.Properties = properties ?? throw new global::System.ArgumentNullException(nameof(properties)); + this.Type = type; + this.Required = required; } /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// Initializes a new instance of the class. /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + public ToolParameters() { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); } - } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ToolParametersProperties.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.ToolParametersProperties.Json.g.cs new file mode 100644 index 0000000..8123245 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.ToolParametersProperties.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class ToolParametersProperties + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.ToolParametersProperties? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.ToolParametersProperties), + jsonSerializerContext) as global::AI21.ToolParametersProperties; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.ToolParametersProperties? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.ToolParametersProperties), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ToolParametersProperties; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.ToolParametersProperties.g.cs b/src/libs/AI21/Generated/AI21.Models.ToolParametersProperties.g.cs index 25e6d3b..29fead4 100644 --- a/src/libs/AI21/Generated/AI21.Models.ToolParametersProperties.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ToolParametersProperties.g.cs @@ -15,91 +15,13 @@ public sealed partial class ToolParametersProperties [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. + /// Initializes a new instance of the class. /// - public static global::AI21.ToolParametersProperties? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public ToolParametersProperties( + ) { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.ToolParametersProperties), - jsonSerializerContext) as global::AI21.ToolParametersProperties; } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.ToolParametersProperties? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.ToolParametersProperties), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ToolParametersProperties; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.TopLogprobsData.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.TopLogprobsData.Json.g.cs new file mode 100644 index 0000000..6b2f898 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.TopLogprobsData.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class TopLogprobsData + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.TopLogprobsData? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.TopLogprobsData), + jsonSerializerContext) as global::AI21.TopLogprobsData; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.TopLogprobsData? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.TopLogprobsData), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.TopLogprobsData; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.TopLogprobsData.g.cs b/src/libs/AI21/Generated/AI21.Models.TopLogprobsData.g.cs index adca5c2..28d240e 100644 --- a/src/libs/AI21/Generated/AI21.Models.TopLogprobsData.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.TopLogprobsData.g.cs @@ -28,91 +28,25 @@ public sealed partial class TopLogprobsData [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. + /// Initializes a new instance of the class. /// - public static global::AI21.TopLogprobsData? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + /// + /// + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public TopLogprobsData( + string token, + double logprob) { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.TopLogprobsData), - jsonSerializerContext) as global::AI21.TopLogprobsData; + this.Token = token ?? throw new global::System.ArgumentNullException(nameof(token)); + this.Logprob = logprob; } /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// Initializes a new instance of the class. /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.TopLogprobsData? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + public TopLogprobsData() { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.TopLogprobsData), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.TopLogprobsData; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.UsageInfo.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.UsageInfo.Json.g.cs new file mode 100644 index 0000000..fe6cecb --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.UsageInfo.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class UsageInfo + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.UsageInfo? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.UsageInfo), + jsonSerializerContext) as global::AI21.UsageInfo; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.UsageInfo? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.UsageInfo), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.UsageInfo; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.UsageInfo.g.cs b/src/libs/AI21/Generated/AI21.Models.UsageInfo.g.cs index 477850e..3ed1ca1 100644 --- a/src/libs/AI21/Generated/AI21.Models.UsageInfo.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.UsageInfo.g.cs @@ -39,91 +39,38 @@ public sealed partial class UsageInfo [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// Initializes a new instance of the class. /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.UsageInfo? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.UsageInfo), - jsonSerializerContext) as global::AI21.UsageInfo; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.UsageInfo? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + /// + /// Number of tokens in the prompt for this request. Note that the prompt token
+ /// includes the entire message history, plus extra tokens needed by the system
+ /// when combining the list of prompt messages into a single message, as
+ /// required by the model. The number of extra tokens is typically proportional
+ /// to the number of messages in the thread, and should be relatively small. + /// + /// + /// Number of tokens in the response message. + /// + /// + /// `prompt_tokens` + `completion_tokens`. + /// + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public UsageInfo( + int promptTokens, + int completionTokens, + int totalTokens) { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.UsageInfo), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.UsageInfo; + this.PromptTokens = promptTokens; + this.CompletionTokens = completionTokens; + this.TotalTokens = totalTokens; } /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// Initializes a new instance of the class. /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + public UsageInfo() { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); } - } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.UserMessage.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.UserMessage.Json.g.cs new file mode 100644 index 0000000..e679fe1 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.UserMessage.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class UserMessage + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.UserMessage? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.UserMessage), + jsonSerializerContext) as global::AI21.UserMessage; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.UserMessage? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.UserMessage), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.UserMessage; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.UserMessage.g.cs b/src/libs/AI21/Generated/AI21.Models.UserMessage.g.cs index 021b10f..a6a0160 100644 --- a/src/libs/AI21/Generated/AI21.Models.UserMessage.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.UserMessage.g.cs @@ -38,91 +38,37 @@ public sealed partial class UserMessage [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// Initializes a new instance of the class. /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.UserMessage? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.UserMessage), - jsonSerializerContext) as global::AI21.UserMessage; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.UserMessage? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + /// + /// The role of an individual message.
+ /// - `user`: Input provided by the user. Any instructions given here that conflict
+ /// with instructions given in the `system` prompt take precedence over the `system`
+ /// prompt instructions.
+ /// - `assistant`: Response generated by the model.
+ /// - `system`: Initial instructions provided to the system to provide general guidance
+ /// on the tone and voice of the generated message. An initial system message is
+ /// optional but recommended to provide guidance on the tone of the chat. For
+ /// example, "You are a helpful chatbot with a background in earth sciences and a
+ /// charming French accent."
+ /// Default Value: user + /// + /// + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public UserMessage( + string content, + global::AI21.UserMessageRole? role) { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.UserMessage), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.UserMessage; + this.Content = content ?? throw new global::System.ArgumentNullException(nameof(content)); + this.Role = role; } /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// Initializes a new instance of the class. /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + public UserMessage() { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); } - } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1CreateCustomModelResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1CreateCustomModelResponse.Json.g.cs new file mode 100644 index 0000000..48d2e76 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1CreateCustomModelResponse.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class V1CreateCustomModelResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.V1CreateCustomModelResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.V1CreateCustomModelResponse), + jsonSerializerContext) as global::AI21.V1CreateCustomModelResponse; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.V1CreateCustomModelResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.V1CreateCustomModelResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1CreateCustomModelResponse; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.V1CreateCustomModelResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1CreateCustomModelResponse.g.cs index ade11a6..a33d4b4 100644 --- a/src/libs/AI21/Generated/AI21.Models.V1CreateCustomModelResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.V1CreateCustomModelResponse.g.cs @@ -15,91 +15,13 @@ public sealed partial class V1CreateCustomModelResponse [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. + /// Initializes a new instance of the class. /// - public static global::AI21.V1CreateCustomModelResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public V1CreateCustomModelResponse( + ) { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.V1CreateCustomModelResponse), - jsonSerializerContext) as global::AI21.V1CreateCustomModelResponse; } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.V1CreateCustomModelResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.V1CreateCustomModelResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1CreateCustomModelResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1DeleteCustomModelResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1DeleteCustomModelResponse.Json.g.cs new file mode 100644 index 0000000..6775130 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1DeleteCustomModelResponse.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class V1DeleteCustomModelResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.V1DeleteCustomModelResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.V1DeleteCustomModelResponse), + jsonSerializerContext) as global::AI21.V1DeleteCustomModelResponse; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.V1DeleteCustomModelResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.V1DeleteCustomModelResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1DeleteCustomModelResponse; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.V1DeleteCustomModelResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1DeleteCustomModelResponse.g.cs index 502405c..e5762da 100644 --- a/src/libs/AI21/Generated/AI21.Models.V1DeleteCustomModelResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.V1DeleteCustomModelResponse.g.cs @@ -15,91 +15,13 @@ public sealed partial class V1DeleteCustomModelResponse [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. + /// Initializes a new instance of the class. /// - public static global::AI21.V1DeleteCustomModelResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public V1DeleteCustomModelResponse( + ) { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.V1DeleteCustomModelResponse), - jsonSerializerContext) as global::AI21.V1DeleteCustomModelResponse; } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.V1DeleteCustomModelResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.V1DeleteCustomModelResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1DeleteCustomModelResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1GetCustomModelResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1GetCustomModelResponse.Json.g.cs new file mode 100644 index 0000000..462bb3b --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1GetCustomModelResponse.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class V1GetCustomModelResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.V1GetCustomModelResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.V1GetCustomModelResponse), + jsonSerializerContext) as global::AI21.V1GetCustomModelResponse; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.V1GetCustomModelResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.V1GetCustomModelResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1GetCustomModelResponse; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.V1GetCustomModelResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1GetCustomModelResponse.g.cs index cb88d61..21c26df 100644 --- a/src/libs/AI21/Generated/AI21.Models.V1GetCustomModelResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.V1GetCustomModelResponse.g.cs @@ -15,91 +15,13 @@ public sealed partial class V1GetCustomModelResponse [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. + /// Initializes a new instance of the class. /// - public static global::AI21.V1GetCustomModelResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public V1GetCustomModelResponse( + ) { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.V1GetCustomModelResponse), - jsonSerializerContext) as global::AI21.V1GetCustomModelResponse; } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.V1GetCustomModelResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.V1GetCustomModelResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1GetCustomModelResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1GetCustomModelsResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1GetCustomModelsResponse.Json.g.cs new file mode 100644 index 0000000..c7e8b31 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1GetCustomModelsResponse.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class V1GetCustomModelsResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.V1GetCustomModelsResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.V1GetCustomModelsResponse), + jsonSerializerContext) as global::AI21.V1GetCustomModelsResponse; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.V1GetCustomModelsResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.V1GetCustomModelsResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1GetCustomModelsResponse; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.V1GetCustomModelsResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1GetCustomModelsResponse.g.cs index 8099b6e..7a0ce6b 100644 --- a/src/libs/AI21/Generated/AI21.Models.V1GetCustomModelsResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.V1GetCustomModelsResponse.g.cs @@ -15,91 +15,13 @@ public sealed partial class V1GetCustomModelsResponse [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. + /// Initializes a new instance of the class. /// - public static global::AI21.V1GetCustomModelsResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public V1GetCustomModelsResponse( + ) { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.V1GetCustomModelsResponse), - jsonSerializerContext) as global::AI21.V1GetCustomModelsResponse; } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.V1GetCustomModelsResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.V1GetCustomModelsResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1GetCustomModelsResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1J2GrandeCompleteResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1J2GrandeCompleteResponse.Json.g.cs new file mode 100644 index 0000000..c654865 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1J2GrandeCompleteResponse.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class V1J2GrandeCompleteResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.V1J2GrandeCompleteResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.V1J2GrandeCompleteResponse), + jsonSerializerContext) as global::AI21.V1J2GrandeCompleteResponse; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.V1J2GrandeCompleteResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.V1J2GrandeCompleteResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1J2GrandeCompleteResponse; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.V1J2GrandeCompleteResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1J2GrandeCompleteResponse.g.cs index de9b048..111284e 100644 --- a/src/libs/AI21/Generated/AI21.Models.V1J2GrandeCompleteResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.V1J2GrandeCompleteResponse.g.cs @@ -15,91 +15,13 @@ public sealed partial class V1J2GrandeCompleteResponse [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. + /// Initializes a new instance of the class. /// - public static global::AI21.V1J2GrandeCompleteResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public V1J2GrandeCompleteResponse( + ) { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.V1J2GrandeCompleteResponse), - jsonSerializerContext) as global::AI21.V1J2GrandeCompleteResponse; } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.V1J2GrandeCompleteResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.V1J2GrandeCompleteResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1J2GrandeCompleteResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1J2GrandeCustomModelCompleteResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1J2GrandeCustomModelCompleteResponse.Json.g.cs new file mode 100644 index 0000000..f85a625 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1J2GrandeCustomModelCompleteResponse.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class V1J2GrandeCustomModelCompleteResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.V1J2GrandeCustomModelCompleteResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.V1J2GrandeCustomModelCompleteResponse), + jsonSerializerContext) as global::AI21.V1J2GrandeCustomModelCompleteResponse; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.V1J2GrandeCustomModelCompleteResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.V1J2GrandeCustomModelCompleteResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1J2GrandeCustomModelCompleteResponse; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.V1J2GrandeCustomModelCompleteResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1J2GrandeCustomModelCompleteResponse.g.cs index 4df073f..a9bbca7 100644 --- a/src/libs/AI21/Generated/AI21.Models.V1J2GrandeCustomModelCompleteResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.V1J2GrandeCustomModelCompleteResponse.g.cs @@ -15,91 +15,13 @@ public sealed partial class V1J2GrandeCustomModelCompleteResponse [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. + /// Initializes a new instance of the class. /// - public static global::AI21.V1J2GrandeCustomModelCompleteResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public V1J2GrandeCustomModelCompleteResponse( + ) { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.V1J2GrandeCustomModelCompleteResponse), - jsonSerializerContext) as global::AI21.V1J2GrandeCustomModelCompleteResponse; } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.V1J2GrandeCustomModelCompleteResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.V1J2GrandeCustomModelCompleteResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1J2GrandeCustomModelCompleteResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1J2GrandeInstructCompleteResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1J2GrandeInstructCompleteResponse.Json.g.cs new file mode 100644 index 0000000..021d3fd --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1J2GrandeInstructCompleteResponse.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class V1J2GrandeInstructCompleteResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.V1J2GrandeInstructCompleteResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.V1J2GrandeInstructCompleteResponse), + jsonSerializerContext) as global::AI21.V1J2GrandeInstructCompleteResponse; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.V1J2GrandeInstructCompleteResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.V1J2GrandeInstructCompleteResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1J2GrandeInstructCompleteResponse; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.V1J2GrandeInstructCompleteResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1J2GrandeInstructCompleteResponse.g.cs index 1bcb1b6..1d6184b 100644 --- a/src/libs/AI21/Generated/AI21.Models.V1J2GrandeInstructCompleteResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.V1J2GrandeInstructCompleteResponse.g.cs @@ -15,91 +15,13 @@ public sealed partial class V1J2GrandeInstructCompleteResponse [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. + /// Initializes a new instance of the class. /// - public static global::AI21.V1J2GrandeInstructCompleteResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public V1J2GrandeInstructCompleteResponse( + ) { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.V1J2GrandeInstructCompleteResponse), - jsonSerializerContext) as global::AI21.V1J2GrandeInstructCompleteResponse; } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.V1J2GrandeInstructCompleteResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.V1J2GrandeInstructCompleteResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1J2GrandeInstructCompleteResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1J2JumboCompleteResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1J2JumboCompleteResponse.Json.g.cs new file mode 100644 index 0000000..1d99b25 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1J2JumboCompleteResponse.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class V1J2JumboCompleteResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.V1J2JumboCompleteResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.V1J2JumboCompleteResponse), + jsonSerializerContext) as global::AI21.V1J2JumboCompleteResponse; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.V1J2JumboCompleteResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.V1J2JumboCompleteResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1J2JumboCompleteResponse; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.V1J2JumboCompleteResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1J2JumboCompleteResponse.g.cs index a480922..22c76a0 100644 --- a/src/libs/AI21/Generated/AI21.Models.V1J2JumboCompleteResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.V1J2JumboCompleteResponse.g.cs @@ -15,91 +15,13 @@ public sealed partial class V1J2JumboCompleteResponse [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. + /// Initializes a new instance of the class. /// - public static global::AI21.V1J2JumboCompleteResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public V1J2JumboCompleteResponse( + ) { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.V1J2JumboCompleteResponse), - jsonSerializerContext) as global::AI21.V1J2JumboCompleteResponse; } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.V1J2JumboCompleteResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.V1J2JumboCompleteResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1J2JumboCompleteResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1J2JumboCompleteResponse2.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1J2JumboCompleteResponse2.Json.g.cs new file mode 100644 index 0000000..8c6d91f --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1J2JumboCompleteResponse2.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class V1J2JumboCompleteResponse2 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.V1J2JumboCompleteResponse2? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.V1J2JumboCompleteResponse2), + jsonSerializerContext) as global::AI21.V1J2JumboCompleteResponse2; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.V1J2JumboCompleteResponse2? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.V1J2JumboCompleteResponse2), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1J2JumboCompleteResponse2; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.V1J2JumboCompleteResponse2.g.cs b/src/libs/AI21/Generated/AI21.Models.V1J2JumboCompleteResponse2.g.cs index 06908bc..127dfe8 100644 --- a/src/libs/AI21/Generated/AI21.Models.V1J2JumboCompleteResponse2.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.V1J2JumboCompleteResponse2.g.cs @@ -15,91 +15,13 @@ public sealed partial class V1J2JumboCompleteResponse2 [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. + /// Initializes a new instance of the class. /// - public static global::AI21.V1J2JumboCompleteResponse2? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public V1J2JumboCompleteResponse2( + ) { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.V1J2JumboCompleteResponse2), - jsonSerializerContext) as global::AI21.V1J2JumboCompleteResponse2; } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.V1J2JumboCompleteResponse2? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.V1J2JumboCompleteResponse2), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1J2JumboCompleteResponse2; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1J2JumboInstructCompleteResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1J2JumboInstructCompleteResponse.Json.g.cs new file mode 100644 index 0000000..d4c9f52 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1J2JumboInstructCompleteResponse.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class V1J2JumboInstructCompleteResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.V1J2JumboInstructCompleteResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.V1J2JumboInstructCompleteResponse), + jsonSerializerContext) as global::AI21.V1J2JumboInstructCompleteResponse; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.V1J2JumboInstructCompleteResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.V1J2JumboInstructCompleteResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1J2JumboInstructCompleteResponse; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.V1J2JumboInstructCompleteResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1J2JumboInstructCompleteResponse.g.cs index cdb1407..72302e7 100644 --- a/src/libs/AI21/Generated/AI21.Models.V1J2JumboInstructCompleteResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.V1J2JumboInstructCompleteResponse.g.cs @@ -15,91 +15,13 @@ public sealed partial class V1J2JumboInstructCompleteResponse [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. + /// Initializes a new instance of the class. /// - public static global::AI21.V1J2JumboInstructCompleteResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public V1J2JumboInstructCompleteResponse( + ) { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.V1J2JumboInstructCompleteResponse), - jsonSerializerContext) as global::AI21.V1J2JumboInstructCompleteResponse; } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.V1J2JumboInstructCompleteResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.V1J2JumboInstructCompleteResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1J2JumboInstructCompleteResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1J2LargeCompleteResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1J2LargeCompleteResponse.Json.g.cs new file mode 100644 index 0000000..33fc6de --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1J2LargeCompleteResponse.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class V1J2LargeCompleteResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.V1J2LargeCompleteResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.V1J2LargeCompleteResponse), + jsonSerializerContext) as global::AI21.V1J2LargeCompleteResponse; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.V1J2LargeCompleteResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.V1J2LargeCompleteResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1J2LargeCompleteResponse; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.V1J2LargeCompleteResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1J2LargeCompleteResponse.g.cs index e32fe3f..7df9b19 100644 --- a/src/libs/AI21/Generated/AI21.Models.V1J2LargeCompleteResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.V1J2LargeCompleteResponse.g.cs @@ -15,91 +15,13 @@ public sealed partial class V1J2LargeCompleteResponse [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. + /// Initializes a new instance of the class. /// - public static global::AI21.V1J2LargeCompleteResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public V1J2LargeCompleteResponse( + ) { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.V1J2LargeCompleteResponse), - jsonSerializerContext) as global::AI21.V1J2LargeCompleteResponse; } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.V1J2LargeCompleteResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.V1J2LargeCompleteResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1J2LargeCompleteResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1J2LargeCustomModelCompleteResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1J2LargeCustomModelCompleteResponse.Json.g.cs new file mode 100644 index 0000000..2b6f3e7 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1J2LargeCustomModelCompleteResponse.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class V1J2LargeCustomModelCompleteResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.V1J2LargeCustomModelCompleteResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.V1J2LargeCustomModelCompleteResponse), + jsonSerializerContext) as global::AI21.V1J2LargeCustomModelCompleteResponse; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.V1J2LargeCustomModelCompleteResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.V1J2LargeCustomModelCompleteResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1J2LargeCustomModelCompleteResponse; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.V1J2LargeCustomModelCompleteResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1J2LargeCustomModelCompleteResponse.g.cs index 1c0528b..896b60b 100644 --- a/src/libs/AI21/Generated/AI21.Models.V1J2LargeCustomModelCompleteResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.V1J2LargeCustomModelCompleteResponse.g.cs @@ -15,91 +15,13 @@ public sealed partial class V1J2LargeCustomModelCompleteResponse [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. + /// Initializes a new instance of the class. /// - public static global::AI21.V1J2LargeCustomModelCompleteResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public V1J2LargeCustomModelCompleteResponse( + ) { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.V1J2LargeCustomModelCompleteResponse), - jsonSerializerContext) as global::AI21.V1J2LargeCustomModelCompleteResponse; } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.V1J2LargeCustomModelCompleteResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.V1J2LargeCustomModelCompleteResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1J2LargeCustomModelCompleteResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1J2LargeInstructCompleteResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1J2LargeInstructCompleteResponse.Json.g.cs new file mode 100644 index 0000000..fec6bb6 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1J2LargeInstructCompleteResponse.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class V1J2LargeInstructCompleteResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.V1J2LargeInstructCompleteResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.V1J2LargeInstructCompleteResponse), + jsonSerializerContext) as global::AI21.V1J2LargeInstructCompleteResponse; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.V1J2LargeInstructCompleteResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.V1J2LargeInstructCompleteResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1J2LargeInstructCompleteResponse; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.V1J2LargeInstructCompleteResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1J2LargeInstructCompleteResponse.g.cs index 0dd0efe..be3de68 100644 --- a/src/libs/AI21/Generated/AI21.Models.V1J2LargeInstructCompleteResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.V1J2LargeInstructCompleteResponse.g.cs @@ -15,91 +15,13 @@ public sealed partial class V1J2LargeInstructCompleteResponse [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. + /// Initializes a new instance of the class. /// - public static global::AI21.V1J2LargeInstructCompleteResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public V1J2LargeInstructCompleteResponse( + ) { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.V1J2LargeInstructCompleteResponse), - jsonSerializerContext) as global::AI21.V1J2LargeInstructCompleteResponse; } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.V1J2LargeInstructCompleteResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.V1J2LargeInstructCompleteResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1J2LargeInstructCompleteResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1J2LightCompleteResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1J2LightCompleteResponse.Json.g.cs new file mode 100644 index 0000000..d4f96c9 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1J2LightCompleteResponse.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class V1J2LightCompleteResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.V1J2LightCompleteResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.V1J2LightCompleteResponse), + jsonSerializerContext) as global::AI21.V1J2LightCompleteResponse; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.V1J2LightCompleteResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.V1J2LightCompleteResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1J2LightCompleteResponse; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.V1J2LightCompleteResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1J2LightCompleteResponse.g.cs index ac968ca..cdbbdce 100644 --- a/src/libs/AI21/Generated/AI21.Models.V1J2LightCompleteResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.V1J2LightCompleteResponse.g.cs @@ -15,91 +15,13 @@ public sealed partial class V1J2LightCompleteResponse [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. + /// Initializes a new instance of the class. /// - public static global::AI21.V1J2LightCompleteResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public V1J2LightCompleteResponse( + ) { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.V1J2LightCompleteResponse), - jsonSerializerContext) as global::AI21.V1J2LightCompleteResponse; } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.V1J2LightCompleteResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.V1J2LightCompleteResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1J2LightCompleteResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1J2LightCustomModelCompleteResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1J2LightCustomModelCompleteResponse.Json.g.cs new file mode 100644 index 0000000..1c7d043 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1J2LightCustomModelCompleteResponse.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class V1J2LightCustomModelCompleteResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.V1J2LightCustomModelCompleteResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.V1J2LightCustomModelCompleteResponse), + jsonSerializerContext) as global::AI21.V1J2LightCustomModelCompleteResponse; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.V1J2LightCustomModelCompleteResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.V1J2LightCustomModelCompleteResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1J2LightCustomModelCompleteResponse; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.V1J2LightCustomModelCompleteResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1J2LightCustomModelCompleteResponse.g.cs index b0f3e48..72bc2c8 100644 --- a/src/libs/AI21/Generated/AI21.Models.V1J2LightCustomModelCompleteResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.V1J2LightCustomModelCompleteResponse.g.cs @@ -15,91 +15,13 @@ public sealed partial class V1J2LightCustomModelCompleteResponse [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. + /// Initializes a new instance of the class. /// - public static global::AI21.V1J2LightCustomModelCompleteResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public V1J2LightCustomModelCompleteResponse( + ) { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.V1J2LightCustomModelCompleteResponse), - jsonSerializerContext) as global::AI21.V1J2LightCustomModelCompleteResponse; } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.V1J2LightCustomModelCompleteResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.V1J2LightCustomModelCompleteResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1J2LightCustomModelCompleteResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1J2MidCompleteResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1J2MidCompleteResponse.Json.g.cs new file mode 100644 index 0000000..68a984c --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1J2MidCompleteResponse.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class V1J2MidCompleteResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.V1J2MidCompleteResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.V1J2MidCompleteResponse), + jsonSerializerContext) as global::AI21.V1J2MidCompleteResponse; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.V1J2MidCompleteResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.V1J2MidCompleteResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1J2MidCompleteResponse; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.V1J2MidCompleteResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1J2MidCompleteResponse.g.cs index 47902df..4bf5587 100644 --- a/src/libs/AI21/Generated/AI21.Models.V1J2MidCompleteResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.V1J2MidCompleteResponse.g.cs @@ -15,91 +15,13 @@ public sealed partial class V1J2MidCompleteResponse [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. + /// Initializes a new instance of the class. /// - public static global::AI21.V1J2MidCompleteResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public V1J2MidCompleteResponse( + ) { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.V1J2MidCompleteResponse), - jsonSerializerContext) as global::AI21.V1J2MidCompleteResponse; } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.V1J2MidCompleteResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.V1J2MidCompleteResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1J2MidCompleteResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1J2MidCustomModelCompleteResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1J2MidCustomModelCompleteResponse.Json.g.cs new file mode 100644 index 0000000..311cbec --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1J2MidCustomModelCompleteResponse.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class V1J2MidCustomModelCompleteResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.V1J2MidCustomModelCompleteResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.V1J2MidCustomModelCompleteResponse), + jsonSerializerContext) as global::AI21.V1J2MidCustomModelCompleteResponse; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.V1J2MidCustomModelCompleteResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.V1J2MidCustomModelCompleteResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1J2MidCustomModelCompleteResponse; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.V1J2MidCustomModelCompleteResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1J2MidCustomModelCompleteResponse.g.cs index a44ed8d..5d70a7b 100644 --- a/src/libs/AI21/Generated/AI21.Models.V1J2MidCustomModelCompleteResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.V1J2MidCustomModelCompleteResponse.g.cs @@ -15,91 +15,13 @@ public sealed partial class V1J2MidCustomModelCompleteResponse [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. + /// Initializes a new instance of the class. /// - public static global::AI21.V1J2MidCustomModelCompleteResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public V1J2MidCustomModelCompleteResponse( + ) { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.V1J2MidCustomModelCompleteResponse), - jsonSerializerContext) as global::AI21.V1J2MidCustomModelCompleteResponse; } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.V1J2MidCustomModelCompleteResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.V1J2MidCustomModelCompleteResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1J2MidCustomModelCompleteResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1J2UltraCompleteResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1J2UltraCompleteResponse.Json.g.cs new file mode 100644 index 0000000..8113253 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1J2UltraCompleteResponse.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class V1J2UltraCompleteResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.V1J2UltraCompleteResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.V1J2UltraCompleteResponse), + jsonSerializerContext) as global::AI21.V1J2UltraCompleteResponse; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.V1J2UltraCompleteResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.V1J2UltraCompleteResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1J2UltraCompleteResponse; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.V1J2UltraCompleteResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1J2UltraCompleteResponse.g.cs index ff06ed5..a02bef8 100644 --- a/src/libs/AI21/Generated/AI21.Models.V1J2UltraCompleteResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.V1J2UltraCompleteResponse.g.cs @@ -15,91 +15,13 @@ public sealed partial class V1J2UltraCompleteResponse [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. + /// Initializes a new instance of the class. /// - public static global::AI21.V1J2UltraCompleteResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public V1J2UltraCompleteResponse( + ) { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.V1J2UltraCompleteResponse), - jsonSerializerContext) as global::AI21.V1J2UltraCompleteResponse; } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.V1J2UltraCompleteResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.V1J2UltraCompleteResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1J2UltraCompleteResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1J2UltraCompleteResponse2.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1J2UltraCompleteResponse2.Json.g.cs new file mode 100644 index 0000000..7bec27c --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1J2UltraCompleteResponse2.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class V1J2UltraCompleteResponse2 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.V1J2UltraCompleteResponse2? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.V1J2UltraCompleteResponse2), + jsonSerializerContext) as global::AI21.V1J2UltraCompleteResponse2; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.V1J2UltraCompleteResponse2? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.V1J2UltraCompleteResponse2), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1J2UltraCompleteResponse2; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.V1J2UltraCompleteResponse2.g.cs b/src/libs/AI21/Generated/AI21.Models.V1J2UltraCompleteResponse2.g.cs index 3aa9953..7a64e26 100644 --- a/src/libs/AI21/Generated/AI21.Models.V1J2UltraCompleteResponse2.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.V1J2UltraCompleteResponse2.g.cs @@ -15,91 +15,13 @@ public sealed partial class V1J2UltraCompleteResponse2 [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. + /// Initializes a new instance of the class. /// - public static global::AI21.V1J2UltraCompleteResponse2? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public V1J2UltraCompleteResponse2( + ) { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.V1J2UltraCompleteResponse2), - jsonSerializerContext) as global::AI21.V1J2UltraCompleteResponse2; } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.V1J2UltraCompleteResponse2? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.V1J2UltraCompleteResponse2), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1J2UltraCompleteResponse2; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1LibraryManagementResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1LibraryManagementResponse.Json.g.cs new file mode 100644 index 0000000..163c911 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1LibraryManagementResponse.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class V1LibraryManagementResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.V1LibraryManagementResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.V1LibraryManagementResponse), + jsonSerializerContext) as global::AI21.V1LibraryManagementResponse; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.V1LibraryManagementResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.V1LibraryManagementResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1LibraryManagementResponse; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.V1LibraryManagementResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1LibraryManagementResponse.g.cs index 60cb450..0aceb23 100644 --- a/src/libs/AI21/Generated/AI21.Models.V1LibraryManagementResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.V1LibraryManagementResponse.g.cs @@ -15,91 +15,13 @@ public sealed partial class V1LibraryManagementResponse [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. + /// Initializes a new instance of the class. /// - public static global::AI21.V1LibraryManagementResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public V1LibraryManagementResponse( + ) { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.V1LibraryManagementResponse), - jsonSerializerContext) as global::AI21.V1LibraryManagementResponse; } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.V1LibraryManagementResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.V1LibraryManagementResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1LibraryManagementResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1ParaphrazeResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1ParaphrazeResponse.Json.g.cs new file mode 100644 index 0000000..c683846 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1ParaphrazeResponse.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class V1ParaphrazeResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.V1ParaphrazeResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.V1ParaphrazeResponse), + jsonSerializerContext) as global::AI21.V1ParaphrazeResponse; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.V1ParaphrazeResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.V1ParaphrazeResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1ParaphrazeResponse; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.V1ParaphrazeResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1ParaphrazeResponse.g.cs index 1779a1b..b4e8a89 100644 --- a/src/libs/AI21/Generated/AI21.Models.V1ParaphrazeResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.V1ParaphrazeResponse.g.cs @@ -15,91 +15,13 @@ public sealed partial class V1ParaphrazeResponse [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. + /// Initializes a new instance of the class. /// - public static global::AI21.V1ParaphrazeResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public V1ParaphrazeResponse( + ) { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.V1ParaphrazeResponse), - jsonSerializerContext) as global::AI21.V1ParaphrazeResponse; } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.V1ParaphrazeResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.V1ParaphrazeResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1ParaphrazeResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.V1UpdateCustomModelResponse.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.V1UpdateCustomModelResponse.Json.g.cs new file mode 100644 index 0000000..336a645 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.V1UpdateCustomModelResponse.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class V1UpdateCustomModelResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.V1UpdateCustomModelResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.V1UpdateCustomModelResponse), + jsonSerializerContext) as global::AI21.V1UpdateCustomModelResponse; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.V1UpdateCustomModelResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.V1UpdateCustomModelResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1UpdateCustomModelResponse; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.V1UpdateCustomModelResponse.g.cs b/src/libs/AI21/Generated/AI21.Models.V1UpdateCustomModelResponse.g.cs index c4e3b41..b274cc7 100644 --- a/src/libs/AI21/Generated/AI21.Models.V1UpdateCustomModelResponse.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.V1UpdateCustomModelResponse.g.cs @@ -15,91 +15,13 @@ public sealed partial class V1UpdateCustomModelResponse [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. + /// Initializes a new instance of the class. /// - public static global::AI21.V1UpdateCustomModelResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public V1UpdateCustomModelResponse( + ) { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.V1UpdateCustomModelResponse), - jsonSerializerContext) as global::AI21.V1UpdateCustomModelResponse; } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.V1UpdateCustomModelResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.V1UpdateCustomModelResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.V1UpdateCustomModelResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.Models.ValidationError.Json.g.cs b/src/libs/AI21/Generated/AI21.Models.ValidationError.Json.g.cs new file mode 100644 index 0000000..b42e58d --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.ValidationError.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public sealed partial class ValidationError + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.ValidationError? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.ValidationError), + jsonSerializerContext) as global::AI21.ValidationError; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.ValidationError? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.ValidationError), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ValidationError; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AI21.Models.ValidationError.g.cs b/src/libs/AI21/Generated/AI21.Models.ValidationError.g.cs index 5a414bc..f746348 100644 --- a/src/libs/AI21/Generated/AI21.Models.ValidationError.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ValidationError.g.cs @@ -37,91 +37,28 @@ public sealed partial class ValidationError [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. + /// Initializes a new instance of the class. /// - public static global::AI21.ValidationError? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + /// + /// + /// + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public ValidationError( + global::System.Collections.Generic.IList> loc, + string msg, + string type) { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.ValidationError), - jsonSerializerContext) as global::AI21.ValidationError; + this.Loc = loc ?? throw new global::System.ArgumentNullException(nameof(loc)); + this.Msg = msg ?? throw new global::System.ArgumentNullException(nameof(msg)); + this.Type = type ?? throw new global::System.ArgumentNullException(nameof(type)); } /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// Initializes a new instance of the class. /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.ValidationError? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + public ValidationError() { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.ValidationError), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.ValidationError; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.ParaphraseClient.V1Paraphraze.g.cs b/src/libs/AI21/Generated/AI21.ParaphraseClient.V1Paraphraze.g.cs index cd037e5..2bb0367 100644 --- a/src/libs/AI21/Generated/AI21.ParaphraseClient.V1Paraphraze.g.cs +++ b/src/libs/AI21/Generated/AI21.ParaphraseClient.V1Paraphraze.g.cs @@ -31,7 +31,7 @@ partial void ProcessV1ParaphrazeResponseContent( /// /// /// The token to cancel the operation with - /// + /// public async global::System.Threading.Tasks.Task V1ParaphrazeAsync( global::AI21.ParaphraseBody request, int? requestStartTime = default, @@ -99,28 +99,97 @@ partial void ProcessV1ParaphrazeResponseContent( ProcessV1ParaphrazeResponse( httpClient: HttpClient, httpResponseMessage: __response); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + if (ReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + var __contentStream_422 = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); + __value_422 = await global::AI21.HTTPValidationError.FromJsonStreamAsync(__contentStream_422, JsonSerializerContext).ConfigureAwait(false); + } - var __content = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessV1ParaphrazeResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); + throw new global::AI21.ApiException( + message: __response.ReasonPhrase ?? string.Empty, + statusCode: __response.StatusCode) + { + ResponseBody = __content_422, + ResponseObject = __value_422, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } - try + if (ReadResponseAsString) { - __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1ParaphrazeResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + } + catch (global::System.Net.Http.HttpRequestException __ex) + { + throw new global::AI21.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + + return __content; } - catch (global::System.Net.Http.HttpRequestException __ex) + else { - throw new global::System.InvalidOperationException(__content, __ex); - } + try + { + __response.EnsureSuccessStatusCode(); + } + catch (global::System.Net.Http.HttpRequestException __ex) + { + throw new global::AI21.ApiException( + message: __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } - return __content; + using var __responseStream = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); + + var __responseValue = await global::System.Text.Json.JsonSerializer.DeserializeAsync(__responseStream, typeof(string), JsonSerializerContext).ConfigureAwait(false) as string; + + return + __responseValue ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } } /// diff --git a/src/libs/AI21/Generated/AI21.ParaphraseClient.g.cs b/src/libs/AI21/Generated/AI21.ParaphraseClient.g.cs index 162a906..fef7431 100644 --- a/src/libs/AI21/Generated/AI21.ParaphraseClient.g.cs +++ b/src/libs/AI21/Generated/AI21.ParaphraseClient.g.cs @@ -25,6 +25,11 @@ public sealed partial class ParaphraseClient : global::AI21.IParaphraseClient, g /// public global::System.Collections.Generic.List Authorizations { get; } + /// + public bool ReadResponseAsString { get; set; } +#if DEBUG + = true; +#endif /// /// /// diff --git a/src/libs/AI21/Generated/AI21.PathBuilder.g.cs b/src/libs/AI21/Generated/AI21.PathBuilder.g.cs index 2575afe..429b61f 100644 --- a/src/libs/AI21/Generated/AI21.PathBuilder.g.cs +++ b/src/libs/AI21/Generated/AI21.PathBuilder.g.cs @@ -1,5 +1,3 @@ -using System.Linq; - #nullable enable namespace AI21 @@ -103,7 +101,11 @@ public PathBuilder AddRequiredParameter( string delimiter = ",", bool explode = false) { - AddRequiredParameter(name, value.Select(selector).ToArray(), delimiter, explode); + AddRequiredParameter( + name, + global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(value, selector)), + delimiter, + explode); return this; } @@ -167,7 +169,11 @@ public PathBuilder AddOptionalParameter( { if (value is not null) { - AddRequiredParameter(name, value.Select(selector).ToArray(), delimiter, explode); + AddRequiredParameter( + name, + global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(value, selector)), + delimiter, + explode); } return this; diff --git a/src/libs/AI21/Generated/AI21.Polyfills.g.cs b/src/libs/AI21/Generated/AI21.Polyfills.g.cs index bf3567d..055d718 100644 --- a/src/libs/AI21/Generated/AI21.Polyfills.g.cs +++ b/src/libs/AI21/Generated/AI21.Polyfills.g.cs @@ -7,7 +7,7 @@ namespace AI21 /// /// /// - public static partial class AutoSDKPolyfills + public static partial class AutoSdkPolyfills { /// /// diff --git a/src/libs/AI21/Generated/AI21.RAGEngineClient.V1LibraryAnswer.g.cs b/src/libs/AI21/Generated/AI21.RAGEngineClient.V1LibraryAnswer.g.cs index b569300..a336288 100644 --- a/src/libs/AI21/Generated/AI21.RAGEngineClient.V1LibraryAnswer.g.cs +++ b/src/libs/AI21/Generated/AI21.RAGEngineClient.V1LibraryAnswer.g.cs @@ -31,7 +31,7 @@ partial void ProcessV1LibraryAnswerResponseContent( /// /// /// The token to cancel the operation with - /// + /// public async global::System.Threading.Tasks.Task V1LibraryAnswerAsync( global::AI21.LibraryAnswerRequest request, int? requestStartTime = default, @@ -99,30 +99,99 @@ partial void ProcessV1LibraryAnswerResponseContent( ProcessV1LibraryAnswerResponse( httpClient: HttpClient, httpResponseMessage: __response); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + if (ReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + var __contentStream_422 = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); + __value_422 = await global::AI21.HTTPValidationError.FromJsonStreamAsync(__contentStream_422, JsonSerializerContext).ConfigureAwait(false); + } - var __content = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessV1LibraryAnswerResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); + throw new global::AI21.ApiException( + message: __response.ReasonPhrase ?? string.Empty, + statusCode: __response.StatusCode) + { + ResponseBody = __content_422, + ResponseObject = __value_422, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } - try + if (ReadResponseAsString) { - __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1LibraryAnswerResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + } + catch (global::System.Net.Http.HttpRequestException __ex) + { + throw new global::AI21.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + + return + global::AI21.LibraryAnswerResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } - catch (global::System.Net.Http.HttpRequestException __ex) + else { - throw new global::System.InvalidOperationException(__content, __ex); - } + try + { + __response.EnsureSuccessStatusCode(); + } + catch (global::System.Net.Http.HttpRequestException __ex) + { + throw new global::AI21.ApiException( + message: __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } - return - global::AI21.LibraryAnswerResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + using var __responseStream = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); + + var __responseValue = await global::AI21.LibraryAnswerResponse.FromJsonStreamAsync(__responseStream, JsonSerializerContext).ConfigureAwait(false); + + return + __responseValue ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } } /// diff --git a/src/libs/AI21/Generated/AI21.RAGEngineClient.V1LibraryManagement.g.cs b/src/libs/AI21/Generated/AI21.RAGEngineClient.V1LibraryManagement.g.cs index e3b9976..e252fe0 100644 --- a/src/libs/AI21/Generated/AI21.RAGEngineClient.V1LibraryManagement.g.cs +++ b/src/libs/AI21/Generated/AI21.RAGEngineClient.V1LibraryManagement.g.cs @@ -31,7 +31,7 @@ partial void ProcessV1LibraryManagementResponseContent( /// Default Value: 1730898900272 /// /// The token to cancel the operation with - /// + /// public async global::System.Threading.Tasks.Task V1LibraryManagementAsync( global::System.Guid fileId, int? requestStartTime = default, @@ -91,28 +91,97 @@ partial void ProcessV1LibraryManagementResponseContent( ProcessV1LibraryManagementResponse( httpClient: HttpClient, httpResponseMessage: __response); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + if (ReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + var __contentStream_422 = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); + __value_422 = await global::AI21.HTTPValidationError.FromJsonStreamAsync(__contentStream_422, JsonSerializerContext).ConfigureAwait(false); + } - var __content = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessV1LibraryManagementResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); + throw new global::AI21.ApiException( + message: __response.ReasonPhrase ?? string.Empty, + statusCode: __response.StatusCode) + { + ResponseBody = __content_422, + ResponseObject = __value_422, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } - try + if (ReadResponseAsString) { - __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1LibraryManagementResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + } + catch (global::System.Net.Http.HttpRequestException __ex) + { + throw new global::AI21.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + + return __content; } - catch (global::System.Net.Http.HttpRequestException __ex) + else { - throw new global::System.InvalidOperationException(__content, __ex); - } + try + { + __response.EnsureSuccessStatusCode(); + } + catch (global::System.Net.Http.HttpRequestException __ex) + { + throw new global::AI21.ApiException( + message: __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } - return __content; + using var __responseStream = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); + + var __responseValue = await global::System.Text.Json.JsonSerializer.DeserializeAsync(__responseStream, typeof(string), JsonSerializerContext).ConfigureAwait(false) as string; + + return + __responseValue ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } } } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.RAGEngineClient.V1LibrarySearch.g.cs b/src/libs/AI21/Generated/AI21.RAGEngineClient.V1LibrarySearch.g.cs index 4ce3585..98264de 100644 --- a/src/libs/AI21/Generated/AI21.RAGEngineClient.V1LibrarySearch.g.cs +++ b/src/libs/AI21/Generated/AI21.RAGEngineClient.V1LibrarySearch.g.cs @@ -31,7 +31,7 @@ partial void ProcessV1LibrarySearchResponseContent( /// /// /// The token to cancel the operation with - /// + /// public async global::System.Threading.Tasks.Task V1LibrarySearchAsync( global::AI21.LibrarySearchRequest request, int? requestStartTime = default, @@ -99,30 +99,99 @@ partial void ProcessV1LibrarySearchResponseContent( ProcessV1LibrarySearchResponse( httpClient: HttpClient, httpResponseMessage: __response); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + if (ReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + var __contentStream_422 = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); + __value_422 = await global::AI21.HTTPValidationError.FromJsonStreamAsync(__contentStream_422, JsonSerializerContext).ConfigureAwait(false); + } - var __content = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessV1LibrarySearchResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); + throw new global::AI21.ApiException( + message: __response.ReasonPhrase ?? string.Empty, + statusCode: __response.StatusCode) + { + ResponseBody = __content_422, + ResponseObject = __value_422, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } - try + if (ReadResponseAsString) { - __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1LibrarySearchResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + } + catch (global::System.Net.Http.HttpRequestException __ex) + { + throw new global::AI21.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + + return + global::AI21.LibrarySearchResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } - catch (global::System.Net.Http.HttpRequestException __ex) + else { - throw new global::System.InvalidOperationException(__content, __ex); - } + try + { + __response.EnsureSuccessStatusCode(); + } + catch (global::System.Net.Http.HttpRequestException __ex) + { + throw new global::AI21.ApiException( + message: __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } - return - global::AI21.LibrarySearchResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + using var __responseStream = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); + + var __responseValue = await global::AI21.LibrarySearchResponse.FromJsonStreamAsync(__responseStream, JsonSerializerContext).ConfigureAwait(false); + + return + __responseValue ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } } /// diff --git a/src/libs/AI21/Generated/AI21.RAGEngineClient.g.cs b/src/libs/AI21/Generated/AI21.RAGEngineClient.g.cs index 2d898e8..5ad01fc 100644 --- a/src/libs/AI21/Generated/AI21.RAGEngineClient.g.cs +++ b/src/libs/AI21/Generated/AI21.RAGEngineClient.g.cs @@ -25,6 +25,11 @@ public sealed partial class RAGEngineClient : global::AI21.IRAGEngineClient, glo /// public global::System.Collections.Generic.List Authorizations { get; } + /// + public bool ReadResponseAsString { get; set; } +#if DEBUG + = true; +#endif /// /// /// diff --git a/src/libs/AI21/Generated/AI21.SegmentationClient.V1Segmentation.g.cs b/src/libs/AI21/Generated/AI21.SegmentationClient.V1Segmentation.g.cs index 28e7e5b..50b2c40 100644 --- a/src/libs/AI21/Generated/AI21.SegmentationClient.V1Segmentation.g.cs +++ b/src/libs/AI21/Generated/AI21.SegmentationClient.V1Segmentation.g.cs @@ -31,7 +31,7 @@ partial void ProcessV1SegmentationResponseContent( /// /// /// The token to cancel the operation with - /// + /// public async global::System.Threading.Tasks.Task V1SegmentationAsync( global::AI21.SegmentationBody request, int? requestStartTime = default, @@ -99,30 +99,99 @@ partial void ProcessV1SegmentationResponseContent( ProcessV1SegmentationResponse( httpClient: HttpClient, httpResponseMessage: __response); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + if (ReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + var __contentStream_422 = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); + __value_422 = await global::AI21.HTTPValidationError.FromJsonStreamAsync(__contentStream_422, JsonSerializerContext).ConfigureAwait(false); + } - var __content = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessV1SegmentationResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); + throw new global::AI21.ApiException( + message: __response.ReasonPhrase ?? string.Empty, + statusCode: __response.StatusCode) + { + ResponseBody = __content_422, + ResponseObject = __value_422, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } - try + if (ReadResponseAsString) { - __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1SegmentationResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + } + catch (global::System.Net.Http.HttpRequestException __ex) + { + throw new global::AI21.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + + return + global::AI21.SegmentationResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } - catch (global::System.Net.Http.HttpRequestException __ex) + else { - throw new global::System.InvalidOperationException(__content, __ex); - } + try + { + __response.EnsureSuccessStatusCode(); + } + catch (global::System.Net.Http.HttpRequestException __ex) + { + throw new global::AI21.ApiException( + message: __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } - return - global::AI21.SegmentationResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + using var __responseStream = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); + + var __responseValue = await global::AI21.SegmentationResponse.FromJsonStreamAsync(__responseStream, JsonSerializerContext).ConfigureAwait(false); + + return + __responseValue ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } } /// diff --git a/src/libs/AI21/Generated/AI21.SegmentationClient.g.cs b/src/libs/AI21/Generated/AI21.SegmentationClient.g.cs index b5adc29..40f6e70 100644 --- a/src/libs/AI21/Generated/AI21.SegmentationClient.g.cs +++ b/src/libs/AI21/Generated/AI21.SegmentationClient.g.cs @@ -25,6 +25,11 @@ public sealed partial class SegmentationClient : global::AI21.ISegmentationClien /// public global::System.Collections.Generic.List Authorizations { get; } + /// + public bool ReadResponseAsString { get; set; } +#if DEBUG + = true; +#endif /// /// /// diff --git a/src/libs/AI21/Generated/AI21.SummarizeClient.V1Summarize.g.cs b/src/libs/AI21/Generated/AI21.SummarizeClient.V1Summarize.g.cs index 40a1320..f753fb9 100644 --- a/src/libs/AI21/Generated/AI21.SummarizeClient.V1Summarize.g.cs +++ b/src/libs/AI21/Generated/AI21.SummarizeClient.V1Summarize.g.cs @@ -31,7 +31,7 @@ partial void ProcessV1SummarizeResponseContent( /// /// /// The token to cancel the operation with - /// + /// public async global::System.Threading.Tasks.Task V1SummarizeAsync( global::AI21.SummarizeBody request, int? requestStartTime = default, @@ -99,30 +99,99 @@ partial void ProcessV1SummarizeResponseContent( ProcessV1SummarizeResponse( httpClient: HttpClient, httpResponseMessage: __response); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + if (ReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + var __contentStream_422 = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); + __value_422 = await global::AI21.HTTPValidationError.FromJsonStreamAsync(__contentStream_422, JsonSerializerContext).ConfigureAwait(false); + } - var __content = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessV1SummarizeResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); + throw new global::AI21.ApiException( + message: __response.ReasonPhrase ?? string.Empty, + statusCode: __response.StatusCode) + { + ResponseBody = __content_422, + ResponseObject = __value_422, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } - try + if (ReadResponseAsString) { - __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1SummarizeResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + } + catch (global::System.Net.Http.HttpRequestException __ex) + { + throw new global::AI21.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + + return + global::AI21.SummarizationResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } - catch (global::System.Net.Http.HttpRequestException __ex) + else { - throw new global::System.InvalidOperationException(__content, __ex); - } + try + { + __response.EnsureSuccessStatusCode(); + } + catch (global::System.Net.Http.HttpRequestException __ex) + { + throw new global::AI21.ApiException( + message: __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } - return - global::AI21.SummarizationResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + using var __responseStream = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); + + var __responseValue = await global::AI21.SummarizationResponse.FromJsonStreamAsync(__responseStream, JsonSerializerContext).ConfigureAwait(false); + + return + __responseValue ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } } /// diff --git a/src/libs/AI21/Generated/AI21.SummarizeClient.V1SummarizeBySegment.g.cs b/src/libs/AI21/Generated/AI21.SummarizeClient.V1SummarizeBySegment.g.cs index 9c91f4b..0608df4 100644 --- a/src/libs/AI21/Generated/AI21.SummarizeClient.V1SummarizeBySegment.g.cs +++ b/src/libs/AI21/Generated/AI21.SummarizeClient.V1SummarizeBySegment.g.cs @@ -31,7 +31,7 @@ partial void ProcessV1SummarizeBySegmentResponseContent( /// /// /// The token to cancel the operation with - /// + /// public async global::System.Threading.Tasks.Task V1SummarizeBySegmentAsync( global::AI21.SegmentedSummaryBody request, int? requestStartTime = default, @@ -99,30 +99,99 @@ partial void ProcessV1SummarizeBySegmentResponseContent( ProcessV1SummarizeBySegmentResponse( httpClient: HttpClient, httpResponseMessage: __response); + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::AI21.HTTPValidationError? __value_422 = null; + if (ReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + __value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + var __contentStream_422 = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); + __value_422 = await global::AI21.HTTPValidationError.FromJsonStreamAsync(__contentStream_422, JsonSerializerContext).ConfigureAwait(false); + } - var __content = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessV1SummarizeBySegmentResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); + throw new global::AI21.ApiException( + message: __response.ReasonPhrase ?? string.Empty, + statusCode: __response.StatusCode) + { + ResponseBody = __content_422, + ResponseObject = __value_422, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } - try + if (ReadResponseAsString) { - __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessV1SummarizeBySegmentResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + } + catch (global::System.Net.Http.HttpRequestException __ex) + { + throw new global::AI21.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + + return + global::AI21.SummarizeBySegmentResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } - catch (global::System.Net.Http.HttpRequestException __ex) + else { - throw new global::System.InvalidOperationException(__content, __ex); - } + try + { + __response.EnsureSuccessStatusCode(); + } + catch (global::System.Net.Http.HttpRequestException __ex) + { + throw new global::AI21.ApiException( + message: __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } - return - global::AI21.SummarizeBySegmentResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + using var __responseStream = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); + + var __responseValue = await global::AI21.SummarizeBySegmentResponse.FromJsonStreamAsync(__responseStream, JsonSerializerContext).ConfigureAwait(false); + + return + __responseValue ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } } /// diff --git a/src/libs/AI21/Generated/AI21.SummarizeClient.g.cs b/src/libs/AI21/Generated/AI21.SummarizeClient.g.cs index 0d5c2a4..d1c7081 100644 --- a/src/libs/AI21/Generated/AI21.SummarizeClient.g.cs +++ b/src/libs/AI21/Generated/AI21.SummarizeClient.g.cs @@ -25,6 +25,11 @@ public sealed partial class SummarizeClient : global::AI21.ISummarizeClient, glo /// public global::System.Collections.Generic.List Authorizations { get; } + /// + public bool ReadResponseAsString { get; set; } +#if DEBUG + = true; +#endif /// /// /// diff --git a/src/libs/AI21/Generated/AnyOf.2.Json.g.cs b/src/libs/AI21/Generated/AnyOf.2.Json.g.cs new file mode 100644 index 0000000..bcec7ec --- /dev/null +++ b/src/libs/AI21/Generated/AnyOf.2.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace AI21 +{ + public readonly partial struct AnyOf + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::AI21.AnyOf? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::AI21.AnyOf), + jsonSerializerContext) as global::AI21.AnyOf?; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::AI21.AnyOf? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize>( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask?> FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::AI21.AnyOf), + jsonSerializerContext).ConfigureAwait(false)) as global::AI21.AnyOf?; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask?> FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync?>( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/AI21/Generated/AnyOf.2.g.cs b/src/libs/AI21/Generated/AnyOf.2.g.cs index f410035..241a2c1 100644 --- a/src/libs/AI21/Generated/AnyOf.2.g.cs +++ b/src/libs/AI21/Generated/AnyOf.2.g.cs @@ -1,4 +1,3 @@ -using System.Linq; #nullable enable @@ -172,7 +171,8 @@ public override int GetHashCode() static int HashCodeAggregator(int hashCode, object? value) => value == null ? (hashCode ^ 0) * prime : (hashCode ^ value.GetHashCode()) * prime; - return fields.Aggregate(offset, HashCodeAggregator); + + return global::System.Linq.Enumerable.Aggregate(fields, offset, HashCodeAggregator); } /// @@ -209,92 +209,5 @@ public override bool Equals(object? obj) { return obj is AnyOf o && Equals(o); } - - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::AI21.AnyOf? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::AI21.AnyOf), - jsonSerializerContext) as global::AI21.AnyOf?; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::AI21.AnyOf? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize>( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask?> FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::AI21.AnyOf), - jsonSerializerContext).ConfigureAwait(false)) as global::AI21.AnyOf?; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask?> FromJsonStream( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync?>( - jsonStream, - jsonSerializerOptions); - } - } }